Repository navigation
Description
Problem
uv run devops openspec archive <change> can print Archived <change>. Every spec and change validates. and move nothing. An agent reported this on 2026-11-09 in the worktree of #4257. The command worked in two other worktrees. The agent then ran openspec archive <change> --yes by hand and filed no issue.
The wrapper decides success from exit codes only. archive_change in src/devops_cli/openspec/archive.py runs openspec archive <change> --yes, then openspec validate --all --strict. It raises only when returncode != 0. It never checks that the change folder is gone or that openspec/changes/archive/<date>-<change>/ exists. So any run where openspec exits 0 and moves nothing gives a false Archived.
Evidence (command output, 2026-11-09, checkout of main):
uv run devops openspec archive no-such-change-zzexits 1 and says the change is not found. This is correct.uv run devops --dry-run openspec archive no-such-change-zzexits 0 and printsArchived no-such-change-zz. Every spec and change validates.The change does not exist.DEVOPS_CLI_DRY_RUN=1 uv run devops openspec archive no-such-change-zzprints the same.
Cause found: in dry-run mode, run_subprocess does not start the process. It returns a PlannedProcessResult with returncode=0 (src/devops_cli/core/process.py). OpenSpecTool.run passes quiet=True, so the planned command is not printed either. Both calls "pass", and the command prints Archived. A shell that has DEVOPS_CLI_DRY_RUN set, or an agent that passes --dry-run, hits this. I could not read the environment of the worktree of #4257, so this is the only path I found that matches the report; it is not proven to be that run.
I also read core/archive.js of the pinned OpenSpec 1.14.3. Its abort paths (validation failed, rebuilt spec invalid) set process.exitCode = 1, so they do not give exit 0. The no-move case is therefore not an OpenSpec defect in this version. I reproduced a normal archive in a throwaway worktree of the commit before 04839499: the wrapper moved the folder and updated the spec. So the wrapper is correct only when the process really runs.
Expected
After the archive command exits 0, the wrapper checks the result on disk before it prints Archived:
- the source folder
openspec/changes/<change>/does not exist, and - one folder
openspec/changes/archive/*-<change>exists.
If a check fails, the wrapper prints the reason, exits non-zero, and does not print Archived.
In dry-run mode the wrapper starts no process and does not print Archived. It prints the commands it would run and says Would archive <change>.
Acceptance criteria
Each command FAILS today and passes after the fix.
uv run devops ci test tests/openspec/test_openspec_archive.py::test_archive_fails_when_the_tool_exits_zero_and_moves_nothing- a fakeopenspecthat exits 0 and moves nothing makesarchive_changeraiseToolExecutionErrorthat names the change and the folder that is still there. Today it returns without an error.uv run devops ci test tests/openspec/test_openspec_archive.py::test_archive_fails_when_no_archive_folder_exists- a fakeopenspecthat removes the source and creates no archive folder makesarchive_changeraise.uv run devops ci test tests/openspec/test_openspec_archive.py::test_archive_succeeds_when_the_folder_moved- a fakeopenspecthat moves the folder makesarchive_changereturn. This test passes today and must keep passing.uv run devops ci test tests/openspec/test_openspec_archive.py::test_archive_in_dry_run_does_not_report_archived- withDEVOPS_CLI_DRY_RUN=1, thearchivecommand printsWould archiveand does not printArchived. Today it printsArchived.
Existing tool considered
openspec archive --json (pinned 1.14.3) returns the archive result as JSON, with the archive path. The wrapper can read the path from it instead of the text output. Even so, a check of the destination on disk is needed, because the failure is that the process did not run. No other open tool covers this. The fix is a small check in archive_change.
Cost
About 20 lines of code and 4 tests. Build: about 15k tokens, 30 minutes. Keep: low; no new dependency. Fix: low. No cost to skip the check is acceptable: a false Archived sends a pull request on without its archive commit, and devops openspec check may then fail late in CI.
Related
- feat(openspec): scaffold OpenSpec and gate its change folders in devops ci #1844 added OpenSpec and its gate.
src/devops_cli/openspec/archive.py,src/devops_cli/openspec/tool.py,src/devops_cli/core/process.py.
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 command reports success while doing nothing, which misleads agents, but it is an edge case in dry-run or a specific environment.Agents and users trust the archive output; a false success breaks downstream workflows.The fix needs disk checks after execution, a dry-run branch, and four new tests, all in one module.Both items manage openspec change folders, but #3203 scaffolds a new folder while the candidate verifies the archive move.devops-cli-service commentedon Nov 9, 2026
Released in v0.103.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.103.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 21:51 UTC