REPORT — phase6-sandbox-sweep-implementer
STEP: phase6-sandbox-sweep (F20)
REV: d9c660e   FINAL: 36cd049b37029295d114142d82127dcc04be2111
CHANGED: src/orchestrator/sandbox.py — `SandboxRunner._kill` sweeps to quiescence (capture, kill, re-capture until a capture is empty or the bounded pass budget expires; module-level `SWEEP_PASSES`/`SWEEP_SETTLE`; the returned list is the union of the passes' captures)
CHANGED: tests/test_batch3_execution.py — the racing-fork pin after the F1 escape pin (a forker tail plus a double-forked sleeper; asserts no probe descendant survives teardown)
VERIFIED: scripts/check-tests --fast — `981 passed, 108 deselected in 96.53s (0:01:36)` (exit 0)
VERIFIED: .venv/bin/python -m pytest tests/test_batch3_execution.py --durations=5 — `13 passed in 4.00s`; slowest five: `1.11s` `test_racing_forker_and_double_forked_sleeper_die_at_teardown`, `0.90s` `test_cancellation_during_dispatch_does_not_produce_a_result`, `0.60s` `test_escaped_process_is_killed_without_a_cgroup`, `0.58s` `test_attempt_deadline_is_shared_across_commands`, `0.24s` `test_limits_verified_is_persisted_in_the_command_result`
VERIFIED: scripts/check-static — exit 0, gated `All checks passed!`, advisory `Found 104 errors.` (unchanged from the brief's baseline)
VERIFIED: scripts/check-docs — `394 Total / 180 Unique / 394 OK / 0 Errors` (exit 0)
VERIFIED: scripts/check-scope d9c660e 36cd049b37029295d114142d82127dcc04be2111 docs/research/phase6-sandbox-sweep-brief.md — exit 0, `claimed: src/orchestrator/sandbox.py tests/test_batch3_execution.py`, `tripped: none`, `scope: ok (3 path(s) in d9c660e..36cd049b37029295d114142d82127dcc04be2111)`
VERIFIED: REV green — `.venv/bin/python -m pytest tests/test_batch3_execution.py::test_racing_forker_and_double_forked_sleeper_die_at_teardown -q` on a REV worktree whose `src/orchestrator/sandbox.py` is byte-identical to `git show d9c660e:src/orchestrator/sandbox.py` — `1 passed in 1.39s`. The brief's named red is absent (F23).
VERIFIED: mutant red — the same node on a byte-verified FINAL scratch with one added line (`SandboxRunner._descendants = staticmethod(lambda root_pid: [])`) — `1 failed in 1.36s`, the named failing assertion `assert survivors == [], f"racing forkers survived teardown: {survivors}"` (~120 surviving pids).
VERIFIED: namespace-init-death measurement — a sandbox workload that forks a racing loop leaves 124 live descendants after a deliberately weakened `_kill` (process-group kill only: `AFTER weak kill, survivors: 124`), and 0 after the single namespace init (`NSpid` last field 1) is SIGKILLed (`AFTER killing init(s), survivors: 0`); `_kill`'s own walk on the live run returns `descendants=128 namespace_inits=[…]`, i.e. the init is always captured.
NOT VERIFIED: none
FINDINGS:
  F20 | SEVERITY: P2 | ORIGIN: CODE | STATE: fixed
  The nested-grading survivor class is closed on the sandbox side: `SandboxRunner._kill` (`src/orchestrator/sandbox.py`) sweeps to quiescence (capture, kill, re-capture over a bounded pass budget — the supervise_run pattern) instead of the single capture-then-kill, and a racing-fork pin holds the no-survivor property.
  FIXED: tests/test_batch3_execution.py::test_racing_forker_and_double_forked_sleeper_die_at_teardown — green at REV (`1 passed in 1.39s`) and FINAL (in the `13 passed in 4.00s` battery), red on a byte-verified FINAL scratch under a kill-surface mutant, the failing assertion `assert survivors == [], f"racing forkers survived teardown: {survivors}"` (`1 failed in 1.36s`). The brief's named REV red does not exist (F23); the mutant is the delivered red class.
  F23 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief's named red at REV is not reproducible — "at REV, with the delivered single-capture `_kill`, the racing forker's final tail forks plus the double-forked sleeper survive teardown adopted out-of-tree". In a NAMESPACE_V1 drive the workload is the PID-namespace init, `_descendants` always captures it (`descendants=128 namespace_inits=[…]`), and its SIGKILL makes the kernel reap the whole namespace (init death kills the namespace; measured: 124 live descendants after a weakened kill, 0 after the init dies), so the delivered `_kill` already leaves no descendant alive and the pin passes at REV. The sweep lands as the brief's requested defense-in-depth port and the pin as a regression pin; the named red is chimeric for the sandbox, and the load-borne leak F20 measured rode the nested-grading/oracle path, not a standing sandbox-drive race.
  FIXED: no regression test — an ORIGIN: BRIEF finding is fixed once a later committed brief corrects the text; the sweep and the pin land as delivered, and the pin's red class is the kill-surface mutant above.
  F24 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  The module's `_probe_pids` (`tests/test_batch3_execution.py`) scans the whole process table for any cmdline containing the literal probe path, so an unrelated process that merely carries that string in argv is counted a survivor. Measured: three `git commit` hook runs failed the F1 pin with exactly two survivors — the `bash -c '<commit>'` wrapper and the `git commit` process — whose command lines carried the path because this step's commit message quoted it; rewording the message cleared it. `scripts/check-tests`' `SERIAL_MODULES` isolation protects against sibling workers but not against the invoking command line.
  FIXED: no regression test — `_probe_pids` is reused verbatim as the brief instructs and is not edited; the named failing assertion at REV is the F1 pin's `assert survivors == [], f"escaped workload survived teardown: {survivors}"`, reproduced only when the invoking command line names the probe path.
SHAPES: none — the one named shape (racing-fork tail plus double-forked sleeper) is built as the pin, and the F1 escape shape is re-driven green at FINAL (its surface, `_kill`, changed); the namespace-init-death behaviour the report names is a hand measurement serving F23, not an unbuilt probe.
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: none
INHERITED:
  From the brief's INHERITED block, the items still open, copied verbatim:

  F13 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief names the pin's red as "N consecutive grades of the known-good tree produce non-identical verdicts (PASS on one run, CANDIDATE_TIMEOUT on the next)". In this environment the known-good tree's `gate-check-tests` grade is stable well under the fixture's 60.0s deadline (ten pin runs, 50 grades, ~37–46s each, every grade PASS), so the pin passes at REV. The lottery's grade-flip needs a candidate whose suite fails — a failing tree's hypothesis tests shrink, and the shrinking varies the suite's wall — and the near-deadline flip is the neutralisation test's broken-source candidate (FAIL→CANDIDATE_TIMEOUT, 3/3 at REV). The pin's assertion and the seeded determinism are correct; the brief's stated candidate is simply not the one that flips here.
  FIXED: no regression test — an ORIGIN: BRIEF finding is fixed once a later committed brief corrects the text; the pin and the seed land as delivered.

  F14 (P2, ORIGIN: DOCUMENT, carried) — the F8 red evidence is load-borne and the implementer report does not say so; a later actor re-driving the red on an idle host sees green and may conclude the red is chimeric. Next action is the planner's: carry the load condition into the carried F8 block (or a later committed brief's correction), the seed and the pins stand as delivered.

  F15 (P2, ORIGIN: CODE, carried) — killed runs leak intermediate probe trees and no janitor reaps them; the shared tmpfs inode table filled to 3 free and the standing battery's first run died ENOSPC until 81 leaked trees were pruned by hand. Next action is the harness owner's (a tombstone/janitor keyed by the run identity) or a planner ruling that scratch hygiene is each session's duty.

  F16 (P2, ORIGIN: CODE, carried) — the seeded determinism is wall-bounded: at the fixture's 60.0s deadline the near-deadline candidate's seeded grade flips FAIL→CANDIDATE_TIMEOUT under host load (measured once mid-run and once at a 62.44s wall), so the pin's green determinism is stable-half evidence only. Next action is the fixture owner's: raise the grading deadline for near-deadline candidates (the 300.0 default gives a >=5x margin here) or an OWNER ruling that the deadline's load envelope is governed, not deterministic.

  F17 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief's boundary-fix instruction is internally inconsistent (FINDINGS, F17): the double-fork pin must leave no descendant alive after the exit while the F10 q1e boundary shape must survive the fix, and the two name one live shape (a session-escaped middleman spawning a session-escaped sleeper then exiting before the deadline, the sleeper adopted by init) that no container boundary can kill and spare at once. The GOAL reading was taken (F11/F12 fixed by the container boundary, both pins green at FINAL, no committed discriminating member changed verdict); the boundary this step retires is the named init-adopted orphan, and the new boundary is what the child never forked. Next action is the planner's: a later committed brief's text correction — the q1e-survival sentence, F12's "without also catching the documented boundary" clause, and the boundary sentence in the module docstring this step corrected in code.
  FIXED: no regression test — the reading is delivered in the work commit and its evidence is the two reds above and the FINAL battery above; the correction itself is a committed brief's prose, which has none.

  F21 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  The implementer report's supervisor-module battery line records the module battery widened by the review module (`.venv/bin/python -m pytest tests/test_phase6_supervisor.py tests/test_review_phase6_supervisor.py --durations=5` — `15 passed in 17.72s`) and never the brief's documented form (`.venv/bin/python -m pytest tests/test_phase6_supervisor.py --durations=5`) with the documented form's own printed line. The wide form is a strict superset (the module's 13 pins plus the review module's 2 probes), green, and every figure it carries is its own printed line — nothing is evaded; but the brief's acceptance names the documented command, and the report's own template requires each claimed figure to name the command that actually ran while this acceptance line names both the documented form it did not run and the wide form it did. This review ran the documented form at FINAL — `13 passed in 12.46s` — so the figures stand; what carries is the report-text deviation from the brief's named battery.
  FIXED: no regression test — a document deviation in a committed report, which only a later step (or the planner's correction of the carried note) absorbs; the documented form's gate line is in this review's VERIFIED.

  F22 (P2, ORIGIN: BRIEF) — the brief's review-block copy of the carried F17 finding is truncated mid-sentence (the literal `(line truncated to 2000 chars)` marker), which rides as a carried text-correction to the planner.

  Then each finding marked carried by this step, with its ID:

  F23 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried (the brief's named REV red is not reproducible in a sandbox drive; see FINDINGS above).

  F24 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried (the global `_probe_pids` scan matches any process carrying the probe path in argv; see FINDINGS above).

  Received-set dispositions kept: F19 fixed by the prior step's absorbed pin; F20 fixed by this step (above); F11/F12/F18 fixed as recorded in the reports that filed them; F13–F17, F21, F22 carried with their named owners.
