13 KiB
11 - Continuity Stabilization Plan (2026-04-17)
Purpose
This note defines the recovery plan for the current pre-expansion breakpoint.
The goal is not to patch individual failing prompts.
The goal is to finish the missing runtime authority that should govern mixed live sessions after the turnaround 11 owner extractions.
Current Reading
The strongest current evidence is:
- narrow and company-selected scenarios can pass end-to-end;
- mixed saved-session runtime still fails on root inventory, selected-object continuity, same-date restore, and cross-domain same-date pivot;
- therefore the architecture is not missing only routes;
- it is missing one governing continuity authority.
In one sentence:
- decision ownership became distributed faster than continuity ownership became explicit.
What This Plan Stabilizes
This plan is specifically about one system object:
assistant_session_continuity_v1
That object should become the shared authority for:
- active root frame
- active selected object
- active organization scope
- active date scope
- active clarification state
- active answer object / reusable bundle
- recap source of truth
Target Runtime Rule
Before any of the following decisions are made:
- route arbitration
- company clarification
- selected-object follow-up routing
- same-date restore
- recap answer generation
the runtime must first resolve one continuity snapshot for the active session.
Those downstream owners may interpret the snapshot differently, but they must not reconstruct competing versions of the session state independently.
Immediate Passes
Pass A. Install shared continuity snapshot
Scope:
- create one shared continuity resolver for session items and grounded address context;
- centralize extraction of active item, organization, date, root frame, and recap-eligible grounded context;
- stop allowing recap and adjacent meta logic to build over ungrounded or clarification-only state.
Exit condition:
- recap can only trigger over verified grounded address context;
- selected-object memory cannot be reconstructed from failed clarification turns;
- route and memory layers consume the same continuity snapshot.
Pass B. Reduce clarification priority conflicts
Scope:
- move clarification behind restored continuity when the business frame is already sufficient;
- stop repeated company clarification from interrupting same-family continuation;
- make clarification state explicit and resumable instead of re-discovered ad hoc.
Exit condition:
- repeated clarification no longer appears after adjacent grounded business answers in the same thread;
- selected-object and same-date follow-ups stop falling into generic company templates.
Pass C. Re-ground recap and answer packaging
Scope:
- recap must summarize verified session facts only;
- answer packaging must not sound more certain than truth assembly;
- technical scaffolding must not leak into the top block of user-facing answers.
Exit condition:
- recap cannot claim supplier/date/document facts that were never grounded;
- meta boundary replies no longer expose
MCP,read-only, route ids, capability ids, or debug labels; - user-facing top blocks remain business-first.
Pass D. Lock mixed runtime as the primary gate
Scope:
- promote mixed saved-session runtime to the main architecture gate before domain expansion;
- keep narrow harnesses and seam tests, but do not let them overrule mixed replay;
- evaluate critical user paths rather than isolated route green status.
Exit condition:
- the core mixed replay is green on direct answer, selected-object continuity, same-date carryover, recap truthfulness, and technical cleanliness;
- no unresolved
P0remains on the primary user path.
Anti-Goals
This stabilization pass is not:
- a rollback to the old monolith
- a case-by-case regex patch sweep
- a prompt-only wording cleanup
- a UI-only improvement pass
Practical Sequence
- Finish the continuity snapshot and wire it into the hot route / recap path.
- Rework clarification precedence so it becomes a last meaningful step.
- Harden recap and boundary presentation against ungrounded and technical output.
- Rerun the mixed AGENT replay until the critical continuity edges are green.
- Only then continue deeper intent extraction and wider domain expansion.
Current Pass Status
Completed in the current working pass:
- shared continuity snapshot is already wired into recap and adjacent route memory logic;
- grounded address history can now restore
active organization scopeinstead of depending only on explicit company-selection metadata; - early organization clarification no longer outranks item-focused inventory follow-up paths when the session already carries a strong object frame;
- meta boundary replies were already cleaned from technical
MCP/read-onlyleakage. - early
non_domainarbitration no longer suppresses a positive L0 address-lane decision for colloquial but supported exact routes; - foreign-accounting pivots over inventory drilldown now preserve root-scoped carryover instead of dropping continuity before root-frame sanitation;
- the wide
assistantAddressFollowupContextregression pack is green again, including month-only VAT follow-up and inventory -> VAT pivot sanitation. - counterparty document root wording is now recovered through unicode-safe exact signals instead of depending on mojibake-sensitive legacy phrases;
- declined Russian account wording like
по счёту 60now restores account scope inside polarity/runtime guards instead of collapsing intoother_numeric; - exact address intents can now stay in the address lane even if the semantic guard overflags deep investigation without an actual investigative user request;
- live replay
address_truth_harness_phase7_meta_domain_mix_live_20260417_post_arch_fix_rerun2is accepted end-to-end with14/14steps green, including the previously brokenstep_01_counterparty_documentsandstep_04_open_items_account_60.
Still open after this pass:
- mixed continuity is now strong enough for the current phase7 gate, but it still needs broader saved-session proof before domain expansion can be treated as low-risk;
- the next architecture pass should move from one repaired mixed replay to a wider saved-session set and multi-domain acceptance pack;
- remaining work should focus on keeping the unified continuity authority stable under new real user paths, not on wording-only polish or isolated route greens.
- company authority is still not proactive enough at root inventory entry in multi-company sessions without an already grounded active organization;
- the next stabilization slice should prefer system-level company authority handling over repeated local clarification templates when the session has enough business context.
Completed in the current follow-up pass:
- direct company activity-age wording like
а по Альтернативе Плюс сколько лет активности в базе 1С?is now protected by a unicode-safe exact signal instead of depending on mojibake-sensitive legacy lifecycle phrases; - capability meta answers now explain supported business groups through human examples instead of leaking internal operation ids like
vat_period_snapshot,inventory_on_hand_as_of_date,explain_boundary, orsuggest_safe_next_step; - the next proof target after unit/build checks is the live phase5 replay, because it exercises both the restored activity-age path and the capability-meta interrupt in one shared session.
Latest live replay evidence after that proof run:
- the capability meta interrupt is now business-first and no longer leaks internal operation ids in the top block;
- the same replay exposed a stricter continuity defect that the top-level review initially missed: organization identity can drift in session state as a damaged live label like
ООО \\Альтернати"а Плюс\\; - when that happens, the runtime keeps both
organizationand a stalecounterpartyanchor, does not emitcounterparty_cleared_for_selected_organization_activity, and falls intocounterparty_anchor_not_matched_in_materialized_rows; - this is a system-level organization-identity robustness gap between data-scope probing, continuity memory, and exact-route truth gating, not a wording-only prompt defect;
- the current stabilization slice therefore includes hardening organization identity matching itself and rerunning the same live pack until step-level human answers and review verdicts align.
Latest phase8 runtime authority evidence after the manual mixed replay hardening:
- live replay
address_truth_harness_phase8_manual_runtime_authority_mix_live_20260417_rerun1proved that the activity-age route was restored, but also exposed a hidden false-green:step_11_inventory_same_date_after_receivablessilently reused stale inventory-root date2021-03-31instead of the freshest receivables date2020-03-31; - the first fix in
assistantServicewas not sufficient on its own, becausedecomposeStagestill rebuiltinventory_rootfollow-up context by overwritingprevious_filtersfromroot_filterswholesale; - the architectural correction was to preserve
rootauthority for organization / warehouse while preserving the freshest temporal scope (as_of_date,period_from,period_to) from the immediately previous grounded step; - this was locked by direct regressions in
assistantTransitionPolicy.test.tsandaddressInventoryRootFrameRegression.test.ts, plus a live rerun against the same manual replay spec; - live replay
address_truth_harness_phase8_manual_runtime_authority_mix_live_20260417_rerun4is now accepted end-to-end with14/14steps green, including:step_07_capability_metawith business-first human wording;step_11_inventory_same_date_after_receivableson the correct date31.03.2020;step_14_company_activity_agewith restored factual lifecycle answer;- cleaned user-facing company labels in the data-scope meta reply (
ООО Альтернатива Плюс,ООО Лайсвуд,РАЙМ) instead of damaged raw probe labels.
Still open after the accepted phase8 replay:
- proactive organization authority at the very beginning of a new multi-company bookkeeping session is still weaker than the target product feel; the current system now clarifies honestly and cleanly, but it does not yet always pre-offer company selection early in the conversational flow;
- some user-facing inventory/counterparty labels inside business answers still deserve final presentation cleanup, but these are now post-stabilization quality refinements rather than continuity-authority blockers.
Latest phase9 proactive-authority evidence after the fresh multi-company replay:
- a new live replay
address_truth_harness_phase9_proactive_scope_offer_live_20260418_rerun3is accepted end-to-end with5/5steps green; - on the very first smalltalk turn, the assistant now stays in normal living-chat mode but appends a business-first proactive organization offer instead of waiting for a later forced clarification;
- explicit company choice in the next turn is now fixed deterministically into session authority before the first accounting route, so later business turns inherit one stable
active organization; - the restored activity-age route for
ООО Альтернатива Плюсis now proven again inside the same shared session, not only in isolated route checks; - the previously broken same-date inventory pivot after receivables is now routed as
inventory_on_hand_as_of_datewith the carried date31.03.2020and the carried organizationООО Альтернатива Плюс, without falling back into repeated company clarification; - this phase therefore closes the remaining gap called out at the end of phase8: proactive company authority is no longer purely reactive in fresh multi-company bookkeeping sessions.
Still open after the accepted phase9 replay:
- business answers are now semantically correct on this path, but some inventory list formatting still feels heavier and more mechanical than the target human style;
- the next architecture slice should keep expanding saved-session proof across additional real user chains, while separately tightening answer presentation so exact routes do not feel template-driven even when the truth path is already correct.
Ready Signal
The project can leave the current breakpoint when:
- mixed live sessions no longer depend on distributed guesswork about active context;
- clarification does not outrank valid restored business continuity;
- recap is grounded and business-useful;
- technical scaffolding is removed from user-facing meta answers;
- the primary mixed replay is green for the real user path, not only for narrow packs.