Skip to content

fix(ci): refuse a replay that proves nothing about the fix - #3514

Merged
dan-petty merged 7 commits into
mainfrom
fix/3124-fail-to-pass-guard-failures
Nov 4, 2026
Merged

dan-petty merged 7 commits into
mainfrom
fix/3124-fail-to-pass-guard-failures

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The base replay of devops ci fail-to-pass runs in a linked worktree under the temporary directory. The host path guard of the test harness refused the HEAD file of that worktree's git directory, so each test of the replay failed on the harness and the check passed for a fix that proved nothing.

The guard now allows the common git directory of a linked worktree. tests/support/host_paths.py holds the roots and starts no git process.

The gate now refuses a replay when a failure carries host path reached without a fake, or when a test that the fix does not change fails on base. A new test, or a test in a file whose helpers changed, counts as changed. The network, process and keyring guards do not refuse a replay.

Closes #3124

Change: openspec/changes/archive/2026-11-04-3124-fail-to-pass-guard-failures/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 4, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass proof

uv run devops ci fail-to-pass --base origin/main exits 0 on the final tree. 14 tests fail on base and 30 pass, in tests/ci/test_changed_tests.py, tests/ci/test_fail_to_pass.py, tests/invariants/test_hermetic_floor.py and tests/invariants/test_host_path_roots.py. 2 tests error on base. They are the new test_changed_tests.py file (collection error).

Red proof of the guard bug: with the hard-coded root removed and the common-dir root disabled, a throwaway test that calls _detect_vcs_metadata failed on base with host path reached without a fake: <checkout>/.git/worktrees/tree10/HEAD. It passed once the root was back. The code that reads the file is _read_git_head_ref in src/devops_cli/telemetry/tracer.py.

Runner form: with the hard-coded root removed, a changed tests/ai/mcp/test_mcp.py (172 tests) passed in the replay tree under /tmp, with no guard message.

Local uv run devops ci

All gates pass except pytest, which has 2 failures that also fail on origin/main. Both come from the devcontainer, which holds the popeye tool that the tests expect to be absent:

  • tests/ai/test_tool_executor_contract.py::test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct]
  • tests/commands/test_devcontainer_install_tools_dry_run.py::test_mark_only_commands_under_global_dry_run

The test gate took 5m 48s in the concurrent local run. That is the known bound problem of #3050, not a change of this pull request.

Review findings applied

Two independent reviews found these points. All were checked against the code.

  • The gate now refuses only host path reached without a fake. The network, process and keyring guards report real defects, and a fix can prove itself by a changed test that fails there. A new test covers each edge.
  • The report names both causes of a host path guard failure.
  • A test now holds allowed_host_roots for a linked worktree. test_hermetic_floor.py builds its expectation from the constant, so a new wording of the guard fails a test.
  • The gate parses each changed test file once.
  • The new text in CONTRIBUTING.md and docs/TESTING.md uses short sentences. The known limit for shared test files moved to CONTRIBUTING.md.

Not applied:

  • Narrow the "rest of the file" rule to the names a test uses. The design documents this trade-off, and a name analysis adds a hand-written helper.
  • A pytester session in a fabricated worktree. The guard reads its roots once per process from the real checkout, so a session cannot change them. The allowed_host_roots test covers the wiring.

@dan-petty
dan-petty marked this pull request as ready for review November 4, 2026 21:01
@dan-petty
dan-petty merged commit 719a697 into main Nov 4, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/3124-fail-to-pass-guard-failures branch November 4, 2026 21:03
dan-petty-release Bot added a commit that referenced this pull request Nov 4, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.56.0](v0.55.4...v0.56.0)
(2026-11-04)


### Features

* **k8s:** GPU thresholds set embedding-only and per-GPU tiers
([#3509](#3509))
([67d3f47](67d3f47)),
closes [#3501](#3501)


### Bug Fixes

* **ci:** refuse a replay that proves nothing about the fix
([#3514](#3514))
([719a697](719a697))
* **config:** config unset --dry-run writes nothing, hides credentials
([#3512](#3512))
([b3280ba](b3280ba))
* **roadmap:** a stop carries a typed class and the failed check
([#3513](#3513))
([3437b9e](3437b9e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): the fail-to-pass base replay fails every test on the worktree HEAD guard

1 participant