АРЧ АП11 - Архитектура: вынести debug payload assembly из assistantService

This commit is contained in:
2026-04-17 17:05:42 +03:00
parent 4b83e2b2de
commit 18e4eba54e
6 changed files with 343 additions and 281 deletions
@@ -14,7 +14,7 @@ The goal is to turn it from a god-service into a thinner coordinator.
Approximate size:
- `5178` lines
- `5050` lines
It currently mixes concerns from:
@@ -26,6 +26,7 @@ It currently mixes concerns from:
- memory recap detection;
- provider-aware predecompose orchestration;
- chat/data-scope/address boundary policy.
- debug and backend-error payload assembly.
## Extraction Principle
@@ -214,6 +215,7 @@ What is already true:
- route, transition, boundary, meta, memory, and provider policies have explicit external owners;
- data-scope probing and organization-history extraction now also have an explicit owner;
- address/backend debug payload assembly now delegates into `assistantDebugPayloadAssembler`;
- runtime already delegates important decisions to those owners.
What is still not fully true:
@@ -126,7 +126,7 @@ This is enough to build targeted semantic packs that are not single-domain toy s
## Honest Phase Status
Estimated overall turnaround completion: `~86%`
Estimated overall turnaround completion: `~87%`
### Phase 0. Shared Baseline
@@ -191,16 +191,17 @@ Remaining debt:
### Phase 5. AssistantService Extraction
Status: `79%`
Status: `82%`
Reason:
- major policy categories have real owners outside the coordinator.
- data-scope probing and organization-history extraction are now delegated to a dedicated owner.
- address/backend debug payload assembly is no longer owned only by the coordinator.
Remaining debt:
- `assistantService.ts` is still about `5178` lines;
- `assistantService.ts` is still about `5050` lines;
- runtime uses extracted owners, but legacy bodies and fallback branches still live in the coordinator file;
- code review still sometimes requires reading `assistantService` together with extracted owners.
@@ -242,6 +243,7 @@ Compared with the pre-turnaround baseline, the system is now materially better i
- factual-negative answers can remain truthful instead of collapsing into generic technical refusals;
- meta questions and memory recap are no longer purely incidental side effects of route logic;
- organization data-scope probing is no longer owned only by coordinator-local helper bodies;
- debug payload assembly is now further isolated from top-level turn coordination;
- architecture regressions can now be localized to route, transition, truth gate, coverage/evidence, boundary, or meta/memory layers.
## What Still Remains The Main Architectural Debt