Skip to content

failed pages whose references are neither linked nor marked data-bare - #18

Merged
malav2110 merged 4 commits into
malav2110:mainfrom
andyhorn:upstream-enforce-reference-links
Oct 14, 2026
Merged

malav2110 merged 4 commits into
malav2110:mainfrom
andyhorn:upstream-enforce-reference-links

Conversation

@andyhorn

@andyhorn andyhorn commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Follows #17, #1, and #14. This is what lets the samples workflow catch a page whose references went unlinked.

The validator now fails a page when a file:line reference is neither linked nor marked as deliberately bare.

Why

validate-output.sh printed references=N linked=M but never compared the numbers. A page that dropped back to bare references, the defect the sample repair fixed, still exited 0, and so did CI. validation.md asked the writer to compare the counts by hand. The rule allows two deliberate exceptions, but nothing on the page recorded which bare references were deliberate, so the script couldn't enforce it.

Changes

  • A data-bare attribute marks a deliberate exception, as in <code data-bare="outside-repo">main.py:8</code>. It doesn't affect rendering. SKILL.md, validation.md, and the template comment document it.
  • The script fails when fewer than references − marked are linked. Pages whose provenance line says References are not linked (the unresolved-host case) are exempt.
  • The reference pattern is tighter. A reference must start the <code> span or .filename label, and host:port strings with a common TLD, such as example.com:8080, are no longer counted.
  • The fastapi PR 16102 sample marks main.py:8, the reader's own file and the only unlinked reference among the samples.

Verification

  • All 9 samples pass, and their reference counts under the tighter pattern equal the old ones.
  • Test pages fail as expected: 3 references with 1 link fails, and localhost.example.com:8080 is not counted.

For the reviewer

  • This adds an authoring rule every generated page must follow. Check whether data-bare is the marker you want, or whether you'd prefer another mechanism.

🤖 Generated with Claude Code

@malav2110

Copy link
Copy Markdown
Owner

Merged #17, Thank You @andyhorn ! Could you rebase this one onto main? #17 went in as a squash, so its two commits here no longer match main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andyhorn
andyhorn force-pushed the upstream-enforce-reference-links branch from 2dcbf86 to fbba6d9 Compare October 8, 2026 17:54
@andyhorn

andyhorn commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main. The branch now carries only its own commit (fbba6d9) on top of the #17 squash, with no conflicts, and all 9 samples pass.

@malav2110 malav2110 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Andy! This closes the gap where unlinked references still passed CI. All 9 samples pass with it merged into main.

data-bare works for me as the marker, and the parser draft in #21 checks the same attribute. One small gap: the script only checks the attribute name. Either check for outside-repo, or drop "naming the reason" from validation.md.

@ChristianMurphy found three cases against this check in #21. I reproduced them, and the inline comments have tested fixes. I'd like lines 35, 40, and 45 fixed before merging. Line 36 is just a question.

Comment thread skills/explain-diff-html/scripts/validate-output.sh Outdated
Comment thread skills/explain-diff-html/scripts/validate-output.sh
Comment thread skills/explain-diff-html/scripts/validate-output.sh
Comment thread skills/explain-diff-html/scripts/validate-output.sh
@malav2110

Copy link
Copy Markdown
Owner

@andyhorn, Christian's #29 replaces validate-output.sh and already fixes the spare-link and provenance cases, with a test page for each. So I'm dropping my asks on lines 40 and 45. Only the line 35 pattern is still needed. It keeps a data-bare before class and 127.0.0.1:8000 from failing until #29 lands. Happy to commit it myself if that's easier.

andyhorn and others added 3 commits October 13, 2026 14:15
…order are read

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T58NPz2J74Vkr1ABminq2L
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T58NPz2J74Vkr1ABminq2L
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T58NPz2J74Vkr1ABminq2L
@malav2110

Copy link
Copy Markdown
Owner

Thanks @andyhorn ! I re-ran Christian's cases with GNU, BSD, and busybox tools. An unlinked filename wide label now fails, a data-bare before class passes, and 127.0.0.1:8000 is no longer counted. All 9 samples pass merged into main, with the same reference counts as before, and the new validation.md note answers my .org question. Merging now.

@malav2110
malav2110 merged commit 16ed6df into malav2110:main Oct 14, 2026
1 check passed
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.

2 participants