ГЛОБАЛЬНЫЙ РЕФАКТОРИНГ АРХИТЕКТУРЫ - Рефакторинг этапов 2.27 вынос оркестрации tryHandleLivingChat (decision/execution ветки) в отдельный runtime adapter.

This commit is contained in:
2026-04-10 20:10:13 +03:00
parent 828c0ef378
commit 9b1d1bff91
6 changed files with 645 additions and 293 deletions
+25 -1
View File
@@ -922,7 +922,31 @@ Validation:
- `assistantMcpRuntimeBridge.test.ts`
- `assistantAddressFollowupContext.test.ts`
Status: **In progress (Phase 2.1 + 2.2 + 2.3 + 2.4 + 2.5 + 2.6 + 2.7 + 2.8 + 2.9 + 2.10 + 2.11 + 2.12 + 2.13 + 2.14 + 2.15 + 2.16 + 2.17 + 2.18 + 2.19 + 2.20 + 2.21 + 2.22 + 2.23 + 2.24 + 2.25 + 2.26 completed)**
Implemented in current pass (Phase 2.27):
1. Extracted living-chat runtime orchestration branch from `assistantService` into dedicated runtime adapter:
- `assistantLivingChatRuntimeAdapter.ts`
- introduced:
- `runAssistantLivingChatRuntime(...)`
2. Centralized living-chat runtime branch sequence (behavior-preserving):
- deterministic capability + safety refusal branch;
- deterministic data-scope contract branch (with live probe projection);
- deterministic organization-boundary and scope-selection branches;
- deterministic operational-boundary and capability-contract branches;
- LLM chat branch with script-guard + grounding-guard post-processing.
3. Rewired `assistantService` `tryHandleLivingChat(...)` to consume runtime adapter output and keep existing chat finalization adapter path unchanged.
4. Added focused unit tests:
- `assistantLivingChatRuntimeAdapter.test.ts`
Validation:
1. `npm run build` passed.
2. Targeted living/chat followup pack passed:
- `assistantLivingChatRuntimeAdapter.test.ts`
- `assistantLivingChatMode.test.ts`
- `assistantLivingRouter.test.ts`
- `assistantAddressFollowupContext.test.ts`
- `assistantWave10SettlementCorrectiveRegression.test.ts`
Status: **In progress (Phase 2.1 + 2.2 + 2.3 + 2.4 + 2.5 + 2.6 + 2.7 + 2.8 + 2.9 + 2.10 + 2.11 + 2.12 + 2.13 + 2.14 + 2.15 + 2.16 + 2.17 + 2.18 + 2.19 + 2.20 + 2.21 + 2.22 + 2.23 + 2.24 + 2.25 + 2.26 + 2.27 completed)**
## Stage 3 (P2): Hybrid Semantic Layer (LLM + Deterministic Guards)