Repository navigation
Description
Problem or Motivation
The content census found 4 closed items named as open in living documents (docs/TESTING.md line 256 with #2174, #2178 and #2183; k8s/README.md line 346 with #550) and 5 in ADRs in force. No check stops a PR that delivers an issue while a document still says that the issue is pending. This breaks AGENTS.md rule 8.
Proposed Solution & Architectural Design
Add a rule that reads the issue numbers of the change folders that the branch adds under openspec/changes/ (also the archive path). It reads them from git diff origin/main...HEAD, with 0 GitHub requests.
A living document that names such a number next to a pending cue fails with file:line. The cues are: "until", "once" or "after #N lands", "tracked in #N", "blocked by #N", "Not yet" and "Known limit". The rule runs in the CI docs row.
The rule catches 3 of the 4 census tokens. #550 closed on 2026-10-03, before the first change folder (2026-10-23), so the scheduled rule of child 12 of #4880 finds that one. Update the PR section of CONTRIBUTING.md.
Target Subsystem
SDLC, Git & PR Governance (devops docs check, the CI docs row).
Existing Tool Considered
git and the existing docs check. No open tool links a delivered issue to document text. Cost: about 120 lines plus tests, about 80k tokens and 2 h.
Acceptance Criteria
- A fixture branch that adds
openspec/changes/<n>-slugand a document line "Not yet (#)" fails with file:line. - The same line with another issue number passes.
- The rule sends 0 GitHub requests.
- The cue list gives 0 false positives on
main.
Dependencies
None.
Source: #4880
Alternatives check of 2026-11-24: partly.
Tool: presmihaylov/todocheck (https://github.com/presmihaylov/todocheck), MIT, last activity 2026-11-04, maintained.
Reason: Searches found todocheck, which fails with file:line when an annotated TODO names a closed issue, but it reads source comments only, needs issue-tracker requests and has no pending-cue list, so it covers part of the rule.
Covers:
- Fails with file:line when a linked issue is closed or missing
- Finds stale references to delivered issues in code
- Configures the issue tracker from the git remote
- Runs in CI and accepts API or offline tokens
Lacks:
- Scans no Markdown living documents or ADRs
- Has no pending-cue list such as "Not yet" or "tracked in"
- Asks the issue tracker over the network, not zero requests
- Takes issue numbers from TODO annotations, not added change folders
Proposed design
Problem statement
Add a rule to devops docs check, the command that the docs row of devops ci runs, that fails with file:line when a living document or an ADR in force names a delivered issue next to a pending cue. The content census found four closed items named as open in living documents (docs/TESTING.md with #2174, #2178 and #2183; k8s/README.md with #550) and five in ADRs in force. No check stops a pull request that delivers an issue while a document still says that the issue is pending, which breaks AGENTS.md rule 8.
Acceptance criteria
Requirement: Fails on a delivered issue with a pending cue
The docs row of devops ci SHALL fail with file:line when the branch adds a change folder for issue N and a hand-written or generated document, or an ADR in force, names N on a line with a pending cue.
Scenario: Change folder and pending cue
- WHEN The branch adds
openspec/changes/4912-docs-check/anddocs/TESTING.mdholds the lineNot yet (#4912). - THEN The check fails and names
docs/TESTING.mdwith the line number of the cue.
Requirement: Ignores another issue number
The check SHALL pass a line that names an issue number that the branch does not deliver.
Scenario: Another number on the same line
- WHEN The branch adds
openspec/changes/4912-docs-check/and the line readsNot yet (#9999). - THEN The check reports no hit.
Requirement: Counts an archived change folder
The check SHALL take the issue number from a change folder that the branch adds under openspec/changes/archive/.
Scenario: Archived change folder
- WHEN The branch adds
openspec/changes/archive/2026-11-16-4912-docs-check/andk8s/README.mdholds the linetracked in #4912. - THEN The check fails and names
k8s/README.mdwith the line number.
Requirement: Sends no GitHub request
The check MUST send no request to GitHub.
Scenario: No request to GitHub
- WHEN The check runs on a branch that adds a change folder for a delivered issue and a fake GitHub session is installed.
- THEN The fake GitHub session records no request.
Requirement: Reports nothing with no added change folder
The check SHALL report no hit when the branch adds no path under openspec/changes/.
Scenario: No added change folder
- WHEN The check runs on
mainanddocs/TESTING.mdholdsNot yet (#2174). - THEN The check reports no hit.
Requirement: Passes a line with no pending cue
The check SHALL pass a line that names the delivered issue with no pending cue.
Scenario: No pending cue
- WHEN The branch adds
openspec/changes/4912-docs-check/and the line readsDelivered in #4912. - THEN The check reports no hit.
Requirement: Runs in the docs row
The docs row of devops ci SHALL run the check.
Scenario: Docs row run
- WHEN
uv run devops ci docsruns on the fixture branch. - THEN The command exits non-zero and prints the file and the line of the cue.
Requirement: PR section names the rule
The PR section of CONTRIBUTING.md SHALL state that a document drops the pending cue of an issue that the pull request delivers.
Scenario: Contributing text
- WHEN A reader opens section 4 of
CONTRIBUTING.md. - THEN The section holds the sentence that names the docs check and the pending cue rule.
Requirement: Skips records and ADRs out of force
The check SHALL scan only the hand-written and generated documents of the documentation inventory and the ADRs in force.
Scenario: Record and superseded ADR
- WHEN The branch adds
openspec/changes/4912-docs-check/and the small tree holdstests/fixtures/roadmap/plan_heads/probe.mdwithNot yet (#4912)anddocs/adr/0002-roadmap-jobs-act-as-a-machine-account.mdwithNot yet (#4912). - THEN The check reports no hit.
Existing Tool Considered
Do not adopt presmihaylov/todocheck; build the rule in devops docs check. todocheck (MIT, last commit 2026-11-04, fetched 2026-11-16) fails with file:line when an annotated TODO comment names a closed or missing issue, but it scans source-code comments, not Markdown living documents or ADRs. It has no pending-cue list, it asks the issue tracker over the network (API or offline token), so it cannot meet the 0 GitHub request constraint, and it does not take the issue numbers from the change folders that the branch adds. The build costs about 120 lines plus tests in src/devops_cli/docs/ and tests/docs/, about 80k tokens and 2 h.
Key questions
- Which path holds the change of a delivered issue?:
openspec/changes/<issue>-<slug>/while the pull request is open, archived toopenspec/changes/archive/<date>-<issue>-<slug>/in its last commit. [sources: CONTEXT.md:16, .github/pull_request_template.md:5] - How does the check find the issue numbers that the branch delivers?: It runs one
git diff --name-only origin/main...HEADfrom the repository root and takes the number from each added path that matchesopenspec/changes/<n>-<slug>/oropenspec/changes/archive/<date>-<n>-<slug>/. It fetches nothing: the static job checks out the full history, soorigin/mainis present, and the check fails with a message that names the ref when it is absent. (best practice) [sources: CONTEXT.md:16, .github/workflows/ci.yml:57, .github/workflows/ci.yml:94]- Chosen: Diff paths of the change folders. The paths are local, so the check sends 0 GitHub requests, and they name the issue that the pull request delivers.
- Rejected: The
Closes #Nline of the pull request body. It needs a GitHub request, which the issue forbids. - Rejected: The trailers of the commits. A squash merge rewrites the commits, so the trailers are not stable.
- Rejected: Fetch
origin/mainwhen the ref is absent. A fetch is a request to GitHub and the issue forbids it; the static job already checks out the full history.
- Where does the check live?: In a new module
src/devops_cli/docs/stale_issue.py, called byDocGenerator.check_docs, because thedocsrow runsuv run devops docs check(src/devops_cli/commands/ci.py:929-936).tests/gate/holds the rows thatdocs/TESTING.md:72lists, anddocsis not one of them. (best practice) [sources: src/devops_cli/commands/ci.py:929, src/devops_cli/docs/generator.py:1392, docs/TESTING.md:72]- Rejected: A pytest test in
tests/invariants/.docs/TESTING.md:72says a check of committed files is a row ofdevops ci, not a pytest test. - Rejected: A
check_*function of thedocsrow intests/gate/. Thedocsrow runsdevops docs check, not the gate runner;tests/gate/holds only the rows thatdocs/TESTING.md:72lists. - Chosen: A function that
DocGenerator.check_docscalls. Thedocsrow already runs that function, and a pytest test of the rule gives it a small tree and canned added paths.
- Rejected: A pytest test in
- Which files does the check scan?: The hand-written and generated documents of the documentation inventory, plus the ADRs in force. It skips the records (change folders, archives,
openspec/specs/and the test fixtures),CHANGELOG.md, the prompt documents and the tool-generated skills, because those are not living documents. (best practice) [sources: src/devops_cli/docs/inventory.py:37, src/devops_cli/config/constants.py:488, docs/adr/README.md:34, src/devops_cli/roadmap/adr.py:107]- Rejected: Every tracked Markdown file. It scans the test fixtures and the specs, which hold issue references on purpose, so it reports false positives.
- Rejected: A list of
docs/andk8s/README.md. The list needs an edit for each new document, and a document outside it escapes the rule. - Chosen: Hand-written and generated documents, plus ADRs in force. It covers the living documents and the ADRs in force, and it skips the records, the prompts and the tool-owned files.
- What does 'next to' mean for a pending cue?: The issue number and the cue sit on the same line. The census tokens are one line each, and the check reports the file and the line of the cue. (best practice) [sources: docs/TESTING.md:276, k8s/README.md:429]
- Chosen: Same line. The census tokens are single lines, the failure is reported as file:line, and the rule stays cheap to check.
- Rejected: Same paragraph. It reads more text for each hit and raises the count of false positives.
- Which cue strings does the check match?: The case-insensitive cues
not yet,until,once,after #N lands,tracked in #N,blocked by #Nandknown limit, where#Nis the delivered issue number. The census lines useNot yet(docs/TESTING.md:276),once #550andUntil then(k8s/README.md:429),once #1562(docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md:199),until #1721 and #1723(docs/adr/0011-releases-come-from-trunk-towncrier-uv-and-semver-tags-instead-of-a-bespoke-cut.md:25) andnot yet measured(docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md:12);Known limitis a pending-limit marker in a living document (docs/roadmap/stage.md:124). (best practice) [sources: docs/TESTING.md:276, k8s/README.md:429, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md:12, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md:199, docs/adr/0011-releases-come-from-trunk-towncrier-uv-and-semver-tags-instead-of-a-bespoke-cut.md:25, docs/roadmap/stage.md:124]- Chosen: The seven cues of the issue. They cover the census tokens and keep the false-positive budget of
main. - Rejected: A wider set of words such as
pendingandopen. It matches ordinary prose and breaks the 0 false-positive budget onmain.
- Chosen: The seven cues of the issue. They cover the census tokens and keep the false-positive budget of
- Which open tool covers the link from a delivered issue to document text?:
presmihaylov/todocheckis the closest open, maintained tool (MIT, last commit 2026-11-04). It fails with file:line when an annotated TODO comment names a closed or missing issue, but it scans source-code comments, not Markdown living documents or ADRs. It has no pending-cue list, it asks the issue tracker over the network (API or offline token), so it cannot meet the 0 GitHub request constraint, and it does not take the issue numbers from the change folders that the branch adds. The project therefore builds the rule. (best practice) [sources: https://github.com/presmihaylov/todocheck]- Rejected:
presmihaylov/todocheck. It scans annotated TODO comments, needs tracker requests and has no pending-cue list. - Chosen: Build the rule in
devops docs check. It reads the local git diff and the document text, so it sends 0 GitHub requests and meets the change-folder paths.
- Rejected:
- How does the test of the check avoid a real git start?: The rule function takes the added paths and the document texts as arguments.
DocGenerator.check_docsmakes the onegit diffcall and passes the paths; a pytest test intests/docs/passes canned paths and a small tree, so it starts no git. (best practice) [sources: docs/TESTING.md:72, src/devops_cli/docs/generator.py:1392]- Rejected: The check runs
git diffitself. A test of it then needs a fake of git, anddocs/TESTING.md:72says a test of the logic of a check gives it a small tree or canned output and starts no program. - Chosen: The row passes the added paths to the check. The test gives the check a small tree and canned paths, and
DocGenerator.check_docskeeps the one real git call.
- Rejected: The check runs
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
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 rule stops documentation drift, but no evidence shows urgent harm.It stops stale documents that name delivered issues as open and removes confusion for readers.The body estimates about 120 lines with tests and 2 hours of work.Both items add an automated check that a PR is grounded in an issue, but 704 checks the task file and issue link, and the candidate checks stale document text.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 enforces AGENTS.md rule 8 and prevents stale documentation, but it does not block users or cause data loss.It stops a class of confusing stale references in living documents and ADRs.The author estimates about 120 lines plus tests in roughly 2 hours with no external dependencies.Both check issue references during PR validation, but #704 validates task file completion while this candidate checks document text for stale pending cues.devops-cli-service commentedon Nov 15, 2026
Alternatives check: partly
Reason: The searches found no tool that links a delivered issue to prose in living documents or ADRs; the closest is todocheck, which reads issue IDs out of annotated TODO comments, checks their state against the tracker and fails with file:line on a closed issue. That covers only the "closed issue named in text is an error" part, and not the document text, the pending cues, the change-folder diff or the zero-GitHub-request constraint of the issue.
Tool: presmihaylov/todocheck (https://github.com/presmihaylov/todocheck)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-15. 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
Status set to Ready at fccb781 (see proposed design in issue body).