Skip to content

fix: an untouched evidence registry is not a rollback - #20

Merged
abrichr merged 1 commit into
mainfrom
fix/evidence-registry-unchanged-is-not-rollback
Aug 28, 2026
Merged

fix: an untouched evidence registry is not a rollback#20
abrichr merged 1 commit into
mainfrom
fix/evidence-registry-unchanged-is-not-rollback

Conversation

@abrichr

@abrichr abrichr commented Aug 28, 2026

Copy link
Copy Markdown
Member

What breaks

Since PR #16 moved evidence-registry.json to v2 revision 1, the Refuse evidence-registry rollback step in profile-consistency.yml fails on every pull request that does not touch the registry.

validate_append_only_history compares the base registry to the head registry and requires revision == previous + 1. There is no case for the two documents being identical, so an untouched registry reads as a failed bump:

REFUSED: registry revision must increase by exactly one

Reproduce it on origin/main with no changes at all:

git show origin/main:evidence-registry.json > /tmp/prev.json
python3 scripts/validate_evidence_registry.py --previous-registry /tmp/prev.json

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.

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>
@abrichr
abrichr merged commit d33ed47 into main Aug 28, 2026
3 checks passed
@abrichr
abrichr deleted the fix/evidence-registry-unchanged-is-not-rollback branch August 28, 2026 18:46
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.

1 participant