fix(state-context): partition durable state and gate final model input #460

Merged
karsten merged 5 commits from feat/session-state-partition into main 2026-11-14 12:06:55 +00:00
Owner

Changes

  • Preserve the partitioned state/context optimization while composing immutable execution rows/indexes with main's v2 dependency snapshots. Keep v1, deployed-v2 and prior partitioned-v1 readers, recovery hashes and authority data.
  • Write changed immutable partitions rather than rewriting unrelated state; retain strict directory durability, verification of existing immutable bytes and post-rename uncertain-publication fencing. Reject missing committed partition directories rather than silently treating them as empty ledgers.
  • Gate the final assembled PI model input against the byte-based admission budget, including tool responses, and handle the already-compacted path without claiming provider-token precision.
  • Update raw-ledger fixture hydration, focused compatibility/fault/budget tests, synthetic IO measurements and technical documentation. Isolate SDK skill discovery tests from operator HOME/settings.

Preserved integration

Head da5a1f277c629cceb7f7293062b82a002c19ca9a is an ordinary merge of b782e929 with main d90cc329, preserving main's dependency safety fixes. Target main is now a3e18d8257c6cfbbc6e0fe732b7bb375e274afef (PR #459); normal merge must retain that later fix as well. No reset, rebase, amend or force-push.

Existing local verification

Unchanged exact candidate source matches the retained validation manifest. No redundant rerun was performed solely for publication.

  • 48/48 dependency encoding, fault, immutability, limits, storage/publication, compatibility, directory-sync, partition and session-state tests.
  • 131/131 dispatcher/lifecycle tests and 31/31 context/state tests (retained unchanged-source receipts).
  • 4/4 SDK skill projection, built-validator artifact and pinned plugin materialization tests.
  • Official materializer hooks, typecheck and build: exit 0.
  • Eight isolated synthetic IO measurements: with 1,000 unrelated 64KiB records, session writes 287,989 vs 65,729,744 logical bytes and execution writes 205,342 vs 65,787,857 logical bytes. Initial migration excluded; measurements precede final ENOENT error wrapping, which does not alter the write algorithm.

Limits and remaining gates

Admission is a byte estimate, not exact provider-token or multimodal accounting. Eager loading, snapshotting, serialization/hashing and linear index costs remain; an indivisible oversized summary fails closed. IO figures are logical bytes, not physical filesystem accounting or inference/token savings.

Normal exact-head remote CI is required before merge; the local receipts are not a whole-suite remote CI claim. This PR is source publication only: no merge, production deployment, restart, live inference, migration, data pruning or effect replay is included. Runtime rollout and actual-user-path acceptance remain separate and unfinished.

## Changes - Preserve the partitioned state/context optimization while composing immutable execution rows/indexes with main's v2 dependency snapshots. Keep v1, deployed-v2 and prior partitioned-v1 readers, recovery hashes and authority data. - Write changed immutable partitions rather than rewriting unrelated state; retain strict directory durability, verification of existing immutable bytes and post-rename uncertain-publication fencing. Reject missing committed partition directories rather than silently treating them as empty ledgers. - Gate the final assembled PI model input against the byte-based admission budget, including tool responses, and handle the already-compacted path without claiming provider-token precision. - Update raw-ledger fixture hydration, focused compatibility/fault/budget tests, synthetic IO measurements and technical documentation. Isolate SDK skill discovery tests from operator HOME/settings. ## Preserved integration Head `da5a1f277c629cceb7f7293062b82a002c19ca9a` is an ordinary merge of `b782e929` with main `d90cc329`, preserving main's dependency safety fixes. Target main is now `a3e18d8257c6cfbbc6e0fe732b7bb375e274afef` (PR #459); normal merge must retain that later fix as well. No reset, rebase, amend or force-push. ## Existing local verification Unchanged exact candidate source matches the retained validation manifest. No redundant rerun was performed solely for publication. - 48/48 dependency encoding, fault, immutability, limits, storage/publication, compatibility, directory-sync, partition and session-state tests. - 131/131 dispatcher/lifecycle tests and 31/31 context/state tests (retained unchanged-source receipts). - 4/4 SDK skill projection, built-validator artifact and pinned plugin materialization tests. - Official materializer hooks, typecheck and build: exit 0. - Eight isolated synthetic IO measurements: with 1,000 unrelated 64KiB records, session writes 287,989 vs 65,729,744 logical bytes and execution writes 205,342 vs 65,787,857 logical bytes. Initial migration excluded; measurements precede final ENOENT error wrapping, which does not alter the write algorithm. ## Limits and remaining gates Admission is a byte estimate, not exact provider-token or multimodal accounting. Eager loading, snapshotting, serialization/hashing and linear index costs remain; an indivisible oversized summary fails closed. IO figures are logical bytes, not physical filesystem accounting or inference/token savings. Normal exact-head remote CI is required before merge; the local receipts are not a whole-suite remote CI claim. This PR is source publication only: no merge, production deployment, restart, live inference, migration, data pruning or effect replay is included. Runtime rollout and actual-user-path acceptance remain separate and unfinished.
Merge current main preserving partitioned state and v2 dependency safety
Some checks failed
decision-interface-ci / full-validation (pull_request) Failing after 3m40s
da5a1f277c
Compose immutable execution partitions with deployed v2 dependency snapshots; retain exact legacy readers, strict directory durability and uncertain-publication fences. Adapt raw-ledger fixtures, fail closed on missing committed partition directories, and isolate SDK skill discovery tests.
test: hydrate partitioned ledger fixtures and drain writers before cleanup
All checks were successful
decision-interface-ci / full-validation (pull_request) Successful in 3m37s
9307aed639
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harness/core!460
No description provided.