Skip to content

[M1.3b] Persist versioned local state and confirmation consumption - #38

Merged
samuelmbabhazi merged 2 commits into
mainfrom
feat/m1.3b-local-state
Nov 5, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
feat/m1.3b-local-state

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

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.

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

Resume/compensation execution and daemon ownership follow in M1.3c. No merge requested.

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator Author

Rebased onto the current main (after the M2.2/M2.3 stack merged); the only conflict was additive THREAT_MODEL text, kept from both sides.

Review follow-up added as commit 2cf6bbd: ConsumeConfirmation now tolerates one minute of clock skew on the upper expiry bound, so a node running slightly behind the control plane no longer rejects fresh confirmation tokens. Test added.

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m1.3a-operation-journal branch from c07c4a0 to ba48cbf Compare November 5, 2026 13:59
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m1.3a-operation-journal to main November 5, 2026 14:00
@samuelmbabhazi
samuelmbabhazi merged commit e065fd3 into main Nov 5, 2026
2 of 11 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m1.3b-local-state branch November 5, 2026 14:19
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
Completes M1.3 with the resumable/compensating executor and daemon-owned
SQLite lifecycle. Depends on #38 and targets its branch.

The executor records each step before its side effect and checkpoints
completion afterwards. After an uncertain interruption it retries
explicitly retry-safe steps; otherwise it compensates the uncertain step
and completed predecessors in reverse order. Compensations must be
idempotent and are checkpointed themselves. Idempotency binds the
payload to a versioned plan and its ordered recovery policy, and
concurrent execution is serialized. Committed transitions are delivered
through an ActionUpdate callback; delivery failures pause further
effects and retry republishes the latest durable state.

The daemon acquires the journal's exclusive process lock at startup and
closes SQLite during shutdown. It reports unfinished operations for
later registered handlers; this foundation introduces no Docker/Caddy
action or stream dispatcher. Those remain their own planned milestones.

Validation: crash injection after every one of three steps for both
recovery policies; interruption during compensation; concurrent
duplicate execution; cached outcomes; changed-plan rejection;
notification failure; cancellation preserving intent; real SQLite
reopen. Go race suite and golangci-lint pass. The startup test now waits
for actual readiness instead of a fixed sleep, covering the new SQLite
initialization. TypeScript/protobuf checks and the binary-size budget
pass.

- [x] M1.3 acceptance criteria and recovery framework tests
- [x] Durable transition history and callback notifications
- [x] No new action, shell execution or raw payload/error persistence
- [x] Plan, spec and threat model updated
- [ ] CI and maintainer review

No merge requested. This independent M1.3 stack is based on main; the
separate M1.2c daemon changes will need their ordinary review-time
integration.
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