Repository navigation
Description
Problem or Motivation
The plan for #3236 (PR #3248) cites uv run devops ai ast-graph --help, uv run devops gh pages-verify --help and the tool keys ("ai", "ast-graph") and ("gh", "pages-verify"). The commands are ai ast graph and gh pages verify, and the exposure table keys are ("ai", "ast", "graph") and ("gh", "pages", "verify"). The names came from the issue text, and no step ran them. The same plan also says that ai_ast_graph writes its graph to the data directory. The command prints the graph when no --output is given.
#3266 compares the tools that a Feasibility names with the run trace. It does not check that a devops command that the plan cites exists, or that a behavior claim is true.
Proposed Solution & Architectural Design
- In the plan check, find each
devops <words>span in Feasibility and tasks (includinguv run devops ...) and resolve it withresolve_click_command(src/devops_cli/ai/mcp/generator.py) or Click directly. Refuse a span that does not resolve, and name it. - Resolve each
("a", "b")key that a plan names againstCONST_MCP_EXPOSURE_TABLE. - Test with the names
ai ast-graph(refused) andai ast graph(accepted).
Target Subsystem
The plan check of devops roadmap (see #3200, #3201).
Source: #3248
Scope from #3299
#3299 reports the same defect from the same plan (PR #3248). It adds these items.
- Option flags. The check also resolves an option flag of a cited command. The plan cited
--root_dirforgh pages verify. The CLI option is--dir(src/devops_cli/commands/gh.py:1139), androot_diris only the name of the parameter. The check refuses a flag that the command does not have, and the problem names the flag. - Location. Put the rule in
check_proposal, so the stage job anddevops roadmap plan-checkboth refuse. The replay judges the same rule, because thepathsgate ofsrc/devops_cli/roadmap/stage_eval_gates.pyrunscheck_proposal. devops openspec check. fix(roadmap): stage verifies command paths in CLI tree #3299 also asks for the check in this command. The plan states a decision: run the check there too, or make it a non-goal with the reason.- Failure text.
resolve_click_commandraisesLookupErrorfor an unknown name. The problem names the unknown subcommand. A cited help command that does not resolve cannot support a Feasibility claim:devops ai ast-graph --helpanddevops gh pages-verify --helpboth fail withNo such command. - Tests. Add cases to
tests/roadmap/for a command tuple that does not resolve, a subcommand that does not exist and a flag that does not exist.
Existing Tool Considered
resolve_click_command in src/devops_cli/ai/mcp/generator.py resolves a command tuple against the Click tree. module_click_command in src/devops_cli/core/command_resolver.py also exists. The change adds no dependency. Cost to build: about 5,000 tokens and 30 minutes.
Proposed design
Problem statement
The plan check accepts devops commands, option flags and MCP exposure keys that do not exist. A plan can cite uv run devops ai ast-graph --help and uv run devops gh pages verify --root_dir .. The real names are ai ast graph and --dir. The check must refuse these names and report them.
Acceptance criteria
Requirement: Resolve cited command spans
The plan check SHALL resolve every devops command span in the Feasibility text and the task text against the real command tree.
Scenario: Unknown subcommand is refused
- WHEN A plan cites
uv run devops ai ast-graph --help. - THEN The check returns a problem that names
ai ast-graphand refuses the plan.
Requirement: Accept a resolved command span
The plan check SHALL accept a devops command span that resolves to a leaf command with valid options.
Scenario: Known subcommand is accepted
- WHEN A plan cites
uv run devops ai ast graph --help. - THEN The check returns no command-resolution problem for that span.
Requirement: Resolve cited option flags
The plan check SHALL resolve each option flag in a cited devops command span against that command.
Scenario: Unknown option is refused
- WHEN A plan cites
uv run devops gh pages verify --root_dir .. - THEN The check returns a problem that names
--root_diranddevops gh pages verifyand refuses the plan.
Requirement: Resolve cited MCP exposure keys
The plan check SHALL resolve each MCP exposure key that a plan names against CONST_MCP_EXPOSURE_TABLE.
Scenario: Unknown exposure key is refused
- WHEN A plan names the key
("ai", "ast-graph"). - THEN The check returns a problem that names the key and refuses the plan.
Requirement: Accept a known MCP exposure key
The plan check SHALL accept an MCP exposure key that exactly matches a key in CONST_MCP_EXPOSURE_TABLE.
Scenario: Known exposure key is accepted
- WHEN A plan names the key
("ai", "ast", "graph"). - THEN The check returns no exposure-key problem for that key.
Requirement: Run the rule in check_proposal
The rule SHALL run inside check_proposal, so the stage job, devops roadmap plan-check and the stage replay use the same check.
Scenario: Stage replay refuses a bad plan
- WHEN The stage replay runs a case whose plan cites
devops ai ast-graph. - THEN The
pathsgate reports a problem that namesai ast-graph.
Requirement: Regression tests for cited names
The change SHALL add roadmap tests for an unknown exposure key, an unknown subcommand and an unknown option flag.
Scenario: The three defects have tests
- WHEN The roadmap test suite runs.
- THEN It passes and one test covers each of the three defects.
Existing Tool Considered
No alternatives check has run. No external tool covers this need. The repository already has resolve_devops_argv in src/devops_cli/core/command_resolver.py; it parses a full devops command line and reports an unknown command, an unknown option or an unexpected argument without running the command. Reuse it. The remaining work is span extraction, exposure-key comparison and tests; the written cost is about 5,000 tokens and 30 minutes.
Key questions
- Which resolver should the plan check use for a cited
devopscommand span?: Useresolve_devops_argvfromsrc/devops_cli/core/command_resolver.py. It parses the full command line, reports an unknown command, an unknown option or an unexpected argument, and runs no command. (best practice) [sources: src/devops_cli/core/command_resolver.py, src/devops_cli/ai/mcp/generator.py]- Chosen: Reuse resolve_devops_argv. It resolves the full argv, including options, and reports the three defects without running the command.
- Rejected: Call resolve_click_command directly. It resolves a command tuple but does not parse option flags or report an unknown option.
- Rejected: Build a new parser. It duplicates the existing resolver and adds maintenance cost.
- Where should the command-citation rule run?: In
check_proposal. The stage job,devops roadmap plan-checkand the stage replay already call it. (best practice) [sources: src/devops_cli/roadmap/stage_eval_gates.py, docs/roadmap/plan-check.md:20]- Chosen: Run in check_proposal. One rule serves the stage job, the plan-check command and the replay.
- Rejected: Run only in plan-check. The stage job and the replay would accept the same bad plan.
- Rejected: Run only in the stage job. The plan-check command and the replay would accept the same bad plan.
- Should
devops openspec checkalso run the command-citation rule?: No. Keep it a non-goal.devops openspec checkvalidates an OpenSpec change. The rule needs the Feasibility text and task text of a stage proposal, and the roadmap plan check owns that input. (best practice) [sources: docs/roadmap/plan-check.md:20, src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Keep it out of devops openspec check. The OpenSpec command has a different input contract and no stage proposal.
- Rejected: Add it to devops openspec check. It couples OpenSpec validation to roadmap plan text and expands this change.
- How should the check report an unknown command, subcommand or option?: Use the
describe()text ofCommandReferenceFinding. Add the cited span. The problem names the rejected token and the command path. (best practice) [sources: src/devops_cli/core/command_resolver.py]- Chosen: Reuse CommandReferenceFinding.describe(). It already names the rejected token and the command path.
- Rejected: Write a new message for each defect. It duplicates existing text and can drift from the resolver.
- How should the check compare an MCP exposure key with the table?: Parse each quoted tuple that the plan names. Compare the exact tuple with the keys of
CONST_MCP_EXPOSURE_TABLE. Refuse a key that is absent. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/ai/mcp/generator.py]- Chosen: Exact tuple match. The table keys are exact command paths, so a near name must fail.
- Rejected: Normalize hyphens and spaces. It would accept
ai ast-graphasai ast graph, which is the defect. - Rejected: Match only the first element. It accepts a wrong command path.
- Does the plan check verify a behavior claim such as where
ai_ast_graphwrites its graph?: No. This issue resolves cited command names, option flags and exposure keys only. A behavior claim needs a probe or a run trace, and fix(roadmap): Refuse Feasibility claims the run did not support #3266 covers the trace comparison. (best practice) [sources: src/devops_cli/ai/mcp/generator.py, src/devops_cli/roadmap/stage_eval_gates.py]- Chosen: Leave behavior claims out of this issue. The rule is a static name and option check, and fix(roadmap): Refuse Feasibility claims the run did not support #3266 covers trace comparison.
- Rejected: Add behavior-claim checks. A reliable check needs a probe or a run trace, which expands the scope.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: partly.
Tool: pallets/click (https://github.com/pallets/click), BSD-3-Clause, last activity 2026-11-06, maintained.
Activity
dan-petty commentedon Nov 2, 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.(roadmap)scope of the title gives the scope.It adds a validation step that catches invalid command references in plans but does not block existing workflows.It prevents plans from citing non-existent commands, which would mislead readers and downstream automation.It requires resolving arbitrary spans against the Click tree, checking exposure-table keys, and adding both accepted and refused test cases.devops-cli-service commentedon Nov 3, 2026
Refine cannot set this item to Ready at 82d22a7 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at d72ec47 (see proposed design in issue body).
devops-cli-service commentedon Nov 6, 2026
Alternatives check: partly
Tool: pallets/click (https://github.com/pallets/click)
Covers:
devops ...argv against the real command tree and raises UsageError ("No such command") for an unknown command or subcommand, without running anything.--root_diragainst--dircase.Lacks:
devops <words>spans in the Feasibility or task prose of a plan; span extraction and the call fromcheck_proposalstill have to be written.CONST_MCP_EXPOSURE_TABLE, so it cannot resolve a cited("ai", "ast-graph")key against the exposure keys.resolve_devops_argv/CommandReferenceFinding.describe()already wrap this).ai_ast_graphwrites its graph.Searches run:
Sources:
Checked on 2026-11-06. A person decides what this means for the item. The check changes no label and closes no issue.
[-]feat(roadmap): the plan check resolves the devops commands that a plan cites[/-][+]feat(roadmap): Resolve devops commands and flags cited in a plan[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 61 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): the plan check resolves the devops commands that a plan citesfeat(roadmap): Resolve devops commands and flags cited in a planfeat(roadmap): resolve devops commands and flags cited in a plan
devops-cli-service commentedon Nov 9, 2026
Released in v0.97.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.97.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 01:02 UTC