Skip to content

feat(roadmap): the docs audit finds documented features the code lacks #5158

Open

Description

@dan-petty

Problem or Motivation

The owner asked on 2026-11-12 for a job that finds "missing functionailty/implementation": a document, an ADR, an OpenSpec spec or a README names a command, an option, a setting or a behavior that the code does not have. Today devops docs check checks only devops command lines, and the stage spec check (src/devops_cli/roadmap/stage_specs.py) refuses a removed command only in a staged change. #4904 and #4910 will add paths, settings, variables and flags for devops-cli. No check reads the requirements of openspec/specs/ against the code, and no check covers the other Service repositories.

Proposed Solution & Architectural Design

Add a "claims" check family to the docs audit step (child 4).

  • By rule (deterministic):
  • By a decision model (flag only, ADR 0021 rule 2): for a requirement or a README feature line with no identifier, get the top 5 ripgrep hits for its key nouns. Ask Jev one closed question: "Does this evidence show code that implements the requirement?" with a probability (ADR 0019). A "no" above 0.8 adds the line to a "possible missing implementation" group. At most 20 Jev calls for each run. The model writes no text.
  • The kind of each group:
    • An OpenSpec requirement or an ADR in force promises the thing: a feat issue that offers both fixes (build it, or change the spec through a spec delta).
    • A guide or a README names the thing: a docs issue.

Target Subsystem

SDLC, Git & PR Governance (src/devops_cli/roadmap/steps/, src/devops_cli/docs/).

Existing Tool Considered

ripgrep (in use) finds the identifiers. The OpenSpec spec files are plain Markdown with fixed headings. Jev through devops ai ask-jev (in use) answers the closed question. No open tool reads spec requirements against code. Custom code: about 300 lines with tests and one Jev rubric. Cost (estimate): about 400,000 tokens and 1.5 days elapsed. Model cost: at most 20 Jev calls for each repository each run.

Acceptance Criteria

  • A fixture spec that names devops foo bar, which does not exist, gives 1 feat group. A spec that names an existing command gives 0.
  • A fixture README that names src/missing.py gives 1 docs group.
  • With a fake Jev that answers "no" at 0.9, a requirement with no identifier gives 1 "possible missing implementation" group. At 0.6 it gives 0.
  • A run makes at most 20 Jev calls.
  • --dry-run sends 0 requests and makes 0 model calls.

Dependencies

Source: #5151

Alternatives check of 2026-11-28: partly.
Tool: lycheeverse/lychee (https://github.com/lycheeverse/lychee), Apache-2.0, last activity 2026-11-23, maintained.
Reason: Searches found only link checkers, and lychee resolves relative paths and anchors in Markdown links, but it reads no identifier inside a code span, no OpenSpec requirement and no ADR line, so it covers only part of the need.

Covers:

  • Resolves relative file paths, URLs and anchor fragments in Markdown links
  • Checks external URLs and e-mail addresses for breakage
  • Runs as CLI, library and GitHub Action over file globs

Lacks:

  • No scan of identifiers inside code spans, such as commands or flags
  • No setting keys, environment variables or metric names checked
  • No OpenSpec requirement or ADR line read against the code
  • No ripgrep over tracked source files for a non-path identifier

Proposed design

Problem statement

devops docs check proves that a generated document matches its generator. It also proves that a devops command line in a hand-written document names a real command. It checks no other claim. A spec requirement, an ADR in force, a guide or a README can name a path, a setting, an environment variable or a metric that the code lacks. No check reports it. This change adds a claims check family to the docs audit step (#5155). Deterministic rules read the identifiers in code spans and the requirements of openspec/specs/. They report a feat group for a spec or an ADR and a docs group for a guide or a README.

Acceptance criteria

Requirement: Spec names a missing devops command

The claims check SHALL report one feat group when an OpenSpec requirement names a devops command that the command tree does not hold.

Scenario: Missing command in a fixture spec

  • WHEN A test gives the check a fixture spec in openspec/specs/ whose code span holds devops foo bar, and the command tree holds no such command.
  • THEN The check returns one feat group that names the requirement and holds a build fix and a spec delta fix.

Requirement: Spec names an existing devops command

The claims check SHALL report no group when an OpenSpec requirement names a devops command that the command tree holds.

Scenario: Existing command in a fixture spec

  • WHEN A test gives the check a fixture spec whose code span holds an existing devops command.
  • THEN The check returns zero groups for that requirement.

Requirement: README names a missing path

The claims check SHALL report one docs group when a README code span names a path that the tree does not hold.

Scenario: Missing path in a fixture README

  • WHEN A test gives the check a fixture README whose code span holds src/missing.py, and the tree holds no such path.
  • THEN The check returns one docs group that names the README path and line.

Requirement: ADR in force names a missing setting

The claims check SHALL report one feat group when an ADR with status accepted names a setting key that the key set does not hold.

Scenario: Missing setting in an ADR

  • WHEN A test gives the check a fixture ADR with status accepted whose code span holds a setting key, and a key set without that key.
  • THEN The check returns one feat group that names the ADR path and line.

Requirement: Managed repository identifiers use tracked source files

The claims check SHALL check a path against the tree and each other identifier with ripgrep over the tracked files that the documentation inventory does not class as a document.

Scenario: Missing setting key in a managed repository

  • WHEN A test gives the check a fixture repository whose src/app.py holds MAX_WORKERS, and a guide whose code span holds MAX_RETRIES.
  • THEN The check returns one docs group for the guide line and no group for MAX_WORKERS.

Requirement: Dry run sends no request and makes no model call

The claims check MUST send no request and make no model call when the run uses --dry-run.

Scenario: Dry run with fixtures

  • WHEN A test runs the claims check with --dry-run on a fixture repository that would make an external request or a model call.
  • THEN The fake transport records zero requests and the fake decision model records zero calls.

Requirement: Prose-only claim waits for a fitted decision point

The claims check MUST make no decision-model call for a requirement or a README feature line that holds no identifier.

Scenario: Prose-only requirement and README line

  • WHEN A test gives the check a fixture requirement and a fixture README feature line with no code span, and no fitted decision point for prose claims is registered.
  • THEN The check returns no possible missing implementation group and the fake decision model records zero calls.

Existing Tool Considered

lycheeverse/lychee covers part of this need. The alternatives check in the issue body gives it the verdict partly and lists what it covers and lacks. lychee checks that file paths and links in Markdown documents resolve. It reads no identifier inside a code span. It checks no command, flag, setting, environment variable or metric name. It reads no OpenSpec requirement and no ADR line. This change builds the code-span scan. The scan reads each identifier in a code span. It checks a path against the tree. It checks each other identifier with ripgrep over the tracked files that the inventory does not class as a document. Custom code: about 250 lines with tests. Cost: about 300,000 tokens to build, about 30,000 tokens a year to keep, about 20,000 tokens to fix, and about 1 day elapsed.

Key questions

  • Should deterministic rules produce the findings, and should a decision model only flag a separate group?: Yes. Deterministic rules read the identifiers and produce each finding and group. A decision model may add only a separate possible missing implementation group, and that flag waits on its fitted decision point. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md, docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md]
    • Chosen: Deterministic findings, and the model only flags. ADR 0005 reserves findings for tools and checked facts. ADR 0019 rule 7 never lets a model answer be the only control.
    • Rejected: The model produces the findings. ADR 0005 rejects a finding that a model alone produces.
    • Rejected: No model use. It leaves a requirement with no identifier unchecked. The deferred decision point covers that case.
  • Which files does the check read for an identifier?: A path is checked against the tree. Each other identifier is checked with ripgrep over the tracked files that CONST_DOCS_INVENTORY does not class as a document. The spec requirements come from the requirement pattern in stage_specs.py. (best practice) [sources: src/devops_cli/config/constants.py:495, src/devops_cli/docs/inventory.py, src/devops_cli/roadmap/stage/stage_specs.py, src/devops_cli/project/profile.py:71, src/devops_cli/templates/profiles/ansible-k8s.toml]
    • Chosen: Docs inventory and tracked source files. CONST_DOCS_INVENTORY classes each document, so the other tracked files hold the source and config that an identifier must appear in. ripgrep needs no parser for each language.
    • Rejected: Source globs of the project profile. The project profile gives the type and the file layout of a repository. It gives no source globs.
    • Rejected: A parser for each language. It adds code for each language and gives no more evidence than ripgrep for an identifier.
    • Rejected: devops-cli only. The issue covers each managed repository.
  • How does a missing claim map to an issue type?: An OpenSpec requirement or an ADR in force gives a feat issue, and that issue offers a build fix and a spec delta fix. A guide or a README gives a docs issue. (best practice) [sources: CONTEXT.md, .github/labels.yml, CONTRIBUTING.md]
    • Chosen: feat for a spec or an ADR, docs for a guide or a README. A spec or an ADR promises behavior, so its issue can build the thing or change the spec. A guide or a README is documentation drift, and the docs type ships no release.
    • Rejected: docs for every group. It hides a missing behavior that a spec or an ADR promises.
    • Rejected: feat for every group. It treats a wording defect of a guide as a missing feature.
  • What limits apply to the decision model?: No cut ships in a constant. ADR 0019 and ADR 0020 make a cut data in the repository from a fit on labelled cases, and the registry refuses the mode on for a point with no fitted cuts. No labelled case exists for the question about prose claims. This change defers the decision point to a new issue, and the deterministic check ships. (best practice) [sources: docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md, docs/adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md, src/devops_cli/config/constants.py:4467, AGENTS.md]
    • Chosen: A registered decision point with fitted cuts, off by default. ADR 0020 makes a workflow decision a registered point with a rule first, cuts as data and a mode that stays off until a fit and a shadow record exist. The call cap is a constant like CONST_ROADMAP_JEV_EVAL_MAX_CALLS.
    • Rejected: A 0.8 cut in a constant. ADR 0019 and ADR 0020 refuse a cut in a constant, and no labelled case exists to fit it.
    • Rejected: A direct devops ai ask-jev call from the step. AGENTS.md rule 7 allows one devops ai call only when no deterministic check answers. ADR 0020 makes a workflow decision a registered point with a record and an outcome join.
    • Rejected: No model at all. It leaves a prose-only requirement unchecked. The deferred point keeps that work with its bar and its label source.
  • Do OpenSpec spec files have fixed headings that a parser reads?: Yes. A spec is plain Markdown at openspec/specs/<capability>/spec.md, and only openspec archive writes it. The requirement pattern in stage_specs.py reads requirement text, so the check reuses that parse. [sources: CONTEXT.md, src/devops_cli/roadmap/stage/stage_specs.py, openspec/specs/project-profile/spec.md, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5155

Activity

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

    @dan-petty
    OwnerAuthor
    • Related: feat(docs): docs check refuses paths that do not exist #4904, which asks for a different change. Both check identifiers in docs against the code tree in src/devops_cli/docs/, but #4904 checks only paths while the candidate checks commands, flags, settings, env vars, metric names, and OpenSpec spec requirements.
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at c58b592 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.

  6. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • Doc Detective test documentation code samples open source, results: 5
    • tool that verifies documentation claims against codebase, results: 5
    • doc-detective github documentation testing tool, results: 5
    • pytest-codeblocks run markdown code blocks tests, results: 5
    • "doc-detective" documentation tests, results: 5
    • github doc-detective doc-detective core markdown test runner, results: 5
    • check file paths referenced in markdown documentation exist tool embedme, results: 5
    • lychee link checker github lycheeverse find broken file links in markdown, results: 5
    • open source requirements traceability tool reports requirements with no implementation in code, results: 5
    • lycheeverse/lychee, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

    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.

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/roadmapsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions