fix(notes): journal reader accepts ExpectedOwners (rollback safety for #898) #905

Closed
kayg wants to merge 0 commits from fix/journal-tolerant-reader into dev
Owner

Reader half only, for the rollback-safety finding P2-1 of the #898 review (comment 77166). Ships in the train BEFORE #898.

#898 writes Requirement::ExpectedOwners into Home journal records. Home records are never compacted, so a build from before #898 cannot read them, and rolling prod back would take every Home with such a record offline.

This PR makes the reader accept the new requirement; it changes no write behaviour:

  • plan.rs: Requirement::ExpectedOwners { digest } exists and validates in Home records.
  • home.rs: admission of a plan that contains it fails closed (owner probe missing); this build has no probe and writes none.
  • docs/deploy.md: rolling back past #898 is only safe to a build that has this reader.
  • Test (write_executor/tests/tolerant.rs): a fixture record written by #898 head 1b81f852 (Committed, two notes, ExpectedOwners) is read, recovered and compacted, and a changed byte is still refused.

No perf impact: no hot-path code changed (reader enum variant only).

🤖 Generated with Claude Code

Reader half only, for the rollback-safety finding P2-1 of the #898 review (comment 77166). **Ships in the train BEFORE #898.** #898 writes `Requirement::ExpectedOwners` into Home journal records. Home records are never compacted, so a build from before #898 cannot read them, and rolling prod back would take every Home with such a record offline. This PR makes the reader accept the new requirement; it changes no write behaviour: - `plan.rs`: `Requirement::ExpectedOwners { digest }` exists and validates in Home records. - `home.rs`: admission of a plan that contains it fails closed (`owner probe missing`); this build has no probe and writes none. - `docs/deploy.md`: rolling back past #898 is only safe to a build that has this reader. - Test (`write_executor/tests/tolerant.rs`): a fixture record written by #898 head 1b81f852 (Committed, two notes, `ExpectedOwners`) is read, recovered and compacted, and a changed byte is still refused. No perf impact: no hot-path code changed (reader enum variant only). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A build older than #898 could not deserialize Requirement::ExpectedOwners, so
one such record took a whole Home offline on rollback. Accept the variant in
the reader and validator; admission still refuses it (this build has no
probe). Writes are unchanged. Test reads a real record written by #898.
Deploy doc: roll back past #898 only to a build with this reader.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
style: cargo fmt
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
5f40792840
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Status (head 8973b7e6)

Reader half only; ships before #898. No write path changed, so there is no perf delta (an enum variant plus a fail-closed admission check, not on any hot path).

Gates (dev-01, ~/bin/slot, nix develop)

  • cargo fmt --all -- --check: OK
  • cargo clippy -j4 -p calternal-notes -p calternal-tasks -p calternal-engine --all-targets -- -D warnings: OK
  • cargo test -j4 --no-fail-fast -p calternal-notes -p calternal-tasks -p calternal-engine: engine 20 passed; notes 550 passed, 0 failed, 6 ignored (crash suites included); tasks 67 passed.
  • New tests (write_executor/tests/tolerant.rs) use a real record written by #898 head 1b81f852 (Committed, two notes, ExpectedOwners): it reads; recovery and compaction run with it present; a one-byte change is still refused.

Deploy doc (docs/deploy.md) and #898's plan and executor doc record: after #898, roll back only to a build that contains this PR.

Merge order: this PR in prod first, then #898.

🤖 Generated with Claude Code

## Status (head 8973b7e6) Reader half only; ships before #898. No write path changed, so there is no perf delta (an enum variant plus a fail-closed admission check, not on any hot path). ### Gates (dev-01, `~/bin/slot`, nix develop) - `cargo fmt --all -- --check`: OK - `cargo clippy -j4 -p calternal-notes -p calternal-tasks -p calternal-engine --all-targets -- -D warnings`: OK - `cargo test -j4 --no-fail-fast -p calternal-notes -p calternal-tasks -p calternal-engine`: engine 20 passed; notes 550 passed, 0 failed, 6 ignored (crash suites included); tasks 67 passed. - New tests (`write_executor/tests/tolerant.rs`) use a real record written by #898 head 1b81f852 (Committed, two notes, `ExpectedOwners`): it reads; recovery and compaction run with it present; a one-byte change is still refused. Deploy doc (`docs/deploy.md`) and #898's plan and executor doc record: after #898, roll back only to a build that contains this PR. Merge order: this PR in prod first, then #898. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

merged into dev as 12103f1c97

merged into dev as 12103f1c973f1e810dd4a9a3bff5a705514d70b0
kayg closed this pull request 2026-11-05 23:23:37 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!905
No description provided.