Skip to content

feat(evidence-plugin): mark the ledger's format and refuse a newer one; say there is no downgrade (#308) - #309

Merged
ethanyzhang merged 5 commits into
mainfrom
caps-308-ledger-format
Nov 18, 2026
Merged

ethanyzhang merged 5 commits into
mainfrom
caps-308-ledger-format

Conversation

@ethanyzhang

Copy link
Copy Markdown
Collaborator

Fixes #308.

Problem. A node that ran the #300/#302 build cannot start on the previous plugin: the older build reads the new checkpoint sub as a failed COSE check, and capsules is a required plugin, so the node stops.

Change.

  • ledger/format marker (ledger_format.rs): written at ledger open (CapsuleState::open, before any store is opened); a build that meets a higher number refuses with this ledger was written by a newer plugin (...); downgrade is not supported: ... and leaves the ledger as it was. Format 1 is the 0.6 stack. No peer reads it; nothing signed or served changes.
  • CHANGELOG: the Move the plugin to the checkpointed-local-log 0.6 stack (agent-action-capsule 0.11, evidencebook, evidence-request) #300 entry now says there is no downgrade and to back up ledger/ and keys/ before upgrading; a new Added entry describes the marker and says it cannot protect a rollback to builds that predate it.
  • chain_store/tests.rs tree() skips the marker like the lock files (the "flat files are untouched" test is about history files).

Tests. ledger_format unit tests (stamp, refuse newer, unreadable and older marker) and open_refuses_a_ledger_written_in_a_newer_format (CapsuleState::open). cargo test in crates/evidence-plugin: exit 0, 1517 passed; cargo clippy --all-targets and cargo fmt --check exit 0.

Not changed: no read-only mode (new machinery, capsules stays required). Public text (changelog wording) and the door confirmation are with Sherlock2; merge waits for both.

…e; say there is no downgrade (#308)

The build before the checkpointed-local-log 0.6 stack cannot read a ledger the 0.6 build wrote and takes a node with a required capsules plugin down. A ledger/format marker now makes a build that meets a newer format stop with a message naming the cause, and the changelog says to back the data directory up before upgrading.

Signed-off-by: Ethan Zhang <github@yzhang.io>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c252594e-d1ac-45f7-b3e0-928d1e617373
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…story moves it, write the marker atomically, say export-flat is no way back (#308)

Signed-off-by: Ethan Zhang <github@yzhang.io>
…its test (#308)

Signed-off-by: Ethan Zhang <github@yzhang.io>
… stops the node (#308)

Signed-off-by: Ethan Zhang <github@yzhang.io>
… the no-downgrade paragraph apart (#308)

Signed-off-by: Ethan Zhang <github@yzhang.io>
@ethanyzhang

Copy link
Copy Markdown
Collaborator Author

Review record (caps-308), PR #309, final head 39544b2.

  • Codex (gpt-6-astra, session 01a1f05c-4782-72e1-8c08-224bc9ce4b2a): round 1 on 9efb4cd, two P1s (format check ran after resolve_log_id could archive a ledger with a newer marker; non-atomic marker write), fixed in bf984de; round 2 on bf984de: CONVERGED.
  • Claude plan-mode stand-in for Kimi (claude-opus-5-5, session 647d438c-85a4-4bda-b8ec-75f5676f1a8f; stand-in because Kimi is out of weekly quota since 2026-11-18): round 1 P2 non-atomic write (same as Codex), P3 export-flat docs still offered a rollback; round 2 on bf984de: P3 only (a test doc comment separated from its test). Fixed in 0b70460 with a targeted check (the 26 owner_maintenance tests pass), no further model round.
  • Sherlock2 (real): buzz://message?channel=0d760ea3-529d-4dec-b309-24184967f8e0&id=b2d1b02189715754ac127bd3cfb90a6322007db088673e8db7ab0368da83f372 reviewed head 2f38ab6: door is engineering's call (no Steven gate); PM ✅ on acceptance pending green CI and three wording edits (whole data directory, drop a repeated sentence, blank line), applied in 39544b2 (changelog text only). Twin (local Sherlock2 twin): same door answer; asked for the keys/ secrecy line and the node-stops sentence, both applied in 2f38ab6; the secrecy line stays and fits the whole-directory wording.
  • Final head: 39544b2 differs from the heads the verdicts covered by CHANGELOG.md text only (2f38ab6, then 39544b2); verified by the targeted check that git diff 0b70460..39544b2 touches only CHANGELOG.md. All 14 checks on 39544b2 pass (one skipped: CodeRabbit).
  • Local run on bf984de: cargo test in crates/evidence-plugin exit 0 (1518 passed), clippy and fmt clean.

review: rounds 2, accepted 4, declined 0, pre-existing 0; classes: check ordering, non-atomic write, doc disagrees with code; record: this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A node that ran the #302 build cannot start on the previous plugin: the checkpoint state changes one way and the older build takes the node down

1 participant