Skip to content

v0.1.0 feat: add G-03 offline backup foundation - #2

Merged
herefindalex merged 2 commits into
mainfrom
feat/g03-offline-backup
Sep 17, 2026
Merged

herefindalex merged 2 commits into
mainfrom
feat/g03-offline-backup

Conversation

@herefindalex

Copy link
Copy Markdown
Owner

Summary

G-03 correctness foundation

  • Adds the owner-only gar-g03-verify prepare/execute path for the fixed S00-S05 workflow.
  • Adds the multi-source graceful-stop oracle, explicit backup-ready evidence, offline-only archive engine, durable backup lifecycle, digest verification, and crash/restart reconciliation.
  • Keeps S06-S10, plugin replacement, restart, rollback, MCP mutation, and writer release disabled.

Real acceptance evidence

  • Records the approved isolated LOCAL_PAPER campaign honestly: S00-S02 passed, Paper exited cleanly, S03 became UNKNOWN after Docker rejected the original log query, and S04/S05 did not run.
  • Fixes Docker log compatibility by querying the containing Unix second and filtering each timestamped line against the exact nanosecond dispatch boundary.
  • Keeps G-03 FAIL, creates no backup claim, retains writer ownership, and preserves G-02 PASS.

Pre-landing correctness fixes

  • Ensures an enrolled bind-mounted plugin is archived exactly once even when its host data-root placeholder is missing or is a directory.
  • Persists and validates the final post-archive BackupReadyEvidence atomically with VALID metadata and S05 completion.

Test Coverage

CODE PATHS                                             OWNER / OPERATOR FLOWS
[+] G-03 proposal and approval boundary                [+] Prepare and approval
  ├── [★★★ TESTED] agent rejects G03_BACKUP_ONLY         ├── [★★ TESTED] real owner prepare + exact approval
  ├── [★★★ TESTED] owner harness creates sealed intent   └── [GAP] [→E2E] automated prepare/replay/approval process
  └── [★★★ TESTED] S06 remains unavailable

[+] Fixed Docker lifecycle                             [+] Graceful stop
  ├── [★★★ TESTED] enrolled lifecycle + timestamps       ├── [★★★ TESTED] exact enrolled-container request
  ├── [★★★ TESTED] bounded stop timeout                   ├── [★★★ TESTED] lifecycle + runtime + log correlation
  ├── [★★★ TESTED] Unix-seconds Docker logs query         ├── [★★★ TESTED] pre-dispatch log rejection
  ├── [★★★ TESTED] stdcopy and plain log decoding         └── [GAP] [→E2E] running/missing-runtime/missing-log variants
  └── [★★★ TESTED] readonly bind source pinning

[+] Offline readiness                                  [+] Maintenance and isolation
  ├── [★★★ TESTED] running/offline host distinction       ├── [★★ TESTED] real LOCAL_PAPER close + zero players
  ├── [★★★ TESTED] source/boot/generation drift           └── [GAP] [→E2E] automated ObserveSafety/CloseAdmission
  ├── [★★★ TESTED] unattributed stop blocks backup
  └── [★★★ TESTED] explicit LOCAL_PAPER evidence level

[+] Backup lifecycle                                   [+] Operator-visible evidence
  ├── [★★★ TESTED] RESERVED→WRITING→FINALIZING            ├── [★★★ TESTED] atomic evidence creation
  ├── [★★★ TESTED] VERIFYING→VALID + digest reread         ├── [★★★ TESTED] existing evidence never overwritten
  ├── [★★★ TESTED] temp/orphan/metadata crash boundaries  └── [GAP] [→E2E] automated CLI config/gate mismatch UX
  ├── [★★★ TESTED] SQLite reopen persistence
  ├── [★★★ TESTED] symlink/hardlink/FIFO rejection
  ├── [★★★ TESTED] size/file/source/destination drift
  └── [★★★ TESTED] bind-mounted artifact archive bytes

COVERAGE: 29/33 audited changed-path families tested (88%)
Tests: 19 → 21 test files (+2); 184 Go tests pass.

Pre-Landing Review

  • Fixed P1: a valid archive could omit the enrolled bind-mounted plugin when its logical placeholder was absent.
  • Fixed P2: final offline revalidation evidence was not persisted with completed metadata.
  • Structured and adversarial re-review found no remaining P1/P2 issues.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN. The branch implements only G-03 S00-S05 and its direct tests/docs; mutation remains disabled.

Plan Completion

  • G-02 remains backed by real host-recovery evidence and exact enrolled identity bindings.
  • Owner-only fixed-target G-03 S00-S05 execution, stop oracle, backup-ready contract, offline archive engine, durable lifecycle, integrity checks, and crash recovery are implemented.
  • S06-S10, plugin replacement, restart, rollback, and mutation remain disabled; MCP and approval boundaries were not broadened.
  • The real approved LOCAL_PAPER campaign is recorded as G-03 FAIL after S03 became UNKNOWN; S04/S05 did not run and no backup was claimed.
  • Required local verification passed.
  • GitHub-hosted CI inspection is pending this PR.

Verification Results

  • 184 Go tests passed.
  • 184 race-enabled Go tests passed.
  • go vet ./... passed.
  • Admission verification passed.
  • GARGuard Gradle tests and JAR build passed.
  • 39 Python tests and Ruff passed.
  • Node 24 frontend build and Node contract tests passed.

Test plan

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • make admission-verify
  • make paper-guard-verify
  • python -m pytest -q
  • ruff check guarded_agent_runner tests
  • make frontend-verify

Generated with Codex.

@herefindalex
herefindalex merged commit 36b1526 into main Sep 17, 2026
10 checks passed
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