NODEDC_1C/docs/TECH/1CLLMARCH-FACT.md

62 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:

  1. existing MCP routes;
  2. manual routing and guard logic;
  3. 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)

  1. 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.
  2. 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.
  3. 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)

  1. Structured normalization contracts and validator loops.
  2. Coverage and grounding artifacts (with different naming than target).
  3. Conversation state persistence.
  4. Operational diagnostics and report generation.

4.2 Not aligned enough for stable prod

  1. Role separation (Interpreter/Planner/Critic/Answer) is incomplete and strongly coupled.
  2. Final user answer quality is constrained by deterministic template synthesis.
  3. Unified contract for analysis date/time scope is missing across all lanes.
  4. Result classes from target (FULLY_ANSWERED, BLOCKED_BY_*, etc.) are not normalized as one contract.
  5. Reason-code taxonomy exists but is fragmented across modules.

5. Stabilization Plan (No Route Breakage)

Stage 1 (P0): Unified Analysis Context + Temporal Hardening

Goal:

  1. Introduce unified analysis_context contract.
  2. Propagate it through eval -> assistant -> runtime lanes.
  3. Remove hidden hardcoded period fallback in live MCP plan generation.
  4. Keep backward compatibility (period_hint still supported).

Acceptance:

  1. If analysis date is set, runtime uses it explicitly in both deep/address paths.
  2. If analysis date is absent, runtime no longer silently injects fixed historical date in live-plan fallback.
  3. Existing APIs and manual workflows remain operational.

Implemented in current pass:

  1. Added unified analysis_context contract to request context (as_of_date, period_from, period_to, snapshot_mode, source).
  2. Added compatibility bridge: legacy period_hint is still accepted and normalized into analysis_context.
  3. Propagated analysis context through eval flows into assistant runtime.
  4. Applied analysis context in temporal guard with explicit precedence over implicit snapshot lock.
  5. 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:

  1. npm run build passed.
  2. Targeted runtime tests passed:
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Status: Completed

Stage 2 (P1): Orchestrator Decomposition (Behavior-Preserving Refactor)

Goal:

  1. Split monolith into explicit modules:
    • QueryFrame builder
    • Execution planner
    • Evidence assembler
    • Coverage critic
    • Answer package builder
  2. Preserve current behavior under compatibility adapter.

Acceptance:

  1. No MCP route regressions.
  2. Existing tests and autorun loop remain green.

Implemented in current pass (Phase 2.1):

  1. Added new orchestration contract module:
    • assistant_query_frame_v1
    • assistant_execution_plan_v1
    • assistant_evidence_bundle_v1
    • assistant_coverage_contract_v1
    • outcome classifier (FULLY_ANSWERED, PARTIALLY_ANSWERED, BLOCKED_*, MISROUTED, FAILED_TO_BIND_ENTITIES)
  2. 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.
  3. Added unit regression tests:
    • assistantOrchestrationContracts.test.ts

Validation:

  1. npm run build passed.
  2. Targeted tests passed:
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.2):

  1. Added runtime orchestration adapter for the deep lane:
    • assistantOrchestrationRuntimeAdapter.ts
    • unified pipeline call for requirements -> coverage -> grounding with stable interfaces.
  2. Integrated adapter into assistantService main deep-lane flow (behavior-preserving):
    • existing extraction/coverage/grounding logic preserved;
    • execution now routed through one orchestration boundary.
  3. Added adapter unit tests:
    • assistantOrchestrationRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted tests passed:
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.3):

  1. Extracted answer package builder (answer_structure_v11) from assistantService into dedicated module:
    • assistantAnswerPackageBuilder.ts
  2. Rewired deep-lane answer structure assembly to use the new module without contract changes.
  3. Added focused unit tests for answer package behavior:
    • assistantAnswerPackageBuilder.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 test pack passed:
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.4):

  1. Extracted coverage/grounding pipeline into dedicated module:
    • assistantCoverageGrounding.ts
    • moved requirement extraction, coverage resolution, and grounding checks under one reusable boundary.
  2. Rewired assistantService to use extracted coverage/grounding module via compatibility wrappers (behavior-preserving).
  3. Added focused regression tests:
    • assistantCoverageGrounding.test.ts
  4. 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.ts by explicitly controlling FEATURE_ASSISTANT_ADDRESS_QUERY_V1.

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.5):

  1. Extracted query-planning helpers from assistantService into dedicated module:
    • assistantQueryPlanning.ts
    • moved fragmentTextById, execution-plan builder, and debug-routes builder under one reusable boundary.
  2. Rewired assistantService to use extracted query-planning module (behavior-preserving wrapper integration).
  3. Added focused unit tests for query-planning behavior:
    • assistantQueryPlanning.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantQueryPlanning.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.6):

  1. Extracted evidence-bundle assembly from assistantService into dedicated module:
    • assistantEvidenceBundleAssembler.ts
    • centralized:
      • assistant_evidence_bundle_v1 contract assembly;
      • debug retrieval_status projection from normalized retrieval results.
  2. Rewired assistantService to use assembler output for both:
    • assistant_orchestration_contracts_v1.evidence_bundle;
    • debug payload retrieval_status.
  3. Added focused unit tests:
    • assistantEvidenceBundleAssembler.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantEvidenceBundleAssembler.test.ts
    • assistantQueryPlanning.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.7):

  1. Extracted deep-lane debug payload assembly from assistantService into dedicated module:
    • assistantDebugPayloadAssembler.ts
  2. Rewired assistantService to build debug via assembler (behavior-preserving):
    • keeps all existing fields, guard audits, orchestration contracts and optional sections.
  3. Added focused unit tests:
    • assistantDebugPayloadAssembler.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantDebugPayloadAssembler.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantQueryPlanning.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.8):

  1. Extracted deep-lane processed log payload assembly from assistantService into dedicated module:
    • assistantMessageLogAssembler.ts
  2. Rewired assistantService to build assistant_message_processed.details via assembler (behavior-preserving).
  3. Added focused unit tests:
    • assistantMessageLogAssembler.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantMessageLogAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantQueryPlanning.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.9):

  1. Extracted orchestration-contract bundle assembly from assistantService into dedicated module:
    • assistantContractsBundleAssembler.ts
  2. Rewired assistantService to consume bundled contracts/outcome class from assembler (behavior-preserving):
    • query_frame, execution_plan, evidence_bundle, coverage, outcome_class.
  3. Added focused unit tests:
    • assistantContractsBundleAssembler.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantContractsBundleAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantQueryPlanning.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.10):

  1. Extracted deep response envelope assembly from assistantService into dedicated module:
    • assistantDeepResponseAssembler.ts
    • centralized:
      • safe final assistant text cleanup (debug tail stripping);
      • answer_structure_v11 selection/building policy;
      • assistant conversation item construction.
  2. Rewired assistantService to consume deep response assembler (behavior-preserving).
  3. Added focused unit tests:
    • assistantDeepResponseAssembler.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 + safety regressions passed:
    • assistantDeepResponseAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantQueryPlanning.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantOrchestrationContracts.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.11):

  1. 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.
  2. Rewired deep-lane assistantService flow to use assembleAssistantDeepTurnPackaging(...) (behavior-preserving):
    • replaced duplicated per-artifact assembly block with single orchestrator call;
    • preserved investigation-state update and existing response/event contract.
  3. Added focused unit test:
    • assistantDeepTurnPackaging.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.12):

  1. Extracted deep-turn input normalization/defaulting from assistantService into dedicated module:
    • assistantDeepTurnInputBuilder.ts
    • centralized normalization of:
      • followupStateUsage default (null when absent);
      • composition defaults (problem_* fields, answer_structure_v11);
      • problem_unit_ids_used array normalization.
  2. Rewired assistantService to build deep-turn input via:
    • buildAssistantDeepTurnPackagingInput(...)
    • followed by existing assembleAssistantDeepTurnPackaging(...) call (behavior-preserving).
  3. Added focused unit tests:
    • assistantDeepTurnInputBuilder.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.13):

  1. Extracted investigation-state update/persist runtime block from assistantService into dedicated adapter:
    • assistantInvestigationStateRuntimeAdapter.ts
    • introduced:
      • buildAssistantInvestigationStateSnapshot(...)
      • persistAssistantInvestigationStateSnapshot(...)
  2. Rewired assistantService to consume new adapter (behavior-preserving):
    • same investigation_state snapshot semantics;
    • same FEATURE_ASSISTANT_INVESTIGATION_STATE_V1 gating;
    • same session persistence call path.
  3. Added focused unit tests:
    • assistantInvestigationStateRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.14):

  1. Extracted deep-lane assistant post-turn commit/persist/log block from assistantService into dedicated adapter:
    • assistantTurnCommitRuntimeAdapter.ts
    • introduced:
      • commitAssistantTurnAndLog(...)
  2. Rewired assistantService deep-lane to use new adapter (behavior-preserving):
    • same append-to-session semantics;
    • same session persistence behavior when session exists;
    • same assistant_message_processed log envelope and event type.
  3. Added focused unit tests:
    • assistantTurnCommitRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.15):

  1. Extracted deep-lane pre-packaging context assembly from assistantService into 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.
  2. Rewired assistantService deep-lane to consume buildAssistantDeepTurnPrePackagingContext(...) (behavior-preserving).
  3. Added focused unit tests:
    • assistantDeepTurnPrePackagingContext.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.16):

  1. Extracted deep-lane success response envelope assembly from assistantService into dedicated builder:
    • assistantDeepTurnResponseBuilder.ts
    • introduced:
      • buildAssistantDeepTurnSuccessResponse(...)
  2. Rewired assistantService deep-lane to return response via new builder (behavior-preserving).
  3. Added focused unit tests:
    • assistantDeepTurnResponseBuilder.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.17):

  1. Extracted deep-lane composition assembly from assistantService into dedicated runtime adapter:
    • assistantDeepTurnCompositionRuntimeAdapter.ts
    • introduced:
      • buildAssistantDeepTurnComposition(...)
  2. Centralized composition-time derivations (behavior-preserving):
    • focusDomainHint from followup usage + investigation state;
    • questionTypeClass via resolveQuestionType(...);
    • period presence signals from company anchors/normalization payload;
    • downstream composeAssistantAnswer(...) call wiring.
  3. Rewired assistantService deep-lane to consume adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.18):

  1. Extracted deep-lane guard runtime pipeline from assistantService into dedicated adapter:
    • assistantDeepTurnGuardRuntimeAdapter.ts
    • introduced:
      • applyAssistantDeepTurnRetrievalGuards(...)
      • applyAssistantDeepTurnGroundingEligibility(...)
  2. 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.
  3. Rewired assistantService deep-lane to consume adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnGuardRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.19):

  1. Extracted deep-lane retrieval execution loop from assistantService into dedicated runtime adapter:
    • assistantDeepTurnRetrievalRuntimeAdapter.ts
    • introduced:
      • executeAssistantDeepTurnRetrievalPlan(...)
  2. 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.
  3. Rewired assistantService deep-lane to consume retrieval adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.20):

  1. Extracted deep-lane execution-plan assembly/enforcement from assistantService into dedicated runtime adapter:
    • assistantDeepTurnPlanRuntimeAdapter.ts
    • introduced:
      • buildAssistantDeepTurnExecutionPlan(...)
  2. 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.
  3. Rewired assistantService deep-lane to consume adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnPlanRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts
    • assistantDeepTurnPlanRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.21):

  1. Extracted deep-lane pre-guard runtime context assembly from assistantService into dedicated adapter:
    • assistantDeepTurnContextRuntimeAdapter.ts
    • introduced:
      • buildAssistantDeepTurnRuntimeContext(...)
  2. 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.
  3. Rewired assistantService deep-lane to consume context adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnContextRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts
    • assistantDeepTurnPlanRuntimeAdapter.test.ts
    • assistantDeepTurnContextRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.22):

  1. Extracted deep-lane post-retrieval grounding runtime orchestration from assistantService into dedicated adapter:
    • assistantDeepTurnGroundingRuntimeAdapter.ts
    • introduced:
      • runAssistantDeepTurnGroundingRuntime(...)
  2. 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.
  3. Rewired assistantService deep-lane to consume adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnGroundingRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts
    • assistantDeepTurnPlanRuntimeAdapter.test.ts
    • assistantDeepTurnContextRuntimeAdapter.test.ts
    • assistantDeepTurnGroundingRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.23):

  1. Extracted deep-lane packaging orchestration block from assistantService into dedicated runtime adapter:
    • assistantDeepTurnPackagingRuntimeAdapter.ts
    • introduced:
      • runAssistantDeepTurnPackagingRuntime(...)
  2. 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).
  3. Rewired assistantService deep-lane to consume packaging runtime adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts
    • assistantDeepTurnPlanRuntimeAdapter.test.ts
    • assistantDeepTurnContextRuntimeAdapter.test.ts
    • assistantDeepTurnGroundingRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.24):

  1. Extracted deep-lane finalization/response tail from assistantService into dedicated runtime adapter:
    • assistantDeepTurnFinalizeRuntimeAdapter.ts
    • introduced:
      • finalizeAssistantDeepTurn(...)
  2. Centralized finalization runtime sequence (behavior-preserving):
    • assistant turn commit + processed-event logging;
    • deep-turn API success response assembly from committed conversation state.
  3. Rewired assistantService deep-lane to consume finalization adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantDeepTurnFinalizeRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 assembler/adapter pack passed:
    • assistantOrchestrationContracts.test.ts
    • assistantOrchestrationRuntimeAdapter.test.ts
    • assistantAnswerPackageBuilder.test.ts
    • assistantCoverageGrounding.test.ts
    • assistantQueryPlanning.test.ts
    • assistantEvidenceBundleAssembler.test.ts
    • assistantDebugPayloadAssembler.test.ts
    • assistantMessageLogAssembler.test.ts
    • assistantContractsBundleAssembler.test.ts
    • assistantDeepResponseAssembler.test.ts
    • assistantDeepTurnPackaging.test.ts
    • assistantDeepTurnInputBuilder.test.ts
    • assistantInvestigationStateRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
    • assistantDeepTurnPrePackagingContext.test.ts
    • assistantDeepTurnResponseBuilder.test.ts
    • assistantDeepTurnCompositionRuntimeAdapter.test.ts
    • assistantDeepTurnGuardRuntimeAdapter.test.ts
    • assistantDeepTurnRetrievalRuntimeAdapter.test.ts
    • assistantDeepTurnPlanRuntimeAdapter.test.ts
    • assistantDeepTurnContextRuntimeAdapter.test.ts
    • assistantDeepTurnGroundingRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts
    • assistantDeepTurnFinalizeRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.25):

  1. Extracted address-lane finalization/response tail from assistantService into dedicated runtime adapter:
    • assistantAddressTurnFinalizeRuntimeAdapter.ts
    • introduced:
      • finalizeAssistantAddressTurn(...)
  2. Centralized address finalization runtime sequence (behavior-preserving):
    • assistant item creation for address lane;
    • structured assistant_message_address processed-event payload build;
    • turn commit/persist/log via shared commit runtime adapter;
    • API success response assembly from committed conversation state.
  3. Rewired assistantService address-lane finalize path to consume adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantAddressTurnFinalizeRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted Stage 2 adapter/finalization pack passed:
    • assistantAddressTurnFinalizeRuntimeAdapter.test.ts
    • assistantDeepTurnFinalizeRuntimeAdapter.test.ts
    • assistantTurnCommitRuntimeAdapter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

Implemented in current pass (Phase 2.26):

  1. Extracted living-chat finalization/response tail from assistantService into dedicated runtime adapter:
    • assistantLivingChatTurnFinalizeRuntimeAdapter.ts
    • introduced:
      • finalizeAssistantLivingChatTurn(...)
  2. Centralized living-chat finalization runtime sequence (behavior-preserving):
    • assistant item creation for chat lane;
    • structured assistant_message_chat processed-event payload build;
    • turn commit/persist/log via shared commit runtime adapter;
    • API success response assembly from committed conversation state.
  3. Rewired assistantService tryHandleLivingChat(...) finalize path to consume adapter output (behavior-preserving).
  4. Added focused unit tests:
    • assistantLivingChatTurnFinalizeRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep finalize pack passed:
    • assistantLivingChatTurnFinalizeRuntimeAdapter.test.ts
    • assistantAddressTurnFinalizeRuntimeAdapter.test.ts
    • assistantDeepTurnFinalizeRuntimeAdapter.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
  3. Additional safety regressions passed:
    • assistantWave10SettlementCorrectiveRegression.test.ts
    • assistantMcpRuntimeBridge.test.ts
    • assistantAddressFollowupContext.test.ts

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

Implemented in current pass (Phase 2.28):

  1. Extracted address-lane retry orchestration branch from assistantService into dedicated runtime adapter:
    • assistantAddressLaneRuntimeAdapter.ts
    • introduced:
      • runAssistantAddressLaneRuntime(...)
  2. 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.
  3. Rewired assistantService address lane execution path to consume retry adapter output and preserve existing address finalization contract.
  4. Added focused unit tests:
    • assistantAddressLaneRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address followup pack passed:
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.29):

  1. Extracted address orchestration bootstrap block from assistantService into dedicated runtime adapter:
    • assistantAddressOrchestrationRuntimeAdapter.ts
    • introduced:
      • buildAssistantAddressOrchestrationRuntime(...)
  2. 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.
  3. Rewired assistantService address pre-lane bootstrap path to consume orchestration runtime adapter output.
  4. Added focused unit tests:
    • assistantAddressOrchestrationRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address followup pack passed:
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.30):

  1. Extracted address tool-gate skip branch from assistantService into dedicated runtime adapter:
    • assistantAddressToolGateRuntimeAdapter.ts
    • introduced:
      • runAssistantAddressToolGateRuntime(...)
  2. Centralized tool-gate skip/runtime sequence (behavior-preserving):
    • deterministic early noop when runAddressLane=true;
    • structured assistant_address_tool_gate_skip logging payload projection;
    • conditional living-chat fallback invocation when mode is chat.
  3. Rewired assistantService to consume tool-gate runtime adapter output and preserve existing early-return contract for handled chat fallback.
  4. Added focused unit tests:
    • assistantAddressToolGateRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address followup pack passed:
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.31):

  1. Extracted deep-lane followup binding + normalize bootstrap block from assistantService into dedicated runtime adapter:
    • assistantDeepTurnNormalizationRuntimeAdapter.ts
    • introduced:
      • buildAssistantDeepTurnNormalizationRuntime(...)
  2. 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.
  3. Rewired assistantService deep-lane bootstrap to consume normalization runtime adapter output.
  4. Added focused unit tests:
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.32):

  1. Extracted deep-lane context/plan/retrieval/guard/grounding/composition orchestration block from assistantService into dedicated runtime adapter:
    • assistantDeepTurnAnalysisRuntimeAdapter.ts
    • introduced:
      • runAssistantDeepTurnAnalysisRuntime(...)
  2. 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.
  3. Rewired assistantService deep-lane middle pipeline to consume analysis runtime adapter output while preserving existing packaging/finalization contracts.
  4. Added focused unit tests:
    • assistantDeepTurnAnalysisRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantDeepTurnAnalysisRuntimeAdapter.test.ts
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.33):

  1. Extracted deep-lane response tail (packaging + finalize) from assistantService into dedicated runtime adapter:
    • assistantDeepTurnResponseRuntimeAdapter.ts
    • introduced:
      • runAssistantDeepTurnResponseRuntime(...)
  2. 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.
  3. Rewired assistantService deep-lane tail to consume response runtime adapter output.
  4. Added focused unit tests:
    • assistantDeepTurnResponseRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnAnalysisRuntimeAdapter.test.ts
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.34):

  1. Extracted top-level address branch orchestration from assistantService into dedicated runtime adapter:
    • assistantAddressRuntimeAdapter.ts
    • introduced:
      • runAssistantAddressRuntime(...)
  2. 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.
  3. Rewired assistantService address branch to a single runtime adapter invocation and preserved addressRuntimeMetaForDeep propagation contract.
  4. Added focused unit tests:
    • assistantAddressRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantAddressRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnAnalysisRuntimeAdapter.test.ts
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.35):

  1. Extracted address-lane response-tail (debug enrichment + finalize projection) from assistantService into dedicated runtime adapter:
    • assistantAddressLaneResponseRuntimeAdapter.ts
    • introduced:
      • runAssistantAddressLaneResponseRuntime(...)
  2. 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.
  3. Rewired assistantService finalizeAddressLaneResponse(...) closure to consume response runtime adapter output.
  4. Added focused unit tests:
    • assistantAddressLaneResponseRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnAnalysisRuntimeAdapter.test.ts
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.36):

  1. Extracted living-chat handler branch (tryHandleLivingChat) from assistantService into dedicated runtime adapter:
    • assistantLivingChatHandlerRuntimeAdapter.ts
    • introduced:
      • tryHandleAssistantLivingChatRuntime(...)
  2. Centralized living-chat handler sequence (behavior-preserving):
    • living-chat runtime invocation (deterministic/LLM guard chain);
    • chat finalization invocation for assistant_message_chat response path;
    • warn-log fallback path for runtime failures.
  3. Rewired assistantService tryHandleLivingChat(...) closure to consume handler runtime adapter output.
  4. Added focused unit tests:
    • assistantLivingChatHandlerRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantLivingChatHandlerRuntimeAdapter.test.ts
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnAnalysisRuntimeAdapter.test.ts
    • assistantDeepTurnNormalizationRuntimeAdapter.test.ts
    • assistantAddressToolGateRuntimeAdapter.test.ts
    • assistantAddressOrchestrationRuntimeAdapter.test.ts
    • assistantAddressLaneRuntimeAdapter.test.ts
    • assistantAddressFollowupContext.test.ts
    • assistantLivingChatMode.test.ts
    • assistantLivingRouter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.37):

  1. Extracted living-chat LLM call/build block from assistantService into dedicated runtime adapter:
    • assistantLivingChatLlmRuntimeAdapter.ts
    • introduced:
      • runAssistantLivingChatLlmRuntime(...)
  2. 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.
  3. Rewired assistantService tryHandleLivingChat(...) closure to consume the new LLM runtime adapter.
  4. Added focused unit tests:
    • assistantLivingChatLlmRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantLivingChatLlmRuntimeAdapter.test.ts
    • assistantLivingChatHandlerRuntimeAdapter.test.ts
    • assistantLivingChatRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.38):

  1. 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.
  2. Simplified assistantService living LLM call wiring:
    • removed buildLivingChatContextWindow / buildLivingChatPrompt injection from executeLlmChat.
  3. Updated focused tests for adapter-owned prompt assembly:
    • assistantLivingChatLlmRuntimeAdapter.test.ts now verifies context carryover and user-message prompt shape.
  4. Applied cleanup inside assistantService after the wiring simplification:
    • removed dead local living prompt/context helper functions.

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantLivingChatLlmRuntimeAdapter.test.ts
    • assistantLivingChatHandlerRuntimeAdapter.test.ts
    • assistantLivingChatRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.39):

  1. Extracted user-turn bootstrap sequence from assistantService into dedicated runtime adapter:
    • assistantUserTurnBootstrapRuntimeAdapter.ts
    • introduced:
      • runAssistantUserTurnBootstrapRuntime(...)
  2. Centralized user-turn bootstrap flow (behavior-preserving):
    • session ensure + user message normalization/repair;
    • user item append + session persistence;
    • runtime analysis context projection.
  3. Rewired assistantService.handleMessage(...) to consume bootstrap runtime output and preserve downstream questionId contract usage.
  4. Added focused unit tests:
    • assistantUserTurnBootstrapRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantUserTurnBootstrapRuntimeAdapter.test.ts
    • assistantLivingChatLlmRuntimeAdapter.test.ts
    • assistantLivingChatHandlerRuntimeAdapter.test.ts
    • assistantLivingChatRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.40):

  1. Extracted address-lane attempt bridge (runAddressLaneAttempt) from assistantService into dedicated runtime adapter:
    • assistantAddressLaneAttemptRuntimeAdapter.ts
    • introduced:
      • runAssistantAddressLaneAttemptRuntime(...)
  2. 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(...).
  3. Rewired assistantService to consume lane-attempt runtime adapter.
  4. Added focused unit tests:
    • assistantAddressLaneAttemptRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantAddressLaneAttemptRuntimeAdapter.test.ts
    • assistantUserTurnBootstrapRuntimeAdapter.test.ts
    • assistantLivingChatLlmRuntimeAdapter.test.ts
    • assistantLivingChatHandlerRuntimeAdapter.test.ts
    • assistantLivingChatRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.test.ts
    • assistantWave10SettlementCorrectiveRegression.test.ts

Implemented in current pass (Phase 2.41):

  1. Extracted living-chat attempt bridge (tryHandleLivingChat) from assistantService into dedicated runtime adapter:
    • assistantLivingChatAttemptRuntimeAdapter.ts
    • introduced:
      • runAssistantLivingChatAttemptRuntime(...)
  2. Centralized living-chat attempt handoff logic (behavior-preserving):
    • delegated handler invocation (tryHandleAssistantLivingChatRuntime(...));
    • delegated LLM call bridge (runAssistantLivingChatLlmRuntime(...)) behind unified executeLlmChat contract;
    • preserved all guard, scope and session finalization hooks.
  3. Rewired assistantService to consume living-chat attempt runtime adapter.
  4. Added focused unit tests:
    • assistantLivingChatAttemptRuntimeAdapter.test.ts

Validation:

  1. npm run build passed.
  2. Targeted living/address/deep followup pack passed:
    • assistantLivingChatAttemptRuntimeAdapter.test.ts
    • assistantAddressLaneAttemptRuntimeAdapter.test.ts
    • assistantUserTurnBootstrapRuntimeAdapter.test.ts
    • assistantLivingChatLlmRuntimeAdapter.test.ts
    • assistantLivingChatHandlerRuntimeAdapter.test.ts
    • assistantLivingChatRuntimeAdapter.test.ts
    • assistantAddressRuntimeAdapter.test.ts
    • assistantAddressLaneResponseRuntimeAdapter.test.ts
    • assistantDeepTurnResponseRuntimeAdapter.test.ts
    • assistantDeepTurnPackagingRuntimeAdapter.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 + 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 completed)

Stage 3 (P2): Hybrid Semantic Layer (LLM + Deterministic Guards)

Goal:

  1. Use LLM for semantic extraction/decomposition in strict schema.
  2. Keep deterministic guardrails as verifier, not primary “brain”.
  3. Reduce dictionary overfitting and false route drifts.

Status: Planned

Stage 4 (P2): Human-Centric Answer Layer

Goal:

  1. Move final user response to contract-driven answer package with:
    • direct answer;
    • what was checked;
    • what was found;
    • what remains unproven;
    • best next step.
  2. Keep claim-to-evidence binding strict.

Status: Planned

Stage 5 (P3): Quality Loop Driven By GUI Markup

Goal:

  1. Drive backlog from manual_case_decision queues.
  2. Build targeted regression packs from real failed comments.
  3. Track trend by reason-code clusters.

Status: Planned

6. Non-Negotiable Constraints

  1. Do not break MCP route interfaces.
  2. Do not remove manual logic without compatible replacement.
  3. Preserve UTF-8 (without BOM) for all source/doc files.
  4. Keep manual markup and autorun API contract stable.