Repository navigation
[M1.3a] Persist operation intent and checkpoints in SQLite - #37
Merged
Merged
Conversation
3 of 4 tasks
samuelmbabhazi
force-pushed
the
feat/m1.3a-operation-journal
branch
from
November 5, 2026 12:50
1e8d1f9 to
c07c4a0
Compare
samuelmbabhazi
force-pushed
the
feat/m1.3a-operation-journal
branch
from
November 5, 2026 13:59
c07c4a0 to
ba48cbf
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Versioned local state and the resume/compensation executor follow in M1.3b/c. No merge requested.