Repository navigation
fix(doctor): judge backup age against the configured interval - #120
Conversation
A new server set up to replace a lost one copied its own empty database into the share as the newest backup, so restoring "the newest copy" (as the install guide said) brought back nothing; the #97 restore drill hit it against the v0.1.0 release. - copy_snapshot refuses a snapshot whose installation differs from the newest readable copy's, both read from the files read-only and immutable, so shares written by 0.1.0 are protected too. - Catch-up and copy status consider only the installation's own backups: never the database a restore set aside. - restore ends with a backup of the restored database, so copies resume from it at once; the set-aside goes through the same snapshot owner, and a snapshot within a second of the last waits for a new name. Closes #115 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
…y pre-restore copies Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
doctor compared the newest backup's age with the 24-hour default even when the service backs up on another interval, so an hourly installation looked healthy for a day after its backups stopped. doctor::Options carries the copy directory and the interval; the CLI reads --backup-interval-hours or CONSOLEBOOK_BACKUP_INTERVAL_HOURS, the same setting serve uses. Closes #117 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
A database a restore set aside no longer postpones the next backup or makes old backups look fresh to doctor and the health read. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
…claude/117-doctor-interval
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
…erval # Conflicts: # CHANGELOG.md # crates/consolebook-server/src/doctor.rs # crates/consolebook-server/tests/copy_ownership.rs
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
|
@codex review Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Verification, final:
Generated by Claude Code |
Primary Issue
Closes #117
Problem And Outcome
doctorcompared the newest backup's age with the 24-hour default, while the scheduler usesCONSOLEBOOK_BACKUP_INTERVAL_HOURS. So:After this PR,
doctorjudges against the interval it's given, in the same settingservereads.Changes
doctor::Options { backup_copy_dir, backup_interval_hours }.backup_copy_dirargument, so later service settings join one place instead of growing the signature.doctorstill reads no configuration files: the caller passes what the service uses.doctor --backup-interval-hours N, also read fromCONSOLEBOOK_BACKUP_INTERVAL_HOURS. It must be at least 1, the same asserve.--backup-interval-hoursif the service uses another.docs/operations.md: thebackupsrow says "younger than the backup interval", and the doctor: judge backup age against the configured interval, not the 24-hour default #117 caveat becomes the flag.doctor --backup-interval-hours 6against the real install.Correction rung: 1. The interval is part of the one options type
doctortakes, not a second constant.Verification
tests/doctor_backup_interval.rs, each with the default interval as a built-in control:warnnaming "1-hour", where the default saysok;ok, where the default warns.doctor_read_only,doctor_backup_copy,operable_shell,copy_ownership) were moved toOptionsand pass, run without DAC override.cargo fmt --checkandcargo clippy --workspace --all-targets -D warningsare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
Generated by Claude Code