Repository navigation
fix(interactive): S07 bounded checkpoint and durable receipt index - #8
Conversation
…nly receipt ledger contract
…index with legacy backfill
…inline result and receipt index cache
… large payload snapshot
…eipt index, signed old Ack and legacy backfill
…without changing public Standard API
… at publish/commit after Ack
…minal with no false Ack
…rministic capacity error
…eady exceeds 2MiB
…al Checkpoint capacity
…ary 128KiB payload cutoff
…t only actual Checkpoint overflow
…d near-2MiB waiting trap
…ows still exits durably
Stage 1 / S07 P1 fix — final source review and test evidence (2026-11-11)Reviewed EXACT PR head: Code and scope review
Negative and positive proofs
Verified exact-HEAD matrixGitHub Actions 42942778808: 7/7 COMPLETED/SUCCESS. Four Review decision: S07 scoped fix PASSES. No known open P0/P1 in this stage's default SQLite/Coordinator capacity behavior. PR #8 can be squash merged only against exact validated head. M6 PR #7 remains Draft until updated to assert the fixed S07 invariant and until S13's genuine model Host/tool-call evidence is obtained. No npm publish, deploy, repository visibility change or P0-B/P1/P2 work authorized. |
Stage 1 — P0-A S07 P1 capacity/liveness fix (strict scope)
This is a new scoped fix PR, separate from existing M6 draft PR #7. Base is reviewed M5
main@c873e3edf0f1a78b13178966cdeb408391755170.Implementation
waitingaccepted by the default SQLite Store.errored(FK_I_CHECKPOINT_CAPACITY)checkpoint/Journaling CAS, preserving original business State and without falsely acknowledging an unaccepted receipt.fk_i_receipt_indexfor FlowKit execution idempotency only: immutable namespaced requestId/digest/attempt/original acceptedRevision correlated with the original Journal revision. Insert index and Checkpoint+Journal in one SQLite transaction.Mandatory verification
tests/interactive/s07-capacity.test.mjsproves original near-2MiB malicious seed is rejected before writing, and a valid 64KiB receipt can finish from the safe state. A legitimate soft-budget-full waiting Run deterministically reacheserrored, not an indefinitewaiting.Gate and non-goals
Review actual source and negative tests. Fix any failures and rerun CI against exact final HEAD before merge. This PR does not implement Context, user file storage, generic artifact providers, TTL, GC, P0-B/P1/P2, or genuine S13 model integration. M6 PR #7 remains Draft / blocked on S13 after S07 fix.
Note
Medium Risk
Touches core Coordinator CAS, receipt idempotency, and SQLite schema/migration paths where mistakes could strand runs or mis-ack receipts; mitigated by explicit capacity guards and broad new S07 tests.
Overview
Introduces the S07 interactive storage contract: the 2 MiB hard Checkpoint limit stays, but nonterminal writes are capped at 1.75 MiB (
MAX_ACTIVE_CHECKPOINT_BYTES) so a 256 KiB reserve remains for a durableerrored(FK_I_CHECKPOINT_CAPACITY)exit. Oversized initial state, transitions, and inline Agent receipts (including envelope size) are rejected or converted to that terminal path without a falseacceptedRevision; large payloads stay Host-owned references.The SQLite Store gains
fk_i_receipt_indexand optionalgetReceipt, written atomically with receipt CAS and journal proof. The Coordinator keeps only 16 recent receipt summaries in the Checkpoint while duplicate/idempotent completion and M5 signed replay resolve older acks from the index (with legacy inline backfill). Documentation, TypeScript types, andtests/interactive/s07-capacity.test.mjsencode the contract.Reviewed by Cursor Bugbot for commit 94bad70. Bugbot is set up for automated code reviews on this repo. Configure here.