Skip to content

feat: doctor reports off-server backup copies; ADR 0027 on copy encryption - #111

Merged
TusanHomichi merged 5 commits into
mainfrom
claude/99-doctor-backup-copy
Oct 15, 2026
Merged

TusanHomichi merged 5 commits into
mainfrom
claude/99-doctor-backup-copy

Conversation

@TusanHomichi

@TusanHomichi TusanHomichi commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Primary Issue

Closes #99
Closes #112 (fix ported from #113)

Problem And Outcome

Off-server backup copies (ADR 0024) were visible only while the server ran, through /api/backups/status and the administrator's home page. doctor didn't look at the copy directory, and ADR 0024 left copy encryption to "an encryption decision". After this PR:

  • doctor --backup-copy-dir reports the copy directory in the same four states as the health read, without writing anything (ADR 0003);
  • ADR 0027 records the encryption decision.

Changes

  • backup_copy::copy_status(data_dir, copy_dir) is the one owner of copy state; status() uses it too. It reads only: it never creates, writes, or repairs the copy directory.
  • doctor::run(data_dir, backup_copy_dir) adds a backup copy finding:
    • ok current: when the directory holds the newest local snapshot;
    • warn for not_configured, unreachable (missing, not a directory, same filesystem as the data, or unlistable), or behind.
    • None of these is FAIL: the installation still works, and the exit status keeps meaning "broken".
  • CLI: doctor --backup-copy-dir, which also reads CONSOLEBOOK_BACKUP_COPY_DIR.
  • Release workflow: against the real systemd install, doctor reports current beside the running service, and unreachable after the share is unmounted, without recreating it.
  • ADR 0027, "Backup copies are not encrypted by Consolebook":
    • copies stay plain SQLite, so recovery needs only the file and a release;
    • the share must use storage encrypted at rest (a storage-layer control; SMB 3 or Kerberos NFS encryption protects only the network path), be writable only by the service account, and be readable only by people who may restore;
    • the ADR states when to revisit: storage the agency doesn't control, an agency policy, or a key-custody story the product needs anyway.
  • Docs: ADR 0024 amended; the install guide gives the share requirements and the doctor command; development index; CHANGELOG.
  • Ported: the test(e2e): scope the acknowledgment assertion to its panel #113 fix for test(e2e): drafts.spec.ts acknowledgment assertion is ambiguous and can pass before the act #112, which scopes the e2e acknowledgment assertion to its panel. It failed this PR's first proof.

Correction rung: 1. One owner for copy state, shared by the health read and doctor.

Decision flag for the maintainer

ADR 0027 decides not to encrypt copies in the application. The reasoning:

  • a key on the server is lost with the server, which is exactly when a copy is needed;
  • a key held elsewhere becomes a long-term custody burden, and losing it makes every copy unrecoverable, which is worse for a records system than the exposure it prevents;
  • agencies already run encrypted storage.

If you'd rather require encryption, this ADR is the place to change it before 0.2.0 ships.

Verification

  • tests/doctor_backup_copy.rs, one test per state:
    • not configured gives warn;
    • a missing directory or one on the same filesystem gives unreachable, and is never created;
    • an older copy only gives behind, and the directory listing is unchanged;
    • holding the newest snapshot gives current, with no failure and the listing unchanged.
  • Negative control: without the check, all four fail.
  • Full local proof on 0033898: passed, all 7 gates.
    • The browser suite had 61 expected, 0 unexpected and 0 flaky results.
    • Receipt .proof/20261015T001744Z-00338986f7e4/receipt.json, sha256 385cfdb176314d9940ae2c2e1ed6f9a57e38df7e3ec60c946b7be7a1a673869f.
  • CI on 0033898: fmt-clippy-test, build-x86_64 (including the installer and doctor steps on a systemd runner), and build-aarch64 all passed.
  • Codex review on 0033898: no major issues.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts


Generated by Claude Code

…el copy encryption

doctor --backup-copy-dir (or CONSOLEBOOK_BACKUP_COPY_DIR) reports the copy
directory in the same states as /api/backups/status: not_configured,
unreachable, behind, or current, read-only (ADR 0003). backup_copy owns the
state through copy_status(). The release workflow runs it against a real
install, before and after the share is unmounted.

ADR 0027: Consolebook does not encrypt backup copies; the share must be
encrypted at rest and access-controlled, and the install guide says so.

Closes #99

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T00:20:44.191038Z 0033898 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…up-copy

# Conflicts:
#	CHANGELOG.md
#	docs/development.md
The version history already showed version 1's "acknowledged receipt with
a response", so the assertion usually passed before the version 2
acknowledgment existed, and failed in strict mode when both were rendered.
It now looks only in the Acknowledgment panel.

Closes #112

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts

Copy link
Copy Markdown
Member Author

The local full proof on 09f0e15 failed one browser test: drafts.spec.ts:451, a strict-mode violation on "Taylor Trainee acknowledged receipt". That isn't this PR's (it doesn't touch web/). The locator also matched version 1's line in the Version history, and usually passed before the act.

Filed as #112 and fixed in #113, with a negative control. The fix is ported here in cb53408, and the proof is rerunning on that head.


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb53408a52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread docs/install.md Resolved
…k path separately

SMB 3 encryption protects the connection, not the files on the share.

Refs #99

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts

Copy link
Copy Markdown
Member Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 00338986f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@TusanHomichi
TusanHomichi merged commit e8f4e42 into main Oct 15, 2026
4 checks passed
@TusanHomichi
TusanHomichi deleted the claude/99-doctor-backup-copy branch October 15, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants