# RetrieX Patch 14 - Remaining Runtime Core Pattern Externalization

## Goal

Patch 14 continues the YAML-only governance work after v1.5.1 and p13b. It externalizes remaining runtime-relevant domain patterns from PHP core code into YAML without changing scoring semantics or enabling strict validation.

## Scope

Changed runtime areas:

- `src/Knowledge/Retrieval/NdjsonHybridRetriever.php`
  - Catalog-list shortcut patterns moved to `config/retriex/retrieval.yaml`.
  - Exact-document token variant prefixes moved to YAML.
  - Indicator/detail follow-up tokens, phrases and table-detection patterns moved to YAML.
  - Exact detail and generic exact-selection token lists moved to YAML.

- `src/Agent/PromptBuilder.php`
  - Direct main-device request patterns moved to `config/retriex/prompt.yaml`.

- `src/Intent/CommerceIntentLite.php`
  - Non-product commerce signals moved to `config/retriex/intent.yaml`.
  - Technical factual knowledge guard label and patterns moved to YAML.

## Intentionally not changed

- No strict YAML validation is enabled.
- No governance/regression hardening terms from `RetriexEffectiveConfigProvider` are moved in this patch. That should remain a separate follow-up patch.
- No scoring weights, top-k limits, retrieval thresholds or prompt rules are changed.
- Technical regex such as number detection, whitespace handling, job id validation and markdown parsing is intentionally left in PHP.

## Required checks after applying

Run locally in the full project with dependencies installed:

```bash
bin/console mto:agent:config:validate
bin/console mto:agent:regression:test
bin/console mto:agent:config:audit-source --details
```

Recommended smoke checks:

- Lowest hardness threshold question still resolves to `0,02 °dH / Testomat 808`.
- Follow-up indicator question still resolves to `Indikatortyp 300`.
- Accessory price follow-up still resolves to the indicator product, not the device.
- Product-selection shop fallback still works.

## Next step

The next isolated patch should externalize governance/regression guardrails from `RetriexEffectiveConfigProvider` into YAML, likely as p15.
