Skip to content

[M1.3a] Persist operation intent and checkpoints in SQLite - #37

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m1.3a-operation-journal
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m1.3a-operation-journal

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

Implements M1.3a, the durable operation journal foundation. This branch starts from main; it is independent of the enrollment PR stack.

The agent records pending intent before side effects, returns the existing operation for compatible idempotency replays, rejects conflicting kind/hash reuse, and atomically advances checkpoints with revision compare-and-swap plus transition history. The private SQLite database uses WAL and FULL synchronization; an exclusive process lock prevents two agents from owning the same state. Symlink database/lock paths are rejected. Payloads and raw output/errors are never persisted, only hashes and bounded outcome metadata.

Validation: real SQLite restart, concurrent submission, duplicate-process ownership, conflicting replay, stale checkpoint, invalid-input and permission tests; Go race suite and golangci-lint; TypeScript lint/typecheck/unit tests. modernc.org/sqlite is the pure-Go driver already selected in ADR 0003; its BSD-3-Clause license was checked. Dependencies are pinned in go.mod/go.sum. SQLite sidecar files are ignored by Git.

  • M1.3a acceptance and malicious-input tests
  • Durable local transition history
  • No shell execution or action payload/secret persistence
  • Plan, spec and threat model updated
  • CI and maintainer review

Versioned local state and the resume/compensation executor follow in M1.3b/c. No merge requested.

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m1.3a-operation-journal branch from c07c4a0 to ba48cbf Compare November 5, 2026 13:59
@samuelmbabhazi
samuelmbabhazi merged commit 3253636 into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m1.3a-operation-journal branch November 5, 2026 14:00
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
Implements M1.3b: durable desired, actual, routing, lease and
confirmation state. Depends on #37 and targets its branch.

Typed protobuf snapshots are cloned and recursively stripped of
debug_redact fields and unknown fields before bounded, canonical JSON
persistence. Secret references keep their name/version while values
never enter SQLite. Desired/routing versions and observation timestamps
reject rollback or conflicting same-version replacement; lease
epochs/expiry cannot regress. Confirmation consumption is atomic and
single-use across restarts, after signature/scope verification by the
future handler.

Validation: real SQLite migration and restart tests; secret fixtures
absent from the database and WAL/sidecars; concurrent confirmation
replay; stale/conflicting snapshots; oversized state; Go race tests and
golangci-lint. Schema v1 upgrades transactionally to v2 without losing
operations. No new external service, shell execution or lease issuance
is introduced.

- [x] M1.3b acceptance and security tests
- [x] Specification, plan and threat model updated
- [x] Caller-owned secret payloads are not mutated
- [ ] CI and maintainer review

Resume/compensation execution and daemon ownership follow in M1.3c. No
merge requested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant