second step

This commit is contained in:
team2
2026-04-29 20:55:43 +02:00
parent d099457534
commit b71adf33f0

View File

@@ -0,0 +1,114 @@
# RetrieX Patch 2: Small Configs YAML-Only
Scope of this patch:
- `ContextServiceConfig`
- `CatalogIntentConfig`
- `StopWordsConfig`
## Goal
Move the first small configuration areas to the new rule:
> YAML is the source of truth. PHP validates and exposes configuration values, but does not provide fachliche defaults.
## Changed behavior
### Context config
The previous PHP constants were removed:
- `MAX_VISIBLE_REGULAR_LINES = 25`
- `MAX_FULL_LINES = 500`
The same values now live in `config/retriex/runtime.yaml`:
```yaml
retriex.context.config:
max_visible_regular_lines: 25
max_full_lines: 500
```
`ContextService` now reads these values through `ContextServiceConfig`.
### Catalog intent config
The previous PHP constants were removed from `CatalogIntentConfig`:
- `MIN_SCORE = 0.72`
- `AMBIGUITY_DELTA = 0.02`
- `SEARCH_LIMIT = 6`
- `MIN_ALLOWED_SCORE = 0.0`
- `MAX_ALLOWED_SCORE = 1.0`
The hidden catalog listing limit from `EntityCatalogService` was also moved out of PHP:
- previous `private const SEARCH_LIMIT = 3`
The values now live in `config/retriex/intent.yaml`:
```yaml
retriex.intent.catalog.config:
min_score: 0.72
ambiguity_delta: 0.02
intent_search_limit: 6
list_search_limit: 3
min_allowed_score: 0.0
max_allowed_score: 1.0
```
`CatalogIntentLite` and `EntityCatalogService` now use the injected `CatalogIntentConfig`.
### Stopwords config
The previous `DEFAULT_STOP_WORDS` list was removed from PHP.
The complete list already exists in `config/retriex/language.yaml`:
```yaml
retriex.stopwords.config:
words:
- mit
- der
...
```
`StopWordsConfig` now requires this YAML list and throws a clear configuration error if it is missing or empty.
## Intentional non-goals
This patch does not touch:
- Retrieval scoring
- PromptBuilder defaults
- AgentRunner defaults
- Commerce parser behavior
- Shop matching behavior
- SearchRepair behavior
## Validation performed
Syntax checks:
```bash
php -l src/Config/ContextServiceConfig.php
php -l src/Config/CatalogIntentConfig.php
php -l src/Config/StopWordsConfig.php
php -l src/Context/ContextService.php
php -l src/Catalog/EntityCatalogService.php
php -l src/Intent/CatalogIntentLite.php
php -l src/Config/RetriexEffectiveConfigProvider.php
php -l src/Config/ConfigSourceAuditProvider.php
```
All checked files are syntactically valid.
A standalone getter smoke test confirmed the migrated YAML values preserve the previous defaults:
- context regular lines: `25`
- context full lines: `500`
- catalog min score: `0.72`
- catalog intent search limit: `6`
- catalog list search limit: `3`
Full Symfony console regression tests were not executed in the ZIP workspace because `vendor/` is not included.