M4 slice c: health probes + backup/restore CLI#5
Merged
Conversation
Add internal/server/health.go with liveness (/healthz) and structured readiness (/readyz) handlers wired at the root mux. The readiness probe aggregates four component checks (KVM device, vault sentinel round-trip, dolt prober, audit-dir writability) into a single JSON envelope and returns 503 when any component fails. Probers are dependency-injected via Router.AttachHealthChecks so tests can fault each component independently. The existing /api/readyz handler is left untouched — it remains the narrow dolt-only probe that the SPA's degraded banner already consumes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add `gemba admin backup --out` / `gemba admin restore --from` for disaster-recovery snapshots. Backups are single tar.gz files containing the dolt data dir, per-workspace vault blobs, the audit log, and a manifest.json with per-entry sha256 checksums. Restore verifies every checksum and refuses to overwrite a non-empty target data dir unless --force is supplied (the only auto-mode-friendly use of force, gated to recovery flows). Tests round-trip a real *vault.boltVault and an audit chain: after restore vault.Inject returns the seeded plaintext and audit.Verify succeeds against the restored log. A corruption test asserts restore rejects a tampered tarball rather than silently extracting garbage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
internal/server/health.goadds root-mux liveness (/healthz, always 200) and readiness (/readyz, aggregates KVM, vault, dolt, audit-dir component checks; 503 if any fail). Dependency-injected probers viaRouter.AttachHealthChecks. Existing /api/readyz untouched.gemba admin backup --outandgemba admin restore --fromproduce/consume a single tar.gz containing dolt data dir, vault blobs, audit log, and a per-entry sha256 manifest. Restore refuses to overwrite a non-empty target without --force.Test plan
🤖 Generated with Claude Code