Skip to content

fix(roadmap): stage verifies command paths in CLI tree #3299

Closed as not planned

Description

@dan-petty

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:

  1. It staged command tuples ("ai", "ast-graph") instead of ("ai", "ast", "graph") and ("gh", "pages-verify") instead of ("gh", "pages", "verify").
  2. In ## Feasibility, it cited devops ai ast-graph --help and devops gh pages-verify --help as passing checks, when both fail on the real CLI with No such command.
  3. It referenced non-existent CLI option flags such as --root_dir for gh 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

  1. In src/devops_cli/roadmap/stage_eval_gates.py and devops openspec check, extract referenced command path tuples and CLI command invocations (devops <subcommand> ...).
  2. Validate command path tuples against resolve_click_command(path). When resolution raises LookupError, fail the gate with a message naming the unknown subcommand.
  3. Validate cited devops <subcommand> CLI help commands against Click command resolution before accepting feasibility claims.
  4. 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

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. dan-petty commented on Nov 2, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It blocks invalid plans from entering review but does not break a running feature.
    • Value: Medium. It removes manual review of hallucinated subcommands and saves maintainer time on every stage plan.
    • Effort: Medium. The body estimates 30 minutes for the core gate plus unit tests in tests/roadmap/.
    • Related: fix(roadmap): the stage job refuses a plan that names a path that does not exist #3010, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 2, 2026
  4. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    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.

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  5. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    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 #3299 of #3302: the --root_dir against --dir case, the location in check_proposal and the replay, the decision on devops openspec check, the LookupError failure text, the tests, and the existing-tool text with module_click_command and its cost.

    Proof: both issues cite ai ast-graph and gh pages-verify from PR #3248. A search of src/devops_cli/roadmap, src/devops_cli/openspec and commands/openspec.py finds no use of resolve_click_command or module_click_command, so the need stays open in #3302. This item has no change folder, no open pull request and no parent issue.

  6. removed
    status/new
    on Nov 4, 2026
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/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions