Skip to content

feat(docs): docs check finds the delivered issue named as open #4912

Open

Description

@dan-petty

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>-slug and 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/ and docs/TESTING.md holds the line Not yet (#4912).
  • THEN The check fails and names docs/TESTING.md with 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 reads Not 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/ and k8s/README.md holds the line tracked in #4912.
  • THEN The check fails and names k8s/README.md with 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 main and docs/TESTING.md holds Not 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 reads Delivered 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 docs runs 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 holds tests/fixtures/roadmap/plan_heads/probe.md with Not yet (#4912) and docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md with Not 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 to openspec/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...HEAD from the repository root and takes the number from each added path that matches openspec/changes/<n>-<slug>/ or openspec/changes/archive/<date>-<n>-<slug>/. It fetches nothing: the static job checks out the full history, so origin/main is 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 #N line 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/main when 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 by DocGenerator.check_docs, because the docs row runs uv run devops docs check (src/devops_cli/commands/ci.py:929-936). tests/gate/ holds the rows that docs/TESTING.md:72 lists, and docs is 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:72 says a check of committed files is a row of devops ci, not a pytest test.
    • Rejected: A check_* function of the docs row in tests/gate/. The docs row runs devops docs check, not the gate runner; tests/gate/ holds only the rows that docs/TESTING.md:72 lists.
    • Chosen: A function that DocGenerator.check_docs calls. The docs row already runs that function, and a pytest test of the rule gives it a small tree and canned added paths.
  • 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/ and k8s/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 #N and known limit, where #N is the delivered issue number. The census lines use Not yet (docs/TESTING.md:276), once #550 and Until 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) and not yet measured (docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md:12); Known limit is 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 pending and open. It matches ordinary prose and breaks the 0 false-positive budget on main.
  • Which open tool covers the link from a delivered issue to document text?: presmihaylov/todocheck is 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.
  • 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_docs makes the one git diff call and passes the paths; a pytest test in tests/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 diff itself. A test of it then needs a fake of git, and docs/TESTING.md:72 says 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_docs keeps the one real git call.

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
    on Nov 12, 2026
  3. added
    effort/low
    on Nov 12, 2026
  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.

    • Priority: P2-Medium. The rule stops documentation drift, but no evidence shows urgent harm.
    • Value: Medium. It stops stale documents that name delivered issues as open and removes confusion for readers.
    • Effort: Low. The body estimates about 120 lines with tests and 2 hours of work.
    • Related: feat(github): pr readiness requires an issue-linked, completed task file #704, which asks for a different change. 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.
  5. 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. It enforces AGENTS.md rule 8 and prevents stale documentation, but it does not block users or cause data loss.
    • Value: Medium. It stops a class of confusing stale references in living documents and ADRs.
    • Effort: Low. The author estimates about 120 lines plus tests in roughly 2 hours with no external dependencies.
    • Related: feat(github): pr readiness requires an issue-linked, completed task file #704, which asks for a different change. Both check issue references during PR validation, but #704 validates task file completion while this candidate checks document text for stale pending cues.
  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    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)

    • License: MIT
    • Last activity: 2026-11-04
    • Maintained: yes

    Covers:

    • Fails with file:line when a text reference names a closed issue (and also when the issue does not exist)
    • Reads issue references from annotations and validates them against GitHub, GitLab and other trackers
    • Runs as a CLI in a CI pipeline over a repository checkout

    Lacks:

    • Scans annotated TODO comments in source code, not Markdown living documents or ADRs
    • Has no notion of pending cues such as "until", "Not yet", "tracked in #N" or "blocked by #N"
    • Asks the issue tracker over the network (API or offline token), so it cannot run with 0 GitHub requests
    • Does not take the issue numbers from the change folders a branch adds under openspec/changes via git diff
    • No pending-cue list with a false-positive budget on main

    Tools considered:

    Searches run:

    • todocheck validate TODO comments issue tracker closed issues, results: 5
    • tool checks documentation references to closed GitHub issues stale "not yet" markers, results: 5
    • todocheck GitHub issue reference linter, results: 5
    • "todo-or-die" GitHub issues check failing tests stale references, results: 5
    • todocheck, results: 5
    • markdown linter detect stale issue references closed issues documentation, results: 5
    • tool detects references to closed GitHub issues in markdown docs CI check, results: 5
    • vale prose linter rule issue reference GitHub, results: 5
    • "closed issue" reference checker github action markdown docs lint, results: 5
    • leasot TODO parser issue references markdown comments, results: 5

    Sources:

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

  7. added
    status/ready
    and removed
    status/new
    on Nov 16, 2026
  8. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at fccb781 (see proposed design in issue body).

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/lowpriority/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