Repository navigation
Description
Problem or Motivation
The content census found 5 living high findings (DEVOPS_CLI_GH_CLI_TIMEOUT, DEVOPS_CLI_AI_TASK_COMPOSE_MODEL and 3 flags in the knowledge base), 11 living low setting keys and 11 findings in ADRs in force. A wrong variable is ignored with no error. devops docs check checks commands, but not settings, variables, or flags that a document names alone.
Proposed Solution & Architectural Design
Add rules to the rule module of #4904:
- A
DEVOPS_*variable must be inget_all_env_var_specs()orkeyring_names(). - A dotted setting key in a code span or a
config.yamlfence must walk the Settings model. - A
--flagon a line or table row that names adevopscommand must belong to that command. The rule uses the command tree that the docs row already loads.
The PR decides the 11 low-confidence keys in the documents. Precision rule as in #4904.
Target Subsystem
SDLC, Git & PR Governance (devops docs check, src/devops_cli/docs/).
Existing Tool Considered
The pydantic-settings model and the Typer tree, which are already the oracle of devops docs check. Cost: about 200 lines plus tests, about 120k tokens and 2.5 h.
Acceptance Criteria
- Planted defects fail: an unknown variable, an unknown setting key and a flag of another command.
- The rules give 0 findings on
mainat the merge.
Dependencies
Source: #4880
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches surfaced only CLI-docs generators (mkdocs-typer, sphinx-click) and generic YAML/markdown validators; none checks names in hand-written markdown against live env-var specs, the Settings model or the Typer tree.
Lacks:
- Checks no DEVOPS_CLI_* name in a code span or fence
- Walks no dotted key against the Settings model
- Resolves no --flag against the command tree of a named command
- Generators rewrite reference pages instead of flagging hand-written rows
Proposed design
Problem statement
Add three rules to devops docs check for unknown DEVOPS_CLI_* variables, dotted setting keys and flags of another command. The content census found 5 living high findings, 11 living low-confidence setting keys and 11 findings in ADRs in force. The check resolves a devops command in a document, but it ignores a setting, a variable or a flag that a document names alone, so a wrong name gives no error. The pull request also corrects the living findings, so the check gives 0 findings at the merge. The 11 findings in ADRs in force go to a separate issue, because a person corrects a record.
Acceptance criteria
Requirement: Unknown environment variable
The docs check SHALL report a finding for each DEVOPS_CLI_* variable that a document names and that neither get_all_env_var_specs() nor keyring_names() holds.
Scenario: Unknown variable fails the check
- WHEN A test document names
DEVOPS_CLI_NOT_A_SETTINGin a code span, and no environment variable spec and no keyring name has that name. - THEN The variable rule returns one finding that names the document path and the line, and
devops docs checkexits with a non-zero status.
Requirement: Unknown setting key
The docs check MUST resolve each dotted setting key in a code span or a config.yaml fence against the Settings model and report a finding when no field is on that path.
Scenario: Unknown setting key fails the check
- WHEN A
config.yamlfence namesai.not_a_setting, and the Settings model has no field on that path. - THEN The setting rule returns one finding at the fence line, and
devops docs checkexits with a non-zero status.
Requirement: Flag of another command
The docs check MUST report a finding for each --flag on a line or a table row that names a devops command when the command tree has no such option.
Scenario: Unknown flag fails the check
- WHEN A table row names
devops docs checkand--not-a-flag, and that command has no such option. - THEN The flag rule returns one finding at that row, and
devops docs checkexits with a non-zero status.
Requirement: Flag without a command is skipped
The flag rule SHALL skip a line or a table row that names no devops command.
Scenario: A flag in prose gives no finding
- WHEN A test document has a line that names
--helpand nodevopscommand. - THEN The flag rule returns no finding for that line.
Requirement: Setting key recognition
The setting rule SHALL consider only a dotted token whose first part is a top-level field of Settings.
Scenario: A domain is not a setting key
- WHEN A test document names
example.comin a code span. - THEN The setting rule returns no finding for that token.
Requirement: Valid names pass
The three rules SHALL report no finding for a variable, a setting key or a flag that resolves against the specs, the Settings model or the command tree.
Scenario: Known names give no finding
- WHEN A test document names a variable from
get_all_env_var_specs(), a field of the Settings model and an option of the named command. - THEN The three rules return no finding for that document, and
devops docs checkexits with status 0.
Requirement: Placeholder names are skipped
The rules MUST skip a name that is a placeholder or a shell variable.
Scenario: Placeholder gives no finding
- WHEN A test document names
<variable>and$DEVOPS_CLI_HOMEin code spans. - THEN The variable rule returns no finding for that document.
Requirement: Clean repository at merge
The three rules MUST report 0 findings on the documents of main at the merge.
Scenario: Zero findings on main
- WHEN
uv run devops docs checkruns after the pull request corrects the two unknownDEVOPS_CLI_*variables, the 3 flags in the knowledge base and the 11 low-confidence setting keys. - THEN The output reports no finding from the variable rule, the setting rule and the flag rule.
Existing Tool Considered
The alternatives check of 2026-11-27 in the issue body gives the verdict none and names no tool. No open, maintained tool covers the need, and the block lists what a tool would lack. This change builds the three rules in the rule module of #4904 with the pydantic-settings model and the Typer tree as the oracle. The written cost is about 200 lines plus tests, about 120k tokens and 2.5 h.
Key questions
- Which module holds the three new rules?: The rule module that feat(docs): docs check refuses paths that do not exist #4904 adds under
src/devops_cli/docs/. Each rule is one function with passing tests, andcheck_docscalls it as it callscheck_documented_argv. (best practice) [sources: src/devops_cli/docs/generator.py, src/devops_cli/docs/markdown_argv_collector.py]- Chosen: Extend the rule module of feat(docs): docs check refuses paths that do not exist #4904. The check already loads that module, so the change adds one registration path and one test layout.
- Rejected: Add a second rule module. It gives the check two loaders and two test layouts for one behavior.
- Where does each rule get the set of valid names?: At check time from the live oracles. The variable rule reads
get_all_env_var_specs()andkeyring_names()insrc/devops_cli/config/env.py. The setting rule walks the fields of theSettingsmodel insrc/devops_cli/config/settings.pyby dotted path. The flag rule walks the command tree thatsrc/devops_cli/core/command_resolver.pyresolves. [sources: src/devops_cli/config/env.py, src/devops_cli/config/settings.py, src/devops_cli/core/command_resolver.py] - How does the setting rule walk a dotted key?: It splits the key on
., starts atSettings.model_fields, follows each part through aBaseModelannotation, and reports a miss when a part is not a field. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/docs/generator.py]- Chosen: Walk model annotations. It resolves no value and works without a config file.
- Rejected: Instantiate Settings and use
getattr. It resolves values, can raise on a bad environment, and hides a missing field.
- How does the setting rule tell a dotted setting key from a file name or a domain?: It considers only a dotted token whose first part is a top-level field of
Settings. A token with another first part, such asexample.comorfoo.py, is not a setting key. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/docs/markdown_argv_collector.py]- Chosen: Require a top-level Settings section. It keeps domains and file names out of the rule.
- Rejected: Treat every dotted token as a setting key. It reports
example.comandfoo.pyas unknown settings.
- How does the flag rule find the command of a line or row?: It reads the longest
devops ...command path on the line or row, resolves it with the command resolver that the docs row already uses, and checks each--flagagainst that command's options. (best practice) [sources: src/devops_cli/core/command_resolver.py, src/devops_cli/docs/markdown_argv_collector.py]- Chosen: Resolve the longest
devopscommand path. It uses the same command tree as the docs row and gives one owner to each flag. - Rejected: Treat each
devopsword as a command. It resolves a subcommand as a group and gives a false owner to a flag.
- Chosen: Resolve the longest
- What does the flag rule do with a line that names no
devopscommand?: It skips the line. A flag with no named command has no owner, so the rule reports nothing. (best practice) [sources: src/devops_cli/docs/markdown_argv_collector.py]- Chosen: Skip a line that names no
devopscommand. A flag with no named command has no owner, so the rule cannot decide it. - Rejected: Report each
--flagthat has no named command. It reports a flag in prose, such as--helpin an example, as a defect.
- Chosen: Skip a line that names no
- How does the pull request settle the 11 low-confidence setting keys?: It checks each key against the
Settingsmodel. A dotted path that walks to no field is a wrong document, so the pull request corrects the document. It adds a field only when a code path reads the key. (best practice) [sources: src/devops_cli/config/settings.py, AGENTS.md]- Chosen: Correct the key in the document. The document is the wrong side when the model has no field and no code reads the key.
- Rejected: Add the key to the Settings model. It adds a setting that no code reads, and it hides the wrong document.
- What precision rule keeps a false finding out?: A finding needs a positive miss against the live oracle. The rules skip a placeholder and a shell variable, and they report only a name that the oracle does not hold. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, src/devops_cli/docs/markdown_argv_collector.py]
- Chosen: Require a positive miss against the live oracle. It gives a finding only when the name is absent from the specs, the model or the tree.
- Rejected: Report each name that does not match a pattern. It reports placeholders and shell variables as defects.
- Which variable prefix do the rules check?:
DEVOPS_CLI_._VARIABLE_PREFIXisDEVOPS_CLI, and a variable is that prefix plus the setting's dotted key in upper case, with_for.. The issue'sDEVOPS_*is shorthand for this prefix. [sources: src/devops_cli/config/env.py, CONTRIBUTING.md] - Do the three rules read the ADRs?: No. The docs check reads the prompt and hand-written classes that
src/devops_cli/config/constants.pydefines, and an ADR underdocs/adr/is a record. The 11 findings in ADRs in force go to a separate issue, because a person corrects a record. (best practice) [sources: src/devops_cli/config/constants.py, docs/adr/0005-review-findings-come-from-tools-not-models.md]- Chosen: Keep ADRs out of the three rules. The check reads no record class, and this change does not correct a record.
- Rejected: Add a fourth rule that reads
docs/adr/. It fails the check on records that this change does not correct.
- Which documents do the three rules scan?: The hand-written documents that the docs check already scans for code-span paths. A generated document is the output of
DocGenerator, and thedocsrow refuses a stale one. The rules skip the classgeneratedin the docs inventory. (best practice) [sources: src/devops_cli/docs/generator.py, CONTEXT.md]- Chosen: Scan hand-written documents. A generated page has its source, and the docs row checks it.
- Rejected: Scan every document. It reports a finding in a generated page that a person cannot edit.
Fit
Fits in one pull request.
Suspected block
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 change improves documentation accuracy but does not block a release.The rules catch wrong settings, variables and flags in documents.The candidate estimates about 200 lines plus tests and 2.5 hours.Both items add rules to the docs check module, but #4904 checks paths and the candidate checks settings, variables and flags.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 silent documentation errors that mislead users, but does not block a release or expose a security risk.Users who follow a wrong variable or flag in the docs lose time and trust in the tool.The body estimates about 200 lines of code plus tests, roughly 2.5 hours of work.Both add rules to devops docs check, but #227 validates document syntax and structure while this candidate validates that named settings, variables, and flags exist in the codebase.devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: The searches returned only unrelated pages (MDN CSS environment-variable guides, Docker Hub image pages) and no maintained tool that cross-checks names a document mentions —
DEVOPS_*variables, dotted setting keys and--flags — against a project's pydantic-settings model and Typer command tree. Nothing found could replace the rule module described in the issue, so the need stays in-repo.Tool: none found
Lacks:
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
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.
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Released in v0.248.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.248.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:50 UTC