Skip to content

[quality] docusaurus.config.ts preprocessor: reference-style link branch untested #409

Closed

Description

@hivecommons-hive

Finding

docusaurus.config.ts's markdown.preprocessor strips .md from
site-internal links using a regex with two syntax alternatives:

/(\]\(|\]:\s*)(\/(?:docs|analyses)\/[^\s)#?]+)\.md(?=$|[\s)#?])/g
  • ]( — inline links, e.g. [docs](/docs/foo.md)
  • ]: — reference-style link definitions, e.g. [1]: /docs/foo.md

lib/docusaurusConfigPreprocessor.test.mts only exercises the ](
branch. c8 reports 100% statement/branch coverage for this file because
both alternatives live inside one regex literal, which the coverage
instrumenter does not decompose — so the gap is invisible to the
existing npm run test:coverage gate.

Evidence (manual mutation, reproducible): removing the |\]:\s*
alternative from the regex and re-running
node --experimental-strip-types --experimental-test-module-mocks --test lib/docusaurusConfigPreprocessor.test.mts
against revision 418adeb still passes all tests. No end-to-end suite
exists in this repository to catch it either (there is no e2e/
integration harness here — see techdocs#390 for the broader CI-signal
gap), so this is Priority 1 (covered by neither unit nor end-to-end
tests) under the quality lane's coverage-evidence rules.

Recommendation

Add a unit test case in lib/docusaurusConfigPreprocessor.test.mts
that feeds the preprocessor a reference-style link definition (e.g.
[1]: /docs/foo.md) and asserts the .md suffix is stripped the same
way inline links are. A PR implementing this is attached.

Priority

  • Impact: medium — a regression in the reference-link branch would
    silently leave broken .md-suffixed links on the live site (README
    uses this exact import path) with no test or coverage signal to catch
    it.
  • Effort: low — single new test case, no production code change.

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: e9eb8c6

— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

Activity

  1. added
    testing
    agent/quality
    on Nov 13, 2026
  2. added
    hive/likely-done
    and removed
    stage/040-covered-by-pr
    on Nov 16, 2026
  3. hivecommons-hive commented on Nov 16, 2026

    @hivecommons-hive
    ContributorAuthor

    Fixed by #410 (#410, merged). Closing because Hive's PR claim metadata says this PR was the full fix.

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/qualityhive/likely-donetesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions