Repository navigation
Description
Problem
uv run devops --dry-run openspec check prints openspec list --json failed with exit code 0: not JSON: and exits 1 (seen 2026-11-09 on a checkout of main). In a dry run, run_subprocess starts no process and returns exit code 0 with empty output. The gate reads that empty output as the answer of the tool, so it fails with a message that points at the tool, not at the dry run. The cause is the same as in #4270 (archive).
Expected
In a dry run, devops openspec check starts no process, lists the openspec commands the gate would run, and says that it would run the gate. It does not read the output of a planned process.
Acceptance criteria
uv run devops ci test tests/openspec/test_openspec_gate.py::test_check_in_dry_run_lists_the_commands- withDEVOPS_CLI_DRY_RUN=1,devops openspec checkexits 0, prints the plannedopenspeccommands, and starts no process. Today it exits 1 withnot JSON.
Existing tool considered
render_request_plan and PlannedRequest (src/devops_cli/dry_run/requests.py) give the plan output. #4270 uses them for archive. No new tool is needed.
Related
Proposed design
Problem statement
In a dry run, devops openspec check reads the empty output of a planned process as the answer of the openspec tool. It then fails with openspec list --json failed with exit code 0: not JSON: and exits 1. The message points at the tool, not at the dry run. A dry run must start no process, list the planned openspec commands, and exit 0.
Acceptance criteria
Requirement: Dry run lists the gate commands
In a dry run, devops openspec check SHALL start no process, print the openspec commands that the gate would run in order, and exit 0.
Scenario: check_in_dry_run_lists_the_commands
- WHEN
devops openspec checkruns withDEVOPS_CLI_DRY_RUN=1on a tree with no change and no spec - THEN The exit code is 0, the output lists the planned
openspeccommands, and the process runner starts no process.
Requirement: Dry run reads no planned output
In a dry run, the gate MUST NOT parse the output of a planned process, so the command MUST NOT print not JSON.
Scenario: dry_run_prints_no_not_json_error
- WHEN
devops openspec checkruns withDEVOPS_CLI_DRY_RUN=1 - THEN The output holds no
not JSONtext and nofailed with exit codetext.
Requirement: Dry run says the gate would run
In a dry run, devops openspec check SHALL state that it would run the gate.
Scenario: dry_run_states_the_intent
- WHEN
devops openspec checkruns withDEVOPS_CLI_DRY_RUN=1 - THEN The output holds a line that says the gate would run, after the list of planned commands.
Requirement: Real run is unchanged
Outside a dry run, check_openspec SHALL run the same commands and report the same findings as before the change.
Scenario: real_run_keeps_the_command_list
- WHEN
check_openspecruns on the empty tree with theopenspec_fake - THEN The findings are empty and the recorded commands equal
EMPTY_TREE_COMMANDS.
Existing Tool Considered
render_request_plan and PlannedRequest in src/devops_cli/dry_run/requests.py give the plan output, and #4270 uses them for archive. No new tool or library is needed. The change adds a small plan function for the gate commands. The cost is low: one plan function, one branch in the command, and two tests.
Key questions
- How does the command know that it runs in a dry run?: Use the same dry-run check that the other commands use, such as the one in
src/devops_cli/dry_run/state.py, in thecheckcommand ofsrc/devops_cli/commands/openspec.py. Follow the pattern that fix(openspec): archive reports success and moves nothing #4270 sets forarchive. [sources: src/devops_cli/dry_run/state.py, src/devops_cli/commands/openspec.py] - Where does the dry-run branch go: in the command, or in
check_openspec?: Put the branch in the command insrc/devops_cli/commands/openspec.py. It builds a list ofPlannedRequestentries and prints them withrender_request_plan.check_openspeckeeps its code for real runs. (best practice) [sources: src/devops_cli/dry_run/requests.py, src/devops_cli/commands/openspec.py, openspec/changes/archive/2026-10-27-2341-worktrees-prune-merged-pr/design.md]- Chosen: Branch in the command, plan with render_request_plan. It follows the dry-run rule (feat(cli): reachable
--dry-runpreviews for delegated commands #412) and the layout of fix(openspec): archive reports success and moves nothing #4270. The gate code stays unchanged. - Rejected: Make
check_openspecskip parsing when the runner is planned. The gate would still need the output of later steps, such as the change list, to decide which commands to run. It would also print a half result.
- Chosen: Branch in the command, plan with render_request_plan. It follows the dry-run rule (feat(cli): reachable
- Which commands does the dry run list?: List the fixed commands that the gate runs over a tree with no change: the four
config setcommands,list --json, the twovalidatecommands,update --force,new change gate-probeand the fiveinstructionscommands. A command that depends on the output of an earlier one carries acondition, for example the validation of one change. Each command has the isolated environment variables asenvwith a placeholder for the scratch directory. (best practice) [sources: tests/openspec/test_openspec_gate.py, src/devops_cli/dry_run/requests.py]- Chosen: List the fixed commands, mark the data-dependent ones with
condition. The dry-run rule says that a request that runs only after an earlier one names that incondition. - Rejected: List only the first command. The expected result says that the plan lists the commands the gate would run.
- Chosen: List the fixed commands, mark the data-dependent ones with
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-10: none.
Tool: none found.
Activity
dan-petty commentedon Nov 9, 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.(openspec)scope of the title gives the scope.A functional bug in dry-run mode that misreports a failure; not a data-loss or security issue.Users who preview openspec check in dry run get a false error and cannot verify the planned commands.The body states no new tool is needed and the fix mirrors the pattern already used for archive in #4270.Both fix the same dry-run root cause in openspec subcommands but target different commands (check vs archive).devops-cli-service commentedon Nov 9, 2026
Status set to Ready at cefc184 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: The searches found no external tool or library for planning subprocess commands in a dry run; they returned only unrelated MDN pages. The issue is an in-repo defect: the
checkcommand ofsrc/devops_cli/commands/openspec.pymust branch on the existing dry-run state and print the gate'sopenspeccommands with the repository's ownrender_request_plan/PlannedRequest, which the issue already names as the intended means, so no third-party tool covers the need.Tool: none found
Lacks:
Searches run:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 12, 2026
Released in v0.116.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.116.2
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 06:05 UTC