fix p55
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
# RetrieX Patch p55b - Genre Config Values Validation Hotfix
|
||||
|
||||
## Purpose
|
||||
|
||||
Small follow-up hotfix for p55 Single-Genre Config Values.
|
||||
|
||||
p55 correctly added `configuration_values` to `config/retriex/genre.yaml`, but the effective config output used by `mto:agent:config:validate` did not expose this block. As a result, validation reported:
|
||||
|
||||
```text
|
||||
Config validation failed: genre.configuration_values must be a non-empty map.
|
||||
```
|
||||
|
||||
The patch also corrects two stale `adaptation_surface.product_roles` path references for the `no_llm_fallback` product role vocabulary-view indirection.
|
||||
|
||||
## Scope
|
||||
|
||||
Changed files:
|
||||
|
||||
- `config/retriex/genre.yaml`
|
||||
- `src/Config/RetriexEffectiveConfigProvider.php`
|
||||
|
||||
## Changes
|
||||
|
||||
### Effective config exposure
|
||||
|
||||
`RetriexEffectiveConfigProvider::genreConfig()` now includes:
|
||||
|
||||
```php
|
||||
'configuration_values' => $this->genreConfig->getConfigurationValues(),
|
||||
```
|
||||
|
||||
This makes the p55 value surface visible to the existing config validation path.
|
||||
|
||||
### Path reference cleanup
|
||||
|
||||
The stale paths:
|
||||
|
||||
```text
|
||||
agent.no_llm_fallback.product_roles.main_device_request_keywords
|
||||
agent.no_llm_fallback.product_roles.accessory_product_keywords
|
||||
```
|
||||
|
||||
were replaced with the current vocabulary-view config paths:
|
||||
|
||||
```text
|
||||
agent.no_llm_fallback.product_roles.vocabulary_views.main_device_request_keywords
|
||||
agent.no_llm_fallback.product_roles.vocabulary_views.accessory_product_keywords
|
||||
```
|
||||
|
||||
The same path spelling was corrected in the corresponding `configuration_values.product_roles.no_llm_fallback_terms.source_paths` metadata.
|
||||
|
||||
## Non-goals
|
||||
|
||||
This patch does not:
|
||||
|
||||
- wire runtime behavior to `genre.yaml`
|
||||
- introduce multi-genre or tenant logic
|
||||
- add new product terms
|
||||
- add new defaults
|
||||
- change ranking, retrieval, Shopware criteria or LLM behavior
|
||||
- move legacy values out of their existing files
|
||||
|
||||
## Local checks
|
||||
|
||||
Performed locally in the extracted project without `vendor/`:
|
||||
|
||||
```bash
|
||||
php -l src/Config/GenreConfig.php
|
||||
php -l src/Config/RetriexEffectiveConfigProvider.php
|
||||
php -l src/Config/ConfigSourceAuditProvider.php
|
||||
```
|
||||
|
||||
YAML parsing was also checked for all files under `config/retriex/*.yaml`.
|
||||
|
||||
A lightweight path check verified that the two corrected `no_llm_fallback` paths now point to existing raw config locations.
|
||||
|
||||
Full Symfony console checks could not be executed locally because the ZIP does not contain `vendor/`.
|
||||
|
||||
## Recommended project checks
|
||||
|
||||
After applying the patch in the full project, run:
|
||||
|
||||
```bash
|
||||
bin/console cache:clear
|
||||
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
|
||||
```
|
||||
148
RETRIEX_PATCH_55_SINGLE_GENRE_CONFIG_VALUES_README.md
Normal file
148
RETRIEX_PATCH_55_SINGLE_GENRE_CONFIG_VALUES_README.md
Normal file
@@ -0,0 +1,148 @@
|
||||
# RetrieX Patch p55 - Single-Genre Config Values
|
||||
|
||||
## Ziel
|
||||
|
||||
Dieser Patch ist der erste Schritt nach p54, um RetrieX fuer eine **eine Installation = ein Genre**-Konfiguration vorzubereiten.
|
||||
|
||||
p54 war die Landkarte (`adaptation_surface`). p55 fuegt nun in `config/retriex/genre.yaml` eine erste zentrale Werteflaeche hinzu:
|
||||
|
||||
```yaml
|
||||
retriex.genre.config:
|
||||
configuration_values:
|
||||
product_roles:
|
||||
product_attributes:
|
||||
brands_and_canonical_terms:
|
||||
intent_and_routing:
|
||||
context_resolution:
|
||||
shop_query_runtime:
|
||||
result_identity_and_answer_policy:
|
||||
search_repair:
|
||||
retrieval_and_language:
|
||||
shop_data_mapping:
|
||||
governance_and_regression:
|
||||
```
|
||||
|
||||
Die Werte sind aus dem aktuellen stabilen Wasseranalyse-/Messgeraete-Genre uebernommen. Dadurch ist erstmals an einer zentralen Stelle sichtbar, welche konkreten fachlichen Werte bei einer spaeteren Umwidmung, z. B. auf Fashion, Moebel, Ersatzteile oder Elektronik, ersetzt werden muessten.
|
||||
|
||||
## Bewusste Nicht-Ziele
|
||||
|
||||
- Keine Multi-Genre-Loesung
|
||||
- Keine Tenant-Logik
|
||||
- Keine Runtime-Umschaltung pro Request
|
||||
- Keine SaaS-/Host-/API-Key-Auswahl
|
||||
- Keine fachliche Logikaenderung
|
||||
- Keine neuen fachlichen Tokenlisten im PHP-Core
|
||||
- Keine Ranking-, Retrieval- oder Shopware-Kriterienaenderung
|
||||
- Keine LLM-Verhaltensaenderung
|
||||
- Keine Entfernung alter Config-Pfade
|
||||
- Kein p56-Wiring
|
||||
|
||||
Die Runtime liest nach diesem Patch weiterhin die bisherigen Config-Dateien und Pfade. `configuration_values` ist die neue zentrale Pflege-/Migrationsflaeche, aber noch nicht die fuehrende Runtime-Quelle.
|
||||
|
||||
## Geaenderte Dateien
|
||||
|
||||
```text
|
||||
config/retriex/genre.yaml
|
||||
src/Config/GenreConfig.php
|
||||
src/Config/RetriexEffectiveConfigProvider.php
|
||||
RETRIEX_PATCH_55_SINGLE_GENRE_CONFIG_VALUES_README.md
|
||||
```
|
||||
|
||||
## Wichtigste Aenderungen
|
||||
|
||||
### `config/retriex/genre.yaml`
|
||||
|
||||
Neu ist der Block:
|
||||
|
||||
```yaml
|
||||
configuration_values:
|
||||
...
|
||||
```
|
||||
|
||||
Er enthaelt die aktuellen genreabhaengigen Werte gruppiert nach denselben Bereichen wie `adaptation_surface`:
|
||||
|
||||
- Produktrollen und Shop-/Prompt-Views
|
||||
- Produktattribute und numerische Constraints
|
||||
- Marken, Canonical Terms und Query-Enrichment
|
||||
- Intent- und Routing-Signale
|
||||
- Follow-up-/Kontextanker
|
||||
- Shopquery-Runtime
|
||||
- Result-Identity und Antwort-/Grounding-Regeln
|
||||
- Search Repair
|
||||
- Retrieval-/Language-Begriffe
|
||||
- Shopdaten-Mapping
|
||||
- Governance-/Regression-Guardrails
|
||||
|
||||
Jeder Unterbereich enthaelt `source_paths`, damit nachvollziehbar bleibt, aus welchen bestehenden Runtime-Pfaden die Werte stammen.
|
||||
|
||||
### `GenreConfig`
|
||||
|
||||
Neue Zugriffsmethoden:
|
||||
|
||||
```php
|
||||
getConfigurationValues(): array
|
||||
getConfigurationValueGroup(string $group): array
|
||||
```
|
||||
|
||||
Diese Methoden stellen die neue Werteflaeche bereit, ohne die Runtime bereits darauf umzustellen.
|
||||
|
||||
### `RetriexEffectiveConfigProvider`
|
||||
|
||||
Die Config-Validierung prueft nun zusaetzlich:
|
||||
|
||||
- `genre.configuration_values` ist eine nicht-leere Map
|
||||
- jede Werte-Gruppe ist eine nicht-leere Map
|
||||
- fuer jede `adaptation_surface`-Gruppe existiert eine passende `configuration_values`-Gruppe
|
||||
|
||||
Fehlende Value-Gruppen wuerden als Warnung sichtbar; strukturell falsche Value-Gruppen als Fehler.
|
||||
|
||||
## Warum p55 noch kein Wiring macht
|
||||
|
||||
p55 soll bewusst risikoarm bleiben. Die alten Pfade bleiben fuehrend, damit bestehende Regressionen und Shop-/RAG-Verhalten unveraendert bleiben.
|
||||
|
||||
Der naechste Schritt waere ein separater Patch:
|
||||
|
||||
```text
|
||||
p56 Single-Genre Config Wiring
|
||||
```
|
||||
|
||||
Dort koennen ausgewaehlte Getter oder ein zentraler Effective-Provider bevorzugt aus `genre.configuration_values` lesen und bei fehlenden Werten auf die alten Pfade zurueckfallen.
|
||||
|
||||
## Lokale Pruefungen
|
||||
|
||||
Ausgefuehrt im entpackten Patch-Arbeitsstand:
|
||||
|
||||
```bash
|
||||
php -l src/Config/GenreConfig.php
|
||||
php -l src/Config/RetriexEffectiveConfigProvider.php
|
||||
```
|
||||
|
||||
Ergebnis: beide PHP-Lints gruen.
|
||||
|
||||
Zusaetzlich wurden alle YAML-Dateien unter `config/retriex/*.yaml` per Python/YAML-Parser geprueft.
|
||||
|
||||
Ergebnis: YAML-Parsing gruen.
|
||||
|
||||
Zusaetzlich wurde geprueft:
|
||||
|
||||
- `adaptation_surface` hat 11 Gruppen
|
||||
- `configuration_values` hat dieselben 11 Gruppen
|
||||
- keine `adaptation_surface`-Gruppe ohne entsprechende Werte-Gruppe
|
||||
|
||||
## Nicht lokal ausfuehrbar
|
||||
|
||||
`bin/console` konnte lokal nicht ausgefuehrt werden, weil im ZIP kein `vendor/` enthalten ist:
|
||||
|
||||
```text
|
||||
Dependencies are missing. Try running "composer install".
|
||||
```
|
||||
|
||||
## Empfohlene Projektchecks nach dem Einspielen
|
||||
|
||||
```bash
|
||||
bin/console cache:clear
|
||||
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
|
||||
```
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,7 @@ body {
|
||||
margin: 0;
|
||||
padding: 2rem;
|
||||
font-size: 0.85rem;
|
||||
|
||||
}
|
||||
|
||||
h1, .h1 {
|
||||
@@ -266,6 +267,8 @@ button:disabled {
|
||||
|
||||
body {
|
||||
color: #cacad5;
|
||||
background: #16202F;
|
||||
background: linear-gradient(180deg,rgba(10, 14, 20, 1) 0%, rgba(22, 32, 47, 1) 24%, rgba(10, 14, 20, 1) 100%);
|
||||
}
|
||||
|
||||
.bg-black {
|
||||
|
||||
@@ -43,6 +43,27 @@ final class GenreConfig
|
||||
return is_array($surface) ? $surface : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function getConfigurationValues(): array
|
||||
{
|
||||
$values = $this->value('configuration_values', []);
|
||||
|
||||
return is_array($values) ? $values : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function getConfigurationValueGroup(string $group): array
|
||||
{
|
||||
$values = $this->getConfigurationValues();
|
||||
$groupValues = $values[$group] ?? [];
|
||||
|
||||
return is_array($groupValues) ? $groupValues : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
|
||||
@@ -448,6 +448,7 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
'mode' => $this->genreConfig->getMode(),
|
||||
'description' => $this->genreConfig->getDescription(),
|
||||
'adaptation_surface' => $this->genreConfig->getAdaptationSurface(),
|
||||
'configuration_values' => $this->genreConfig->getConfigurationValues(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1160,6 +1161,33 @@ final readonly class RetriexEffectiveConfigProvider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$configurationValues = $genre['configuration_values'] ?? null;
|
||||
if (!is_array($configurationValues) || $configurationValues === []) {
|
||||
$errors[] = 'genre.configuration_values must be a non-empty map.';
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($configurationValues as $group => $valueDefinition) {
|
||||
if (!is_string($group) || trim($group) === '') {
|
||||
$errors[] = 'genre.configuration_values keys must be non-empty strings.';
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_array($valueDefinition) || $valueDefinition === []) {
|
||||
$errors[] = sprintf('genre.configuration_values.%s must be a non-empty map.', $group);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_keys($surface) as $group) {
|
||||
if (!is_string($group) || $group === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!array_key_exists($group, $configurationValues)) {
|
||||
$warnings[] = sprintf('genre.configuration_values is missing value group for adaptation_surface.%s.', $group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user