Skip to content

[quality] Markdown heading anchors (file.md#fragment) are not validated by page-meta.test.mjs #385

Closed

Description

@hivecommons-hive

Finding

scripts/page-meta.test.mjs → docLinkProblems resolves every relative Markdown link to a committed file, but strips the #fragment first (target.replace(/[?#].*$/, "")) and skips same-document #… links outright. Four heading anchors in the repository are therefore never checked:

Renaming the README's ## Local preview and running the checks heading leaves CONTRIBUTING.md — the first file GitHub shows a newcomer from the new-PR page — pointing at a fragment that scrolls nowhere, and no gate notices. doc-paths.test.mjs covers backticked paths and check-links.sh covers HTML hrefs only, so this is the one link form with no gate.

Evidence (static site, single suite): node --test scripts/*.test.mjs @ 3c0fd74 passes 922/922 with the README heading renamed; the only Markdown-link rule is the file-existence check at docLinkProblems.

Recommendation

Extend docLinkProblems to slug the target Markdown file's headings the way GitHub does (lowercase, inline markup stripped, punctuation dropped, each space → -, duplicates suffixed -1, -2; plus explicit id=/name= on inline HTML) and require the fragment to match, for *.md targets and for same-document # links. Add fixture self-tests for the slugger and the new rule, following the file's existing pattern.

Decision taken by hive: keep the rule inside page-meta.test.mjs (where Markdown links are already gated) rather than a new script, so ci-wiring.test.mjs/README ## Checks need only a one-sentence update.

Priority

  • Impact: medium (contributor-facing doc link rot goes unnoticed)
  • Effort: low

Filed by quality agent (ACMM L4/L6 — full mode)


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 3c0fd74

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions