Repository navigation
Description
What happened
#2143 records the owner's rule of 2026-10-24: a test of src/ starts no program. The review tests still start a real git. The test-suite audit of 2026-10-24 at df8e2ee recorded every program a test started, with a PEP 578 audit hook on subprocess.Popen. It saw 107 tests in these files start git:
| File | Tests that started git |
|---|---|
tests/test_review_tool_runs.py |
43 |
tests/test_review_untrusted_tree.py |
21 |
tests/test_review_project_conventions.py |
9 |
tests/test_review_path_routing.py |
7 |
tests/test_review_worktree_regression.py |
5 |
tests/test_review_samples.py |
5 |
tests/test_review_sample_validation.py |
4 |
tests/test_review_runner.py |
3 |
tests/test_review_group_analysis.py |
3 |
tests/ai/review/test_runner.py |
2 |
tests/test_review_security_tools.py |
1 |
tests/test_review_repos.py |
1 |
tests/test_review_path.py |
1 |
tests/test_review_backend_activity.py |
1 |
tests/commands/test_review_pre_analysis_only.py |
1 |
Most of them build a repository under tmp_path with a git helper or fixture, and the code under test then starts git through the process runner. A test that starts only git has a median time of 0.194 s, against 0.026 s for a test that starts nothing (the audit's cost summary).
What should happen
These tests reach git through the git fake of #2146 and start no program. A helper that builds a repository with git goes: the test writes its files under tmp_path and states the git answers it needs. A test that needs an answer that #2146 did not record adds the transcript with the recording row of #2146.
Evidence
.data/agent/scratch/audit/full_list.txtof the 2026-10-24 audit, section 1.git.
At b170358:
tests/test_review_tool_runs.py:89: thetreefixture, over the rootgitfixture.tests/test_review_project_conventions.py:31-33:_reporunsgit init.tests/test_review_path_routing.py:84,:92:git init.
Acceptance criteria
- No test in the files above starts git or another program. The hermetic floor fails any of them that starts git, as it fails a test that starts gh.
- The tests reach git only through the fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146, and patch no
devops_cliname (docs/TESTING.md). - Each test still checks the behaviour it checked before. The pull request names each test it deletes and why.
- The pull request gives the summed time of these files before and after (
uv run pytest <files> -n 0 --durations=0). -
uv run devops cipasses.
Order: after #2146. #2174 migrates the data directory, run store and gitignore tests in the same way. Follows ADR 0007 as #2143 amends it. Related: #1328 (the review tests move onto fakes).
Source: #2146
Proposed design
Problem statement
107 review tests in 15 files start a real git process. The owner's rule states that a test of src/ starts no program. These tests must reach git through the git fake of #2146 instead of starting git directly.
Acceptance criteria
- Criterion 1: No test in the 15 in-scope files starts git or another program.
Verification: The hermetic floor fails any test that starts git, as it fails a test that starts gh. Run the hermetic floor check on the 15 files. - Criterion 2: The tests reach git only through the git fake of test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146 and patch no devops_cli name.
Verification: Search the 15 files forsubprocess.runwith git, for thegitfixture parameter, and forpatchof adevops_cliname. Each search returns no result. - Criterion 3: Each test still checks the behaviour it checked before the change.
Verification: The pull request names each test it deletes and gives the reason. The remaining tests pass with the same assertions. - Criterion 4: The pull request reports the summed time of the 15 files before and after the change.
Verification: The pull request includes the output ofuv run pytest -n 0 --durations=0for both the before and after states. - Criterion 5: The CI pipeline passes.
Verification:uv run devops ciexits with code 0.
Key questions
- What git operations do the in-scope tests start?: The tests start
git init,git add .,git commit,git switch -qc,git update-ref,git branch -qD, andgit worktree add. Thetreefixture in test_review_tool_runs.py calls init, add, and commit. The_repohelper in test_review_project_conventions.py calls init via subprocess. The_projectand_branchhelpers in test_review_path_routing.py call init, add, commit, and switch. Thehostile_repoandown_repofixtures in test_review_untrusted_tree.py call init, add, commit, and worktree add. [sources: tests/test_review_tool_runs.py:89, tests/test_review_project_conventions.py:31, tests/test_review_path_routing.py:84, tests/test_review_untrusted_tree.py:56] - What is the dependency for this work?: This item depends on test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146, which provides the git fake and its recording row. The body states the order as after test(git): one git seam answers tests from recorded git transcripts, with a contract suite that replays them #2146. [sources: tests/test_review_tool_runs.py:89, tests/test_review_project_conventions.py:31]
- Is this item separate from test(core): the data directory, run store and gitignore tests start no git and reach git through the git fake #2174?: Yes. The owner decided on 2026-10-24 that test(core): the data directory, run store and gitignore tests start no git and reach git through the git fake #2174 and test(roadmap): the roadmap refine, run and intake tests start no git and reach git through the git fake #2178 to test(repos): the repos, branches, github, ssh, devcontainer, tf and openspec tests start no git and reach git through the git fake #2183 each move a different group of test files to the git fake, and each gives its own pull request. This item (test(review): the review tests start no git and reach git through the git fake #2180) moves the 15 files listed in its body. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
The owner decided on 2026-10-24 that this item is separate from #2174: each of #2174 and #2178 to #2183 moves a different group of test files to the git fake, and each gives its own pull request. Intake judged it a duplicate of #2174 (recorded as a case on #1989), so it was placed by hand with the values of #2174: Priority P2-Medium, Value Medium; Effort Medium.
dan-petty commentedon Oct 28, 2026
Status set to Ready at bb46660 (see proposed design in issue body).