Repository navigation
feat(interactive): M3 durable SQLite Checkpoint Store and hash-chained Journal - #4
Conversation
…al JSON and real-process races
…facts before copying
M3 implementation gate — independent source review + actual CI evidence (2026-11-10 UTC)Reviewed commit: Source review scope: Findings closed before merge:
Test evidence: GitHub Actions run 42824870369 SUCCESS, 5/5:
Review decision: no remaining P0/P1 findings within M3's persistence-only implementation. M4 Coordinator, M5 trusted Host, and M6 integrated end-to-end proofs are not claimed complete. No public Interactive SDK, npm publish, deployment, or P0-B+ scope in this PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c879166. Configure here.
| const startIntentHash = sha256Bytes(canonicalBytes({ | ||
| namespace, startKey, artifactHash:base.artifactHash, state:base.state, | ||
| policyHash:base.policyHash ?? null, intent, | ||
| })); |
There was a problem hiding this comment.
Canonical cap rejects wrapped payloads
Medium Severity
createRun fingerprints state together with startIntent under the same 2 MiB canonicalBytes cap that already applies to each piece separately, so two legal inputs can still throw RangeError. journalDigest has the same wrapping issue, so a journal entry near MAX_JOURNAL_BYTES can fail compareAndSwap even after the payload itself was accepted.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c879166. Configure here.


Scope — confirmed P0-A / M3 only
DatabaseSyncpersistence with WAL, synchronous FULL, busy timeout, FK integrity, and explicit namespace-scoped run identity.Evidence gate (do NOT merge before passing)
tests/interactive/store.test.mjs: canonicalization adversarial cases, namespace isolation, immutable programs, start conflicts, retries, rollback after uniqueness conflict, durable reopen, two real OS processes racing same CAS, tampered rows.npm run verifyin Ubuntu 24.04 / Windows 2025 × Node 22.13.0 / 24.22.1; docs consumers and packaging checks.node:sqlitein Node 22 is experimental; this is a host-owned sync CLI Store, NOT a model-facing sandbox, and M4/M5/M6 have not been implemented.Note
Medium Risk
New durable persistence and concurrency-critical CAS/journal logic on experimental
node:sqlite, with strict validation paths that must not regress or accept corrupt data.Overview
Adds P0-A/M3 host-owned persistence for interactive state-machine runs: a strict canonical JSON layer (
canonical.mjs) for bounded, hash-stable checkpoint/journal bytes, and a synchronous SQLite checkpoint store (sqlite-store.mjs) built on Node’sDatabaseSyncwith WAL, full sync, and foreign keys.The store registers immutable program artifacts by content hash, idempotently starts runs per namespace/
startKey/intent fingerprint, and advances state via revision CAS with a hash-chained journal. Reads verify checkpoint and journal integrity and reject corruption, tenant mismatch, or unsafe DB configuration.package-files.mjsships the two new interactive modules;tests/interactive/store.test.mjscovers canonicalization edge cases, isolation, CAS races across processes, tampering, and rollback behavior.Reviewed by Cursor Bugbot for commit c879166. Bugbot is set up for automated code reviews on this repo. Configure here.