Repository navigation
Closed
Labels
Description
Friction
scanner_fakedoublesshutil.whichandsubprocess.run. The review scanners now start their tools through aToolExecutor, so the process edge has a seam. The fake still patches the standard library under that seam.
Evidence
Checked at main 4bb052c.
- The docstring of
tests/support/fakes/scanners.pysays: "The process edge has no seam yet (refactor(cli): one process runner owns execution, process groups and dry-run #775), so the fake doubles the stdlib objects themselves". - feat(review): review tools run through one injectable executor in a network-less sandbox with CPU, memory and time limits #772 Part B (feat(review): start the scanners and the review pipeline through the tool executor #1941) moved every review scanner onto
ToolExecutor.ToolExecutorFake(tests/support/fakes/tool_executor.py) exists with its contract suite. docs/agent/tasks/task-772-the-review-scanners-run-through-the-tool-executor.mdlists this part as not done. It says that the recordings andtests/test_scanner_contract.pystay.- feat(review): review tools run through one injectable executor in a network-less sandbox with CPU, memory and time limits #772 lists this change as its later part 3 of six. After the split, feat(review): review tools run through one injectable executor in a network-less sandbox with CPU, memory and time limits #772 only tracks its child issues, and no pull request closes feat(review): review tools run through one injectable executor in a network-less sandbox with CPU, memory and time limits #772 itself. So this candidate asks for a change that no other issue holds.
Existing tool considered
ToolExecutorFakeis the shared fake of the review-tool edge (ADR 0007). This part reuses it and adds no second fake.
Proposed remedy
- Rebuild
scanner_fakeoverToolExecutorFake. The fake answers eachToolRequestof a recorded scanner with the recorded exit code, standard output and standard error. - Keep the recordings in
tests/fixtures/scanner_runs/recorded_runs.jsonand the contract suitetests/test_scanner_contract.py. - Remove the patches of
shutil.whichandsubprocess.runfrom the fake.
Acceptance criteria
-
scanner_fakeinstallsToolExecutorFakeand patches noshutilorsubprocessname. - Every test that uses
scanner_fakepasses with the same recordings. -
tests/test_scanner_contract.pystill checks that each adapter makes the recorded command and reads the recorded run as it read the real run. - Tests run offline with fakes and recorded tool output: no network, no real scanner, no model. Each new test runs under 1 s.
-
uv run devops cipasses.
Source: #772
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 23, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate changes test behavior and fake implementation.The change improves test reliability and maintainability.The change affects how tests run and their accuracy.The change requires rebuilding a fake and updating tests.fix(security): the agent scan tools run the scanner adapters and repo…
docs(openspec): plan #2116 use PATH stand-ins for scanner tests (#2977)