Repository navigation
Description
Problem Description
The base replay of devops ci fail-to-pass fails every test it runs, also the tests that the pull request does not change. Each test fails with the hermetic guard error host path reached without a fake: <checkout>/.git/worktrees/tree/HEAD. So the check passes for each fix pull request that changes a test, also when the changed tests pass on the base. The check proves nothing.
Reproduction Steps
- Open a fix pull request that changes a test in
tests/commands/test_argo.py. Example: fix(argo): replace a token that Argo CD refuses #3121. - Read the log of the
Fail-to-Pass Checkjob (run 41359122060, job 125005470880).
Expected vs Actual Behavior
- Expected: a test that the pull request does not change, such as
test_argo_cd_apps_list_null_items, passes on the base. Only the tests that the fix changes fail on the base. - Actual:
29 failed on base (29 failed and 27 passed ...; 30 errored). The failures include unchanged tests such astest_status_exits_1_when_argo_cd_refuses_the_readandtest_status_dry_run_sends_no_request, each withFailed: host path reached without a fake: /home/runner/work/devops-cli/devops-cli/.git/worktrees/tree/HEAD. The teardown reportsnetwork edge reached without a fake.
The same result occurs locally with uv run devops ci fail-to-pass --base origin/main at 7735d8b.
Environment Diagnostics
CI runner ubuntu-latest, and a cloud sandbox. Both replay in the git worktree .git/worktrees/tree.
Logs, Traces, or Terminal Output
failed on base: tests.commands.test_argo_apps_status::test_status_dry_run_sends_no_request (Failed: host path reached without a fake: /home/runner/work/devops-cli/devops-cli/.git/worktrees/tree/HEAD)
errored on base: tests.commands.test_argo::test_argo_cd_apps_list_null_items (failed on teardown with "Failed: network edge reached without a fake — ... host path reached without a fake: /home/runner/work/devops-cli/devops-cli/.git/worktrees/tree/HEAD. ...")
Existing Tool Considered
None. The cause is in the replay tree of devops ci fail-to-pass and the host-path guard of the test harness. #2197 made git work in the replay tree, but the guard now refuses the read of the worktree HEAD file.
Filed directly because devops roadmap intake had no GitHub login in the agent sandbox. The next intake run places it.
Evaluation 2026-11-04
Answers to the two refine questions.
- The guard is at
tests/conftest.py:567-590(_install_host_path_guard, message at line 590). The allow list is at lines 484-513, and line 500 hard-codes the main worktree path. - The code that reads
HEADis probably_read_git_head_ref(src/devops_cli/telemetry/tracer.py:592-600). It is the only such read that a search ofsrc/found. The call path from a test is unverified until a run confirms it.
The same guard stops test runs in a runner worktree, not only the replay. The stop of #3230 (2026-11-04T10:22Z) holds host path reached without a fake: <model-clone>/.git/worktrees/w-3230/HEAD, with teardown errors in tests/ai/mcp/test_mcp.py. The stop of #3368 (11:15Z) holds the network edge reached text. These 2 stops took 5.72M input tokens. Other stops on #2116 and #2462 may have this cause, but that is inferred. A run of their test files in a linked worktree can settle it.
Scope to add.
- The guard allows the common git directory of any linked worktree. Reuse
_linked_worktree_common_dir(src/devops_cli/core/repo.py:88), with nogit rev-parsesubprocess in conftest. Add it first. Remove the hard-coded path only after the test passes in both the devcontainer and the GitHub runner. - A test runs the hermetic floor in a linked worktree outside the repository.
- A test of
tests/ai/mcp/test_mcp.pypasses in a worktree of the runner form. satisfied(src/devops_cli/ci/fail_to_pass.py:104-107) is false when a failure carries a guard message (host path reached,network edge reached,process edge reached), or when a test that the pull request did not change fails in the changed files. A failure of every test alone does not refuse the report, because a fix with one new test correctly fails in full on the base.
Setup and teardown errors need no new rule: fail_to_pass.py:99-101 counts errored apart from failed.
Proposed design
Problem statement
The fail-to-pass base replay fails every test in a linked worktree. The hermetic guard denies the read of .git/worktrees//HEAD and reports host path reached without a fake. The check then passes for a fix that changes a test, also when the changed tests pass on the base. The fix must allow the linked worktree common git directory and refuse a replay that carries a guard failure or an unchanged-test failure.
Acceptance criteria
Requirement: linked-worktree-head-read
The hermetic guard SHALL allow a read of the HEAD file under the common git directory of a linked worktree.
Scenario: linked-worktree-head-read-allowed
- WHEN a test runs in a linked worktree outside the repository and opens
.git/worktrees//HEAD - THEN the open succeeds and the guard raises no
host path reached without a fakeerror
Requirement: no-git-subprocess-in-guard
The host path guard SHALL allow the linked worktree common directory without a git rev-parse subprocess in tests/conftest.py.
Scenario: guard-allows-without-subprocess
- WHEN a test runs in a linked worktree and
git rev-parseis patched to fail - THEN the linked worktree HEAD read succeeds and
tests/conftest.pystarts nogit rev-parsesubprocess
Requirement: runner-form-mcp-tests
The test suite SHALL run tests/ai/mcp/test_mcp.py in a linked worktree with the GitHub runner path form.
Scenario: runner-form-mcp-test-passes
- WHEN the test suite runs
tests/ai/mcp/test_mcp.pyin a linked worktree under a path with the GitHub runner form - THEN the test file passes and the guard raises no host path error
Requirement: guard-message-refuses-replay
The fail-to-pass gate SHALL refuse a base replay when any failure carries a hermetic guard message.
Scenario: guard-message-makes-replay-unsatisfied
- WHEN a base replay reports a failure with
host path reached without a fake,network edge reached without a fakeorprocess edge reached without a fake - THEN
satisfiedis false
Requirement: unchanged-test-refuses-replay
The fail-to-pass gate SHALL refuse a base replay when a test that the pull request did not change fails in a changed test file.
Scenario: unchanged-test-failure-makes-replay-unsatisfied
- WHEN a changed test file has one changed test that fails on the base and one unchanged test that also fails on the base
- THEN
satisfiedis false
Requirement: one-new-test-keeps-replay-valid
The fail-to-pass gate SHALL accept a base replay when every test fails and the pull request adds only one new test.
Scenario: new-test-fails-in-full-on-base
- WHEN a fix pull request adds one new test and the base replay fails every test in the changed file with no guard message
- THEN
satisfiedis true
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need: the fix changes the repository's own hermetic test guard and fail-to-pass gate. The written cost is about 30k tokens and 2-4 hours to locate the guard and HEAD read, change the allow list and the satisfied rule, and run the focused tests.
Key questions
- Where does the hermetic guard raise
host path reached without a fake?:_install_host_path_guardintests/conftest.pyraises the message at line 590 when_is_allowed_host_pathrejects the path. The allow list hard-codes the main worktree path at line 500. [sources: tests/conftest.py:500, tests/conftest.py:567, tests/conftest.py:590] - Which code reads the worktree HEAD file?:
_read_git_head_refinsrc/devops_cli/telemetry/tracer.pyreadsgit_dir / "HEAD"at line 592. It is the only such read that a search ofsrc/found. A focused test must confirm the call path from the failing test. [sources: src/devops_cli/telemetry/tracer.py:592, src/devops_cli/telemetry/tracer.py:651] - How should the guard allow the linked worktree HEAD read?: Add the common git directory of a linked worktree to the guard's allowed roots. Reuse
_linked_worktree_common_dirfromsrc/devops_cli/core/repo.py:88. Do not rungit rev-parseintests/conftest.py. (best practice) [sources: src/devops_cli/core/repo.py:88, tests/conftest.py:500, tests/conftest.py:567]- Chosen: Add linked-worktree common dir to allowed roots. Reuses the existing helper, needs no subprocess, and covers
.git/worktrees//HEADand other common git files. - Rejected: Allow only
.git/worktrees/*/HEADby pattern. Too narrow. Other reads in the common git directory can still fail. - Rejected: Fake the HEAD read in the test harness. The fake needs the exact HEAD content and breaks when the code changes. The read is legitimate.
- Rejected: Remove the HEAD read from
tracer.py. This is invasive and removes telemetry data that git operations need.
- Chosen: Add linked-worktree common dir to allowed roots. Reuses the existing helper, needs no subprocess, and covers
- Should this change remove the hard-coded main worktree path from the guard?: Yes, after the linked-worktree test passes in the devcontainer and the GitHub runner. Keep the hard-coded path until both runs pass. Then remove it in the same pull request. (best practice) [sources: tests/conftest.py:500]
- Chosen: Keep the path until both environments pass, then remove it. The new common-dir root fixes the bug. The removal waits on evidence from the devcontainer and the GitHub runner.
- Rejected: Remove the path at once. The removal can break the devcontainer or runner before the linked-worktree test proves the new root.
- Rejected: Keep the hard-coded path permanently. The path is redundant and can hide a regression in the linked-worktree root.
- How should
satisfiedtreat a guard message in the base replay?:satisfiedSHALL return false when any base failure carrieshost path reached,network edge reachedorprocess edge reached. The report SHALL name the guard message as the reason. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py:104]- Chosen: Refuse on any guard message. A guard failure is a harness failure, not a fail-to-pass result. It can make every test fail.
- Rejected: Refuse only when every test fails. A fix that adds one new test correctly fails in full on the base.
- Rejected: Add no gate rule. The check can pass when a changed test fails for the guard reason, so it proves nothing.
- How should the gate identify a test that the pull request did not change?: Compare each failed test ID with the changed test IDs that the replay command gets from the pull request diff. A failed test that is not in the changed set refuses the report. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py:104, .github/workflows/ci.yml:571]
- Chosen: Compare failed test IDs with changed test IDs. Uses the test IDs in the JUnit report and the changed files that the command already selects. No new source of truth.
- Rejected: Refuse on any failure in a changed file. A changed file can hold unchanged tests that fail for a real base defect. The rule must name the unchanged test.
- Rejected: Refuse when every test fails. A fix that adds one new test correctly fails in full on the base.
- How are setup and teardown errors counted?:
fail_to_pass.pycountserroredapart fromfailed. A teardown error needs no new rule. [sources: src/devops_cli/ci/fail_to_pass.py:99] - Which tests prove the change offline?: Add a test that runs the hermetic floor in a linked worktree outside the repository. Add a test that runs
tests/ai/mcp/test_mcp.pyin a runner-form worktree. Add gate tests intests/ci/test_fail_to_pass.pyfor the guard-message and unchanged-test rules. (best practice) [sources: tests/conftest.py:567, tests/ci/test_fail_to_pass.py, tests/ai/mcp/test_mcp.py]- Chosen: Add focused guard and gate tests. They prove the fix offline and cover the two failure modes.
- Rejected: Rely on the end-to-end fail-to-pass run only. The run needs a pull request and does not isolate the guard or gate rule.
- Rejected: Add only a guard test. The gate rules would stay untested and can regress.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 1, 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 fail-to-pass check is the project's evidence standard and currently proves nothing for every fix pull request.The failed run 41359122060 does not set P0: no failed run of this repository has that id. A person can set P0 with the label priority/p0-critical.A broken verification gate undermines the test-first evidence standard for all fix pull requests.The fix targets one guard interaction with the worktree HEAD file but requires understanding the replay and guard interplay.Both concern the hermetic test guard and the fail-to-pass replay, but #2179 asks tests to stop starting real git while the candidate asks the replay to work despite the guard blocking the worktree HEAD file.devops-cli-service commentedon Nov 2, 2026
Refine cannot set this item to Ready at 6c57c85 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 46cf288 (see proposed design in issue body).
devops-cli-service commentedon Nov 4, 2026
Released in v0.56.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.56.0
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 21:19 UTC
fix(ci): count a changed test that errors on base as proof (#6379)