63 KiB
1CLLMARCH Fact Check And Stabilization Plan
Updated at: 2026-04-10
Source baseline: docs/TECH/1CLLMARCH.md
1. Purpose
This document fixes the current factual state of the codebase against 1CLLMARCH and records a production-focused stabilization plan that preserves:
- existing MCP routes;
- manual routing and guard logic;
- GUI manual markup + autorun operational loop.
2. Executive Reality Check
Current state is not MVP and also not stable production.
It is an advanced prototype with strong observability and eval tooling, but with architectural coupling and quality bottlenecks.
Approximate readiness against target architecture: 55/100.
3. Verified Facts (Code + Runtime)
- Strong engineering layers already exist:
- requirement extraction, coverage, grounding checks;
- rich debug payload and session trace;
- investigation state/followup continuity;
- manual annotation schema and post-analysis queues;
- async eval run + live history APIs.
- Main production blockers:
- orchestration monolith and coupling in
assistantService.ts; - deterministic/template-heavy final answer construction;
- large lexical heuristic surface for intent routing;
- temporal policy inconsistency (date handling differs by lane/path);
- hidden fallback behavior around historical snapshot assumptions.
- orchestration monolith and coupling in
- Quality metrics from latest Stage1 runs confirm weak user value:
- low retrieval differentiation;
- high generic explanation rate;
- low accountant actionability;
- zero mechanism specificity.
4. Gap Vs 1CLLMARCH
4.1 Already aligned (partially or strongly)
- Structured normalization contracts and validator loops.
- Coverage and grounding artifacts (with different naming than target).
- Conversation state persistence.
- Operational diagnostics and report generation.
4.2 Not aligned enough for stable prod
- Role separation (Interpreter/Planner/Critic/Answer) is incomplete and strongly coupled.
- Final user answer quality is constrained by deterministic template synthesis.
- Unified contract for analysis date/time scope is missing across all lanes.
- Result classes from target (
FULLY_ANSWERED,BLOCKED_BY_*, etc.) are not normalized as one contract. - Reason-code taxonomy exists but is fragmented across modules.
5. Stabilization Plan (No Route Breakage)
Stage 1 (P0): Unified Analysis Context + Temporal Hardening
Goal:
- Introduce unified
analysis_contextcontract. - Propagate it through eval -> assistant -> runtime lanes.
- Remove hidden hardcoded period fallback in live MCP plan generation.
- Keep backward compatibility (
period_hintstill supported).
Acceptance:
- If analysis date is set, runtime uses it explicitly in both deep/address paths.
- If analysis date is absent, runtime no longer silently injects fixed historical date in live-plan fallback.
- Existing APIs and manual workflows remain operational.
Implemented in current pass:
- Added unified
analysis_contextcontract to request context (as_of_date,period_from,period_to,snapshot_mode,source). - Added compatibility bridge: legacy
period_hintis still accepted and normalized intoanalysis_context. - Propagated analysis context through eval flows into assistant runtime.
- Applied analysis context in temporal guard with explicit precedence over implicit snapshot lock.
- Removed hidden hardcoded live-plan fallback period by switching to:
- explicit analysis period/date when provided;
- query-derived period when present;
- generic live probe when period is absent.
Validation:
npm run buildpassed.- Targeted runtime tests passed:
assistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Status: Completed
Stage 2 (P1): Orchestrator Decomposition (Behavior-Preserving Refactor)
Goal:
- Split monolith into explicit modules:
- QueryFrame builder
- Execution planner
- Evidence assembler
- Coverage critic
- Answer package builder
- Preserve current behavior under compatibility adapter.
Acceptance:
- No MCP route regressions.
- Existing tests and autorun loop remain green.
Implemented in current pass (Phase 2.1):
- Added new orchestration contract module:
assistant_query_frame_v1assistant_execution_plan_v1assistant_evidence_bundle_v1assistant_coverage_contract_v1- outcome classifier (
FULLY_ANSWERED,PARTIALLY_ANSWERED,BLOCKED_*,MISROUTED,FAILED_TO_BIND_ENTITIES)
- Integrated contracts into deep-lane runtime without route/answer behavior changes:
- debug payload now includes
assistant_outcome_class_v1; - debug payload and event logs now include
assistant_orchestration_contracts_v1.
- debug payload now includes
- Added unit regression tests:
assistantOrchestrationContracts.test.ts
Validation:
npm run buildpassed.- Targeted tests passed:
assistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.2):
- Added runtime orchestration adapter for the deep lane:
assistantOrchestrationRuntimeAdapter.ts- unified pipeline call for
requirements -> coverage -> groundingwith stable interfaces.
- Integrated adapter into
assistantServicemain deep-lane flow (behavior-preserving):- existing extraction/coverage/grounding logic preserved;
- execution now routed through one orchestration boundary.
- Added adapter unit tests:
assistantOrchestrationRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted tests passed:
assistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.3):
- Extracted answer package builder (
answer_structure_v11) fromassistantServiceinto dedicated module:assistantAnswerPackageBuilder.ts
- Rewired deep-lane answer structure assembly to use the new module without contract changes.
- Added focused unit tests for answer package behavior:
assistantAnswerPackageBuilder.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 test pack passed:
assistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.4):
- Extracted coverage/grounding pipeline into dedicated module:
assistantCoverageGrounding.ts- moved requirement extraction, coverage resolution, and grounding checks under one reusable boundary.
- Rewired
assistantServiceto use extracted coverage/grounding module via compatibility wrappers (behavior-preserving). - Added focused regression tests:
assistantCoverageGrounding.test.ts
- Stabilized deterministic Stage 2 regression environment for followup continuity checks:
- fixed accidental false-positive token in grounding test fixture;
- fixed env isolation in
assistantWave10SettlementCorrectiveRegression.test.tsby explicitly controllingFEATURE_ASSISTANT_ADDRESS_QUERY_V1.
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.5):
- Extracted query-planning helpers from
assistantServiceinto dedicated module:assistantQueryPlanning.ts- moved
fragmentTextById, execution-plan builder, and debug-routes builder under one reusable boundary.
- Rewired
assistantServiceto use extracted query-planning module (behavior-preserving wrapper integration). - Added focused unit tests for query-planning behavior:
assistantQueryPlanning.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantQueryPlanning.test.tsassistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.6):
- Extracted evidence-bundle assembly from
assistantServiceinto dedicated module:assistantEvidenceBundleAssembler.ts- centralized:
assistant_evidence_bundle_v1contract assembly;- debug
retrieval_statusprojection from normalized retrieval results.
- Rewired
assistantServiceto use assembler output for both:assistant_orchestration_contracts_v1.evidence_bundle;- debug payload
retrieval_status.
- Added focused unit tests:
assistantEvidenceBundleAssembler.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantEvidenceBundleAssembler.test.tsassistantQueryPlanning.test.tsassistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.7):
- Extracted deep-lane debug payload assembly from
assistantServiceinto dedicated module:assistantDebugPayloadAssembler.ts
- Rewired
assistantServiceto builddebugvia assembler (behavior-preserving):- keeps all existing fields, guard audits, orchestration contracts and optional sections.
- Added focused unit tests:
assistantDebugPayloadAssembler.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantDebugPayloadAssembler.test.tsassistantEvidenceBundleAssembler.test.tsassistantQueryPlanning.test.tsassistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.8):
- Extracted deep-lane processed log payload assembly from
assistantServiceinto dedicated module:assistantMessageLogAssembler.ts
- Rewired
assistantServiceto buildassistant_message_processed.detailsvia assembler (behavior-preserving). - Added focused unit tests:
assistantMessageLogAssembler.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantMessageLogAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantEvidenceBundleAssembler.test.tsassistantQueryPlanning.test.tsassistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.9):
- Extracted orchestration-contract bundle assembly from
assistantServiceinto dedicated module:assistantContractsBundleAssembler.ts
- Rewired
assistantServiceto consume bundled contracts/outcome class from assembler (behavior-preserving):query_frame,execution_plan,evidence_bundle,coverage,outcome_class.
- Added focused unit tests:
assistantContractsBundleAssembler.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantContractsBundleAssembler.test.tsassistantMessageLogAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantEvidenceBundleAssembler.test.tsassistantQueryPlanning.test.tsassistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.10):
- Extracted deep response envelope assembly from
assistantServiceinto dedicated module:assistantDeepResponseAssembler.ts- centralized:
- safe final assistant text cleanup (debug tail stripping);
answer_structure_v11selection/building policy;- assistant conversation item construction.
- Rewired
assistantServiceto consume deep response assembler (behavior-preserving). - Added focused unit tests:
assistantDeepResponseAssembler.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 + safety regressions passed:
assistantDeepResponseAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantMessageLogAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantEvidenceBundleAssembler.test.tsassistantQueryPlanning.test.tsassistantCoverageGrounding.test.tsassistantWave10SettlementCorrectiveRegression.test.tsassistantAnswerPackageBuilder.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantOrchestrationContracts.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.11):
- Added top-level deep turn packager to compose extracted Stage 2 modules behind one boundary:
assistantDeepTurnPackaging.ts- centralizes orchestration of:
- evidence bundle assembly;
- contracts/outcome class assembly;
- deep answer artifacts;
- debug payload;
- assistant conversation item;
- processed log details.
- Rewired deep-lane
assistantServiceflow to useassembleAssistantDeepTurnPackaging(...)(behavior-preserving):- replaced duplicated per-artifact assembly block with single orchestrator call;
- preserved investigation-state update and existing response/event contract.
- Added focused unit test:
assistantDeepTurnPackaging.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.12):
- Extracted deep-turn input normalization/defaulting from
assistantServiceinto dedicated module:assistantDeepTurnInputBuilder.ts- centralized normalization of:
followupStateUsagedefault (nullwhen absent);- composition defaults (
problem_*fields,answer_structure_v11); problem_unit_ids_usedarray normalization.
- Rewired
assistantServiceto build deep-turn input via:buildAssistantDeepTurnPackagingInput(...)- followed by existing
assembleAssistantDeepTurnPackaging(...)call (behavior-preserving).
- Added focused unit tests:
assistantDeepTurnInputBuilder.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.13):
- Extracted investigation-state update/persist runtime block from
assistantServiceinto dedicated adapter:assistantInvestigationStateRuntimeAdapter.ts- introduced:
buildAssistantInvestigationStateSnapshot(...)persistAssistantInvestigationStateSnapshot(...)
- Rewired
assistantServiceto consume new adapter (behavior-preserving):- same
investigation_statesnapshot semantics; - same
FEATURE_ASSISTANT_INVESTIGATION_STATE_V1gating; - same session persistence call path.
- same
- Added focused unit tests:
assistantInvestigationStateRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.14):
- Extracted deep-lane assistant post-turn commit/persist/log block from
assistantServiceinto dedicated adapter:assistantTurnCommitRuntimeAdapter.ts- introduced:
commitAssistantTurnAndLog(...)
- Rewired
assistantServicedeep-lane to use new adapter (behavior-preserving):- same append-to-session semantics;
- same session persistence behavior when session exists;
- same
assistant_message_processedlog envelope and event type.
- Added focused unit tests:
assistantTurnCommitRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.15):
- Extracted deep-lane pre-packaging context assembly from
assistantServiceinto dedicated module:assistantDeepTurnPrePackagingContext.ts- centralized:
- dropped intent segments extraction;
- analysis context projection for contracts;
- debug route projection;
- resolved execution state projection;
- safe assistant reply base sanitization.
- Rewired
assistantServicedeep-lane to consumebuildAssistantDeepTurnPrePackagingContext(...)(behavior-preserving). - Added focused unit tests:
assistantDeepTurnPrePackagingContext.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.16):
- Extracted deep-lane success response envelope assembly from
assistantServiceinto dedicated builder:assistantDeepTurnResponseBuilder.ts- introduced:
buildAssistantDeepTurnSuccessResponse(...)
- Rewired
assistantServicedeep-lane to return response via new builder (behavior-preserving). - Added focused unit tests:
assistantDeepTurnResponseBuilder.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.17):
- Extracted deep-lane composition assembly from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnCompositionRuntimeAdapter.ts- introduced:
buildAssistantDeepTurnComposition(...)
- Centralized composition-time derivations (behavior-preserving):
focusDomainHintfrom followup usage + investigation state;questionTypeClassviaresolveQuestionType(...);- period presence signals from company anchors/normalization payload;
- downstream
composeAssistantAnswer(...)call wiring.
- Rewired
assistantServicedeep-lane to consume adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnCompositionRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.18):
- Extracted deep-lane guard runtime pipeline from
assistantServiceinto dedicated adapter:assistantDeepTurnGuardRuntimeAdapter.ts- introduced:
applyAssistantDeepTurnRetrievalGuards(...)applyAssistantDeepTurnGroundingEligibility(...)
- Centralized and isolated runtime sequence (behavior-preserving):
- polarity guard on retrieval results;
- targeted evidence acquisition;
- evidence admissibility gate;
- grounded-answer eligibility evaluation + grounding status overlay.
- Rewired
assistantServicedeep-lane to consume adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnGuardRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.19):
- Extracted deep-lane retrieval execution loop from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnRetrievalRuntimeAdapter.ts- introduced:
executeAssistantDeepTurnRetrievalPlan(...)
- Centralized retrieval runtime behavior (behavior-preserving):
- skipped/no-route call record generation;
- sequential route execution with temporal hint propagation;
- raw result capture;
- failed-route fallback normalization with stable error envelope.
- Rewired
assistantServicedeep-lane to consume retrieval adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnRetrievalRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.tsassistantDeepTurnRetrievalRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.20):
- Extracted deep-lane execution-plan assembly/enforcement from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnPlanRuntimeAdapter.ts- introduced:
buildAssistantDeepTurnExecutionPlan(...)
- Centralized planning runtime sequence (behavior-preserving):
- requirement extraction by fragment;
- execution plan build from route summary;
- RBP route-plan enforcement;
- FA route-plan enforcement;
- temporal hint overlay;
- polarity hint overlay.
- Rewired
assistantServicedeep-lane to consume adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnPlanRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.tsassistantDeepTurnRetrievalRuntimeAdapter.test.tsassistantDeepTurnPlanRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.21):
- Extracted deep-lane pre-guard runtime context assembly from
assistantServiceinto dedicated adapter:assistantDeepTurnContextRuntimeAdapter.ts- introduced:
buildAssistantDeepTurnRuntimeContext(...)
- Centralized context runtime sequence (behavior-preserving):
- company anchors resolution;
- initial business-scope alignment;
- P0 domain inference + domain whitelist gating for guard focus;
- temporal guard resolution with runtime analysis context;
- domain polarity guard resolution;
- claim-bound anchors resolution;
- live business-scope resolution with followup flag;
- normalized live temporal hint projection.
- Rewired
assistantServicedeep-lane to consume context adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnContextRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.tsassistantDeepTurnRetrievalRuntimeAdapter.test.tsassistantDeepTurnPlanRuntimeAdapter.test.tsassistantDeepTurnContextRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.22):
- Extracted deep-lane post-retrieval grounding runtime orchestration from
assistantServiceinto dedicated adapter:assistantDeepTurnGroundingRuntimeAdapter.ts- introduced:
runAssistantDeepTurnGroundingRuntime(...)
- Centralized grounding/runtime sequence (behavior-preserving):
- RBP live-route audit projection;
- FA live-route audit projection;
- coverage+grounding pipeline execution;
- grounded-answer eligibility overlay on base grounding check.
- Rewired
assistantServicedeep-lane to consume adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnGroundingRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.tsassistantDeepTurnRetrievalRuntimeAdapter.test.tsassistantDeepTurnPlanRuntimeAdapter.test.tsassistantDeepTurnContextRuntimeAdapter.test.tsassistantDeepTurnGroundingRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.23):
- Extracted deep-lane packaging orchestration block from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnPackagingRuntimeAdapter.ts- introduced:
runAssistantDeepTurnPackagingRuntime(...)
- Centralized packaging/runtime sequence (behavior-preserving):
- pre-packaging context assembly;
- investigation-state snapshot build/persist;
- deep-turn packaging input assembly;
- deep-turn packaging output projection (
safeAssistantReply, debug payload, assistant item, processed log details).
- Rewired
assistantServicedeep-lane to consume packaging runtime adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnPackagingRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.tsassistantDeepTurnRetrievalRuntimeAdapter.test.tsassistantDeepTurnPlanRuntimeAdapter.test.tsassistantDeepTurnContextRuntimeAdapter.test.tsassistantDeepTurnGroundingRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.24):
- Extracted deep-lane finalization/response tail from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnFinalizeRuntimeAdapter.ts- introduced:
finalizeAssistantDeepTurn(...)
- Centralized finalization runtime sequence (behavior-preserving):
- assistant turn commit + processed-event logging;
- deep-turn API success response assembly from committed conversation state.
- Rewired
assistantServicedeep-lane to consume finalization adapter output (behavior-preserving). - Added focused unit tests:
assistantDeepTurnFinalizeRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 assembler/adapter pack passed:
assistantOrchestrationContracts.test.tsassistantOrchestrationRuntimeAdapter.test.tsassistantAnswerPackageBuilder.test.tsassistantCoverageGrounding.test.tsassistantQueryPlanning.test.tsassistantEvidenceBundleAssembler.test.tsassistantDebugPayloadAssembler.test.tsassistantMessageLogAssembler.test.tsassistantContractsBundleAssembler.test.tsassistantDeepResponseAssembler.test.tsassistantDeepTurnPackaging.test.tsassistantDeepTurnInputBuilder.test.tsassistantInvestigationStateRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.tsassistantDeepTurnPrePackagingContext.test.tsassistantDeepTurnResponseBuilder.test.tsassistantDeepTurnCompositionRuntimeAdapter.test.tsassistantDeepTurnGuardRuntimeAdapter.test.tsassistantDeepTurnRetrievalRuntimeAdapter.test.tsassistantDeepTurnPlanRuntimeAdapter.test.tsassistantDeepTurnContextRuntimeAdapter.test.tsassistantDeepTurnGroundingRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantDeepTurnFinalizeRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.25):
- Extracted address-lane finalization/response tail from
assistantServiceinto dedicated runtime adapter:assistantAddressTurnFinalizeRuntimeAdapter.ts- introduced:
finalizeAssistantAddressTurn(...)
- Centralized address finalization runtime sequence (behavior-preserving):
- assistant item creation for address lane;
- structured
assistant_message_addressprocessed-event payload build; - turn commit/persist/log via shared commit runtime adapter;
- API success response assembly from committed conversation state.
- Rewired
assistantServiceaddress-lane finalize path to consume adapter output (behavior-preserving). - Added focused unit tests:
assistantAddressTurnFinalizeRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted Stage 2 adapter/finalization pack passed:
assistantAddressTurnFinalizeRuntimeAdapter.test.tsassistantDeepTurnFinalizeRuntimeAdapter.test.tsassistantTurnCommitRuntimeAdapter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.26):
- Extracted living-chat finalization/response tail from
assistantServiceinto dedicated runtime adapter:assistantLivingChatTurnFinalizeRuntimeAdapter.ts- introduced:
finalizeAssistantLivingChatTurn(...)
- Centralized living-chat finalization runtime sequence (behavior-preserving):
- assistant item creation for chat lane;
- structured
assistant_message_chatprocessed-event payload build; - turn commit/persist/log via shared commit runtime adapter;
- API success response assembly from committed conversation state.
- Rewired
assistantServicetryHandleLivingChat(...)finalize path to consume adapter output (behavior-preserving). - Added focused unit tests:
assistantLivingChatTurnFinalizeRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep finalize pack passed:
assistantLivingChatTurnFinalizeRuntimeAdapter.test.tsassistantAddressTurnFinalizeRuntimeAdapter.test.tsassistantDeepTurnFinalizeRuntimeAdapter.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.ts
- Additional safety regressions passed:
assistantWave10SettlementCorrectiveRegression.test.tsassistantMcpRuntimeBridge.test.tsassistantAddressFollowupContext.test.ts
Implemented in current pass (Phase 2.27):
- Extracted living-chat runtime orchestration branch from
assistantServiceinto dedicated runtime adapter:assistantLivingChatRuntimeAdapter.ts- introduced:
runAssistantLivingChatRuntime(...)
- 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.
- Rewired
assistantServicetryHandleLivingChat(...)to consume runtime adapter output and keep existing chat finalization adapter path unchanged. - Added focused unit tests:
assistantLivingChatRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/chat followup pack passed:
assistantLivingChatRuntimeAdapter.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantAddressFollowupContext.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.28):
- Extracted address-lane retry orchestration branch from
assistantServiceinto dedicated runtime adapter:assistantAddressLaneRuntimeAdapter.ts- introduced:
runAssistantAddressLaneRuntime(...)
- Centralized address retry/runtime branch sequence (behavior-preserving):
- contextual-first execution when followup context is preferred;
- primary execution without followup context;
- optional contextual fallback when context exists but is not preferred;
- retry with raw user message for retryable limited results;
- deterministic fallback to pending limited result when retry does not improve outcome.
- Rewired
assistantServiceaddress lane execution path to consume retry adapter output and preserve existing address finalization contract. - Added focused unit tests:
assistantAddressLaneRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address followup pack passed:
assistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.29):
- Extracted address orchestration bootstrap block from
assistantServiceinto dedicated runtime adapter:assistantAddressOrchestrationRuntimeAdapter.ts- introduced:
buildAssistantAddressOrchestrationRuntime(...)
- Centralized address orchestration bootstrap sequence (behavior-preserving):
- LLM predecompose stage or deterministic fallback contract when feature is disabled;
- effective address input message resolution;
- followup carryover context resolution;
- orchestration/tool-gate decision resolution;
- dialog continuation contract projection into runtime meta;
- living mode decision projection for chat fallback.
- Rewired
assistantServiceaddress pre-lane bootstrap path to consume orchestration runtime adapter output. - Added focused unit tests:
assistantAddressOrchestrationRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address followup pack passed:
assistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.30):
- Extracted address tool-gate skip branch from
assistantServiceinto dedicated runtime adapter:assistantAddressToolGateRuntimeAdapter.ts- introduced:
runAssistantAddressToolGateRuntime(...)
- Centralized tool-gate skip/runtime sequence (behavior-preserving):
- deterministic early noop when
runAddressLane=true; - structured
assistant_address_tool_gate_skiplogging payload projection; - conditional living-chat fallback invocation when mode is
chat.
- deterministic early noop when
- Rewired
assistantServiceto consume tool-gate runtime adapter output and preserve existing early-return contract for handled chat fallback. - Added focused unit tests:
assistantAddressToolGateRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address followup pack passed:
assistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.31):
- Extracted deep-lane followup binding + normalize bootstrap block from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnNormalizationRuntimeAdapter.ts- introduced:
buildAssistantDeepTurnNormalizationRuntime(...)
- Centralized deep normalization bootstrap sequence (behavior-preserving):
- followup state binding projection when feature flags are enabled;
- deterministic fallback to raw user question when followup binding is disabled/unavailable;
- normalize request payload assembly and normalizer invocation.
- Rewired
assistantServicedeep-lane bootstrap to consume normalization runtime adapter output. - Added focused unit tests:
assistantDeepTurnNormalizationRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantDeepTurnNormalizationRuntimeAdapter.test.tsassistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.32):
- Extracted deep-lane context/plan/retrieval/guard/grounding/composition orchestration block from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnAnalysisRuntimeAdapter.ts- introduced:
runAssistantDeepTurnAnalysisRuntime(...)
- Centralized deep analysis sequence wiring (behavior-preserving):
- runtime context stage output propagation;
- execution-plan, retrieval, guard and grounding stage chaining;
- composition stage input projection from grounded retrieval output.
- Rewired
assistantServicedeep-lane middle pipeline to consume analysis runtime adapter output while preserving existing packaging/finalization contracts. - Added focused unit tests:
assistantDeepTurnAnalysisRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantDeepTurnAnalysisRuntimeAdapter.test.tsassistantDeepTurnNormalizationRuntimeAdapter.test.tsassistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.33):
- Extracted deep-lane response tail (packaging + finalize) from
assistantServiceinto dedicated runtime adapter:assistantDeepTurnResponseRuntimeAdapter.ts- introduced:
runAssistantDeepTurnResponseRuntime(...)
- Centralized deep response-tail sequence (behavior-preserving):
- packaging runtime invocation with full debug/contract payload projection;
- deep finalization invocation with packaged reply/debug artifacts;
- single response projection back to caller.
- Rewired
assistantServicedeep-lane tail to consume response runtime adapter output. - Added focused unit tests:
assistantDeepTurnResponseRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnAnalysisRuntimeAdapter.test.tsassistantDeepTurnNormalizationRuntimeAdapter.test.tsassistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.34):
- Extracted top-level address branch orchestration from
assistantServiceinto dedicated runtime adapter:assistantAddressRuntimeAdapter.ts- introduced:
runAssistantAddressRuntime(...)
- Centralized full address-branch control flow (behavior-preserving):
- address bootstrap orchestration stage;
- tool-gate skip/chat fallback stage;
- lane execution/retry stage with analysis-date hint propagation;
- address finalize stage projection with retry audit merge.
- Rewired
assistantServiceaddress branch to a single runtime adapter invocation and preservedaddressRuntimeMetaForDeeppropagation contract. - Added focused unit tests:
assistantAddressRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantAddressRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnAnalysisRuntimeAdapter.test.tsassistantDeepTurnNormalizationRuntimeAdapter.test.tsassistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.35):
- Extracted address-lane response-tail (debug enrichment + finalize projection) from
assistantServiceinto dedicated runtime adapter:assistantAddressLaneResponseRuntimeAdapter.ts- introduced:
runAssistantAddressLaneResponseRuntime(...)
- Centralized address response-tail sequence (behavior-preserving):
- reply sanitization and structured address debug payload assembly;
- followup-offer projection + known/active organization debug enrichment;
- address turn finalization through existing finalize adapter contract.
- Rewired
assistantServicefinalizeAddressLaneResponse(...)closure to consume response runtime adapter output. - Added focused unit tests:
assistantAddressLaneResponseRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantAddressLaneResponseRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnAnalysisRuntimeAdapter.test.tsassistantDeepTurnNormalizationRuntimeAdapter.test.tsassistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.36):
- Extracted living-chat handler branch (
tryHandleLivingChat) fromassistantServiceinto dedicated runtime adapter:assistantLivingChatHandlerRuntimeAdapter.ts- introduced:
tryHandleAssistantLivingChatRuntime(...)
- Centralized living-chat handler sequence (behavior-preserving):
- living-chat runtime invocation (deterministic/LLM guard chain);
- chat finalization invocation for
assistant_message_chatresponse path; - warn-log fallback path for runtime failures.
- Rewired
assistantServicetryHandleLivingChat(...)closure to consume handler runtime adapter output. - Added focused unit tests:
assistantLivingChatHandlerRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantLivingChatHandlerRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnAnalysisRuntimeAdapter.test.tsassistantDeepTurnNormalizationRuntimeAdapter.test.tsassistantAddressToolGateRuntimeAdapter.test.tsassistantAddressOrchestrationRuntimeAdapter.test.tsassistantAddressLaneRuntimeAdapter.test.tsassistantAddressFollowupContext.test.tsassistantLivingChatMode.test.tsassistantLivingRouter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.37):
- Extracted living-chat LLM call/build block from
assistantServiceinto dedicated runtime adapter:assistantLivingChatLlmRuntimeAdapter.ts- introduced:
runAssistantLivingChatLlmRuntime(...)
- Centralized living LLM execution sequence (behavior-preserving):
- context window assembly from session history;
- canon excerpt loading and prompt composition;
- model/token selection with guard clamp;
- output sanitization with stable fallback.
- Rewired
assistantServicetryHandleLivingChat(...)closure to consume the new LLM runtime adapter. - Added focused unit tests:
assistantLivingChatLlmRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantLivingChatLlmRuntimeAdapter.test.tsassistantLivingChatHandlerRuntimeAdapter.test.tsassistantLivingChatRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.38):
- Internalized living-chat prompt/context builders into
assistantLivingChatLlmRuntimeAdapter:- removed external builder dependencies from runtime input contract;
- centralized compacting + clipping + context/prompt projection directly in adapter.
- Simplified
assistantServiceliving LLM call wiring:- removed
buildLivingChatContextWindow/buildLivingChatPromptinjection fromexecuteLlmChat.
- removed
- Updated focused tests for adapter-owned prompt assembly:
assistantLivingChatLlmRuntimeAdapter.test.tsnow verifies context carryover and user-message prompt shape.
- Applied cleanup inside
assistantServiceafter the wiring simplification:- removed dead local living prompt/context helper functions.
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantLivingChatLlmRuntimeAdapter.test.tsassistantLivingChatHandlerRuntimeAdapter.test.tsassistantLivingChatRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.39):
- Extracted user-turn bootstrap sequence from
assistantServiceinto dedicated runtime adapter:assistantUserTurnBootstrapRuntimeAdapter.ts- introduced:
runAssistantUserTurnBootstrapRuntime(...)
- Centralized user-turn bootstrap flow (behavior-preserving):
- session ensure + user message normalization/repair;
- user item append + session persistence;
- runtime analysis context projection.
- Rewired
assistantService.handleMessage(...)to consume bootstrap runtime output and preserve downstreamquestionIdcontract usage. - Added focused unit tests:
assistantUserTurnBootstrapRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantUserTurnBootstrapRuntimeAdapter.test.tsassistantLivingChatLlmRuntimeAdapter.test.tsassistantLivingChatHandlerRuntimeAdapter.test.tsassistantLivingChatRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.40):
- Extracted address-lane attempt bridge (
runAddressLaneAttempt) fromassistantServiceinto dedicated runtime adapter:assistantAddressLaneAttemptRuntimeAdapter.ts- introduced:
runAssistantAddressLaneAttemptRuntime(...)
- Centralized address-lane attempt handoff logic (behavior-preserving):
- organization-scoped followup context merge;
- fallback to plain lane attempt when scoped context is unavailable;
- strict propagation of analysis-date hint into
addressQueryService.tryHandle(...).
- Rewired
assistantServiceto consume lane-attempt runtime adapter. - Added focused unit tests:
assistantAddressLaneAttemptRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantAddressLaneAttemptRuntimeAdapter.test.tsassistantUserTurnBootstrapRuntimeAdapter.test.tsassistantLivingChatLlmRuntimeAdapter.test.tsassistantLivingChatHandlerRuntimeAdapter.test.tsassistantLivingChatRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.41):
- Extracted living-chat attempt bridge (
tryHandleLivingChat) fromassistantServiceinto dedicated runtime adapter:assistantLivingChatAttemptRuntimeAdapter.ts- introduced:
runAssistantLivingChatAttemptRuntime(...)
- Centralized living-chat attempt handoff logic (behavior-preserving):
- delegated handler invocation (
tryHandleAssistantLivingChatRuntime(...)); - delegated LLM call bridge (
runAssistantLivingChatLlmRuntime(...)) behind unifiedexecuteLlmChatcontract; - preserved all guard, scope and session finalization hooks.
- delegated handler invocation (
- Rewired
assistantServiceto consume living-chat attempt runtime adapter. - Added focused unit tests:
assistantLivingChatAttemptRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantLivingChatAttemptRuntimeAdapter.test.tsassistantAddressLaneAttemptRuntimeAdapter.test.tsassistantUserTurnBootstrapRuntimeAdapter.test.tsassistantLivingChatLlmRuntimeAdapter.test.tsassistantLivingChatHandlerRuntimeAdapter.test.tsassistantLivingChatRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantWave10SettlementCorrectiveRegression.test.ts
Implemented in current pass (Phase 2.42):
- Extracted address-lane response attempt bridge (
finalizeAddressLaneResponse) fromassistantServiceinto dedicated runtime adapter:assistantAddressLaneResponseAttemptRuntimeAdapter.ts- introduced:
runAssistantAddressLaneResponseAttemptRuntime(...)
- Centralized address-lane response handoff logic (behavior-preserving):
- delegated response runtime invocation (
runAssistantAddressLaneResponseRuntime(...)); - preserved followup-offer/debug payload and session finalization contract wiring.
- delegated response runtime invocation (
- Rewired
assistantServiceto consume address-lane response attempt runtime adapter. - Added focused unit tests:
assistantAddressLaneResponseAttemptRuntimeAdapter.test.ts
Validation:
npm run buildpassed.- Targeted living/address/deep followup pack passed:
assistantAddressLaneResponseAttemptRuntimeAdapter.test.tsassistantLivingChatAttemptRuntimeAdapter.test.tsassistantAddressLaneAttemptRuntimeAdapter.test.tsassistantUserTurnBootstrapRuntimeAdapter.test.tsassistantLivingChatLlmRuntimeAdapter.test.tsassistantLivingChatHandlerRuntimeAdapter.test.tsassistantLivingChatRuntimeAdapter.test.tsassistantAddressRuntimeAdapter.test.tsassistantAddressLaneResponseRuntimeAdapter.test.tsassistantDeepTurnResponseRuntimeAdapter.test.tsassistantDeepTurnPackagingRuntimeAdapter.test.tsassistantWave10SettlementCorrectiveRegression.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 + 2.28 + 2.29 + 2.30 + 2.31 + 2.32 + 2.33 + 2.34 + 2.35 + 2.36 + 2.37 + 2.38 + 2.39 + 2.40 + 2.41 + 2.42 completed)
Stage 3 (P2): Hybrid Semantic Layer (LLM + Deterministic Guards)
Goal:
- Use LLM for semantic extraction/decomposition in strict schema.
- Keep deterministic guardrails as verifier, not primary “brain”.
- Reduce dictionary overfitting and false route drifts.
Status: Planned
Stage 4 (P2): Human-Centric Answer Layer
Goal:
- Move final user response to contract-driven answer package with:
- direct answer;
- what was checked;
- what was found;
- what remains unproven;
- best next step.
- Keep claim-to-evidence binding strict.
Status: Planned
Stage 5 (P3): Quality Loop Driven By GUI Markup
Goal:
- Drive backlog from
manual_case_decisionqueues. - Build targeted regression packs from real failed comments.
- Track trend by reason-code clusters.
Status: Planned
6. Non-Negotiable Constraints
- Do not break MCP route interfaces.
- Do not remove manual logic without compatible replacement.
- Preserve UTF-8 (without BOM) for all source/doc files.
- Keep manual markup and autorun API contract stable.