Repository navigation
Description
Problem or Motivation
When a change adds a new CLI command under src/devops_cli/commands/, the project requires multiple companion registrations across contracts and tests:
- Dry-run classification in
command-dry-run-classspecification and corresponding command dry-run test callbacks (e.g.PR_COMMAND_CALLBACKSintests/commands/test_pr_dry_run.py). - MCP exposure entry in
CONST_MCP_EXPOSURE_TABLE(src/devops_cli/config/constants.py) or MCP exclusion entry intests/ai/mcp/test_mcp.pyto preventtest_all_cli_commands_are_either_exposed_or_excludedfailures. - Generated CLI documentation (
docs/CLI_REFERENCE.mdanddocs/commands/<family>.md).
In PR #3237 (issue #3199), the automated stage plan added devops pr evidence but omitted all companion registrations and dry-run spec updates.
check_proposal has no rule enforcing that a plan adding a CLI command includes tasks for dry-run classification, MCP registry/exclusion, and generated command documentation.
Proposed Solution & Architectural Design
- In
src/devops_cli/roadmap/stage_change.pyorstage_eval_gates.py, detect when a plan's task groups add a new CLI command tosrc/devops_cli/commands/. - Verify that the plan includes:
- A spec delta for
command-dry-run-classassigning the command's dry-run class. - Tasks modifying
CONST_MCP_EXPOSURE_TABLEortests/ai/mcp/test_mcp.py. - Tasks running
uv run devops docs generate --sync-readmeand verifyinguv run devops ci docs.
- A spec delta for
- Provide actionable feedback to the stage model during planning if any companion registrations are missing.
- Add unit tests in
tests/roadmap/asserting that plans adding CLI commands must include companion dry-run and MCP tasks.
Target Subsystem
src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/roadmap/stage_change.py
Existing Tool Considered
check_proposal in stage_eval_gates.py already checks group forms and spec deltas. Extending it with command addition checks prevents missing companion registrations without adding external dependencies. Cost to build: about 6,000 tokens and 45 minutes.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Proposed design
Problem statement
A stage plan can add a new CLI command and leave out the registrations that the project requires for it. The dry-run class, the dry-run test callback, the MCP exposure or exclusion, and the generated documentation each fail a check after the merge. check_proposal in src/devops_cli/roadmap/stage_change.py already returns the plan problems to the stage model, and it holds no rule for these companion registrations. This change adds that rule there, with unit tests in tests/roadmap/.
Acceptance criteria
Requirement: New command detection
The stage proposal check SHALL report a devops command that a task group names and that the command tree at the staged commit does not hold.
Scenario: New subcommand in an existing module
- WHEN A plan task says
Add devops pr evidence to src/devops_cli/commands/pr.pyand the staged tree holds nopr evidencecommand. - THEN
check_proposalreturns a finding that namespr evidenceand its task group.
Requirement: No finding for an existing command
The stage proposal check SHALL NOT report a companion registration finding for a task group that names only commands that the staged tree holds.
Scenario: Edit of an existing command
- WHEN A plan task changes the help text of
devops pr listand names no new command. - THEN
check_proposalreturns no companion registration finding.
Requirement: Dry-run class delta
The stage proposal check SHALL refuse a plan that adds a CLI command without a command-dry-run-class spec delta entry for that command.
Scenario: Missing dry-run class
- WHEN A plan adds
devops pr evidenceand its spec deltas hold nocommand-dry-run-classentry forpr evidence. - THEN The finding states that the plan must add the dry-run class of
pr evidencetocommand-dry-run-class.
Requirement: Dry-run callback
The stage proposal check SHALL require a task that adds the new command to the dry-run callback table of its family.
Scenario: Missing dry-run callback
- WHEN A plan adds
devops pr evidenceand no task modifiesPR_COMMAND_CALLBACKSintests/commands/test_pr_dry_run.py. - THEN The finding names
tests/commands/test_pr_dry_run.pyand the missing callback entry.
Requirement: MCP exposure or exclusion
The stage proposal check SHALL require a task that adds the new command to CONST_MCP_EXPOSURE_TABLE or records its exclusion in tests/ai/mcp/test_mcp.py.
Scenario: Missing MCP registration
- WHEN A plan adds
devops pr evidenceand no task modifiesCONST_MCP_EXPOSURE_TABLEortests/ai/mcp/test_mcp.py. - THEN The finding states that the plan must expose
pr evidenceor record its exclusion.
Requirement: Generated documentation
The stage proposal check SHALL require a task for uv run devops docs generate --sync-readme and a task for uv run devops ci docs when a plan adds a CLI command.
Scenario: Missing documentation tasks
- WHEN A plan adds
devops pr evidenceand its tasks omit one of the two documentation commands. - THEN The finding names each missing documentation command.
Requirement: One actionable report
The stage proposal check SHALL report all missing companion registrations of a new CLI command in one finding list.
Scenario: Several missing registrations
- WHEN A plan adds
devops pr evidenceand misses the dry-run class, the MCP entry and both documentation commands. - THEN One finding list names the dry-run class, the MCP entry and both documentation commands.
Requirement: Unit test coverage
The roadmap test suite SHALL hold unit tests for a plan that adds a CLI command with and without its companion registrations.
Scenario: Complete companion plan
- WHEN A test plan adds
devops pr evidencewith its dry-run class, dry-run callback, MCP entry and both documentation tasks. - THEN
check_proposalreturns no finding for a missing companion registration.
Existing Tool Considered
No open, maintained tool or library covers this need. The rule reads the plan form of this project, CONST_MCP_EXPOSURE_TABLE and the dry-run callback tables of this project, so no external code answers it. The change extends check_proposal in src/devops_cli/roadmap/stage_change.py (line 593) and its gate in src/devops_cli/roadmap/stage_eval_gates.py. Written cost to build, keep and fix that code: about 6,000 tokens and 45 minutes of elapsed time.
Key questions
- Does the premise of this item hold at the staging commit: does
check_proposallack a rule that requires the companion registrations of a new CLI command?: Yes.check_proposalatsrc/devops_cli/roadmap/stage_change.py:593returns only the spec-delta problems, the content problems, the group form, the path problems, the what-changes problems, the move-prefix and move-verify problems, the search problems, the criteria problems and the overlap problems (lines 615-624). It holds no check for a new CLI command and none for the dry-run class, the dry-run callback, the MCP entry or the generated documentation. The premise holds, and theplaceholderline of the stage return is no evidence at all. [sources: src/devops_cli/roadmap/stage_change.py:593, src/devops_cli/roadmap/stage_change.py:615] - Which inputs does
check_proposalreceive, and does one of them give the command tree at the staged commit?: It receives the proposal, the known capability names, theStagedTreeof the staging commit and the keyword inputsrequirements,issue_body,probes,overlapsandsearch_evidence(src/devops_cli/roadmap/stage_change.py:593). None gives the command tree:StagedTreeholds only the tracked file paths of the commit as afrozenset, with the folders, suffixes and file names above them (src/devops_cli/roadmap/stage_paths.py:76), and it holds no file text and no command name. So the check must take the command paths from the command registry that the job already imports,_COMMAND_SPECSofsrc/devops_cli/main.py:38, and match thedevopscommand that a task group names against it; the tree tells only whether a task touchessrc/devops_cli/commands/. [sources: src/devops_cli/roadmap/stage_change.py:593, src/devops_cli/roadmap/stage_paths.py:76, src/devops_cli/main.py:38] - Which defect type of the roadmap-stage spec does a companion registration finding take?: No new defect type and no new gate: the finding is one more problem of the
pathsgate, which catchesmissing_path._path_gatecallscheck_proposalandGATESmapsGateName.PATHStoDefectType.MISSING_PATH(src/devops_cli/roadmap/stage_eval_gates.py:155,src/devops_cli/roadmap/stage_eval_gates.py:191), and a prior change that added a rule tocheck_proposalrecorded the same choice (openspec/changes/3344-the-stage-probe-checks-client-model/design.md:10). The nine types of the verification pass stay as they are. (best practice) [sources: src/devops_cli/roadmap/stage_eval_gates.py:155, src/devops_cli/roadmap/stage_eval_gates.py:191, openspec/changes/3344-the-stage-probe-checks-client-model/design.md:10]- Chosen: Report it through the existing
pathsgate asmissing_path. The rule runs incheck_proposal, which the replay judges with thepathsgate, and that gate catchesmissing_path; the finding is a missing companion registration, which is a missing path. - Rejected: Add a new defect type and a new gate. It changes the nine-type schema, the verification prompt and the eval cases for a rule that the
pathsgate already judges.
- Chosen: Report it through the existing
- Where should the check for companion registrations live?: Extend
check_proposalinsrc/devops_cli/roadmap/stage_change.py, beside the other proposal rules thatsrc/devops_cli/roadmap/stage_eval_gates.py:161andsrc/devops_cli/roadmap/stage.py:948both call. Its findings reach the stage model. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:593, src/devops_cli/roadmap/stage_eval_gates.py:161, src/devops_cli/roadmap/stage.py:948]- Chosen: Extend check_proposal. It already checks group forms and spec deltas, and both the job and the replay reach it.
- Rejected: Add the rule to stage_change.py outside check_proposal.
check_proposalis the one place that both callers reach, and a rule outside it would run in neither the replay nor the job's gate. - Rejected: Add a separate validation module. It splits related rules and adds a second call path.
- How should the check identify a new CLI command?: Take each
devopscommand that a task of a group touchingsrc/devops_cli/commands/names, and match it against_COMMAND_SPECSofsrc/devops_cli/main.py:38, which holds the command groups that the app registers. A command that the registry lacks is new. TheStagedTreegives no command name, so the registry is the reference. (best practice) [sources: src/devops_cli/main.py:38, src/devops_cli/roadmap/stage_paths.py:76, src/devops_cli/roadmap/stage_change.py:593]- Chosen: Compare task-text commands with
_COMMAND_SPECS. It catches a new subcommand in an existing module, and_COMMAND_SPECSis the registry that the app and the dry-run ratchet already use. - Rejected: Treat every task group that touches commands/ as a new command. It reports edits and refactors as new commands.
- Rejected: Require a new plan field for new commands. It changes the plan schema and the prompt for a check that can use the existing task text.
- Chosen: Compare task-text commands with
- Should a missing companion registration stop the plan or only warn?: Stop the plan.
check_proposalreturns a finding, and the stage model must correct the plan before it proceeds. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:593, src/devops_cli/roadmap/stage.py:948]- Chosen: Stop the plan. The missing registration breaks tests and generated documentation after the merge.
- Rejected: Warn only. A warning does not prevent the known failure.
- Rejected: Stop only after the first plan. It adds a second path for the same rule.
- Which MCP registration should the check accept?: Accept either an entry in
CONST_MCP_EXPOSURE_TABLEor an exclusion intests/ai/mcp/test_mcp.py. (best practice) [sources: src/devops_cli/config/constants.py, tests/ai/mcp/test_mcp.py]- Chosen: Exposure table or exclusion test. The existing test requires every CLI command to be exposed or excluded.
- Rejected: Exposure table only. Not every command is safe or useful to expose through MCP.
- Rejected: Exclusion test only. An exposed command needs its table entry with timeout and read-only flags.
- Which dry-run evidence should the check require?: Require both a
command-dry-run-classspec delta and an entry in the dry-run test callback table of the command family. (best practice) [sources: tests/commands/test_pr_dry_run.py, tests/invariants/test_dry_run_class_ratchet.py]- Chosen: Spec delta and test callback. The spec assigns the class and the callback test enforces it.
- Rejected: Spec delta only. It does not prove that the command callback declares the class.
- Rejected: Test callback only. It leaves the dry-run class undefined in the specification.
- Which documentation tasks should the check require?: Require
uv run devops docs generate --sync-readmeanduv run devops ci docs. (best practice) [sources: docs/CLI_REFERENCE.md, src/devops_cli/config/constants.py]- Chosen: Generate and CI check. The generate command writes the reference and the CI command verifies the generated documents.
- Rejected: Generate only. It does not verify that the generated documents pass the docs gate.
- Rejected: CI check only. It does not regenerate the reference after the command change.
- Which test enforces MCP exposure or exclusion for every CLI command?:
test_all_cli_commands_are_either_exposed_or_excludedintests/ai/mcp/test_mcp.py. [sources: tests/ai/mcp/test_mcp.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: none.
Tool: none found.
Activity
devops-cli-service commentedon Nov 3, 2026
Status set to Ready at fc16309 (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
5 remaining items
docs(openspec): plan #3296 Require a new command's companion registra…
devops-cli-service commentedon Nov 8, 2026
Stopped at group 1.
Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.Reason:
Last message of the agent (a claim that no check verified): The callback is satisfied by the verify command. Let me make the tests name the callback as work, and keep the sample verify.
The job discarded this work. The diff is cut to 20000 characters. Read it before you retry:
The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.The push of the commits that passed failed too.
GitHub did not open the draft pull request of
feat/3296-check-new-commands-register-dry-run: GitHub refused POST /repos/dan-petty/devops-cli/pulls (HTTP 422): Validation Failed: 'No commits between main and feat/3296-check-new-commands-register-dry-run'. The job removed the branch from origin.devops-cli-service commentedon Nov 8, 2026
The runner Job devops-cli-runner-20261108-035237-9613 ended: succeeded.
Image digest: sha256:df15d6fee1e08fa36b689fb1856024f5229f204279d65d0ca78c5a680e1732cc
The last lines of its log:
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30). This item adds or extends a hand-written gate, refusal, context block or plan-shape rule of the stage or implement job. #6519 found that 263 of about 900 issues in four weeks added gates and none replaced the engine; stage now runs on stock Coder, where the agent reads the repository itself and runs the OpenSpec checks in its loop. The code paths that this item names have also moved (for example
src/devops_cli/roadmap/stage/stage_change.py). If the failure class still shows in graded attempts (plan_defect), file a new item from that evidence. Closed as not planned.