Repository navigation
Description
Update 2026-11-26 (infra move): devops install-tools and tools_lock are deleted (#6555), so the CLI test, TQ2, S1, S3 and S4 no longer apply. The version read is version_finding in openspec/gate.py. Left: assert the full unreadable detail in the gate test, treat a nonzero exit as no version (C3), and check TQ3.
Problem Description
Depends on #5355.
The vetting of #5355 found that the new tests do not prove some branches of the version read. A mutant that deletes such a branch passes the tests. The items below come from the verdict (TQ1, TQ2, TQ3, C3, S1, S3, S4). The line numbers are at the head of #5355 (59486f86b).
Test gaps:
- TQ1. No CLI test and no gate test asserts the text that says the version cannot be read. A mutant that deletes the unreadable branch in
src/devops_cli/commands/install_tools.py:410-411or insrc/devops_cli/openspec/gate.py:117-123passes all 76 targeted tests. Without the branch, the check prints the "differs" line withNoneas the version. That line also names the path, and the check also exits 1, so the tests see no change. Also, the fake_record_npm(tests/commands/test_install_tools.py:412-461) always answers--versionwith exit 0 (line 431). Thus no CLI test proves the merged scenario "A command that prints no version fails the check", whose WHEN is "theopenspeccommand on PATH exits 1". - TQ2.
tests/tools_lock/test_versions.py:57-67gives the failing answer an empty stdout. Thus the ruleif result.returncode != 0: return (path, None)(src/devops_cli/tools_lock/versions.py:36-37) is not proven. A mutant that deletes the rule passes, because an empty stdout also gives no version line. - TQ3.
tests/openspec/test_openspec_gate.py:159-175asserts that the finding detail does not holdregenerate. This assertion proves nothing:missing_hintnever holdsregenerate, and the test edits no skill. Only the assertion onupdate --forceproves the early return.
Code nits in the same files:
- C3.
_version_finding(src/devops_cli/openspec/gate.py:114) reads only stdout and ignores the exit code ofopenspec --version.path_versionreads a nonzero exit as no version. The two readers must apply the same rule. - S1.
path_version(src/devops_cli/tools_lock/versions.py:35) runs--versionwith the default subprocess timeout of 1800 s and does not changesubprocess.TimeoutExpiredinto a domain error.OpenSpecTool.run(src/devops_cli/openspec/tool.py:66-84) usesDEFAULT_OPENSPEC_COMMAND_TIMEOUT_SECONDS(120 s) and raisesToolExecutionError. - S3.
path_versionpasses noCONST_OPENSPEC_OPT_OUT_ENV, and the isolated child environment dropsDO_NOT_TRACK,OPENSPEC_TELEMETRYandOPENSPEC_NO_UPDATE_CHECK. ADR 0010 sets the opt-outs on every run of the tool. Now no request goes out, becauseopenspec --versionexits before the telemetry hook of the tool. A later release of the tool can change this. - S4. The help text of
--only-missing(src/devops_cli/lang/en/help.py:2333-2336, and the generateddocs/commands/install-tools.md:15) says that the option installs each tool "whose command on PATH prints another version". The code reads the version ofopenspeconly (_version_state,src/devops_cli/commands/install_tools.py:392-400).
Reproduction Steps
- Check out the head of fix: install-tools --check passes an older openspec binary #5355, or
mainafter the merge. - Delete the
if version is Nonebranch atsrc/devops_cli/commands/install_tools.py:410-411. - Run
uv run pytest tests/commands/test_install_tools.py tests/openspec/test_openspec_gate.py tests/tools_lock/test_versions.py. - All tests pass.
- Do steps 2 to 4 again for
src/devops_cli/openspec/gate.py:117-123and forsrc/devops_cli/tools_lock/versions.py:36-37. All tests pass again.
Expected vs Actual Behavior
Expected: each branch of the version read has a test that fails when the branch is deleted. Both readers read a nonzero exit as no version. The version run has the timeout, the error type and the opt-outs of every other openspec run. The help text says that only the openspec version is read.
Actual: the mutants pass. The gate reads a version from a run that exits nonzero. The version run of path_version has a 1800 s timeout and no opt-outs. The help text says that the option reads the version of each tool.
Proposed Fix
- TQ1: Let
_record_npmanswer--versionwith an exit code that the test sets. Add a CLI test in whichopenspec --versionexits 1. Assert exit 1 and the fullMESSAGES.install.check_version_unreadableline. In the gate test, assert the fullMESSAGES.openspec.version_unreadabledetail. - TQ2: In
tests/tools_lock/test_versions.py:57-67, answer withProcessAnswer(returncode=1, stdout="1.17.0\n", stderr="boom\n"). - TQ3: Add a hand edit of a committed
SKILL.mdto the test attests/openspec/test_openspec_gate.py:159. Then theregenerateassertion proves the early return. - C3: In
_version_finding, read a nonzero exit as no version, aspath_versiondoes. One shared function insrc/devops_cli/tools_lock/versions.pycan hold the rule for both readers. - S1: Give the run in
path_versionthe timeoutDEFAULT_OPENSPEC_COMMAND_TIMEOUT_SECONDS. Changesubprocess.TimeoutExpiredintoToolExecutionError, asOpenSpecTool.rundoes. - S3: Pass
CONST_OPENSPEC_OPT_OUT_ENVin theenvargument of the version run. - S4: Change the help text to say that the option reads the version of the
openspeccommand on PATH only. Then runuv run devops docs generate.
Existing tool: pytest and the process_fake fixture cover the tests. No new tool is necessary.
Acceptance
- Each new test that proves a branch fails on the code before the fix. For a guard that exists already (the unreadable branches and the nonzero-exit rule), mutation evidence is sufficient: the test fails when the branch is deleted.
check_openspecgives the fullMESSAGES.openspec.version_unreadabledetail whenopenspec --versionexits 1, and a gate test proves it.uv run devops docs checkpasses.
Environment Diagnostics
- DevOps CLI Version: head of fix: install-tools --check passes an older openspec binary #5355 (
59486f86b), on 0.126.x - Python Version: 3.14.10
- OS & Architecture: Linux x86_64
- Execution Environment: DevContainer
Logs, Traces, or Terminal Output
# From the vetting verdict of #5355:
# A mutant that deletes the unreadable branches (install_tools.py:410-411, gate.py:117-123) passes all 76 tests.
# A mutant that deletes versions.py:36 passes, because the failing answer has an empty stdout.Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal keys are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Source: #5355
Alternatives check of 2026-11-26: not-applicable.
Class: test, no model call.
Tool: none found.
Proposed design
Problem statement
The OpenSpec gate tests do not prove the unreadable-version branch or the nonzero-exit rule. A mutant that deletes one branch passes all targeted tests. The regenerate assertion in the gate test proves nothing because the test edits no skill. The gate also reads a version from a run that exits nonzero.
Acceptance criteria
Requirement: Gate unreadable version detail
The OpenSpec gate MUST report the full MESSAGES.openspec.version_unreadable detail when openspec --version exits nonzero.
Scenario: Nonzero version exit in the gate
- WHEN a gate test runs
check_openspecand the fakeopenspec --versionexits 1. - THEN the
GateCheck.VERSIONfinding detail equals the formattedMESSAGES.openspec.version_unreadabletext.
Requirement: Gate reads nonzero exit as no version
version_finding MUST read a nonzero exit of openspec --version as no version.
Scenario: Gate nonzero exit with version output
- WHEN the
openspec --versionrun exits 1 and prints1.17.0to stdout. - THEN the gate reports the unreadable version finding, not the version-differs finding.
Requirement: Hand-edited skill proves early return
The gate test MUST hand-edit a committed SKILL.md so the regenerate assertion proves the early return.
Scenario: Hand-edited committed skill
- WHEN a gate test hand-edits a committed
SKILL.mdand runs the gate. - THEN the finding detail holds the pinned
openspec update --forcehint and does not holdregenerate.
Requirement: Mutation of guarded branches
Each new gate test MUST fail when its guarded branch is deleted.
Scenario: Deleted guarded branch
- WHEN the unreadable-version branch or the nonzero-exit rule in
src/devops_cli/openspec/gate.pyis deleted and the targeted pytest command runs. - THEN
uv run pytest tests/openspec/test_openspec_gate.pyfails.
Existing Tool Considered
The alternatives check in the issue body gives not-applicable and names no tool. The change extends the existing pytest tests and the OpenSpecFake. It builds no new tool.
Key questions
- Which function reads the
openspecversion in the current tree?:version_findinginsrc/devops_cli/openspec/gate.pyreads the version. The infra move deletedtools_lockand itspath_versionreader. [sources: src/devops_cli/openspec/gate.py] - Should
version_findingread a nonzero exit ofopenspec --versionas no version?: Yes. A nonzero exit gives no trustworthy version, so the gate reports the unreadable finding. Put the rule in the one version guard that serves check and regenerate. (best practice) [sources: src/devops_cli/openspec/gate.py]- Chosen: Treat a nonzero exit as no version. A failed run gives no trustworthy version, and its stdout may hold a stale or partial version.
- Rejected: Read stdout only. This is the defect C3 reports: the gate reads a version from a run that exits nonzero.
- Should the gate test hand-edit a committed
SKILL.md?: Yes. Add a hand edit of a committedSKILL.mdto the test attests/openspec/test_openspec_gate.py:159. Then theregenerateassertion proves the early return. (best practice) [sources: tests/openspec/test_openspec_gate.py:159]- Chosen: Hand-edit a committed
SKILL.md. The currentregenerateassertion passes with no edit and proves nothing. - Rejected: Keep the current assertion.
missing_hintnever holdsregenerate, so the assertion cannot prove the early return.
- Chosen: Hand-edit a committed
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both touch install-tools version reading, but #5107 fixes the check to read the binary version while the candidate adds tests for unreadable branches and aligns the two version readers.devops-cli-service commentedon Nov 17, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 2620fae (see proposed design in issue body).
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
chore(main): release 0.247.0 (#7752)
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC