fix(docs-check): require an actual markdown link for index coverage - #113
Merged
Conversation
check-docs.mjs treated docs/README.md index coverage as satisfied by any substring match of "<category>/<name>", so a bare mention of a doc's path in prose, a comment, or a fenced example counted as an index entry. Index coverage now parses real relative markdown link targets the same way link-integrity does, and only counts a doc as indexed when a link actually resolves to it.
Review round 1 blocker defect:scripts/check-docs.mjs:html-comment-links: a commented-out markdown link (e.g. <!-- [Example](adr/example.md) -->) in docs/README.md was counted as coverage even though it renders no actual link. Strip HTML comment regions before extracting links, and add a regression test proving a commented-out link still fails the missing-index diagnostic. Co-Authored-By: Claude Sonnet 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.
Summary
check-docs.mjscounted a doc as indexed indocs/README.mdif its<category>/<name>path appeared anywhere as a substring — including in prose, comments, or fenced code examples, not just an actual markdown link.Test plan
node --test test/docs-integrity.test.mjs— added two regression tests: a bare-path mention fails with the missing-index diagnostic, and an actual relative link passes coverage.npm run checkpasses at the repository root (docs check, organization check, full test suite — 13/13 tests pass).