Skip to content

feat(docs): check links and anchors of all documents with rumdl #4899

Open

Description

@dan-petty

Problem or Motivation

The custom _broken_links helper (tests/invariants/test_agents_md.py) checks links in about 10 documents. The other hand-written, prompt, skill and knowledge base documents have no link check. Today 624 relative links and 61 anchors have 0 defects, so a check can start green. Child 21 of #4771 and #4605 already choose rumdl.

Proposed Solution & Architectural Design

  1. Pin rumdl as a dev dependency, at a release at least 14 days old (0.3.3 is current).
  2. Enable only MD051 and MD057 in [global] enable.
  3. Add a commit-stage pre-commit hook on staged *.md files.
  4. Add a devops ci docs row step over the hand-written, prompt and generated classes, the skills and the knowledge base.
  5. A planted-defect test shows that rumdl finds a dead relative link, a missing cross-file fragment and a missing same-file anchor.
  6. Then delete _broken_links and its tests.

Share the pin and config with child 21 of #4771 and #4605. Update CONTRIBUTING.md and docs/TESTING.md.

Target Subsystem

SDLC, Git & PR Governance (devops ci docs row, pre-commit, tests/invariants/).

Existing Tool Considered

rumdl (MIT, PyPI). A 2-file probe of rumdl 0.3.3 found a missing cross-file fragment (MD051), a dead relative link (MD057) and a missing same-file anchor in 124 ms. Its config key is [global] enable. Fallback: remark-validate-links, if rumdl misses a defect that _broken_links finds. Nothing is built apart from the test.

Acceptance Criteria

  • The planted-defect test fails on each of the 3 defects.
  • _broken_links is gone.
  • rumdl check over the scope gives 0 findings on main.
  • The hook takes under 1 s on a commit of 10 staged files.
  • The docs row stays under 45 s on the runner.

Dependencies

None. Share the rumdl pin with child 21 of #4771 and #4605; the first to merge adds it.

Source: #4880

Alternatives check of 2026-11-21: in-use.
The item already names this tool.
Tool: rvben/rumdl (https://github.com/rvben/rumdl), NOASSERTION, last activity 2026-11-20, maintained.
Reason: The documentation confirms MD051 checks same-document and cross-file fragments, while MD057 reports missing link targets; the issue already adopts rumdl, so it covers the link-and-anchor need.

Covers:

  • MD051 validates same-file and cross-file heading fragments
  • MD057 reports dead relative link targets
  • Official pre-commit hook runs checks on staged Markdown

Lacks:

  • External URL reachability is not checked
  • Commit hook sees only staged files for cross-file fragments
  • CI row, planted-defect check and helper removal remain project work

Proposed design

Problem statement

The custom _broken_links helper in tests/invariants/test_agents_md.py checks about 10 documents. The other hand-written, prompt, generated, skill and knowledge-base Markdown has no link or anchor check. This change replaces the helper with rumdl's MD051 and MD057 rules, adds the official rumdl-pre-commit hook at the commit stage and a rumdl_links gate step to the devops ci docs row, and deletes the helper and its tests once the new check is green.

Acceptance criteria

Requirement: Rumdl is a pinned development dependency

The dev dependency group SHALL pin rumdl==0.3.5, and the rumdl-check hook SHALL use release 0.3.5.

Scenario: The pinned rumdl runs from the checkout

  • WHEN uv run rumdl --version runs in the development environment
  • THEN it exits 0 and prints 0.3.5.

Requirement: Only the link and anchor rules run

The root .rumdl.toml SHALL enable MD051 and MD057 and no other rule.

Scenario: A style defect reports no finding

  • WHEN uv run rumdl check runs on a temporary directory that holds a copy of the root .rumdl.toml, a dead relative link, a missing cross-file fragment, a missing same-file anchor and a line longer than the limit
  • THEN the command exits non-zero and its output names MD051 and MD057 and no other rule.

Requirement: The commit hook rejects a dead relative link

The commit-stage rumdl-check hook SHALL reject a staged Markdown file that holds a dead relative link.

Scenario: The hook names MD057

  • WHEN uv run pre-commit run rumdl-check --files <temp file> runs on a temporary Markdown file that holds a dead relative link, after uv run pre-commit install-hooks
  • THEN the hook exits non-zero and its output names MD057 for that file.

Requirement: The docs row runs the rumdl gate check over the four classes

The docs row of devops ci SHALL run the rumdl_links gate check, and that check SHALL run rumdl check over the hand-written, prompt, generated and tool-generated documents.

Scenario: The row names the rumdl gate check and its four classes

  • WHEN uv run pytest tests/invariants/test_rumdl_links.py -k docs_row_runs_rumdl runs
  • THEN the test passes only when the docs row's also_cmds holds _python_check_cmd("rumdl_links") and tests.gate.rumdl_links.in_scope_documents(REPO_ROOT) returns the documents of the hand-written, prompt, generated and tool-generated classes.

Requirement: The docs row rejects a dead link in scope

The docs row SHALL fail when an in-scope Markdown document holds a dead relative link.

Scenario: The docs row names MD057

  • WHEN uv run devops ci --check --only docs runs with a dead relative link in an in-scope document
  • THEN the row exits non-zero and its output names MD057 for that document.

Requirement: The in-scope documents are clean on main

rumdl check over the in-scope documents SHALL report no finding on main.

Scenario: The docs row passes on main

  • WHEN uv run devops ci --check --only docs runs on main
  • THEN the row exits 0 and prints no rumdl finding.

Requirement: The planted-defect check covers the three defect classes

The rumdl_links gate check SHALL plant a dead relative link, a missing cross-file fragment and a missing same-file anchor and SHALL report each of them.

Scenario: The three planted defects are reported

  • WHEN uv run python -c "from tests.gate.rumdl_links import check_rumdl_reports_each_defect; check_rumdl_reports_each_defect()" runs
  • THEN the command exits 0, so the check saw MD057 for the dead link and MD051 for both fragments.

Requirement: The custom broken-links helper is gone

The _broken_links helper and its three link tests SHALL be removed from tests/invariants/test_agents_md.py, and the generated-AGENTS.md routing test SHALL assert its routing rows alone.

Scenario: No broken-links helper remains

  • WHEN grep -rn '_broken_links' tests/ src/ runs
  • THEN the command prints no line and exits 1, so no definition or call of _broken_links remains.

Requirement: The contributor, testing and gate documents name the check

CONTRIBUTING.md, docs/TESTING.md and the gate list of docs/SDLC.md SHALL name the rumdl link check and the command that runs it.

Scenario: Each document names the check

  • WHEN grep -c 'rumdl check' CONTRIBUTING.md docs/TESTING.md docs/SDLC.md runs
  • THEN each file reports a count of at least 1 and the command exits 0.

Requirement: The commit hook stays under one second

The rumdl-check hook SHALL complete in under 1 second on a commit of 10 staged Markdown files.

Scenario: Ten staged files complete under one second

  • WHEN time uv run pre-commit run rumdl-check --files $(git ls-files '*.md' | head -10) runs after uv run pre-commit install-hooks
  • THEN the command names no rumdl finding for the 10 files and its real time is under 1.0 s.

Requirement: The docs row stays under 45 seconds

The docs row of devops ci SHALL complete in under 45 seconds on the runner.

Scenario: The docs row completes under 45 seconds

  • WHEN time uv run devops ci --check --only docs runs on the CI runner
  • THEN the row exits 0 and its real time is under 45 s.

Requirement: The runner tool table names rumdl

RUNNER_TOOLS SHALL name rumdl for the ci:docs row.

Scenario: The runner tool table holds rumdl for the docs row

  • WHEN uv run pytest tests/invariants/test_rumdl_links.py -k runner_tool runs
  • THEN the test passes only when tool_names() holds rumdl and its needed_by holds ci:docs.

Existing Tool Considered

rumdl (https://github.com/rvben/rumdl) covers the need. The alternatives check of 2026-11-14 in the issue body records the verdict covers, and its comment names what the tool lacks. The person's reply of 2026-11-21 adopts the tool and keeps this item. The project writes no checker: it adds the root .rumdl.toml, the rumdl_links gate check in tests/gate/, the docs row step, the RUNNER_TOOLS entry, the _broken_links removal and the document edits, and it uses the official rvben/rumdl-pre-commit hook.

Key questions

  • Adopt rumdl, or keep the custom check and give the reason?: Adopt rumdl. The person's reply of 2026-11-21 adopts it and keeps the item. The owner chose rumdl as the one Markdown linter of the project on 2026-11-11. The license is MIT. The alternatives check of 2026-11-14 records covers. The fallback is markdownlint-cli2 (MIT). (best practice) [sources: https://github.com/rvben/rumdl, https://github.com/rvben/rumdl-pre-commit, CONTRIBUTING.md:24]
    • Chosen: Adopt rumdl. The person adopted it, the alternatives check records covers, and the license is MIT.
    • Rejected: Keep _broken_links and extend it. It is project-built code that covers about 10 documents, and extending it writes the checker that rumdl provides.
  • Which rumdl rules does the link check run?: Run MD051 and MD057 only, named in the [global] enable list of a root .rumdl.toml. The MD051 documentation says the rule checks same-document anchors and cross-file fragment links when multiple files are linted together, and that a link whose file does not exist is reported by MD057. The issue's probe and the alternatives check name the [global] enable key. fix(docs): a check finds a code span that nested backticks break #4605 adds its rules to the same list. (best practice) [sources: https://rumdl.dev/md051, https://github.com/rvben/rumdl]
    • Chosen: MD051 and MD057 only. They are the two link rules: MD051 covers both fragment cases and MD057 the missing file, and external URLs stay out of scope.
    • Rejected: All rumdl rules. It adds style findings such as MD013 that are outside the link and anchor need, and the row would fail for unrelated reasons.
    • Rejected: MD057 only. It misses the missing cross-file fragment and the missing same-file anchor.
  • Which rumdl release does the project pin?: Pin rumdl==0.3.5 in the dev group and rev: v0.3.5 in the hook. CONTRIBUTING.md, 'Dependency Versions' (owner, 2026-11-11), sets no minimum release age and asks for the newest release that the surrounding tools support. The official rumdl-pre-commit page names rev: v0.3.5 (fetched 2026-11-21), and the person's reply of 2026-11-21 names v0.3.5 of 2026-11-18 as current. The project keeps the dev pin and the hook rev together as it does for ruff. (best practice) [sources: CONTRIBUTING.md:35, https://github.com/rvben/rumdl-pre-commit, .pre-commit-config.yaml:54, .github/renovate.json:191]
    • Chosen: 0.3.5. It is the current release that the official hook and the person's reply name, and the project sets no minimum release age.
    • Rejected: 0.3.3. It is the release of the issue's probe and is older than the release the official hook names.
    • Rejected: A development build. It is not a release, and no surrounding tool supports it.
  • Which pre-commit hook runs rumdl?: The official rvben/rumdl-pre-commit hook, id rumdl-check, at rev: v0.3.5, limited to Markdown files. The page says the hook runs rumdl check and installs rumdl in an isolated Python environment, so the project writes no hook. A Renovate group matches rumdl and rvben/rumdl-pre-commit, as the ruff group does. (best practice) [sources: https://github.com/rvben/rumdl-pre-commit, .pre-commit-config.yaml:54, .github/renovate.json:191]
    • Chosen: The official rumdl-pre-commit hook. It is the maintained standard interface, installs rumdl in its own environment, and matches the hook pattern of the project.
    • Rejected: A local uv run rumdl check hook. It adds project code and a second command line to keep, and local hooks exist for tools with no official repository.
  • Where does the rumdl check run in CI?: As the rumdl_links gate step of the existing docs row of devops ci (src/devops_cli/commands/ci.py:1014). The row's cmd stays uv run devops docs check; the rumdl step is an also_cmds entry, as the lint and constructs rows add their gate checks (src/devops_cli/commands/ci.py:952, :1063). ADR 0004 makes CI the authoritative gate, and the row already checks the documents. (best practice) [sources: src/devops_cli/commands/ci.py:1014, src/devops_cli/commands/ci.py:219, docs/adr/0004-ci-is-the-authoritative-gate.md]
    • Chosen: The docs row of devops ci. ADR 0004 makes CI the gate, the row already checks the documents, and the issue names it.
    • Rejected: A separate workflow. It adds a second gate and does not use the existing docs row.
  • How does the docs row run rumdl, and where does the check live?: As a rumdl_links gate check in tests/gate/rumdl_links.py, invoked by the docs row through _python_check_cmd("rumdl_links"). docs/TESTING.md records the project's decision that a check of committed files or tool configuration is a row of devops ci, not a pytest test, and that the code of these rows lives in tests/gate/, one module for each row. The module collects the four inventory classes and runs rumdl check; it writes no checker. (best practice) [sources: docs/TESTING.md:76, src/devops_cli/commands/ci.py:929, src/devops_cli/commands/ci.py:219, src/devops_cli/docs/inventory.py:30]
    • Chosen: A tests/gate/rumdl_links.py gate check in the docs row. docs/TESTING.md:76 makes a check of committed files a devops ci row with its code in tests/gate/, and the inventory already names the four classes.
    • Rejected: A pytest test that runs rumdl over the tree. docs/TESTING.md:76 says a check of committed files or tool configuration is a row of devops ci, not a pytest test.
    • Rejected: A separate workflow. It adds a second gate, and ADR 0004 makes the existing docs row the authoritative check.
  • Which documents does the docs row check?: The hand-written, prompt, generated and tool-generated classes that documents_of_class returns. The knowledge base is hand-written (no inventory entry), and the committed skills are the tool-generated class. The record and tool-owned classes are out of scope. [sources: src/devops_cli/docs/inventory.py:30, src/devops_cli/config/constants.py:507, src/devops_cli/config/constants.py:536]
  • Where do the planted-defect documents live?: In a temporary directory that the rumdl_links gate check writes at run time, with a copy of the root .rumdl.toml, and one rumdl check over that directory so MD051 sees both documents of a cross-file fragment. A committed fixture would be hand-written and would fail the docs row and pre-commit run --all-files. (best practice) [sources: src/devops_cli/docs/inventory.py:37, docs/SDLC.md:419, https://rumdl.dev/md051]
    • Chosen: Temporary documents written by the gate check. They never enter the tracked tree, and one rumdl check over the directory checks the cross-file fragment.
    • Rejected: A committed tests/fixtures/rumdl/ fixture. A tracked fixture holds a known dead link and a known missing anchor, so a reader cannot tell a defect of the tree from a fixture.
  • What happens to _broken_links and its callers?: Delete _broken_links at tests/invariants/test_agents_md.py:420; delete test_every_relative_link_in_the_test_conventions_and_their_pointers_resolves (:489), test_a_link_to_a_missing_file_or_heading_is_broken (:507) and test_every_relative_link_of_the_release_page_resolves (:689); change test_a_generated_agents_md_routes_only_to_documents_that_exist (:338) to assert its routing rows alone. RELEASE_CYCLE.md is hand-written and in the rumdl scope, so its link check moves to the docs row. (best practice) [sources: tests/invariants/test_agents_md.py:338, tests/invariants/test_agents_md.py:420, tests/invariants/test_agents_md.py:489, tests/invariants/test_agents_md.py:507, tests/invariants/test_agents_md.py:689]
    • Chosen: Delete the helper and its three link tests, and change the routing test. The issue requires the removal, and rumdl replaces the helper over a wider scope.
    • Rejected: Keep both checks. It keeps two link checks and their maintenance.
    • Rejected: Run rumdl inside the routing test. It adds a subprocess and a copied config to a unit test, and the docs row and the planted-defect check cover links.
  • Which documents name the new check?: CONTRIBUTING.md, docs/TESTING.md and the gate list of docs/SDLC.md (docs/SDLC.md:215). (best practice) [sources: docs/SDLC.md:215, CONTRIBUTING.md:11, docs/TESTING.md:59]
    • Chosen: The three documents. The issue names CONTRIBUTING.md and docs/TESTING.md, and the gate list would otherwise describe the docs row without its rumdl step.
    • Rejected: Only CONTRIBUTING.md and docs/TESTING.md. The gate list would be stale.
  • Does the runner tool table need rumdl?: Yes. The rumdl_links gate step starts rumdl, and the runner image must hold it. Add _checkout("rumdl", "ci:docs") to RUNNER_TOOLS (src/devops_cli/roadmap/runner_tools.py:117). A test in tests/invariants/test_rumdl_links.py asserts the entry, and the runner tool test reads each row's argv and each hook. [sources: src/devops_cli/roadmap/runner_tools.py:117, tests/roadmap/test_roadmap_runner_tools.py:140]
  • Does the commit hook catch a missing cross-file fragment?: Only when both the linking and target documents are linted in the same run. The MD051 documentation says the rule checks cross-file fragment links when linting multiple files together, and that a link whose file does not exist is reported by MD057. The commit hook sees the staged files only, so the docs row over the whole scope catches a cross-file fragment whose target is not staged. [sources: https://rumdl.dev/md051]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/docs
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/docs. The (docs) scope of the title gives the scope.
    • Priority: P2-Medium. Improves documentation quality by catching broken links, but does not block releases or cause data loss.
    • Value: Medium. Prevents broken links and anchors in all project documents, improving reader trust and navigation.
    • Effort: Medium. Requires pinning a dependency, configuring rumdl, adding a pre-commit hook, a CI step, a planted-defect test, and removing the old helper.
    • Related: feat(docs): documentation syntax, code fence nesting, and mermaid link validator #227, which asks for a different change. Both validate links in documentation, but #227 is a full linter covering syntax, code fences, Mermaid and tables while the candidate adds only rumdl-based link and anchor checking.
  4. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/docs. The (docs) scope of the title gives the scope.
    • Priority: P2-Medium. The change improves documentation quality checks. It does not block users or cause data loss.
    • Value: Medium. It extends link and anchor checks to all documents and removes a limited helper.
    • Effort: Medium. It needs a dependency pin, config, a hook, a CI step, a planted-defect test and doc edits.
    • Related: feat(docs): documentation syntax, code fence nesting, and mermaid link validator #227, which asks for a different change. Both items check relative links in documents. Item 227 builds a validator engine. The candidate adopts an external tool and adds a hook and a CI step.
  5. added
    priority/p2-medium
    on Nov 12, 2026
  6. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: covers

    Reason: Searches for the need returned little on the web, but the PyPI and GitHub facts confirm rumdl as an MIT-licensed, maintained Markdown linter, and the issue's own 2-file probe of 0.3.3 shows its MD051 and MD057 rules catch all three defect classes the issue wants (dead relative link, missing cross-file fragment, missing same-file anchor). No ADR in force rejects it, so rumdl covers the link and anchor checking; only the hook, CI row and planted-defect test around it are the project's own work.

    Tool: rvben/rumdl (https://github.com/rvben/rumdl)

    • License: NOASSERTION
    • Last activity: 2026-11-14
    • Maintained: yes

    Covers:

    • MD057 detects a dead relative link in a Markdown file
    • MD051 detects a missing cross-file fragment and a missing same-file anchor
    • The rules can be limited to MD051 and MD057 through the [global] enable config key
    • A fast CLI that fits a commit-stage pre-commit hook and a devops ci docs row

    Lacks:

    • No check of external http(s) URLs; the need is only relative links and anchors, so nothing beyond that
    • Does not provide the planted-defect test, the pre-commit hook, the CI docs row or the CONTRIBUTING/TESTING edits, which the issue must add
    • Does not itself remove _broken_links or keep its wider document scope checked without the new config and hook

    Tools considered:

    Searches run:

    • rumdl markdown linter MD051 MD057 link anchor check, results: 5
    • rumdl markdown linter rust python package rules, results: 5
    • rumdl MD057 existing relative links MD051 link fragments documentation, results: 5
    • "rumdl" markdown lint tool, results: 5
    • rumdl md051 md057 rule, results: 5

    Sources:

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  7. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Owner question: The alternatives check records that rumdl covers the need. Adopt rumdl or keep the item with a reason? (a person decides)

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    The owner question of this item is on #4605: #4605

    Answer it there.

  9. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor

    Answer to the alternatives question of this item and of #4605: adopt rumdl (rvben/rumdl). Keep this item. It adds its rules and its fixes.

    • The owner chose rumdl as the one Markdown linter of the project on 2026-11-11.
    • License: MIT. LICENSE and Cargo.toml say MIT. GitHub shows NOASSERTION, because the file also holds the MIT notice of the MDX parser.
    • Maintenance: v0.3.5 of 2026-11-18, and 10 releases since 2026-09-23.
    • This item adds the pin, one .rumdl.toml, the official rvben/rumdl-pre-commit hook at the same release, and one devops ci step. It enables MD051 and MD057.
    • fix(docs): a check finds a code span that nested backticks break #4605 adds its rules to the same enable list. fix(docs): a check finds a code span that nested backticks break #4605 needs this item.
    • Fallback: markdownlint-cli2 (MIT) has the same rule numbers, if rumdl stops its releases.

    #4605 is no dependency of this item.

  10. added
    status/ready
    and removed
    status/new
    on Nov 21, 2026
  11. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  12. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: covers, tool https://github.com/rvben/rumdl. A person decides what the new result means for the item.

    Searches (4)

    Tools considered:

    Searches run:

    • rumdl markdown linter MD051 MD057 broken links anchors, results: 5
    • rumdl.dev MD051, results: 5
    • rumdl MD051 link fragments MD057, results: 5
    • rumdl markdown linter documentation, results: 5

    Sources:

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

    effort/mediumpriority/p2-mediumscope/docssource/agentstatus/readytype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions