feat: add backup retention and local observability - #9
Merged
Conversation
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
Completes the final v0.6 increment with:
Retention behavior
A valid backup pair is eligible only when:
createdAtis strictly older than the configured maximum agekeepLatestvalid pairsRetention never runs automatically.
Apply requires both
--applyand--confirm-delete.Invalid, incomplete, unknown, symlinked, temporary, WAL/SHM, lock, and recovery artifacts are never deleted.
Safety
Retention apply uses:
O_NOFOLLOWwhere supportedThe protocol handles ordinary failures conservatively but does not claim crash atomicity across process death, power loss, or host failure.
Operational observability
Maintenance commands emit closed-schema NDJSON events on stderr.
Events contain only bounded operational fields such as:
They exclude paths, filenames, backup names, hashes, identifiers, SQL, user content, credentials, causes, and stacks.
No telemetry, analytics, log shipping, persistent operational logging, or external request is added.
Operations status
Adds the following commands:
pnpm --silent ops:statuspnpm --silent ops:status -- --jsonThe command performs a local, read-only inspection of:
It performs no migration, database creation, cleanup, enqueueing, lease recovery, or network request.
Commands added
pnpm --silent db:backup:retention -- --dry-runpnpm --silent db:backup:retention -- --apply --confirm-deletepnpm --silent ops:statuspnpm --silent ops:status -- --jsonVerification
git diff --checkpassedScope
No changes to:
pnpm-lock.yamlNo tag or release is created by this PR.