Архитектура: синхронизировать open-world breadth и Planner Autonomy

This commit is contained in:
dctouch 2026-05-01 11:38:01 +03:00
parent 5cd4d459fe
commit 499d0882b3
6 changed files with 328 additions and 4 deletions

View File

@ -284,3 +284,37 @@ The current hand-off is therefore:
- keep D/E/F as the bounded autonomy baseline;
- keep Post-F semantic integrity invariants as regression gates;
- continue the next slice by expanding open-world breadth only behind the same evidence and replay discipline.
## Breadth Proof Update - 2026-05-01
The next bounded breadth slice is now replay-backed for the active inventory stock domain contract:
- active contract: `docs/orchestration/active_domain_contract.json`
- accepted pack: `inventory_stock_open_world_breadth_rerun_semantic_integrity_20260501_fix5`
- domain: `inventory_stock_supplier_provenance`
- execution_status: `exact`
- final_status: `accepted`
- repair targets: `0`
This proof matters for D/E/F because it validates the intended operating model after the foundation closure:
- one mutable domain contract describes a scenario tree rather than scattered ad hoc prompts;
- live replay validates root nodes, critical drilldowns, selected-object wording, colloquial wording, and carryover edges;
- runtime fixes are minimal seams around evidence retrieval, semantic filters, and stale-scope protection;
- acceptance is based on user-facing business answers first, then debug contracts.
This should not be read as arbitrary open-world 1C completion.
It is a successful bounded breadth slice:
- inventory root snapshots;
- supplier provenance;
- purchase documents and dates;
- supplier overlap;
- unresolved supplier-link analysis;
- sale trace;
- purchase-to-sale chain verification.
The detailed map is:
- [19 - inventory_stock_open_world_breadth_proof_2026-05-01.md](./19%20-%20inventory_stock_open_world_breadth_proof_2026-05-01.md)

View File

@ -250,3 +250,34 @@ In practice this means:
- breadth work without semantic replay is not enough;
- semantic polish without protecting the actual business object is not enough;
- user trust now depends on both.
## Post-Closure Gate Update - 2026-05-01
The first inventory-stock breadth slice after Post-F closure has now passed under these invariants:
- `inventory_stock_open_world_breadth_rerun_semantic_integrity_20260501_fix5`
- execution_status: `exact`
- final_status: `accepted`
- repair targets: `0`
This does not reopen Post-F.
It confirms the intended hand-off: new bounded breadth work can proceed when every added domain path is forced through the semantic-integrity gates.
The accepted inventory pack specifically exercised Post-F-sensitive seams:
- selected-object carryover from root stock snapshots into supplier provenance;
- pronoun and colloquial follow-ups over the active stock item;
- supplier/buyer verification without stale organization contamination;
- sale-trace pivots after account-41 stock snapshots;
- unresolved supplier-link analysis where semantic period truth must remain visible even when execution broadens to recover purchase history.
The last seam produced the final `fix5` guard:
- semantic filters keep `period_from=2021-09-01`, `period_to=2021-09-30`, `as_of_date=2021-09-30`;
- lifecycle execution detaches the month window but keeps the as-of date for evidence recovery;
- the user-facing answer reports confirmed available evidence and limitations instead of leaking debug mechanics.
Detailed proof:
- [19 - inventory_stock_open_world_breadth_proof_2026-05-01.md](./19%20-%20inventory_stock_open_world_breadth_proof_2026-05-01.md)

View File

@ -23,7 +23,8 @@ Use the documentation in this order:
2. `16 - data_need_graph_and_open_world_mcp_plan_2026-04-22.md` for the D/E/F bounded-autonomy baseline.
3. `17 - post_f_semantic_integrity_hardening_2026-04-23.md` for the semantic-integrity invariants and closure evidence.
4. This document for the code-level responsibility map after Post-F.
5. Documents `01` through `15` as historical architecture and stabilization trail, not as the current final status.
5. `19 - inventory_stock_open_world_breadth_proof_2026-05-01.md` for the first post-closure inventory-stock breadth proof under Post-F gates.
6. Documents `01` through `15` as historical architecture and stabilization trail, not as the current final status.
## Current Code Map
@ -178,3 +179,21 @@ Every new breadth step must keep the Post-F invariants as regression gates.
- historical docs before `15` are not current status documents and can be misread without this sync layer;
- full broad test-suite green was not the primary proof for Post-F closure; semantic replay remains the stronger evidence;
- future runtime-job artifacts can still accumulate outside the curated autorun flow and should be committed only when intentionally useful.
## Addendum - 2026-05-01
The first post-closure bounded breadth slice is now accepted:
- `inventory_stock_open_world_breadth_rerun_semantic_integrity_20260501_fix5`
- domain: `inventory_stock_supplier_provenance`
- execution_status: `exact`
- final_status: `accepted`
- repair targets: `0`
This addendum does not change the Post-F closure reading.
It adds evidence that the code map can now support a broader inventory-stock scenario tree while preserving the Post-F rules around stale scope, selected-object memory, direct-answer-first behavior, and temporal honesty.
The detailed inventory-stock map is:
- [19 - inventory_stock_open_world_breadth_proof_2026-05-01.md](./19%20-%20inventory_stock_open_world_breadth_proof_2026-05-01.md)

View File

@ -0,0 +1,119 @@
# 19 - Inventory Stock Open-World Breadth Proof (2026-05-01)
## Purpose
This note records the first inventory-stock breadth slice that was hardened after the Post-F semantic integrity closure.
It is not a new Post-F rescue pass.
It is the next track described in the Post-F hand-off:
- grow bounded open-world 1C coverage;
- keep Post-F semantic integrity invariants as regression gates while that breadth grows.
## What Was Hardened
The active domain contract is:
- `docs/orchestration/active_domain_contract.json`
- domain: `inventory_stock_supplier_provenance`
- runtime domain: `inventory_stock`
The accepted pack covers:
- root stock snapshots on current and historical dates;
- selected-item supplier provenance;
- purchase dates and purchase documents for selected stock items;
- supplier overlap and supplier-scoped stock;
- old-stock aging and unresolved supplier-link analysis;
- sale trace and purchase-to-sale chain checks.
The important architecture point is that this pack validates a scenario tree, not isolated prompts. It covers root nodes, critical drilldown nodes, critical edges, UI selected-object wording, colloquial wording, short follow-ups, and pronoun-style carryover.
## Main Runtime Fixes Represented In The Proof
The current accepted runtime slice depends on these code-level seams:
- inventory sale trace now uses document-level sale evidence instead of accounting movement rows when the user asks who the item was sold to;
- purchase-to-sale chain checks use a purchase plus sale document union and keep requested supplier/buyer as verification parties rather than hard row filters;
- explicit `counterparty` and `contract` row fields are materialized before falling back to analytics strings;
- supplier anchors in chain wording are trimmed away from the `-> item -> buyer` tail;
- current-turn supplier/buyer anchors are protected from stale organization-scope poisoning;
- unresolved supplier-link stock questions keep a semantic stock month from `as_of_date`, while execution still queries purchase history broadly up to the snapshot date.
The last bullet is the `fix5` closure seam. Before it, the user-facing answer was already useful, but the pack rejected the step because the semantic period window was not visible when dialog continuation treated the turn as a new topic.
## Replay Evidence
Accepted live replay:
- `inventory_stock_open_world_breadth_rerun_semantic_integrity_20260501_fix5`
- execution_status: `exact`
- final_status: `accepted`
- repair targets: `0`
Scenario results:
- `inventory_snapshot_roots`: accepted
- `inventory_selected_item_provenance`: accepted
- `inventory_supplier_overlap`: accepted
- `inventory_aging_and_unresolved`: accepted
- `inventory_sale_trace`: accepted
The final unresolved supplier-link step now answers directly:
- confirms `192` purchase operations without an explicitly extracted supplier in the available stock-snapshot evidence;
- states the snapshot date `30.09.2021`;
- states the limitation that this is available purchase-trace evidence, not legal batch ownership proof;
- lists concrete item/document evidence.
The debug contract now keeps:
- `detected_intent = inventory_supplier_stock_overlap_as_of_date`
- `selected_recipe = address_inventory_supplier_stock_overlap_as_of_date_v1`
- `capability_id = inventory_inventory_supplier_stock_overlap_as_of_date`
- `mcp_call_status = matched_non_empty`
- `rows_fetched/materialized/matched = 500/500/500`
- `period_from = 2021-09-01`
- `period_to = 2021-09-30`
- `as_of_date = 2021-09-30`
- `missing_required_filters = []`
- `period_window_semantic_from_inventory_as_of_month`
- `period_window_detached_for_lifecycle_execution`
## Validation
Local validation for the accepted slice:
- `npm.cmd test -- addressInventorySelectedObjectFollowup.test.ts`: passed, `20 passed`, `1 skipped`
- targeted regression pack: passed, `537 passed`, `1 skipped`
- `npm.cmd run build`: passed
- graphify rebuild: `5905 nodes`, `12809 edges`, `137 communities`
- live domain pack `fix5`: accepted
## Architecture Reading
This pass should be read as a breadth step guarded by Post-F invariants.
It does not reopen the Post-F closure. Instead, it proves that new domain breadth can be added while preserving the hard Post-F rules:
- explicit current-turn subject beats stale scope;
- selected-object carryover remains object-centric;
- semantic period/debug truth can differ from broad recovery execution when the user needs historical evidence;
- exact route success must materialize into a business-useful answer;
- replay acceptance is judged first through the human answer, then through debug internals.
## Remaining Risk
This does not mean arbitrary inventory questions are solved.
The accepted slice is strong for the declared stock/provenance/sale-trace tree, but the broader open-world surface still needs more domain packs and unfamiliar-question probes.
The next safe move is to continue one bounded domain slice at a time:
1. choose the next active domain contract or expand this inventory contract deliberately;
2. run a live pack;
3. inspect user-facing answers first;
4. patch minimal runtime seams;
5. rerun until the scenario tree is accepted;
6. only then save or commit runtime artifacts intentionally.

View File

@ -0,0 +1,103 @@
# 20 - Planner Autonomy Consolidation (2026-05-01)
## Purpose
This note starts the consolidation layer after the first accepted inventory-stock breadth proof.
The goal is to move from:
- domain pack proves one more slice;
- planner still carries too many local recipe branches;
to:
- reusable MCP primitive and chain descriptors;
- planner-selected route fabric;
- domain packs as semantic gates, not as the main design mechanism.
This is the continuation of the original "MCP as bounded brain" goal.
## Architectural Reading
The target is not an unrestricted model agent.
The target remains:
`user question -> data_need_graph -> catalog chain template -> reviewed primitives -> bounded evidence loop -> truth gate -> answer`
The LLM may help choose the path, but only inside reviewed MCP boundaries.
## Code Steps
The first consolidation step adds reusable chain templates to `assistantMcpCatalogIndex`.
The catalog now describes not only primitive contracts, but also planner route-fabric templates:
- `metadata_inspection`
- `catalog_drilldown`
- `entity_resolution`
- `document_evidence`
- `movement_evidence`
- `value_flow`
- `value_flow_comparison`
- `value_flow_ranking`
- `lifecycle`
Each template declares:
- semantic data need;
- human-readable chain summary;
- fallback primitive sequence;
- base required axes;
- supported fact/action families;
- planning tags;
- evidence-gate requirement.
The planner now instantiates selected evidence chains from this catalog for the first base lanes instead of keeping all route meaning only in local planner branches.
The follow-up consolidation step moved the value-flow planner seams onto the same catalog fabric:
- bidirectional incoming-vs-outgoing comparison now instantiates `value_flow_comparison`;
- ranked revenue/payment questions now instantiate `value_flow_ranking`;
- organization-scoped open totals now instantiate `value_flow` with subjectless primitives but catalog-owned axes and evidence-gate semantics;
- heuristic fallback routes for value-flow, lifecycle, metadata, movement, document, entity, and unclassified metadata inspection now also use catalog chain templates.
This keeps behavior stable while making the planner's route meaning inspectable through catalog descriptors instead of only through local `recipeFor()` branches.
## Why This Matters
This reduces the pressure to add one hard route per user wording.
Future domain enablement should prefer:
- add or strengthen primitive descriptors;
- add or strengthen chain templates;
- let data-need graph and catalog search assemble the path;
- use domain packs to verify the scenario tree and catch semantic drift.
Domain-specific exact recipes can still exist as fast paths, but they should not be the only way the assistant understands a new business question.
## Validation
Local validation after the catalog-template and value-flow consolidation steps:
- `npm.cmd test -- assistantMcpCatalogIndex.test.ts assistantMcpDiscoveryPlanner.test.ts`: passed, `46 passed`
- MCP-discovery suite: passed, `226 passed`, `9 skipped`
- `npm.cmd run build`: passed
- graphify rebuild: `5908 nodes`, `12815 edges`, `138 communities`
## Next Step
The next safe step is to move beyond catalog-instantiated known chain templates into broader catalog scoring and live proof.
Recommended order:
1. metadata-scoped document/movement continuation scoring, not only template instantiation;
2. lifecycle evidence template with stronger bounded inference semantics;
3. inventory-stock evidence templates only after the generic fabric is stable;
4. a small live semantic canary that proves catalog-instantiated value-flow still preserves Post-F stale-scope and clarification invariants.
The key rule remains:
- do not hide a domain workaround inside the planner;
- promote repeated successful domain behavior into a reviewed primitive or chain template.

View File

@ -36,8 +36,10 @@ This package answers the next question:
16. [16 - data_need_graph_and_open_world_mcp_plan_2026-04-22.md](./16%20-%20data_need_graph_and_open_world_mcp_plan_2026-04-22.md)
17. [17 - post_f_semantic_integrity_hardening_2026-04-23.md](./17%20-%20post_f_semantic_integrity_hardening_2026-04-23.md)
18. [18 - post_f_code_documentation_sync_2026-04-24.md](./18%20-%20post_f_code_documentation_sync_2026-04-24.md)
19. [19 - inventory_stock_open_world_breadth_proof_2026-05-01.md](./19%20-%20inventory_stock_open_world_breadth_proof_2026-05-01.md)
20. [20 - planner_autonomy_consolidation_2026-05-01.md](./20%20-%20planner_autonomy_consolidation_2026-05-01.md)
## Current Status Snapshot (2026-04-24)
## Current Status Snapshot (2026-05-01)
This package is no longer planning-only.
@ -63,15 +65,25 @@ It now documents a turnaround that is already operational in code, already mater
- runtime artifact tail commit: `837e1fe Post-F: сохранить хвосты ручных runtime-прогонов`
- live map sync: [18 - post_f_code_documentation_sync_2026-04-24.md](./18%20-%20post_f_code_documentation_sync_2026-04-24.md)
- the next bounded breadth slice is now replay-backed under Post-F gates:
- inventory stock/provenance/sale-trace pack: `inventory_stock_open_world_breadth_rerun_semantic_integrity_20260501_fix5`, accepted
- live map sync: [19 - inventory_stock_open_world_breadth_proof_2026-05-01.md](./19%20-%20inventory_stock_open_world_breadth_proof_2026-05-01.md)
- Planner Autonomy Consolidation has started:
- MCP catalog now carries reusable chain templates in addition to primitive contracts;
- planner route-fabric selection has started moving from local recipe branches toward catalog-instantiated chains;
- value-flow, value-flow comparison, value-flow ranking, lifecycle, metadata, movement, document, and entity fallback branches now expose catalog-template instantiation reason codes in planner output;
- live map sync: [20 - planner_autonomy_consolidation_2026-05-01.md](./20%20-%20planner_autonomy_consolidation_2026-05-01.md)
Current honest status:
- turnaround implementation progress: `~99%`
- exit-from-danger-zone readiness: `~97%`
- pre-multidomain readiness: `~90%`
- bounded-autonomy foundation readiness: `~89%`
- open-world bounded-autonomy readiness: `~75%`
- open-world bounded-autonomy readiness: `~82%`
- Post-F semantic integrity module progress: `~99%` operationally closed, with remaining risk now treated as next-slice discovery rather than an open blocker inside the closed slice
- graph snapshot after latest rebuild: `5892 nodes`, `12772 edges`, `137 communities`
- active inventory-stock breadth slice progress: `100%` for the declared scenario pack, not for arbitrary inventory questions
- graph snapshot after latest rebuild: `5908 nodes`, `12815 edges`, `138 communities`
- current breakpoint:
- the validated hot paths are no longer structurally broken;
- flagship continuity collapse is no longer the primary risk;
@ -103,6 +115,8 @@ Latest live proof now includes:
- `address_truth_harness_phase11_manual_followup_meta_quality_live_rerun_vatfix` accepted `10/10`
- `address_truth_harness_phase20_continuity_stabilization_live_rerun_vatfix` accepted `6/6`
- `addressQueryRuntimeM23.test.ts` full semantic/runtime slice accepted `403/403` after Post-F VAT/date-basis, scope-recovery, open value-flow organization clarification, document-vs-bank arbitration, and reply-shape hardening
- `inventory_stock_open_world_breadth_rerun_semantic_integrity_20260501_fix5` accepted all declared inventory stock scenarios: root snapshots, selected-item supplier provenance, supplier overlap, stock aging/unresolved supplier-link, sale trace, and purchase-to-sale chain
- MCP planner/catalog consolidation slice accepted locally: `assistantMcpCatalogIndex.test.ts` + `assistantMcpDiscoveryPlanner.test.ts` passed `46/46`, full MCP-discovery slice passed `226/226` with `9` skipped
Current architectural reading:
@ -124,6 +138,8 @@ For the detailed audit, current percentages, and remaining debt, read:
- [15 - mcp_bounded_autonomy_reset_plan_2026-04-21.md](./15%20-%20mcp_bounded_autonomy_reset_plan_2026-04-21.md)
- [16 - data_need_graph_and_open_world_mcp_plan_2026-04-22.md](./16%20-%20data_need_graph_and_open_world_mcp_plan_2026-04-22.md)
- [17 - post_f_semantic_integrity_hardening_2026-04-23.md](./17%20-%20post_f_semantic_integrity_hardening_2026-04-23.md)
- [19 - inventory_stock_open_world_breadth_proof_2026-05-01.md](./19%20-%20inventory_stock_open_world_breadth_proof_2026-05-01.md)
- [20 - planner_autonomy_consolidation_2026-05-01.md](./20%20-%20planner_autonomy_consolidation_2026-05-01.md)
## Architectural Objects Of Planning
@ -160,6 +176,8 @@ Read in this order:
17. `16 - data_need_graph_and_open_world_mcp_plan_2026-04-22.md`
18. `17 - post_f_semantic_integrity_hardening_2026-04-23.md`
19. `18 - post_f_code_documentation_sync_2026-04-24.md`
20. `19 - inventory_stock_open_world_breadth_proof_2026-05-01.md`
21. `20 - planner_autonomy_consolidation_2026-05-01.md`
## Planning Rules