REPORT — phase6-supervisor-fixes-2-review
STEP: phase6-supervisor-fixes-2 (Phase 6: the sweep-to-quiescence fix — F9)
REV: 2da5a5a9a67336c1b8c9bb1d0f49e703eb32f806   FINAL: 0459c5b5577117a4116890ee0cc356edcf9214ca
CHANGED: none — reviewer wrote no committed test file; all probes ran on scratch under /tmp/kilo (r6_q1.py, r6_q2.py, r6_w1f.py, r6_w1b.py, r6_w3f.py, r6_w3b.py) plus a scratch tree at /tmp/kilo/nofreeze cut from FINAL with the SIGSTOP freeze removed, diff-verified against `git show 0459c5b:scripts/supervise_run.py` before use.
VERIFIED: scripts/check-scope 2da5a5a9a67336c1b8c9bb1d0f49e703eb32f806 0459c5b5577117a4116890ee0cc356edcf9214ca docs/research/phase6-supervisor-fixes-2-brief.md — exit 0, run first. Prints `claimed: scripts/supervise_run.py tests/test_phase6_supervisor.py`, `tripped: none`, `scope: ok (3 path(s) in 2da5a5a9a67336c1b8c9bb1d0f49e703eb32f806..0459c5b5577117a4116890ee0cc356edcf9214ca)` (the gate's own printed lines; the third path is the brief under docs/research/, allowed implicitly).
VERIFIED: scripts/check-tests --fast — `976 passed, 106 deselected in 86.42s (0:01:26)`, exit 0 (the gate's own printed line; REV's 975 plus the racing-fork pin).
VERIFIED: .venv/bin/python -m pytest tests/test_phase6_supervisor.py tests/test_review_phase6_supervisor.py — `13 passed in 14.16s`, exit 0 (eleven delivered pins plus the two unedited review probes).
VERIFIED: .venv/bin/python -m pytest tests/test_axis2_robustness.py -m "not slow" — `17 passed, 4 deselected in 5.82s`, exit 0 (same 17/4 as REV).
VERIFIED: .venv/bin/python -m pytest tests/test_phase3_project_oracle.py — `5 passed in 335.05s (0:05:35)`, exit 0 (green run at HEAD, whose tree matches FINAL on every file the oracle reads — FINAL's diff touches only the brief, the supervisor, and the supervisor pin module).
VERIFIED: scripts/check-static — exit 0. The gated `ruff check --select BLE001,S110 src/orchestrator` (re-run via `.venv/bin/ruff`) prints `All checks passed!`; the advisory run prints `Found 104 errors.` (unchanged from REV).
VERIFIED: scripts/check-docs — exit 0, prints `376 Total (in 741ms) 174 Unique 376 OK 0 Errors` (the gate's own printed line, rule 14; unchanged from REV).
VERIFIED: Q1a racing-fork shape re-driven live at FINAL through the supervisor as a subprocess (scratch fixture child forking session-escaped sleepers every ~5ms across `--budget 0.4`): 62 forked PIDs recorded, 0 alive after the exit, timed_out=True — attacked-and-not-falsified.
VERIFIED: Q1b earlier faces re-driven live at FINAL: the in-group grandchild dead at the fixed point (3.5s) and the session-escaped grandchild dead after the exit (timed_out=True), plus the child-head observation (exactly one `--json` launch, exit 0) — attacked-and-not-falsified on all three.
VERIFIED: Q1c reparented-orphan boundary re-driven live at FINAL 3/3: the doubly-escaped orphan (middleman spawns a session-escaped sleeper then exits, adopted before the deadline) survives the sweep still adopted out-of-tree (`state=S ppid=3174` on all three runs) — the documented boundary holds and is not hidden.
VERIFIED: Q1 window attacks at FINAL: (w2) an 8-thread fork storm — 213 forked, 0 alive (the freeze stops the in-group forker, so the storm never outruns the pass budget); (w3b) a sleeper whose middleman exits at the deadline — caught dead (adoption after the first capture is still reached while the middleman is a descendant). The `if not descendants: break` shape means the loop exits early only on an empty capture — the budget bounds passes, never the kill. Two window classes falsified-with-reproducer, filed as F11/F12 below; both are OUT-OF-SCOPE seams the brief names explicitly (no container boundary), so neither blocks.
VERIFIED: Q2 F10 one-reading — the loop-without-freeze mutant (scratch tree cut from FINAL, byte-verified, freeze-plus-settle removed so only the brief's as-written capture-kill-sweep loop remains, diffed against the FINAL pre-image): `.venv/bin/python -m pytest tests/test_phase6_supervisor.py::test_the_deadline_kill_sweeps_a_racing_forker_to_quiescence` goes red on the pin's own assertion (`AssertionError: 2 of 69 forked PIDs survive the supervisor's exit` at `tests/test_phase6_supervisor.py:511`, `assert not alive`), while the merged tree pin stays green (1 failed, 1 passed) — the freeze is what makes the pin pass. The racing pin at FINAL passes repeatedly (2/2 isolated runs plus every full-suite run). No second consistent reading exists in the delivered surface: the only named alternative (subreaper) needs machinery the delivered module does not contain (no prctl/cgroup/pidfd anywhere in it) and would catch the boundary orphan the brief promises survives — so F10's claim stands as the one reading.
VERIFIED: Q4 forms and counts — FINAL is the work commit `0459c5b5577117a4116890ee0cc356edcf9214ca` (verified, never the report commit `bb1b4dd`); `git diff REV FINAL --stat` touches only the IN SCOPE files plus the brief (3 paths); no committed test file outside IN SCOPE is edited (only `+def test_the_deadline_kill_sweeps_a_racing_forker_to_quiescence` under tests/); the work commit carries `Actor: IMPLEMENTER` and contains only the two IN SCOPE files; the report commit carries `Actor: IMPLEMENTER`; every report field is present and filled with nothing outside the template; SHAPES names the reparented-orphan boundary with its live 3/3 probe (measured, not buried — re-driven 3/3 here); INHERITED closes F9 fixed and carries F8 with an actionable owner, matching the received set; the embedded brief copy is byte-identical to the committed brief file; standing battery `scripts/check-tests --fast` recorded above (serial; the `--parallel` form additionally attempted — its failures are `git init: Sem espaço livre no dispositivo` with /tmp inodes 99% full from other sessions' scratch, environmental and unrelated to this step).
NOT VERIFIED: the full `scripts/check-tests` (no `--fast`) as a reviewer run: the brief's ACCEPTANCE names the `--fast` form, the oracle module (the slow face touching this step's files) is re-run green above, and the pre-commit hook (`scripts/hooks/pre-commit`: prose-only → check-docs, else tables.py plus `check-tests --fast --parallel`) plus the pre-push hook (`scripts/hooks/pre-push`: full `check-tests`) are the method's own gates — no separate slow-battery run is owed to close this step.
FINDINGS:
  F8 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  The phase3 oracle fixture's gate-check grade is a hypothesis-seed lottery: the frozen corpus's unseeded in-sandbox suite can exceed the fixture's 60.0s per-check deadline on heavy draws and flip correct grades. Real and outside this step — the oracle module shares no file with this step's diff (no `supervise|phase6` string in it; its last commits predate this step), the failure signatures are grade flips (`FALSE_SUCCESS`/`CANDIDATE_TIMEOUT`), not supervisor kills, and the oracle line rides green here (`5 passed`).
  FIXED: no regression test — a committed fixture's lottery has none. Next action is the fixture's owner: raise `gate_timeout_seconds` toward the 300.0 default or fix the in-sandbox gate's hypothesis seed/profile (both files outside this brief's scope).
  F11 | SEVERITY: P1 | ORIGIN: CODE | STATE: carried
  A session-escaped forker — outside the child's process group, so the killpg(SIGSTOP) freeze cannot reach it — keeps forking across the sweep's passes, and its final tail forks (born during the last pass's settle, after the last capture) are adopted to init when the sweep stops and survive: measured 2 of 80, 1 of 80, 2 of 77, 3 of 79, 2 of 79 alive after the exit, always the final tail forks (`state=S ppid=3174`). The freeze stabilises only the in-group tree; the sweep has no container boundary, so a forker that itself escaped the group re-opens the capture window every pass. Reproducer: scratch /tmp/kilo/r6_q2.py `w1` (session-escaped ~5ms forker across `--budget 0.4`).
  FIXED: no regression test — a review probe on a scratch fixture, not a committed pin; no committed module was edited by this review. Next action is the planner's per rule 13: a container boundary (cgroup/pid-namespace) or an OWNER ruling narrowing the whole-tree sentence to the in-group forker surface; the brief's OUT OF SCOPE names the missing boundary explicitly ("no container boundary"), so this finding leaves as carried and does not block.
  F12 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  A double-forking shape whose middleman exits before the deadline produces sleepers already adopted by init at the first capture, which the sweep cannot reach by construction: measured 11 of 11 and 10 of 10 alive after the exit, every survivor born before the deadline fired (0.10s–0.42s against a 0.4s budget plus startup) with `ppid=3174`. This is the report's named boundary driven at a higher fork rate — it confirms the boundary is load-bearing, not vacuous: any racing shape that double-forks fast enough falls outside the surface. A middleman that exits at the deadline instead is caught (w3b: 1 of 1 dead). Reproducer: scratch /tmp/kilo/r6_q2.py `w3` / /tmp/kilo/r6_w3f.py.
  FIXED: no regression test — a review probe on a scratch fixture, not a committed pin; no committed module was edited by this review. Next action is the planner's: pin the boundary explicitly or narrow the whole-tree sentence the same way F11 goes; OUT OF SCOPE names the missing boundary explicitly, so this finding leaves as carried and does not block.
SHAPES: one shape probed live at FINAL that the suite does not build, and it is the brief's named boundary rather than a hidden gap:
  1. The session-escaped forker (F11) — a fixture child whose forker itself runs session-escaped (outside the frozen group) keeps forking across the sweep; its final tail forks survive adopted by init (2 of 80 / 1 of 80 / 2 of 77 / 3 of 79 / 2 of 79, always the final tail, `state=S ppid=3174`). Filed as F11 above with its scratch reproducer; no committed test file was touched. (The brief's `Reparented-orphan boundary shape` is the same out-of-tree class at rest and is named in the implementer's SHAPES with its 3/3 live probe, re-driven 3/3 here; the `Sweep-to-quiescence shape` is the committed racing-fork pin, not an unbuilt shape; the w2 storm and w3b at-deadline double-fork are green, not survivors.)
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: none
INHERITED:
Nothing in the received set is still open: the brief's INHERITED carried F9 (P1, carried) and F8 (P2, carried). F9 is fixed here — the racing-fork pin at tests/test_phase6_supervisor.py:491 and the freeze-and-sweep fix at scripts/supervise_run.py:193–:216 — and F8 stays carried, its owner named above. Added by this review, each carried finding with its ID:
  F11 (P1, ORIGIN: CODE, carried) — a session-escaped forker outside the frozen group re-opens the capture window every pass; its final tail forks survive adopted by init. Next action is the planner's per rule 13: a container boundary or an OWNER ruling narrowing the whole-tree sentence to the in-group forker surface.
  F12 (P2, ORIGIN: CODE, carried) — a double-forking shape whose middleman exits before the deadline falls outside the surface by construction (the named boundary at a higher fork rate). Next action is the planner's: pin the boundary explicitly or narrow the whole-tree sentence the same way F11 goes.
