Repository navigation
Description
Problem or Motivation
During OpenSpec stage planning for issue #3236 (PR #3248), the automated stage planner generated invalid command path tuples and non-existent CLI subcommands:
- It staged command tuples
("ai", "ast-graph")instead of("ai", "ast", "graph")and("gh", "pages-verify")instead of("gh", "pages", "verify"). - In
## Feasibility, it citeddevops ai ast-graph --helpanddevops gh pages-verify --helpas passing checks, when both fail on the real CLI withNo such command. - It referenced non-existent CLI option flags such as
--root_dirforgh pages verify, where the actual CLI flag is--dir.
The CLI already implements command tree resolution via resolve_click_command(path: tuple[str, ...]) in src/devops_cli/ai/mcp/generator.py and module_click_command in src/devops_cli/core/command_resolver.py.
However, stage_eval_gates.py and devops openspec check do not validate command path tuples or CLI command strings referenced in change proposals and tasks.
This allows hallucinated subcommands and command path keys to enter stage plans, blocking PR merge readiness until maintainer review finds the error.
Proposed Solution & Architectural Design
- In
src/devops_cli/roadmap/stage_eval_gates.pyanddevops openspec check, extract referenced command path tuples and CLI command invocations (devops <subcommand> ...). - Validate command path tuples against
resolve_click_command(path). When resolution raisesLookupError, fail the gate with a message naming the unknown subcommand. - Validate cited
devops <subcommand>CLI help commands against Click command resolution before accepting feasibility claims. - Add unit tests in
tests/roadmap/asserting that plans with invalid command path tuples or non-existent subcommands fail the stage validation gate.
Target Subsystem
src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/ai/mcp/generator.py
Existing Tool Considered
resolve_click_command in generator.py already resolves command tuples against Click command trees. Reusing it in stage evaluation gates prevents hallucinated command paths without external dependencies. Cost to build: about 5,000 tokens and 30 minutes.
Proposed design
Problem statement
placeholder
Acceptance criteria
Existing Tool Considered
placeholder
Key questions
None.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
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.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.It blocks invalid plans from entering review but does not break a running feature.It removes manual review of hallucinated subcommands and saves maintainer time on every stage plan.The body estimates 30 minutes for the core gate plus unit tests in tests/roadmap/.Both add validation in stage gates that referenced items exist, but 3010 checks file paths on disk while the candidate checks CLI command tuples against the Click tree.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.
dan-petty commentedon Nov 4, 2026
This is a duplicate of #3302. Both issues report the same defect from PR #3248, and they were filed 9 minutes apart. Intake flagged no link between them.
What moved, in the section
Scope from #3299of #3302: the--root_diragainst--dircase, the location incheck_proposaland the replay, the decision ondevops openspec check, theLookupErrorfailure text, the tests, and the existing-tool text withmodule_click_commandand its cost.Proof: both issues cite
ai ast-graphandgh pages-verifyfrom PR #3248. A search ofsrc/devops_cli/roadmap,src/devops_cli/openspecandcommands/openspec.pyfinds no use ofresolve_click_commandormodule_click_command, so the need stays open in #3302. This item has no change folder, no open pull request and no parent issue.