Repository navigation
Description
Found while verifying #3720 on merged develop. The badge URL gate passes, but a second, rarer malformation is still present in 24 files and the gate cannot see it.
The shape
#3720 fixed the common shape, where the destination is a bare URL containing a space:
 ← was
 ← nowThe angle-bracket form wraps the destination in <...> and places the closing > mid-URL, which breaks the image differently: GitHub ends the destination at the >, leaving Validation-OK-success.svg) as literal text.
Why the gate does not report it
scripts/validation/validate-badge-urls.cjs documents this at lines 42-46 and declines to match it:
A second, rarer malformation wraps the destination in angle brackets and places the
>mid-URL... That one is not matched here: the closing>sits inside the destination, so it needs a different pattern, and no file in the repository currently uses it. Adding it blind would mean guessing at a shape with no evidence to test against.
That reasoning was correct when written and is now false. 240 occurrences exist across 24 files, so there is now plenty of evidence to test against. They are not a hypothetical:
./tests/README.md
./.github/specs/008-label-audit-consolidation/{spec,tasks,research,plan,quickstart,data-model}.md
./.github/specs/008-label-audit-consolidation/contracts/*.md
./.github/specs/008-label-audit-consolidation/checklists/requirements.md
./.github/specs/005-requirements-quality-checklist/research.md
./skills/markdown-to-html/references/code-blocks-to-html.md
./docs/BADGES_{EXAMPLES,GOVERNANCE,TROUBLESHOOTING}.md (inside code fences — examples, leave)
tests/README.md is the clearest case: its whole BADGES-START/BADGES-END block is angle-bracketed and auto-generated, so it will regenerate broken on the next badge run.
Confirmed pre-existing, not introduced by #3720
tests/README.md line 5 was already in this form at b028d5d8d3, before the merge. #3720 neither caused nor fixed it — it fixed a different shape. git diff b028d5d8d3..d9e36d403f -- tests/README.md is empty.
Suggested change
- Extend
BROKEN_BADGEwith a second alternative for the angle form, capturing the destination up to the mid-URL>. - Add
--fixsupport for it, reusingrepairBadge. - Decide per file whether the fenced examples in
docs/BADGES_*.mdshould be rewritten. They are documentation showing the malformation, so repairing them would destroy the thing they exist to illustrate — the fence tracker should keep excluding them, and that exclusion needs a test so a future change does not silently start rewriting the documentation. - Regenerate
tests/README.md's badge block rather than hand-editing it, or the generator has to be fixed first — fix(skills): correct twelve documentation defects and check the contracts (#3702) #3716 fixed the generator for the bare form, so the same generator path likely emits the angle form for labels containing a colon, e.g.Badges: Documentation Update.
Worth checking which of the two the generator emits, because fixing only the files leaves the block regenerating itself broken.
Metadata
Metadata
Assignees
Type
Fields
Priority
Activity
linear-code commentedon Oct 2, 2026
GIT-2539
eleshar commentedon Oct 2, 2026
Correction to this issue after checking the generator, which changes the recommended fix.
The generator does not emit the angle form.
scripts/agents/branding.agent.js:335builds every badge as:That is the bare form, and
encodeBadgeSegment()percent-encodes it. #3716 fixed this function, so the generator is correct today.So the 240 angle-form badges are stale output from an older generator, not something that regenerates broken. My earlier suggestion that
tests/README.mdwould regenerate itself broken on the next badge run is wrong — the next run rewrites that block to the correct bare-encoded form, and the problem resolves itself for any file the badge bot owns.That narrows the real scope considerably. The files that matter are the ones the badge bot does not own, because they are hand-maintained or inside a spec:
.github/specs/008-label-audit-consolidation/and.github/specs/005-requirements-quality-checklist/— specification documents, not badge-block owners.skills/markdown-to-html/references/code-blocks-to-html.md— a reference example.docs/BADGES_*.md— documentation showing the malformation; the fence tracker should keep excluding these.Revised suggested change
BADGES-START/BADGES-ENDblock the bot owns. Those will self-heal on the next badge run; verify rather than edit them, so the count of genuinely hand-maintained occurrences is known before any code is written.BROKEN_BADGEfor the remaining hand-maintained files, with--fixsupport via the existingrepairBadge.docs/BADGES_*.mdand add a test pinning it, so repairing the malformation does not rewrite the documentation that illustrates it.Step 1 is deliberately first: if every one of the 24 turns out to be bot-owned, the correct action is to run the badge generator and close this with no code change at all.
eleshar commentedon Oct 2, 2026
Step 1 done, and it changes the conclusion again. Correcting myself twice on this issue; the final answer is the one that matters.
All 24 files carry
BADGES-START, but the bot does not own themThe badge bot writes a block only when it is generating metadata badges from frontmatter and it has a
readmePath.updateBadgesInReadme()returnsfalseand writes nothing whenallBadges.length === 0— and these 24 files are specification documents, contract files and reference material, not skill or agent READMEs.scripts/agents/includes/badges.jsnever referencestests/README.mdat all.So
BADGES-STARTin these files was itself written by an older bot run and is now orphaned. Nothing will regenerate it. My previous comment's claim that they self-heal was wrong: the bot does not target them, so the next run changes nothing.Corrected conclusion
--fixpath extended to the angle form, or the stale blocks removed.Revised recommended action
BROKEN_BADGEwith an alternative for the angle form — destination closed by a mid-URL>— and add--fixsupport reusingrepairBadge. This is the real work: one pattern, one repair path, tests for both.docs/BADGES_{EXAMPLES,GOVERNANCE,TROUBLESHOOTING}.mdillustrate the malformation inside code fences.createFenceTracker()already skips fenced lines, which is why they do not appear in the 240; add a test so a future pattern change does not start rewriting the documentation that exists to demonstrate it.BADGES-STARTblocks in spec documents should be rewritten or deleted. That is a content decision, not a validation one — those blocks do not describe anything true about a specification contract, andupdateBadgesInReadme()would now strip them for having no metadata badges. Worth a maintainer's call rather than a mechanical fix.No verification is owed on #3720 itself: this is a pre-existing gap it did not introduce and did not claim to close.