test: cover root-level *.md relative link and anchor integrity (tests/root-docs-links.test.mjs) - #309
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Adds tests/root-docs-links.test.mjs, asserting over every root-level *.md that relative links resolve on disk, that #fragments match a heading in their target, that same-document anchors match a heading, that nothing links into generated directories, and that links escaping the repository root are only GitHub's repo-relative idiom. Root-level markdown is outside the Docusaurus route tree, so onBrokenMarkdownLinks never reads it, and check:links delegates to a Makefile that does not exist. Nothing verified these 18 links. Closes #308 Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
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.
Test Improvement
Adds one test-only file,
tests/root-docs-links.test.mjs(7 tests), covering relative-link and anchor integrity across the ten root-level*.mdfiles:AGENTS.md,CODE_OF_CONDUCT.md,CONTRIBUTING.md,GOVERNANCE.md,LAUNCH.md,MAINTAINERS.md,MILESTONES.md,README.md,ROADMAP.md,SECURITY.md.Files claimed by this PR:
tests/root-docs-links.test.mjs(new). Nothing else — no production code, no content, no workflow file, nopackage.json, no lockfile, no dependency.tests/helpers.mjsis deliberately untouched (claimed by #231).The gap
Those files carry 18 relative links into the repository, and three mechanisms each look like they cover them while none does:
npm run check:linksresolves tomake --keep-going check-links; there is noMakefilein this repository, so it cannot run (fix: rewire check:links off missing Makefile and drop orphan typecheck script #291 is rewiring it).docusaurus.config.js:33setsonBrokenMarkdownLinks: 'warn'— and root-level*.mdare not in the Docusaurus route tree at all, so the build never reads them and the warning never applies.grep -rln 'README.md\|CONTRIBUTING.md\|GOVERNANCE.md' tests/returned nothing before this change.Renaming
MAINTAINERS.md,adr/0001-site-ownership-and-cutover-path.md, or a heading indocs/skills/blog-management.mdtherefore breaks the contributor-facing entry points with no CI signal. #205, #236, #244 and #246 are all open PRs editing exactly this set of files.The 7 assertions
*.mdset is non-empty and containsREADME.mdandCONTRIBUTING.md.#fragmenton a cross-file.md/.mdxlink matches a heading slug in the target.#fragmentlink matches a heading in that same document.node_modules/,build/or.docusaurus/.SECURITY.md's../../security/advisories/newresolves against the repository URL, not the file tree, so it is exempted by an explicit allowlist of GitHub path roots rather than by a filesystem check that happens not to fail.Fenced and inline code are stripped before matching, so link-like text in examples is ignored.
This is a guard, not a repair
All 18 links resolve at
00b44df; the suite lands green and stays green until something breaks.Verification
node --testat rev00b44df: 62 tests pass, 0 fail (55 existing + 7 new).[x](NOPE.md),[x](ROADMAP.md#no-such-heading),[x](#no-such-heading),[x](node_modules/foo/README.md)and[x](../../../etc/passwd)toREADME.mdeach turned exactly the corresponding test red, and renaming the real## Publishing cadenceheading indocs/skills/blog-management.mdturned assertion 4 red. The working tree was restored clean after each.npx prettier --check tests/root-docs-links.test.mjspasses.Scope / non-overlap
One cluster: relative-link and anchor integrity in root-level
*.md. Disjoint from #296 (docs/tree only), #235 (MILESTONES.md↔data/milestones.jsonparity), #282 (adr/records), #270 (blog/frontmatter), #275 (navbar/sidebar wiring), #289 (/imgstatic assets) and #278 (package.json/workflow script wiring). Nosrc/module is imported, so this does not depend on or conflict with the JSX test harness in #229.Related Issue
Closes #308
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5