Repository navigation
Description
Problem Description
devops ci fail-to-pass checks out the merge base and puts the whole tests/ tree of the head on it. Thus a fix whose cause is in tests/support/ (or in another file under tests/ that is not a test_*.py file) gets its fixed support code on the base too. The changed tests then pass on the base, and the replay exits 1, also when the tests fail on the real base. AGENTS.md rule 4 tells each fix pull request to cite this run, so the author must write the proof by hand.
Reproduction Steps
- Check out PR fix(tests): refuse test writes under the real home #4857 (a fix of the hermetic floor in
tests/support/, with no change undersrc/). - Run
uv run devops ci fail-to-pass --base origin/main. - The command exits 1:
0 failed on base (0 failed and 27 passed in tests/invariants/test_hermetic_floor.py; 0 errored). - Run the same tests with the base versions of the changed
tests/support/files:3 failed.
Expected vs Actual Behavior
Expected: the replay shows the three new tests as failed on base, because the base holds the defect.
Actual: the replay runs the fixed support code on the base, and the new tests pass there.
Proposed Fix
Replay the base versions of the changed files under tests/ that are neither a changed tests/**/test_*.py file nor a changed check module of tests/gate/<row>_checks/, and keep the head versions of those two kinds. A changed test that needs a new helper of the head then cannot be collected on the base, which is reported as errored, so the design must name how a fix that adds a helper and fixes a helper proves itself.
Environment Diagnostics
Reported in a comment of #4554 by the agent of #4739. #4554 adds the gate check replay and keeps the overlay of the head's tests/ tree, because the check modules of the head must run against the base manifests.
Source: #4554
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found only SWE-bench-style evaluation harnesses and container images; they apply the whole test patch, support files included, to the base commit, which is the same defect. No tool classifies changed tests/ files or replays base support versions.
Lacks:
- Classifies changed files under tests/ into test, check and support modules
- Writes base version of changed support modules and conftest files
- Keeps head version of changed test and gate check modules
- Reports an uncollectable changed test as errored and names its file
Proposed design
Problem statement
devops ci fail-to-pass checks out the merge base and puts the whole tests/ tree of the head on it. A fix whose cause is in tests/support/ or tests/conftest.py then gets its fixed support code on the base. The changed tests pass on the base, the command exits 1, and the author writes the proof by hand. The command must replay the base versions of the changed support files and keep the head versions of the changed test modules and gate check modules. The replay runs only when the fix changes a src/ module or a tests/gate/ file, and it keeps the merged rule that a changed test which errors on the base proves the fix.
Acceptance criteria
Requirement: A changed support file takes the base version
The replay SHALL write the base version of each changed file under tests/ that is neither a tests/**/test_*.py module nor a module directly under tests/gate/<row>_checks/, when the base holds that path.
Scenario: Changed support module
- WHEN The changed files hold
src/devops_cli/ci/fail_to_pass.pyandtests/support/base_replay.py, and the base holdstests/support/base_replay.py. - THEN The base worktree holds the base version of
tests/support/base_replay.pywhen pytest starts.
Requirement: A changed test module keeps the head version
The replay SHALL keep the head version of each changed tests/**/test_*.py file.
Scenario: Changed test module
- WHEN The changed files hold
src/devops_cli/ci/fail_to_pass.pyandtests/ci/test_fail_to_pass.py. - THEN The base worktree holds the head version of
tests/ci/test_fail_to_pass.pywhen pytest runs.
Requirement: A changed gate check module keeps the head version
The replay SHALL keep the head version of each changed module directly under a tests/gate/<row>_checks/ folder, other than __init__.py.
Scenario: Changed check module
- WHEN The changed files hold a module directly under a
tests/gate/<row>_checks/folder. - THEN The base worktree holds the head version of that module when its gate row runs.
Requirement: A changed tests conftest takes the base version
The replay SHALL write the base version of a changed tests/conftest.py when the base holds that path.
Scenario: Changed tests conftest
- WHEN The changed files hold
src/devops_cli/ci/fail_to_pass.pyandtests/conftest.py. - THEN The base worktree holds the base version of
tests/conftest.pywhen pytest starts.
Requirement: A support file that the base lacks keeps the head version
The replay SHALL keep the head version of each changed file under tests/ that the base does not hold.
Scenario: Added helper module
- WHEN The head adds
tests/support/new_helper.pyand the base holds no such path. - THEN The base worktree holds the head version of
tests/support/new_helper.pywhen pytest runs.
Requirement: A support file that the head deletes stays at its base version
The replay SHALL leave the base version of each file under tests/ that the head deletes.
Scenario: Deleted helper module
- WHEN The head deletes
tests/support/old_helper.pyand the base holds that path. - THEN The base worktree still holds
tests/support/old_helper.pywhen pytest runs.
Requirement: The dry run lists the base support file reads
The dry run SHALL list each git read of the base version of a changed support file and SHALL start no process.
Scenario: A dry run of a support file fix
- WHEN
uv run devops ci fail-to-pass --dry-runruns for a fix that changessrc/devops_cli/ci/fail_to_pass.pyandtests/support/bootstrap.py. - THEN The plan lists a git request that reads the base version of
tests/support/bootstrap.py, and the process fake records no call.
Requirement: The report names a changed test that errors on the base
The replay SHALL count a changed test that it cannot collect on the base as errored and SHALL name its file in the report.
Scenario: A changed test that needs a head-only name
- WHEN The replay writes the base version of a changed support file, and a changed test imports a name that only the head version of that file holds.
- THEN The report prints
errored on basefor that changed test file, and the summary counts one errored test.
Requirement: The contributing guide states the base support file rule
CONTRIBUTING.md SHALL state that the replay writes the base version of each changed support file under tests/ and keeps the head version of each changed test module and check module.
Scenario: The guide after the change
- WHEN The fail-to-pass section of
CONTRIBUTING.mdis read. - THEN It says that a changed
tests/conftest.pyortests/support/module is replayed at its base version, and that a new helper goes in a new file or in the changed test file.
Existing Tool Considered
The alternatives check of 2026-11-27 in the issue body records the verdict none, with no tool found. Its block lists what a tool lacks. The change builds the classification of the changed files and the overlay in devops ci fail-to-pass. Written cost: about 2,000 tokens to build, about 1,000 tokens to keep, about 500 tokens per fix, and about 2 hours of elapsed time.
Key questions
- Which changed files under
tests/must come from the base, and which must come from the head?: The base version of every changed file undertests/that is neither atests/**/test_*.pymodule nor a module directly undertests/gate/<row>_checks/, when the base holds that path. The head version of each changed test module, each changed check module, and each changed support file that the base does not hold. A file that the head deletes stays at its base version. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py, tests/ci/test_fail_to_pass.py, tests/conftest.py, openspec/specs/ci-fail-to-pass/spec.md, CONTRIBUTING.md]- Chosen: Base version of every changed file under
tests/except test modules and check modules. pytest loads conftest and support modules from the tree, so the base tree must hold their base versions to show the defect. - Rejected: Base version of changed
tests/support/files only. A fix intests/conftest.pyalone stays on the base. - Rejected: Keep the whole head
tests/tree on the base. That is the defect: the fixed support code lands on the base and the changed tests pass there. - Rejected: Base version of every changed file under
tests/, test modules included. The changed test module must be the head version, else the replay runs no new test.
- Chosen: Base version of every changed file under
- How does the base support-file replay interact with the merged collection-error proof of fix(ci): count a test that errors on base as fail-to-pass proof #6372 and fix(ci): finish the fail-to-pass error rule of #6379 #6400?: The replay keeps the merged rule that a changed test which errors on the base proves the fix, from
TestCaseOutcome.proves_fixinsrc/devops_cli/ci/fail_to_pass.py:146and the spec requirementA changed test that errors on base proves the fix. The overlay writes the base version of the changed support files and keeps the head version of the changed test and check modules. A changed test that needs a new helper of the head takes it from a new support file that the base does not hold, or from the changed test file. The report still names each errored changed test. (best practice) [sources: openspec/specs/ci-fail-to-pass/spec.md, src/devops_cli/ci/fail_to_pass.py:146, tests/ci/test_fail_to_pass.py:949]- Chosen: Keep the merged rule: a changed test that errors on the base proves the fix. The spec holds that requirement since fix(ci): count a test that errors on base as fail-to-pass proof #6372 and fix(ci): finish the fail-to-pass error rule of #6379 #6400, so this item must not contradict it.
- Rejected: Refuse the replay when a changed test errors on the base. It contradicts the merged requirement, and the earlier try was returned for that reason.
- Rejected: Ask a person to change the spec. The spec records the project decision, so the design follows it and asks no person.
- Does the replay run for a fix that changes no
src/module and notests/gate/file?: No. The replay runs only when the fix changes a.pyfile undersrc/or a file undertests/gate/. A puretests/support/ortests/conftest.pyfix replays nothing and needs no failing proof. The base support-file replay applies only to a fix that also changessrc/code or atests/gate/file. [sources: openspec/specs/ci-fail-to-pass/spec.md, src/devops_cli/ci/fail_to_pass.py] - When does
devops ci fail-to-passexit 0?: It exits 0 when the report is satisfied: no replay could not run, no head replay could not run, no failure carries the host path guard message, no unchanged test fails on the base, no gate row refuses, and at least one changed test fails or errors on the base, or a case of a changed gate check fails on the base and passes on the head. [sources: src/devops_cli/ci/fail_to_pass.py, src/devops_cli/commands/ci.py, openspec/specs/ci-fail-to-pass/spec.md] - What happens when a new support file of the head imports a name that the base
src/lacks?: The replay writes the base version of a changed support module, so the head import never loads and pytest starts. A new support file that the base does not hold keeps the head version, so it must import the module and call the attribute. It must not import a name that the basesrc/lacks at module import time. (best practice) [sources: tests/conftest.py, tests/support/git_scenarios.py, src/devops_cli/roadmap/project_review/git_read.py, src/devops_cli/ci/fail_to_pass.py]- Chosen: Replay changed support modules at the base version and import the module in a new support file. The base version removes the head import from a changed support module; a new support file avoids a name that the base lacks.
- Rejected: Keep the head version of a changed support module that adds a name. The fixed support code would be on the base and the changed tests would pass there.
- Rejected: Ignore a pytest start failure on the base. The replay would prove nothing and the author would get no useful result.
- Which commit does the replay check out, and which diff gives the changed files?: It resolves the merge base of
--baseand--headand checks out that merge base as a detached git worktree. It lists the changed files withgit diff --name-status -z --find-renames <merge_base>...<head>. ForHEAD, it also lists the untracked files undertests/. The change alters only which versions of those changed files the worktree holds. [sources: src/devops_cli/ci/fail_to_pass.py, src/devops_cli/git/operations.py, src/devops_cli/commands/ci.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 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.(ci)scope of the title gives the scope.The check gives false proof for fix PRs that change support files, but a manual workaround exists.Fix PRs touching tests/support/ cannot get automated fail-to-pass proof, breaking the AGENTS.md rule 4 requirement.Requires classifying changed files under tests/ and handling the edge case where a test needs a new helper from the head.devops ci fail-to-pass) #844, which asks for a different change.Both concern the devops ci fail-to-pass replay; #844 created the command, this candidate fixes a bug where support files leak into the base replay.devops-cli-service commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
(ci)scope of the title gives the scope.The bug causes false failures for a limited set of fixes, and a manual proof is a workaround.The change restores correct proof for fixes that touch test support code.The fix changes the replay file selection and needs a design for helper files.devops ci fail-to-pass) #844, which asks for a different change.Both items concern the fail-to-pass base replay, but #844 adds the check and the candidate fixes its support-file overlay.dan-petty commentedon Nov 12, 2026
A second case of this defect: the fix of #3990 is in
tests/conftest.pyonly. The floor fixtureisolate_devops_cli_confignow removesDEVOPS_CLI_ROADMAP_IMPLEMENT_IN_RUNNER. The pull request changes no file undersrc/.uv run devops ci fail-to-pass --base origin/mainprints0 failed on base (0 failed and 35 passed in tests/invariants/test_hermetic_floor.py, tests/roadmap/implement/test_roadmap_implement_records.py; 0 errored). The replay puts the fixedtests/conftest.pyof the head on the base.test_the_runner_variable_of_the_outer_environment_reaches_no_test, fails on the commit before the fix, wheretests/conftest.pyis the same as onmain:AssertionError: assert ('true', True) == (None, False).So the proposed fix must also replay the base version of a changed
conftest.py, not only the files oftests/support/.dan-petty commentedon Nov 12, 2026
Another case: the fix of #4711 is in
tests/conftest.pyandtests/support/bootstrap.py, with no change undersrc/.uv run devops ci fail-to-pass --base origin/mainexits 1:0 failed on base (0 failed and 31 passed in tests/invariants/test_hermetic_floor.py; 0 errored).origin/main8a7b113) with only the changed test file of the head gives2 failed, 1 passed:test_caught_udp_sends_and_name_lookups_fail_with_edge_nameandtest_git_refuses_a_network_remote_at_oncefail on the base.The root
conftest.pyis a third kind of file that the replay must take from the base.devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: Searches for a tool that replays a fix's changed tests on the base commit with base versions of the changed test-support files found only pytest-replay (re-executes a previous run's test order) and git replay (rebases commits); neither checks out a base tree, classifies changed files under
tests/, or overlays base support/conftest files while keeping head test and check modules. The needed change is therefore specific to this project's owndevops ci fail-to-passcommand, and no external tool covers it.Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
5 remaining items
devops-cli-service commentedon Nov 28, 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