Repository navigation
Description
Problem or Motivation
The content census at cd6fb76 found 10 living high and 19 living low path findings, 31 in history sections and 29 in ADRs in force. The standards pass of 2026-11-11 (#4772) fixed 22 moved test paths by hand. The only path check (test_the_test_rules_name_only_test_files_that_exist) reads only docs/TESTING.md.
Proposed Solution & Architectural Design
- Add a rule module in
src/devops_cli/docs/thatdevops docs checkruns over the hand-written and prompt classes, the skills and the knowledge base. - A code span whose first segment is a tracked top-level entry or a package of
src/devops_climust resolve ingit ls-files. A glob must match. - The (target) mark names a planned path.
- The message names the tracked file with the same base name as the probable new path.
- Bare file names go to the scheduled rules of child 12 of feat(docs): track current content and brain-fed reference docs #4880.
- Delete the test that reads only
docs/TESTING.md.
The PR decides each of the 19 low-confidence tokens in the document: reword, link or narrow the stated scope. It never adds an allow list. Precision rule: the rule goes into the docs row only when its run on main gives 0 findings after #4894. Update CONTRIBUTING.md and the docs row of docs/ROUTINE_TASKS.md.
Target Subsystem
SDLC, Git & PR Governance (devops docs check, src/devops_cli/docs/).
Existing Tool Considered
git ls-files and markdown-it-py (already dependencies). No open tool checks code-span paths against a git tree. Cost: about 150 lines plus tests, about 100k tokens and 2.5 h.
Acceptance Criteria
- A planted moved path fails with file:line and the probable new path.
- The rule gives 0 findings on
mainat the merge. - The old test is gone.
- The docs row grows by at most 8 s on the runner.
Dependencies
Source: #4880
Alternatives check of 2026-11-21: partly.
Tool: lycheeverse/lychee (https://github.com/lycheeverse/lychee), Apache-2.0, last activity 2026-11-16, maintained.
Reason: Searches found only link checkers: lychee reports broken hyperlinks and local file link targets, but it reads no inline code spans and resolves nothing against the tracked git tree, so it covers only part of the need.
Covers:
- Broken hyperlink and mail address detection in Markdown and HTML
- Resolution of local file link targets
- Findings that name the file and line
- Relative URL and anchor fragment checks
Lacks:
- No read of inline code spans
- No resolve against the
git ls-filestracked set - No glob match for a code-span path
- No
(target)mark or<...>placeholder handling - No probable new path in the message
Proposed design
Problem statement
Add the code-span path rule to devops docs check after #4894 lands and when the rule reports 0 findings on main. Fix the 19 low-confidence tokens in the same pull request, delete the old test, and update CONTRIBUTING.md and the Documentation Sync row. The only check of a documentation path reads docs/TESTING.md. The content census at cd6fb76 found 10 living high and 19 living low path findings. The standards pass of 2026-11-11 (#4772) fixed 22 moved test paths by hand. A code span in a hand-written document, a prompt, a project skill or the knowledge base can name a path that git does not track, and no check reports it.
Acceptance criteria
Requirement: The docs check runs the code-span path rule
devops docs check SHALL run the code-span path rule from a module under src/devops_cli/docs/ over the hand-written and prompt documents, which include the project skills and the knowledge base.
Scenario: Each document kind is inspected
- WHEN the check runs over a tree with one hand-written document, one prompt, one project skill and one knowledge-base document, each with one stale path
- THEN the check reports four findings, each with its file and line
Requirement: A code span at a tracked top-level entry must exist
The rule SHALL report a finding when the first segment of a code span is a tracked top-level entry and no tracked file has the path.
Scenario: A moved document path fails
- WHEN a hand-written document holds the code span
docs/OLD_GUIDE.mdand git tracks no such path - THEN the rule reports one finding at the line of the code span
Requirement: A code span at a src/devops_cli package must exist
The rule SHALL report a finding when the first segment of a code span is a package directory under src/devops_cli and neither the span nor src/devops_cli/<span> is tracked.
Scenario: A moved module path fails
- WHEN a document holds the code span
roadmap/missing.pyand git tracks no such path at the root or undersrc/devops_cli/roadmap/ - THEN the rule reports one finding at the line of the code span
Requirement: A glob in a code span matches a tracked file
The rule SHALL report a finding when a code span holds a glob that matches no tracked file.
Scenario: A glob that matches nothing fails
- WHEN a document holds the code span
src/devops_cli/docs/*.missingand no tracked file matches the glob - THEN the rule reports one finding at the line of the code span
Requirement: The (target) mark names a planned path
The rule MUST NOT report a finding for a code span that an emphasis starting with (target) follows.
Scenario: A planned path passes
- WHEN a document holds the code span
docs/NEW_GUIDE.mdfollowed by*(target)*and git tracks no such path - THEN the rule reports no finding
Requirement: A <...> placeholder is checked up to the placeholder
The rule SHALL resolve only the text before a <...> placeholder in a code span.
Scenario: A placeholder in a tracked folder passes
- WHEN a document holds the code span
tests/support/fakes/<edge>.pyand git trackstests/support/fakes/clock.py - THEN the rule reports no finding
Requirement: A bare file name is not the subject of the rule
The rule MUST NOT report a finding for a code span whose first segment is a bare file name.
Scenario: A bare file name passes
- WHEN a document holds the code span
conftest.pyand git tracks no file at that path - THEN the rule reports no finding
Requirement: The finding names the probable new path
The rule SHALL name each tracked file with the same base name as the probable new path in the finding, at most five, sorted.
Scenario: A moved path names its probable file
- WHEN a document holds
docs/OLD_GUIDE.md, git tracks no such path, and git tracks exactly one file namedOLD_GUIDE.mdatdocs/guides/OLD_GUIDE.md - THEN the message names
docs/guides/OLD_GUIDE.md
Requirement: One git call for each run of the rule
The rule SHALL read the tracked files with one git ls-files call for each run of the rule.
Scenario: Ten documents start git once
- WHEN the rule runs over ten documents
- THEN the git fake records one
ls-filescall
Requirement: The repository tree has no path finding
The rule SHALL report no finding when it runs over the repository tree of the change.
Scenario: The docs check passes on the tree
- WHEN
uv run devops docs checkruns over the repository tree of the change - THEN the code-span path rule reports no finding
Requirement: The docs row runs the code-span path rule
The docs row of devops ci SHALL fail when a code-span path in a checked document does not resolve.
Scenario: The docs row reports a stale code-span path
- WHEN
uv run devops ci --check --only docsruns over a tree with one stale code-span path - THEN the row fails and prints the finding with its file and line
Requirement: The old test is deleted
The change SHALL delete the test test_the_test_rules_name_only_test_files_that_exist.
Scenario: No test holds the old name
- WHEN a person runs
! git grep -n test_the_test_rules_name_only_test_files_that_exist tests/ - THEN the command exits 0 and prints nothing
Requirement: The documents name the code-span path rule
CONTRIBUTING.md and the Documentation Sync row of docs/ROUTINE_TASKS.md SHALL name the code-span path rule.
Scenario: The documents name the rule
- WHEN a person runs
git grep -n "code-span path" CONTRIBUTING.md docs/ROUTINE_TASKS.md - THEN the command prints a line in each file and exits 0
Requirement: Pending a person after the merge
The docs row SHALL take at most 8 s more than the docs row on main.
Scenario: A person measures the docs row on the runner
- WHEN a person runs the docs row on the runner after the merge and compares its elapsed time with the docs row on
main - THEN the elapsed time is at most 8 s more
Existing Tool Considered
The alternatives check of 2026-11-21 in the issue body records partly for lychee (https://github.com/lycheeverse/lychee), Apache-2.0, maintained; its Covers: and Lacks: lists are the record. This change builds the code-span rule that lychee lacks with git ls-files and markdown-it-py, at about 150 lines plus tests, about 100k tokens and 2.5 h.
Key questions
- Which test reads only
docs/TESTING.md?:test_the_test_rules_name_only_test_files_that_existintests/invariants/test_agents_md.pyreads onlydocs/TESTING.md. [sources: docs/TESTING.md] - Where does the rule live, and which row runs it?: The rule is a module under
src/devops_cli/docs/.devops docs checkcalls it fromDocGenerator.check_docs. Thedocsrow ofdevops cirunsdevops docs check. (best practice) [sources: src/devops_cli/commands/docs.py:150, src/devops_cli/docs/generator.py:1392, docs/SDLC.md:215, docs/ROUTINE_TASKS.md:33]- Chosen: module under
src/devops_cli/docs/. The command already owns the docs checks, so one module serves the command and the row. - Rejected:
check_*function intests/gate/. The docs row runsdevops docs check, not a separate gate module. - Rejected: new command. It adds a command to keep and a second entry point for one check.
- Chosen: module under
- Which documents does the rule read?: The rule reads the hand-written and prompt classes of
CONST_DOCS_NAME_CHECKED_CLASSES. The hand-written class is the complement of the inventory, so it holds the project skills and the knowledge base. The prompt class holdssrc/devops_cli/ai/personas/**/*.mdandsrc/devops_cli/ai/tasks/**/*.md. (best practice) [sources: src/devops_cli/config/constants.py:532, src/devops_cli/config/constants.py:519, src/devops_cli/config/constants.py:523, src/devops_cli/docs/inventory.py:37]- Chosen: hand-written and prompt classes. The hand-written class includes the project skills and the knowledge base; the prompt class covers the documents a model loads at run time.
- Rejected: every class of the inventory. Generated pages are checked against their generator, records are history, and tool-generated skills are checked against regeneration.
- Rejected: hand-written only. A stale path in a prompt sends the model to a missing file.
- How does the rule read the tracked files?: The rule starts one
git ls-files -zthroughrun_subprocessfor each run and reads each document once.list_repo_filesadds untracked files with--others, so it is no substitute. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py:143, src/devops_cli/core/repo.py:628, docs/TESTING.md:80]- Chosen: one
git ls-files -zcall throughrun_subprocess.docs/TESTING.mdholds every start of git to the process runner, and one call gives the tracked set of the whole run. - Rejected: walk the working tree with
pathlib. It counts untracked and ignored files, so a path that git does not track passes. - Rejected: read
.git/indexdirectly. It copies the index format of git and its rules into the product code.
- Chosen: one
- How does the rule find a code span and its line?: It reads each document line by line, skips fenced code blocks and takes each inline code span with its line number, as the argv collector does. It reads the text after the span on the same line for the
(target)mark. (best practice) [sources: src/devops_cli/docs/markdown_argv_collector.py:30, src/devops_cli/docs/markdown_argv_collector.py:138, src/devops_cli/docs/markdown_argv_collector.py:158]- Chosen: line-by-line inline code regex. It gives the exact line of each span and skips fenced blocks, which the docs row needs for file:line.
- Rejected: the markdown-it token map. The map gives the line of the inline block, not the line of each span inside a multi-line paragraph.
- Rejected: a full markdown parse and a search for each span. A span can repeat, and a search gives no reliable line.
- How does the rule match a glob in a code span?: The rule matches the glob against the tracked list with
fnmatch.fnmatchcase, and only whenglob.has_magicsays the span is a glob. A glob that matches no tracked file is a finding. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py:199, src/devops_cli/roadmap/stage/stage_paths.py:53]- Chosen: match against the
git ls-fileslist withfnmatch.fnmatchcase.StagedTree.hasdoes this withhas_magic; the tracked list is the subject of the rule, and the standard library supplies the matcher. - Rejected: walk the working tree with
glob.glob. It counts an untracked file as a match, so a stale glob can pass.
- Chosen: match against the
- Which code spans does the rule inspect?: The rule inspects a code span only when it holds a
/or a glob and its first segment is a tracked top-level entry or a package directory undersrc/devops_cli. A package-relative span resolves assrc/devops_cli/<span>as well as at the root. A bare file name is not a finding, because child 12 of feat(docs): track current content and brain-fed reference docs #4880 covers it. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py:209, src/devops_cli/roadmap/stage/stage_paths.py:217, src/devops_cli/roadmap/init.py, src/devops_cli/docs/init.py]- Chosen: first segment is a tracked top-level entry or a
src/devops_clipackage, with a slash or a glob.StagedTree.as_pathrequires a slash and a known first folder; the package branch adds the module paths that documents name relative to the package. - Rejected: every code span that holds a slash. It reports commands and URLs, and it holds no limit that a person can state.
- Rejected: only paths under
src/. It misses every path that starts atdocs/ortests/.
- Chosen: first segment is a tracked top-level entry or a
- How does the rule treat the
(target)mark?: A code span that an emphasis starting with(target)follows names a planned path, so the rule reports no finding for it.docs/TESTING.mdalready marks a name that does not exist yet this way, and the deleted test reads it the same way. (best practice) [sources: docs/TESTING.md:57]- Chosen: skip a code span that an emphasis starting with
(target)follows.docs/TESTING.mdalready uses*(target)*for a path that does not exist yet, and the deleted test reads the mark the same way. - Rejected: an allow list in the module. An allow list hides a stale path, and the body forbids it.
- Rejected: a TODO comment beside the path. It is invisible in the rendered page and it needs a second rule to find it.
- Chosen: skip a code span that an emphasis starting with
- How does the rule treat a
<...>placeholder?: It resolves only the text before the first<...>placeholder. Sotests/support/fakes/<edge>.pypasses whentests/support/fakes/is tracked, andtests/nowhere/<edge>.pyfails when it is not. This keeps the behavior of the test that the change deletes. (best practice) [sources: docs/TESTING.md:82]- Chosen: resolve the text before the placeholder. The deleted test does this;
docs/TESTING.md:82holdstests/support/fakes/<edge>.py, and the folder is tracked. - Rejected: skip every span with a placeholder. A placeholder under a missing folder would pass, and the deleted test reports it.
- Rejected: treat the placeholder as a glob.
<is no glob character, and the tracked set holds no file with it.
- Chosen: resolve the text before the placeholder. The deleted test does this;
- How does the message name the probable new path?: The rule lists the tracked files with the same base name, sorted, at most five, and names each in the message. It does not guess one. When no tracked file has that base name, the message says so. This is the
same_nameindex ofStagedTree. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py:205, src/devops_cli/roadmap/stage/stage_paths.py:71]- Chosen: list the tracked files with the same base name, sorted, at most five.
StagedTree.same_namebuilds the index and caps the list; a person or agent copies a real path. - Rejected: name the one tracked file with the same base name. A guess hides a wrong path when several files share the name.
- Rejected: a similarity search of git history. It needs the old blob, and a document holds no commit.
- Chosen: list the tracked files with the same base name, sorted, at most five.
- Does the new rule replace the test that reads only
docs/TESTING.md?: Yes for a path that starts at a tracked top-level entry or asrc/devops_clipackage, such astests/invariants/test_agents_md.py. A bare file name indocs/TESTING.mdhas no check until child 12 of feat(docs): track current content and brain-fed reference docs #4880 lands. (best practice) [sources: docs/TESTING.md]- Chosen: delete
test_the_test_rules_name_only_test_files_that_exist. The new rule reports the same stale test paths and reads every document class; the placeholder and(target)behavior is kept. - Rejected: keep both tests. Two checks report one stale path, and the old test reads one file.
- Chosen: delete
- How does the change fix a finding, including the 19 low-confidence tokens?: Each finding is fixed by rewording the sentence, linking the path or narrowing the stated scope. The module holds no list of accepted paths.
docs/SDLC.mdforbids an escape or exemption to make a check pass, andAGENTS.mdrule 11 asks for the cause to be fixed. (best practice) [sources: docs/SDLC.md:223, AGENTS.md:17]- Chosen: reword, link or narrow the stated scope. The document then names a path that exists, and the check stays true for the next change.
- Rejected: an allow list of accepted paths. It hides a stale path, and the body forbids it.
- How does the change hold the 8 s budget of the docs row?: The rule starts one
git ls-filesand reads each document once. No test bounds elapsed wall-clock time from above, perdocs/TESTING.md; a person measures the docs row on the runner after the merge. (best practice) [sources: docs/TESTING.md:154, src/devops_cli/roadmap/stage/stage_paths.py:143]- Chosen: one git call and one read for each document. It is the smallest work that gives the tracked set and the code spans.
- Rejected: a test that asserts the row ends within 8 s.
docs/TESTING.mdforbids a test that bounds elapsed wall-clock time from above.
- When does the rule join the docs row?: The rule joins the docs row after docs: fix the stale statements that the content census found #4894 lands and when its run on
maingives 0 findings. The change fixes the 19 low-confidence tokens in the same pull request. (best practice) [sources: docs/ROUTINE_TASKS.md:33, docs/SDLC.md:215]- Chosen: wait for docs: fix the stale statements that the content census found #4894 and 0 findings on
main. The body sets this precision rule; a rule with findings onmainwould break the docs row. - Rejected: add the rule before docs: fix the stale statements that the content census found #4894. The row would fail on paths that docs: fix the stale statements that the content census found #4894 fixes.
- Chosen: wait for docs: fix the stale statements that the content census found #4894 and 0 findings on
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(docs)scope of the title gives the scope.It catches a recurring class of documentation errors but does not block a release or fix a security issue.It prevents a known recurring class of wrong-path references in documentation.About 150 lines plus tests and updates to two files, estimated at 2.5 hours.Both address documents that name files that are gone or moved; 3508 fixes specific text, the candidate adds a check that catches such paths.devops-cli-service commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The check prevents recurring stale paths, but it depends on 4894 and is not urgent.It stops wrong paths in docs from misleading users and agents.It needs about 150 lines, tests, and a decision on 19 low-confidence tokens.Both items address stale document paths from the content census; 4894 fixes the findings, while the candidate adds a check that prevents new ones.devops-cli-service commentedon Nov 14, 2026
Alternatives check: partly
Reason: The searches found only general Markdown link checkers; lychee validates local file link targets in a document, which covers the link-target half of keeping stale paths out of the docs. None of the tools parse inline code spans, resolve them against git ls-files, match globs or suggest the probable new path, so the rule this issue asks for is not covered.
Tool: lycheeverse/lychee (https://github.com/lycheeverse/lychee)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Refine cannot set this item to Ready at fccb781 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.