ГЛОБАЛЬНЫЙ РЕФАКТОРИНГ АРХИТЕКТУРЫ - Рефакторинг этапов Stage 3.4: расширен soft-refusal в deep/living, чтобы при слабом/непокрытом домене не падать в шаблонный Коротко/Что сломано.

This commit is contained in:
2026-04-11 17:41:07 +03:00
parent a0d0f95dde
commit 88d5561fad
5 changed files with 386 additions and 15 deletions
+15
View File
@@ -2401,6 +2401,21 @@ Implemented in current pass (Stage 3.3 soft-refusal + anti-template limited repl
- Extended regression pack: `11` files / `344` tests passed.
- Type build: `npm --prefix llm_normalizer/backend run build` passed.
Implemented in current pass (Stage 3.4 deep/living soft-refusal boundary widening):
1. Extended boundary fallback trigger in policy composer:
- `shouldUseBoundaryFallbackReply(...)` now supports `broad_partial` mode when domain coverage is weak/unconfirmed.
- Added domain-aware gate (`focus_domain == null` or `focusDomainGroundingBlocked`) + weak-evidence envelope checks.
2. Reduced template leakage for off-domain partial replies:
- Cases with weak partial support but no confirmed domain grounding now return soft-refusal boundary reply instead of rigid `Коротко/Что сломано/...` template blocks.
3. Improved boundary fallback UX:
- Added deterministic heading variants to reduce repetitive wording.
- Added quick actionable line (`Что могу сделать сейчас`) sourced from nearest supported capability set.
4. Added targeted regression coverage:
- Rewrote/normalized `assistantBoundaryFallbackReply.test.ts` in UTF-8 and added case for `broad_partial + weak evidence + uncovered domain`.
5. Validation snapshot:
- Stage 3 focused suite (+boundary): `12` files / `348` tests passed.
- Type build: `npm --prefix llm_normalizer/backend run build` passed.
Acceptance (Stage 3):
1. LLM outputs strictly validated schema for extraction/decomposition (no free-form).
2. Deterministic guards can block or downgrade answers when evidence insufficient.