АРЧ АП11 - Архитектура: вынести data scope и organization history из assistantService в отдельный owner

This commit is contained in:
2026-04-17 16:59:24 +03:00
parent cd0b78d1de
commit 4b83e2b2de
6 changed files with 1162 additions and 223 deletions
@@ -14,7 +14,7 @@ The goal is to turn it from a god-service into a thinner coordinator.
Approximate size:
- `5198` lines
- `5178` lines
It currently mixes concerns from:
@@ -114,13 +114,13 @@ Current owner:
Current references:
- [assistantService.ts:3974](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:3974)
- [assistantService.ts:4412](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:4412)
- [assistantService.ts:6052](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:6052)
- [assistantService.ts:4284](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:4284)
- [assistantService.ts:4977](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:4977)
Target owner:
- `assistantBoundaryPolicy`
- `assistantDataScopePolicy`
Expected artifact:
@@ -201,17 +201,19 @@ This order is chosen because route and transition pressure are currently the mai
This extraction is materially underway and no longer just a proposal.
Current active owner creation and wiring in [assistantService.ts](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:4283):
Current active owner creation and wiring in [assistantService.ts](/x:/1C/NDC_1C/llm_normalizer/backend/src/services/assistantService.ts:4188):
- provider owner near `4283`
- meta and memory owners near `4296-4301`
- route owner near `4306`
- transition owner near `4343`
- boundary owner near `4997`
- provider owner near `4188`
- meta and memory owners near `4201-4206`
- route owner near `4211`
- transition owner near `4250`
- data-scope owner near `4284`
- boundary owner near `4977`
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;
- 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: `~85%`
Estimated overall turnaround completion: `~86%`
### Phase 0. Shared Baseline
@@ -191,15 +191,16 @@ Remaining debt:
### Phase 5. AssistantService Extraction
Status: `76%`
Status: `79%`
Reason:
- major policy categories have real owners outside the coordinator.
- data-scope probing and organization-history extraction are now delegated to a dedicated owner.
Remaining debt:
- `assistantService.ts` is still about `5198` lines;
- `assistantService.ts` is still about `5178` 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.
@@ -240,6 +241,7 @@ Compared with the pre-turnaround baseline, the system is now materially better i
- temporal honesty is now evaluated as an explicit invariant;
- 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;
- 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