Архитектура: закрыть phase17 clarification-resume и обновить readiness-статус перед расширением доменов

This commit is contained in:
2026-04-19 17:17:09 +03:00
parent af15e21bf6
commit 0e098cde38
18 changed files with 842 additions and 87 deletions
@@ -16,14 +16,16 @@ It is the current-state audit that answers:
This snapshot is based on:
- `graphify-out/GRAPH_REPORT.md` rebuilt on `2026-04-18`
- `graphify-out/GRAPH_REPORT.md` rebuilt on `2026-04-19`
- current owner modules in `llm_normalizer/backend/src/services/`
- current scenario acceptance scripts under `scripts/`
- current AGENT semantic source catalog under `docs/orchestration/`
- live replay comparison between:
- `address_truth_harness_phase12_wider_saved_session_pool_live_20260418_rerun10`
- `address_truth_harness_phase12_wider_saved_session_pool_live_20260419_rerun16`
- `address_truth_harness_phase14_counterparty_tail_resume_live_20260418_rerun2`
- `address_truth_harness_phase15_answer_inspection_followup_live_20260418_rerun7`
- `address_truth_harness_phase15_answer_inspection_followup_live_20260418_rerun8`
- `address_truth_harness_phase16_multicompany_late_pivot_live_20260419_rerun10`
- `address_truth_harness_phase17_clarification_resume_and_counterparty_tail_live_20260419_rerun5`
- [10 - regression_breakpoint_analysis_2026-04-17.md](./10%20-%20regression_breakpoint_analysis_2026-04-17.md)
- [11 - continuity_stabilization_plan_2026-04-17.md](./11%20-%20continuity_stabilization_plan_2026-04-17.md)
@@ -31,9 +33,9 @@ This snapshot is based on:
Latest graph rebuild:
- `5352 nodes`
- `11506 edges`
- `134 communities`
- `5371 nodes`
- `11523 edges`
- `135 communities`
Most relevant current god nodes for turnaround `11`:
@@ -132,9 +134,9 @@ This is enough to build targeted semantic packs that are not single-domain toy s
## Honest Phase Status
Turnaround implementation progress: `~92%`
Turnaround implementation progress: `~96%`
Pre-expansion readiness: `~64%`
Pre-expansion readiness: `~78%`
This split is intentional.
@@ -160,7 +162,7 @@ Reason:
### Phase 2. State And Transition Contracts
Status: `84%`
Status: `88%`
Reason:
@@ -213,7 +215,7 @@ Remaining debt:
### Phase 5. AssistantService Extraction
Status: `81%`
Status: `84%`
Reason:
@@ -242,7 +244,7 @@ Remaining debt:
### Phase 7. Scenario Acceptance As Primary Gate
Status: `79%`
Status: `86%`
Reason:
@@ -265,6 +267,8 @@ It is now:
- `phase12_wider_saved_session_pool` is green end-to-end on the broader flagship saved-session family;
- `phase14_counterparty_tail_resume` is green on a different late-session counterparty/inventory/activity contour;
- `phase15_answer_inspection_followup` is green on grounded self-correction plus neighboring VAT bridge continuity;
- `phase16_multicompany_late_pivot` is green on late company switch plus referential inventory/receivables authority;
- `phase17_clarification_resume_and_counterparty_tail` is green on the specific semantic seams exposed by the manual run `assistant-stage1-uWH6xahSDt`: company clarification resumption, historical inventory continuation, short `СВК` retarget, and counterparty tail follow-up;
- therefore the original collapse has been materially repaired, and the main remaining risk has shifted from acute failure to incomplete generalization.
In practical terms, the active breakpoint is now:
@@ -507,7 +507,21 @@ Still open after the accepted phase12 replay:
- the phase16 live replay `address_truth_harness_phase16_multicompany_late_pivot` is now accepted on `2026-04-19`, which is the first explicit proof that a non-flagship multi-company late switch keeps truthful company authority across both inventory and receivables exact routes in the same saved session;
- the same phase16 pass also hardened replay-gate honesty: its receivables step now accepts semantically equivalent honest empty-match phrasing (`31.03.2020` or `31 марта 2020`, `долг` / `долж`) instead of overfitting to one single first-line wording, so this pack is now a trustworthy breadth gate rather than a fragile phrasing oracle.
## Next Execution Slice (2026-04-18)
Latest phase17 clarification-resume evidence after the current replay hardening:
- a new live pack `address_truth_harness_phase17_clarification_resume_and_counterparty_tail` validates `smalltalk -> inventory clarification -> explicit company choice -> historical inventory continuation -> selected-item provenance -> short counterparty tail -> current inventory -> activity age` inside one shared session;
- the semantic review of `assistant-stage1-uWH6xahSDt` exposed three distinct architecture defects rather than one generic red score:
- explicit company choice fixed the organization but did not resume the interrupted inventory root;
- short displayed-entity follow-up like `а по свк` lost the previous counterparty thread and fell back into stale organization fixation behavior;
- inventory-root follow-up turns still carried hidden `counterparty=АЛЬТЕРНАТИВА` contamination inside debug-derived filters, which could later poison carryover even when the visible answer looked acceptable;
- the stabilization fix is now explicit in runtime contracts instead of living as prompt luck:
- route/follow-up arbitration resumes the interrupted inventory root after explicit company choice instead of stopping at scope fixation;
- short displayed-entity follow-up keeps counterparty retarget on the validated path instead of losing to stale organization-switch interpretation;
- `decomposeStage` no longer hydrates inventory follow-up filters with the selected organization alias as a fake counterparty anchor, so hidden carryover state stays truthful;
- targeted `assistantRoutePolicy`, `assistantAddressFollowupContext`, `addressImplicitOrganizationScope`, and `addressFollowupTemporalRegression` suites are green after the fix, and backend build stays green;
- live replay `address_truth_harness_phase17_clarification_resume_and_counterparty_tail_live_20260419_rerun5` is accepted `10/10`, which is the current proof that clarification-resume, historical inventory continuation, and short counterparty-tail retarget are now semantically clean on a non-flagship saved-session path.
## Next Execution Slice (2026-04-19)
The project is now moving from:
@@ -534,6 +548,15 @@ Current explicit goals for this slice:
- fewer hybrid/deep entry seams that still depend on fragment luck instead of explicit runtime contracts;
- cleaner user-facing business answers on already-correct truth paths;
- lower risk that new domains multiply orchestration chaos faster than capability growth.
- clarification-resume, late company switch, and short entity-tail behavior should stop being "repaired on one chain only" and continue moving toward reusable runtime contracts across replay families.
Current remaining heavy fronts before low-risk domain expansion:
- finish the last convergence work toward one continuity owner for `active organization`, `active date`, `root frame`, `focus object`, and clarification state across every hot runtime path;
- widen saved-session replay breadth beyond the current flagship + phase14 + phase15 + phase16 + phase17 families;
- reduce coordinator pressure still concentrated in `assistantService.ts`, `addressQueryService.ts`, and `resolveAddressIntent()`;
- complete the missing contour for counterparty shipped-goods / service extraction instead of relying on honest-but-limited document-list fallback;
- keep answer shaping as secondary debt only where it materially affects acceptance, not as the primary architecture frontier.
## Ready Signal
@@ -23,10 +23,10 @@ Current verdict:
Current confidence snapshot:
- turnaround implementation progress: `~92%`
- exit-from-danger-zone readiness: `~84%`
- pre-multidomain readiness: `~64%`
- latest graph snapshot: `5352 nodes`, `11506 edges`, `134 communities`
- turnaround implementation progress: `~96%`
- exit-from-danger-zone readiness: `~91%`
- pre-multidomain readiness: `~78%`
- latest graph snapshot: `5371 nodes`, `11523 edges`, `135 communities`
## What Is Already True
@@ -35,7 +35,11 @@ The following claims are now supported by code plus live replay evidence:
- phase12 flagship wider saved-session replay is accepted end-to-end;
- phase14 counterparty-tail late-session replay is accepted end-to-end;
- phase15 answer-inspection replay is accepted end-to-end;
- phase16 multi-company late-pivot replay is accepted end-to-end;
- phase17 clarification-resume and short counterparty-tail replay is accepted end-to-end;
- continuity on validated inventory / VAT / counterparty / company-authority chains is materially stronger than before;
- clarification-resume after explicit company choice now restores the interrupted business root instead of stopping at organization fixation;
- short displayed-entity follow-up like `а по свк` now wins over stale organization-fixation behavior on the validated replay family;
- user-facing meta answers are significantly cleaner and no longer dominated by technical garbage;
- the assistant no longer depends on the old ambient monolith behavior on the validated seams;
- the team now has a working replay-driven hardening loop instead of blind local patching.
@@ -64,7 +68,7 @@ This is much better than the old implicit monolith, but it still means:
The important nuance now is:
- this is no longer causing the original flagship collapse on the validated packs;
- it is still the main architectural reason broad future expansion remains risky.
- it is still the main architectural reason broad future expansion remains risky, especially outside the already repaired replay families.
### 2. Core orchestration remains too concentrated
@@ -135,7 +139,7 @@ The system should not be considered ready for the next level until all of the fo
## Recommended Next Execution Sequence
### Pass 16. Continuity authority completion
### Pass 18. Continuity authority completion
Goal:
@@ -145,7 +149,7 @@ Target:
- transition / route / clarification should consume one continuity snapshot before making divergent decisions.
### Pass 17. Wider saved-session acceptance pool
### Pass 19. Wider saved-session acceptance pool
Goal:
@@ -153,9 +157,9 @@ Goal:
Target:
- several saved sessions covering inventory, VAT, counterparty, payables/receivables, meta interrupts, and cross-domain pivots.
- several saved sessions covering inventory, VAT, counterparty, payables/receivables, meta interrupts, and cross-domain pivots beyond phase12 / phase16 / phase17.
### Pass 18. Human answer shaping cleanup
### Pass 20. Human answer shaping cleanup
Goal:
@@ -165,7 +169,7 @@ Target:
- product-quality business answers on already-correct truth paths.
### Pass 19. Coordinator pressure reduction
### Pass 21. Coordinator pressure reduction
Goal:
@@ -32,7 +32,7 @@ This package answers the next question:
12. [12 - manual_run_system_analysis_3NilqwT1G2_2026-04-18.md](./12%20-%20manual_run_system_analysis_3NilqwT1G2_2026-04-18.md)
13. [13 - pre_multidomain_readiness_audit_2026-04-18.md](./13%20-%20pre_multidomain_readiness_audit_2026-04-18.md)
## Current Status Snapshot (2026-04-18)
## Current Status Snapshot (2026-04-19)
This package is no longer planning-only.
@@ -45,33 +45,35 @@ It now documents a turnaround that is already operational in code, already mater
Current honest status:
- turnaround implementation progress: `~92%`
- exit-from-danger-zone readiness: `~84%`
- pre-multidomain readiness: `~64%`
- graph snapshot after latest rebuild: `5352 nodes`, `11506 edges`, `134 communities`
- turnaround implementation progress: `~96%`
- exit-from-danger-zone readiness: `~91%`
- pre-multidomain readiness: `~78%`
- graph snapshot after latest rebuild: `5371 nodes`, `11523 edges`, `135 communities`
- current breakpoint:
- the validated hot paths are no longer structurally broken;
- flagship continuity collapse is no longer the primary risk;
- the main remaining risk is incomplete convergence toward one true runtime authority plus replay breadth still below the intended multi-domain blast radius;
- the main remaining risk is no longer clarification-resume collapse, but the unfinished final convergence toward one true runtime authority plus replay breadth still below the intended multi-domain blast radius;
- product shaping is now secondary debt, not the primary blocker.
- main remaining architectural pressure:
- no single fully authoritative continuity contract consumed by all hot runtime owners
- no single fully authoritative continuity contract consumed by every hot runtime owner
- residual coordinator/legacy pressure inside `assistantService.ts`
- central domain-intent pressure inside `resolveAddressIntent()`
- replay breadth still narrower than the intended multi-domain rollout surface
- replay breadth still narrower than the intended multi-domain rollout surface beyond the flagship and late-switch families
- remaining answer-semantics pressure inside `composeStage.ts` / `answerComposer.ts`
Latest live proof now includes:
- `address_truth_harness_phase12_wider_saved_session_pool_live_20260418_rerun10` accepted `20/20`
- `address_truth_harness_phase12_wider_saved_session_pool_live_20260419_rerun16` accepted `20/20`
- `address_truth_harness_phase14_counterparty_tail_resume_live_20260418_rerun2` accepted `10/10`
- `address_truth_harness_phase15_answer_inspection_followup_live_20260418_rerun7` accepted `9/9`
- `address_truth_harness_phase15_answer_inspection_followup_live_20260418_rerun8` accepted `9/9`
- `address_truth_harness_phase16_multicompany_late_pivot_live_20260419_rerun10` accepted
- `address_truth_harness_phase17_clarification_resume_and_counterparty_tail_live_20260419_rerun5` accepted `10/10`
Current architectural reading:
- the system is already materially past the dangerous regression breakpoint;
- it is now safe for continued architecture hardening and controlled domain-by-domain enablement under replay gates;
- it is still not safe to declare broad low-risk multi-domain expansion.
- it is now materially closer to pre-multidomain stability, but still not safe to declare broad low-risk multi-domain expansion.
For the detailed audit, current percentages, and remaining debt, read:
@@ -131,12 +133,12 @@ and start being described as:
- "a stateful exact-data assistant with explicit transition contracts and isolated truth gating."
As of `2026-04-18`, the project is already materially closer to the target description and is no longer in the same acute collapse state. The remaining blocker is no longer the original continuity failure itself, but the unfinished convergence toward one runtime authority plus still-insufficient replay breadth for low-risk multi-domain expansion.
As of `2026-04-19`, the project is already materially closer to the target description and is no longer in the same acute collapse state. The remaining blocker is no longer the original continuity failure itself, but the unfinished convergence toward one runtime authority plus still-insufficient replay breadth for low-risk multi-domain expansion.
The biggest remaining blockers are:
- split continuity ownership across route / transition / recap / coordinator glue;
- saved-session acceptance still too narrow compared with the intended domain-expansion blast radius;
- saved-session acceptance still too narrow compared with the intended domain-expansion blast radius outside the repaired flagship + late-pivot families;
- clarification precedence is much better than before, but still not yet proven widely enough outside the repaired replay family;
- residual `assistantService` overload;
- central intent pressure in `resolveAddressIntent()`;