Browse the documentation
CAP-13: Durable run store and conformance suite
- ID:
CAP-13 - Title: Durable run store and conformance suite
- Lead:
seed - Touches:
bloom,trellis - Horizon:
later - Milestone:
M7 - CLI phase: none
- Status:
proposed - Claim:
planned - Depends on:
CAP-12
Why
Stage 1 (src/run-model.mjs and src/resume.mjs) defines in-memory objective, attempt, intent, receipt, and lease records, while docs/roadmap.md Stage 3.1 specifies keeping those records (plus CAP-12 checkpoints) durable across process restarts. seed itself must stay database-free and local-first (docs/charter.md), so seed needs a pure store interface, a data-driven conformance suite that verifies any store backend, and an in-memory reference store, while bloom backs it with SQLite and trellis probes the reference.
What it does
CAP-13 defines the durable run store contract and its cross-backend verification suite:
- Store interface over six run record collections:
objectives: create, read by ID, and apply legaltransitionchecks while keepingreadyand later objectives immutable in content (run-model.md).attempts: start attempt with copiedallowedToolssnapshot, read attempt by(objectiveId, attempt).intents: append-only intent log (recordIntent) written before any effect runs, checked againstallowedToolsat write time.receipts: attach verification receipts (attachReceipt) binding check name and revision beforesettling->complete.leases: atomicclaimLeaseandreleaseLeasehonoringexpiresAtexclusivity, stale-holder rejection, and malformed-lease refusal.checkpoints: write and readCAP-12checkpoints bycheckpointId, list lineage viaparentCheckpointId, and readcompletedWriteson resume or fork.
- Conformance suite as data plus runner:
seedexports declarative conformance case descriptors (inputs, operations, and expected invariants as plain data) alongside a runnerrunStoreConformance(createStore, options)that executes the suite over any caller-injected store factory.- The runner supports an optional
reopenhook so durable backends (such as SQLite inbloom) prove records, leases, and intents survive closing and reopening handles across simulated process restarts.
- In-memory reference implementation in
seed:seedships a zero-dependency in-memory store reference implementing the full interface so callers, unit tests, andtrellisprobes run cleanly with no database package or filesystem state.
- Consumer implementations and probes:
bloomimplements the durable run store on SQLite (CAP-13.2), persisting across process restarts and passing the fullseedconformance suite.trelliswrites external behavior probes exercisingseed’s in-memory reference and conformance runner invariants (CAP-13.3).
Contract touchpoints
seed:docs/contracts/run-model.md(formalizes Stage 3.1 durable run store interface across objectives, attempts, intents, receipts, leases, and checkpoints).bloom:docs/architecture.md(SQLite-backed durable run store replacing ephemeral in-memory run persistence).trellis:docs/contracts/probes.md(conformance behavior probes targetingseed’s reference store).
Tool IDs and events
Tool IDs
None defined by this capability.
| Tool ID | Effect | Third-party egress | Owner gate | Summary |
|---|
Events
None defined by this capability. Store persistence events and trace hooks belong to CAP-10.
| Event | Emitter | Payload summary |
|---|
Acceptance tests
reference-store-passes-conformance:seed’s in-memory reference store passes 100% of the data-driven conformance suite cases with zero filesystem or network calls.intent-recorded-before-effect-survives-reopen: When a conformance test injects a restart (reopen) immediately after recording an intent and before completing the step, the reopened store surfaces the uncompleted intent and does not silently mark it finished.lease-atomic-claim-and-stale-release-rejected: Concurrent or sequentialclaimLeasecalls refuse a second holder while live, allow replacement only at or afterexpiresAt, and ignorereleaseLeasefrom a stale lease holder.illegal-objective-transition-fails-closed: Storetransitionrejects illegal status jumps (such asrunning->completewithoutsettlingand a matching receipt) without mutating stored state.checkpoint-lineage-and-fork-isolated: Reading checkpoints acrossreopenpreservesparentCheckpointId,stateDigest, andcompletedWrites, and forking leaves the original attempt history intact.bloom-sqlite-store-passes-conformance:bloom’s SQLite store passes the identicalseedconformance suite including real handle reopen across restarts.
Slices
CAP-13.1(seed, milestoneM7, statusproposed): Define durable run store interface, export declarative conformance cases +runStoreConformancerunner, and ship the zero-DB in-memory reference store (seed).CAP-13.2(bloom, milestoneM7, statusproposed): Implement SQLite durable run store inbloompassing theseedconformance suite (bloom).CAP-13.3(trellis, milestoneM7, statusproposed): Add external behavior probes validating theseedreference store and conformance suite (trellis).
Non-goals
- Shipping SQLite bindings, filesystem database drivers, or migration runners inside
seed. - Storing memory records (
myosotis), retrieval corpuses (capillary), or binary artifact blobs inside the run store.
Family rules and conflicts
- Zero runtime dependencies:
seedships no database engine; SQLite stays inbloombehind the injected store interface. - One authority per fact: The run store holds run facts (objectives, attempts, intents, receipts, leases, checkpoints) and never duplicates memory or retrieval stores.
- Receipts over self-report: An objective cannot transition to
completein any conforming store unless a revision-bound verification receipt is recorded.
Open owner decisions
- Default store retention and SQLite location policy: Whether
bloom’s SQLite run store keeps completed objectives indefinitely or applies an owner-configured retention/archive threshold, and howbloomlocates its store file per workspace (settled whenM7begins;seeditself holds no path or DB config).
Evidence
None yet. Capability is proposed with claim planned.
Changes
2026-11-23: AddedM7slice milestones acrossCAP-13.1..CAP-13.3.2026-11-23: Initial capability specification created (CAP-01.2scaffold).