Skip to content

TOOLS-146: Use committed state for SQL recovery - #180

Merged
averycrespi merged 4 commits into
mainfrom
avery/tools-146-operation-recovery
Nov 3, 2026
Merged

averycrespi merged 4 commits into
mainfrom
avery/tools-146-operation-recovery

Conversation

@averycrespi

Copy link
Copy Markdown
Owner

Context

TOOLS-146 replaces blanket per-write filesystem recovery with validated committed SQLite authority. Missing acknowledgment must not undo a committed SQL-only change or permit replay.

Changes

  • Remove generic write-marker production, compensating credential recovery and maintenance verify-and-recover-storage; retain strict, nonmutating recognition of historical security evidence.
  • Pin synchronous transaction/connection ownership and quarantine unresolved driver state before reuse. Preserve atomic domain/audit commits and current policy/ciphertext validation.
  • Retain dedicated initialization and master-key rotation protocols, including committed-WAL rotation reconciliation without repeated encryption and administrator output directory durability.
  • Fence OAuth token authority before external handoff, preserve reauthentication/no-replay behavior and reject malformed successful refresh responses and conflicting foreground exchanges.
  • Update design, operator guidance, command manifests and observable regression coverage.

Review Notes

  • Committed agent issuance/credential activation remains current after lost output; lost bearers require deliberate inspection/revocation/reissuance. Pending fences never permit superseded-secret fallback.
  • Unknown, malformed, conflicting, unsafe or foreign authority evidence still blocks. Historical backup/restore artifacts remain untouched.
  • Both databases, rich configuration and persistent identities remain. Doctor redesign and setup/migration command removal are not included.
  • Disposable-process and injected-fault evidence does not qualify physical power loss, installed services or live client trust. Real Docker qualification remains a required CI responsibility.

Test Plan

  • make -C agent-gateway verify — passed (modules, formatting, lint)
  • make -C agent-gateway test-unit — passed
  • Focused owning-tag go test -race -count=1 -timeout=5m batches — passed across affected storage, authority, keyring, OAuth, administration, composition, diagnostics and CLI owners
  • Focused -tags=integration -p 1 batch — passed across seven affected packages
  • Focused real-binary -tags=e2e recovery/startup/credential/retirement scenarios — passed
  • Real subprocess crash after rotation commit with nonempty WAL — passed; recovery preserves plaintext and encryption count without replay
  • npm run format:check and git diff --check — passed
  • All target-applicable exact-head CI checks must pass before ready promotion

Use validated committed SQLite authority instead of blanket write markers and compensating recovery. Keep unresolved driver ownership quarantined and retain dedicated rotation, initialization, publication and OAuth handoff safety.
Exercise supported stopped dry-run maintenance after generic recovery removal. Preserve exact refusal and no-write checks, distinguish settled pre-BEGIN refusal from uncertain commits, and wait for the independent history opener before proxy assertions.
Historical SQL evidence is no longer a live latch. Preserve server error mapping coverage by injecting lost commit acknowledgment in the owning process instead of relying on retired marker semantics.
Exercise real commit-acknowledgment uncertainty rather than retired marker cleanup, prove known busy BEGIN permits new independent writes after settlement, and wait for optional history before calls whose retained evidence is asserted across restart.
@averycrespi
averycrespi marked this pull request as ready for review November 2, 2026 05:24
@averycrespi
averycrespi added this pull request to stack #183 November 3, 2026 22:10
@averycrespi
averycrespi merged commit 0f90d09 into main Nov 3, 2026
19 checks passed
@averycrespi
averycrespi deleted the avery/tools-146-operation-recovery branch November 3, 2026 22:12
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