Skip to content

test(docs): a repo path named in inline code must exist on disk #1403

Closed

Description

@HugoXK

Written-by: Chief
Enhancement (owner-approved 2026-10-27)

Problem

Markdown links in the README are caught when they rot; repo paths written as inline code are not. The README rewrite (#1385, merged e615c566) already carries one:

README.md:118

0.2.0-rc.2 is the DeepSeek Harness release FlyBot is built and tested against — the same version dev/harness

There is no dev/harness in the tree: repo-root dev/ holds only interop and live-e2e, and the real path is core/dev/harness — core/dev/harness/package.json is the file that actually pins @deepseek-ai/dsh: 0.2.0-rc.2. The sentence is true; the path is one directory short. Nothing catches it, so it will sit there until someone tries to cd into it.

Proposal

One test in core/test/ (~40 lines). core/ is our module; this does not belong in .github/scripts.

  • Scan README.md, README.zh.md, core/README.md, docs/**, plugins/*/README.md.
  • Take each backticked token that looks like a repo path (contains /, no whitespace).
  • Skip: fenced code blocks, inline URLs, globs (*, **), placeholders (<...>, {...}), and tokens that are not repo-relative (e.g. owner/repo#123, npm scopes, absolute/env paths).
  • Resolve each remaining token against the working tree and report every miss as file:line: <path>.

Acceptance

  1. Run against the README as merged: the test is RED and names exactly README.md:118: dev/harness.
  2. Fix that occurrence to core/dev/harness in the same PR; the test goes green.
  3. TZ=UTC npm run verify still green, and the new file shows up in the arch-docs / changed-file accounting like any other core test.

Scope

  • Size S. Test-only plus one doc correction; no behaviour change.
  • Unrelated to P-10 (i18n coverage) and to the fence/preview family.
  • If the tokenizer proves noisy on docs/**, narrow the file list — do not add an allowlist of known-good paths, that would re-hide exactly the class of bug this test exists to catch.

Activity

  1. Birfy commented on Oct 27, 2026

    @Birfy
    Collaborator

    Triaged on main 18d567bb (read 2026-10-27T09:47Z). Ready as written — the spec and the red-first acceptance are already executable.

    Duplicate check — none. is:issue "inline code" → this issue only; nothing in core/test/ walks markdown for repo paths (the nearest is core/test/check-arch-docs.test.js, which only checks subsystem front-matter against the module table). Closest live neighbour is #1397: same broken path, but that one is the fix-only issue and Chief left it un-dispatched on purpose. This issue's PR is the one that carries the edit, so fixing README.md:118 here also completes #1397 — do not open a second PR for it.

    Verified on 18d567bb:

    • README.md:118 reads the same version `dev/harness`; repo-root dev/ holds interop/ and live-e2e/ only, and core/dev/harness/package.json is the file that pins @deepseek-ai/dsh: 0.2.0-rc.2. So the sentence is true and only the path is one directory short, exactly as filed.
    • core/scripts/<check>.mjs + core/test/<check>.test.js is this repo's shape for a tree-wide check (check-arch-docs is the sibling), so core/scripts/check-doc-paths.mjs + core/test/check-doc-paths.test.js fits and keeps the logic unit-testable — the tokenizer cases (fenced block, glob, <placeholder>, owner/repo#123, npm scope, absolute path) can be asserted without the real tree.

    Acceptance, tightened from the issue:

    1. Before the doc fix, the test is red and its message is exactly README.md:118: dev/harness — one miss, not a wall of noise. A run that reports more than that on the merged tree means the tokenizer is over-broad; narrow the file list rather than adding an allowlist.
    2. After README.md:118 → core/dev/harness, green.
    3. Unit test for each skip rule, so a later change to those rules fails on its own case.
    4. The file list is the issue's five: README.md, README.zh.md, core/README.md, docs/**, plugins/*/README.md.
    5. TZ=UTC npm run verify green; new files show up in the arch-docs accounting (they will need a subsystem row only if core/scripts/ is owned by one — ds-bot-core covers it today).
    6. No new dependency: node:fs + a regex, no markdown parser.

    Labels: enhancement + area:docs. Owner not assigned here — Lead places it (size S, core/ test + one doc line).

  2. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    enhancementNew feature or request
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 27, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions