mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
The ADR-324 decision ledger is a hash chain, which rejects a modified or deleted-middle receipt but not a deleted tail: a prefix of a valid chain is itself a valid chain. Deleting the most recent receipts, or all of them, from .claude-flow/policy/state.json still verified as valid: true. - PolicyState gains ledgerHead/ledgerLength, updated in the same state write as every receipt append. - verifyLedger fails with policy-ledger-truncated (or policy-ledger-anchor-mismatch) when the chain disagrees with its anchor, and answers an empty ledger distinctly (state: 'empty'). - appendReceipt refuses to extend a chain that no longer matches its anchor, so a new decision cannot re-anchor a truncated ledger and erase the evidence. - Ledgers written before the anchor existed verify as valid and are anchored once (anchor: 'established-now'); truncation before that point is not detectable and is not claimed to be. - verifyPolicyLedger is now a locked read instead of a write transaction, whose own post-operation check turned every failure into a generic policy-ledger-verification-failed. `policy verify` exits 1 when invalid. Co-Authored-By: RuFlo <ruv@ruv.net>