feat(blueprint-plugin): guard ADR-number collisions in blueprint-adr-validate#1963
Open
laurigates wants to merge 1 commit into
Open
feat(blueprint-plugin): guard ADR-number collisions in blueprint-adr-validate#1963laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
Conversation
…validate ADR numbers are chosen at branch time but only claimed at merge time, so two in-flight ADR PRs can pick the same number and both land (issue #1585 — the FVH infrastructure #2015 collision where two ADRs both claimed 0038 and the README index silently missed 0039/0040 for a week). Adds the lightweight validation-only guard from the issue's "lighter alternative" — no renaming automation, just deterministic collision + index detection: - check-adr-numbers.sh reports duplicate_adr_number (two working-tree files share a number, ERROR), adr_number_collision (a working-tree ADR's number is held by a different filename on origin/main — the pre-merge parallel-PR case, ERROR), and adr_missing_index_row (ADR absent from the README index, WARN). - Resolves docs/adrs/ or docs/adr/, emits the STATUS=/ISSUE_COUNT= convention, degrades to OK when no ADR dir / base ref exists (parallel-safe). - Wired into blueprint-adr-validate SKILL.md Step 2b + Agentic Optimizations, documented in REFERENCE.md. - Regression test (git fixture, 8 assertions) + plugin-compliance-check guard asserting the SKILL.md retains the invocation. Closes #1585 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Plugin Compliance Review
Recommendations
|
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
Adds a deterministic ADR-number collision guard to
blueprint-adr-validate(the lightweight validation-only variant proposed in #1585).blueprint-plugin/skills/blueprint-adr-validate/scripts/check-adr-numbers.shreports three classes, emitting theSTATUS=/ISSUE_COUNT=structured convention:duplicate_adr_numberNNNN-.adr_number_collisionorigin/main— the pre-merge parallel-PR case.adr_missing_index_rowIt resolves
docs/adrs/(blueprint canonical) ordocs/adr/, degrades toSTATUS=OKwhen neither exists, and skips the base-ref comparison (still checking duplicates + index) whenorigin/mainis unavailable — so it is parallel-safe (exit 0 on OK/WARN, 1 on ERROR).Why
ADR numbers are chosen at branch time but only claimed at merge time, so two in-flight ADR PRs can pick the same number and both land. This is the FVH infrastructure #2015 collision: two ADRs both numbered
0038, a third assigned0040over the apparent gap, and the README index silently missed0039/0040for a week.blueprint-adr-validatevalidated ADR relationships but had no numbering guard, so the race was invisible until implementation time.Per the issue, this is the lighter alternative (validation-only, no renaming automation). The full placeholder-number + merge-time-assignment automation remains open in #1585 if wanted later.
How
check-adr-numbers.sh+ wiring intoblueprint-adr-validate/SKILL.md(Step 2b + Agentic Optimizations) and REFERENCE.md.scripts/tests/test-check-adr-numbers.sh— git fixture, 8 assertions (clean→OK, base-ref collision→ERROR+exit1, within-tree dupe→ERROR, missing index→WARN, no ADR dir→OK, absent base ref→graceful degrade). Auto-discovered byrun-skill-script-tests.sh.plugin-compliance-check.shcheck_skill_body()guard asserting the SKILL.md retains thecheck-adr-numbers.shinvocation (per.claude/rules/regression-testing.md).Verification
shellcheckclean on both scripts;lint-shell-scripts.shclean.PASS=8 FAIL=0.STATUS=OK).Closes #1585
🤖 Generated with Claude Code