fix: an untouched evidence registry is not a rollback - #20
Merged
Conversation
Since the v1-to-v2 migration landed on main, the "Refuse evidence-registry rollback" step fails on every pull request that does not touch evidence-registry.json. validate_append_only_history compares the base registry to the head registry and demands revision == previous + 1, with no case for the two being identical, so an unmodified registry is read as a failed bump. Both currently open pull requests are blocked by it, and neither one goes near the registry. Refusing a rollback is the point of the gate. An unchanged registry is not a rollback, so return early when the two documents are equal. Everything else still applies: the head registry is fully validated first, and a registry that actually changed must still bump the revision, bind the previous head, and append rather than rewrite. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
Since PR #16 moved
evidence-registry.jsonto v2 revision 1, the Refuse evidence-registry rollback step inprofile-consistency.ymlfails on every pull request that does not touch the registry.validate_append_only_historycompares the base registry to the head registry and requiresrevision == previous + 1. There is no case for the two documents being identical, so an untouched registry reads as a failed bump:Reproduce it on
origin/mainwith no changes at all:Both open PRs (#18 and #19) fail on this step, and neither goes near the registry.
The fix
Return early when the previous and current documents are equal. Refusing a rollback is the point of the gate, and an unchanged registry is not a rollback.
Nothing else relaxes. The head registry is still fully validated before the comparison, and a registry that actually changed must still bump the revision, bind the previous head, and append rather than rewrite. Three tests cover the new case, the still-invalid-when-unchanged case, and a changed registry that leaves the revision standing still.
157 tests, all green.