From 8977cac8df82b1f703a46a93e5084538f472a47b Mon Sep 17 00:00:00 2001 From: team 1 Date: Tue, 5 May 2026 18:12:44 +0200 Subject: [PATCH] p43H --- config/retriex/agent.yaml | 46 +----------- config/retriex/vocabulary.yaml | 46 ++++++++++++ ..._EVIDENCE_SYNONYM_VOCABULARY_MAP_README.md | 74 +++++++++++++++++++ src/Config/AgentRunnerConfig.php | 34 ++++++++- 4 files changed, 155 insertions(+), 45 deletions(-) create mode 100644 patch_history/RETRIEX_PATCH_43H_RAG_EVIDENCE_SYNONYM_VOCABULARY_MAP_README.md diff --git a/config/retriex/agent.yaml b/config/retriex/agent.yaml index 6a54c52..98294ec 100644 --- a/config/retriex/agent.yaml +++ b/config/retriex/agent.yaml @@ -260,50 +260,8 @@ parameters: - '/\b\d+\s+(?:[a-z0-9+\-]+\s+){0,3}(?:produkte|artikel|geräte|geraete|messgeräte|messgeraete)\b/u' - '/\b(?:insgesamt|gesamt|total)\b.{0,80}\b\d+\b/u' - '/\b(?:sortiment|portfolio|lieferprogramm)\b.{0,120}\b(?:umfasst|enthält|enthaelt|besteht\s+aus|beinhaltet)\b.{0,80}\b\d+\b/u' - synonyms: - salinität: - - salinität - - salinitaet - - salinity - - salzgehalt - - tds - - leitfähigkeit - - leitfaehigkeit - salinitaet: - - salinität - - salinitaet - - salinity - - salzgehalt - - tds - - leitfähigkeit - - leitfaehigkeit - salinity: - - salinität - - salinitaet - - salinity - - salzgehalt - - tds - - leitfähigkeit - - leitfaehigkeit - redox: - - redox - - orp - - oxidations-reduktionspotential - - oxidations reduktionspotential - orp: - - redox - - orp - - oxidations-reduktionspotential - - oxidations reduktionspotential - ph: - - ph - - ph-wert - - ph wert - chlor: - - chlor - - freies chlor - - gesamtchlor - - chlorine + vocabulary_maps: + synonyms: agent.rag_evidence_guard.synonyms no_llm_fallback: max_shop_results: 5 diff --git a/config/retriex/vocabulary.yaml b/config/retriex/vocabulary.yaml index 6eaa8be..337641c 100644 --- a/config/retriex/vocabulary.yaml +++ b/config/retriex/vocabulary.yaml @@ -667,6 +667,52 @@ parameters: - ph-indikatoren - ph indikatoren maps: + agent: + rag_evidence_guard: + synonyms: + salinität: + - salinität + - salinitaet + - salinity + - salzgehalt + - tds + - leitfähigkeit + - leitfaehigkeit + salinitaet: + - salinität + - salinitaet + - salinity + - salzgehalt + - tds + - leitfähigkeit + - leitfaehigkeit + salinity: + - salinität + - salinitaet + - salinity + - salzgehalt + - tds + - leitfähigkeit + - leitfaehigkeit + redox: + - redox + - orp + - oxidations-reduktionspotential + - oxidations reduktionspotential + orp: + - redox + - orp + - oxidations-reduktionspotential + - oxidations reduktionspotential + ph: + - ph + - ph-wert + - ph wert + chlor: + - chlor + - freies chlor + - gesamtchlor + - chlorine shop: accessory_focus_variants: indikator: diff --git a/patch_history/RETRIEX_PATCH_43H_RAG_EVIDENCE_SYNONYM_VOCABULARY_MAP_README.md b/patch_history/RETRIEX_PATCH_43H_RAG_EVIDENCE_SYNONYM_VOCABULARY_MAP_README.md new file mode 100644 index 0000000..503c7f8 --- /dev/null +++ b/patch_history/RETRIEX_PATCH_43H_RAG_EVIDENCE_SYNONYM_VOCABULARY_MAP_README.md @@ -0,0 +1,74 @@ +# RetrieX Patch p43H - RAG Evidence Synonym Vocabulary Map + +## Ziel + +p43H reduziert weitere lokale Config-Duplikate, ohne fachliche Runtime-Logik, Prompt-Regeln, Retrieval oder Scoring zu ändern. + +Der Patch verschiebt die Synonym-Map für `rag_evidence_guard` aus `agent.yaml` in die zentrale `vocabulary.yaml` und referenziert sie über einen konfigurierbaren Vocabulary-Map-Pfad. + +## Änderungen + +- `config/retriex/agent.yaml` + - lokale `rag_evidence_guard.synonyms` entfernt + - neue Referenz `rag_evidence_guard.vocabulary_maps.synonyms: agent.rag_evidence_guard.synonyms` ergänzt + +- `config/retriex/vocabulary.yaml` + - neue zentrale Map `maps.agent.rag_evidence_guard.synonyms` ergänzt + - Werte entsprechen 1:1 der vorherigen lokalen Agent-Konfiguration + +- `src/Config/AgentRunnerConfig.php` + - `getRagEvidenceSynonyms()` löst weiterhin lokale Overrides auf, falls `rag_evidence_guard.synonyms` vorhanden ist + - fehlt der lokale Override, wird die konfigurierte Vocabulary-Map verwendet + - neuer Helper `getConfiguredStringListMapOrVocabularyMap()` analog zu bestehenden Vocabulary-View-Fallbacks + +## Nicht geändert + +- keine neue Fachlogik +- keine Prompt-Regeländerung +- keine Retrievaländerung +- keine Scoringänderung +- keine Admin-UI +- keine neuen harten Listen im PHP-Core + +## Kompatibilität + +Lokale Overrides bleiben möglich: Wird `rag_evidence_guard.synonyms` in `agent.yaml` oder einer Tenant-/Override-Konfiguration gesetzt, bevorzugt `AgentRunnerConfig` weiterhin diese lokale Map. + +## Effektive Werte + +Die effektive Synonym-Map ist gegenüber p43G identisch geblieben: + +- `salinität` +- `salinitaet` +- `salinity` +- `redox` +- `orp` +- `ph` +- `chlor` + +Alle zugehörigen Synonymlisten wurden 1:1 übernommen. + +## Lokal ausgeführte Checks + +```bash +php -l src/Config/AgentRunnerConfig.php +php -l src/Config/SearchRepairConfig.php +php -l src/Config/PromptBuilderConfig.php +python3 YAML parse check for config/retriex/agent.yaml and config/retriex/vocabulary.yaml +python3 effective rag_evidence_guard.synonyms p43G vs p43H comparison +``` + +Ergebnis: grün. + +## Nicht lokal ausführbare Checks + +Die folgenden Checks konnten in dieser Umgebung nicht ausgeführt werden, weil der ZIP-Stand kein `vendor/` enthält und `bin/console` mit `Dependencies are missing. Try running "composer install".` abbricht: + +```bash +bin/console mto:agent:config:validate +bin/console mto:agent:regression:test +bin/console mto:agent:config:audit-source --details +bin/console mto:agent:config:audit-patterns --details +``` + +Bitte nach Einspielen des Patch-ZIPs in der vollständigen Projektumgebung ausführen. diff --git a/src/Config/AgentRunnerConfig.php b/src/Config/AgentRunnerConfig.php index 910f259..8812cd3 100644 --- a/src/Config/AgentRunnerConfig.php +++ b/src/Config/AgentRunnerConfig.php @@ -450,6 +450,35 @@ final class AgentRunnerConfig return $terms; } + /** + * @return array + */ + private function getConfiguredStringListMapOrVocabularyMap(string $configPath, string $mapPathConfigPath): array + { + if ($this->optionalValue($configPath) !== null) { + return $this->getRequiredStringListMap($configPath); + } + + if ($this->vocabulary === null) { + throw new \InvalidArgumentException(sprintf( + 'RetrieX agent config path "%s" is missing and no vocabulary resolver is available.', + $configPath + )); + } + + $mapPath = $this->getRequiredString($mapPathConfigPath); + $terms = $this->vocabulary->map($mapPath, []); + + if ($terms === []) { + throw new \InvalidArgumentException(sprintf( + 'RetrieX agent vocabulary map "%s" resolved to an empty map.', + $mapPath + )); + } + + return $terms; + } + /** * @return array */ @@ -672,7 +701,10 @@ final class AgentRunnerConfig */ public function getRagEvidenceSynonyms(): array { - return $this->getRequiredStringListMap('rag_evidence_guard.synonyms'); + return $this->getConfiguredStringListMapOrVocabularyMap( + 'rag_evidence_guard.synonyms', + 'rag_evidence_guard.vocabulary_maps.synonyms' + ); } /**