REPORT — phase6-supervisor-cleanup-review
STEP: phase6-supervisor-cleanup (Phase 6: absorb the leaf-cleanup probe — F19)
REV: c6d2d7adb1d5f67c99b31d3a976d6763dfdfcdc5   FINAL: 584e63e08698b2a65a0df0fd85060923afc0e2ee
CHANGED: docs/research/phase6-supervisor-cleanup-review.md — this report (the review's one file; no test file, no IN SCOPE file, and no other committed file is touched; the verification scratch drives ran in detached worktrees under /tmp/kilo)
VERIFIED: REVIEW ACCEPTANCE run first, before every other drive — `scripts/check-scope c6d2d7adb1d5f67c99b31d3a976d6763dfdfcdc5 584e63e08698b2a65a0df0fd85060923afc0e2ee docs/research/phase6-supervisor-cleanup-brief.md` — exit 0, `claimed: scripts/supervise_run.py tests/test_phase6_supervisor.py`, `tripped: none`, `scope: ok (3 path(s) in c6d2d7adb1d5f67c99b31d3a976d6763dfdfcdc5..584e63e08698b2a65a0df0fd85060923afc0e2ee)`.
VERIFIED: FINAL is the work commit, not the report commit — the work commit carries trailer `Actor: IMPLEMENTER` (`git log --format=%H` and trailer check on `584e63e08698b2a65a0df0fd85060923afc0e2ee`); the report commit `cb87f1952c417e76ceac9924a7b4a6e30c7aaae4` adds only `docs/research/phase6-supervisor-cleanup-implementer.md` and the plan commit `d163a9a` only this review's brief (`git diff 584e63e08698b2a65a0df0fd85060923afc0e2ee HEAD --stat`: the two doc files, nothing else). Neither commit was written by this session.
VERIFIED: `git diff c6d2d7adb1d5f67c99b31d3a976d6763dfdfcdc5 584e63e08698b2a65a0df0fd85060923afc0e2ee --stat` — 3 files: `docs/research/phase6-supervisor-cleanup-brief.md | 136 +++`, `scripts/supervise_run.py | 8 +-`, `tests/test_phase6_supervisor.py | 66 ++++-`: exactly the IN SCOPE files plus the brief. The probe file rides byte-identical: `git show 584e63e…:tests/test_review_phase6_supervisor_boundary.py` `cmp`-equal to `git show c6d2d7a…:…` (0-line diff), and it does not appear in the range diff.
VERIFIED: F22's truncation claim, verified against the committed brief files — the literal marker sits at `docs/research/phase6-supervisor-cleanup-brief.md:43` and `docs/research/phase6-supervisor-boundary-review-brief.md:10`, each tail reading `…text correction — the boundary sentence... (line truncated to 2000 chars)`, exactly as filed. The F17 item is intact in the same brief at `:20` and `:38` (headers `:19`/`:37`, body lines `:20`/`:38`), both bodies complete through `…and the boundary sentence in the module docstring this step corrected in code.` with no marker. The truncated FINDINGS copy's completion is intact in `docs/research/phase6-supervisor-boundary-review.md` (`…— the boundary sentence, F12's "without also catching the documented boundary" clause, and the module docstring's boundary sentence this step corrected in code.`). `rg "line truncated to 2000" scripts/ tests/ src/` matches nothing: no code and no pin rides on the truncated copy, and no sentence is buried — the next actor's needed text is intact in the same file and in the boundary review's report. F22 verified as filed; attacked-and-not-falsified.
VERIFIED: Q1 (a) — the absorbed pin reproduces the probe's shape live at REV under the leak defect. Scratch: a detached worktree at REV (`/tmp/kilo/rev-scratch`), `.venv` symlinked; `scripts/supervise_run.py` sha256 97d857f592b286434a820d1148a5cba75d1c97eb37b9a6492fff2bb80c2010ea — byte-identical to `git show c6d2d7adb1d5f67c99b31d3a976d6763dfdfcdc5:scripts/supervise_run.py` and equal to the implementer's recorded scratch sha; `tests/test_phase6_supervisor.py` copied in and `cmp`-verified byte-identical to `git show 584e63e08698b2a65a0df0fd85060923afc0e2ee:tests/test_phase6_supervisor.py`. Mutant applied to the scratch and diff-verified against the byte-verified pre-image before driving: the diff is the single line `for _ in range(CONTAINER_REMOVALS):` → `for _ in range(0):` (`_container_close`'s removal loop disabled, no other delta). Run: `.venv/bin/python -m pytest -q tests/test_phase6_supervisor.py::test_the_deadline_drive_leaves_no_container_leaf tests/test_phase6_supervisor.py::test_the_deadline_kill_reaches_a_session_escaped_forkers_tail_forks tests/test_phase6_supervisor.py::test_the_deadline_kill_reaches_a_predecessor_exited_double_forked_sleeper --durations=3` — `1 failed, 2 passed in 9.09s`: the absorbed pin's leaf-set assertion is the thing that failed — `E assert not {'/…scope/orchestrator-supervisor-pkn8tg9h'}` at `tests/test_phase6_supervisor.py:757`, `AssertionError: leaf(s) left standing after the deadline drive: …` — no error, no collection failure, no hang; both boundary pins green over the same mutant (`2.32s` call double-forked sleeper, `0.73s` call escaped-forkers tail forks). Matches the probe's measured red class (`1 failed in 6.01s`); attacked-and-not-falsified.
VERIFIED: mutant-run hygiene — the 3-node mutant drive leaves three `orchestrator-supervisor-*` leaves standing under the boundary parent (one per drive's supervisor: the red pin's own leaf named in the assertion, plus the two boundary pins' drives' leaves, the unheld residue) — counted, pruned by hand, confirmed gone (delegation back to zero leaves; F15's no-janitor class, contained).
VERIFIED: Q1 (b) — green at FINAL. `scripts/supervise_run.py` and `tests/test_phase6_supervisor.py` are byte-equal between the work commit and HEAD (`git diff 584e63e… HEAD -- <both>`: empty), so the delivered close drives at HEAD: `.venv/bin/python -m pytest tests/test_phase6_supervisor.py --durations=5` — `14 passed in 11.54s`, slowest five `3.51s call test_the_deadline_kill_reaches_the_tree_at_a_fixed_time_and_the_whole_surface_after_the_exit, 2.35s call test_the_deadline_kill_reaches_a_predecessor_exited_double_forked_sleeper, 2.23s call test_killed_child_is_reaped_marked_timed_out_and_drives_recovery, 0.78s call test_the_deadline_kill_reaches_a_session_escaped_forkers_tail_forks, 0.74s call test_the_deadline_kill_sweeps_a_racing_forker_to_quiescence` — the absorbed pin placed below the top five; its own single-node drive `1 passed in 0.96s` with call wall `0.76s`: inside the existing pins' envelope (slowest `3.51s`, the escaped-forker drive class `0.73-0.78s`), the `120`s `@pytest.mark.timeout` unbreached, no budget raised. The delivered `_container_close` removes the drive's leaf inside the pin's fresh 5.0s measurement window — the pin's green is that window's loop exiting on an empty remainder.
VERIFIED: probe rides green at FINAL — `.venv/bin/python -m pytest tests/test_review_phase6_supervisor_boundary.py` — `1 passed in 0.90s` (ridden, not edited, as the brief requires).
VERIFIED: Q1 (c) — the docstring devolution names the clean-child corner with no kill-surface change. The REV→FINAL diff on `scripts/supervise_run.py` is one hunk, comment-only, replacing the removal sentence (`:106-:107` → `:106-:111`): `The leaf is per supervisor process and is removed when the child is done, with one clean-child corner it does not cover: a process that outlived a clean child's exit was never in any kill's surface, so a leaf still occupied after the bounded removal budget is left standing by construction, and the deadline contract does not cover that path.` — the corner is named; `_container_close` and its budget are not in any hunk (constants `CONTAINER_PREFIX`, `CONTAINER_REMOVALS = 20`, `CONTAINER_REMOVAL_SETTLE = 0.05` stand at `:112`/`:115`/`:116`, the removal loop and its settle untouched, the sweep loop untouched); the FINAL `_container_close` docstring still names the corner (`A leaf still occupied after the budget — a process that outlived a clean child … is left standing`). Attacked-and-not-falsified.
VERIFIED: ACCEPTANCE at FINAL, each command as run with its own printed summary — `scripts/check-tests --fast`: `980 passed, 108 deselected in 90.14s (0:01:30)`, exit 0. `.venv/bin/python -m pytest tests/test_phase6_supervisor.py --durations=5`: `14 passed in 11.54s` (above). `scripts/check-static`: exit 0, gated `All checks passed!`, advisory `Found 104 errors.` unchanged. `scripts/check-docs`: at a scratch worktree at the work commit `584e63e…`, `392 Total (in 227ms) / 180 Unique / 392 OK / 0 Errors`, exit 0 — the report's own line; same command at this session's HEAD prints `393 Total / 180 Unique / 393 OK / 0 Errors`, the +1 being this review's own brief file (unique count unchanged).
VERIFIED: the fast-suite delta is exactly the one absorbed pin. `(cd <REV scratch> && .venv/bin/python -m pytest tests --collect-only -q)` and the same at the work commit, node ids sorted: whole-suite collect diff is exactly one addition, `tests/test_phase6_supervisor.py::test_the_deadline_drive_leaves_no_container_leaf` (1087 → 1088 nodes; no test dropped, renamed, moved, or deselected). Module pin count `def test_` at REV 13 → at FINAL 14. Revised-baseline re-drive of the brief's REV figure on the REV scratch: `scripts/check-tests --fast` — `979 passed, 108 deselected in 91.41s`, exit 0 — so FINAL's `980 passed, 108 deselected` minus the REV scratch's `979 passed, 108 deselected` is the one absorbed pin, nothing else.
VERIFIED: standing battery (this review's full run) — `scripts/check-tests` (no mode argument, the falsification ground): `1088 passed in 1005.66s (0:16:45)`, exit 0 — the whole collected suite, no deselection; it includes `tests/test_phase6_supervisor.py … 14` dots and `tests/test_review_phase6_supervisor_boundary.py .` green.
VERIFIED: Q3's remaining forms — the report's `TRIPPED: none` matches check-scope's `tripped: none` printed by this review's first run; the report's documented battery line names the documented command (`.venv/bin/python -m pytest tests/test_phase6_supervisor.py --durations=5`, `14 passed in 11.92s`) with its own printed summary — the F21 deviation is not repeated; every VERIFIED figure names the command that ran; every pytest line names `.venv/bin/python -m pytest`.
VERIFIED: report form — every template field present and filled (REPORT/STEP/REV/FINAL with FINAL the work commit/CHANGED/VERIFIED/NOT VERIFIED/FINDINGS/SHAPES/TRIPPED/PROPOSED ROWS/METHOD FRICTION/INHERITED), F19's FIXED naming the node id, the command, the named failing assertion (`assert not remaining` at `tests/test_phase6_supervisor.py:757`), and the delivered file's line numbers, nothing outside the template added, F22 filed with ORIGIN: BRIEF.
NOT VERIFIED: none
FINDINGS: none
SHAPES: The brief's one named shape — the leaf-cleanup shape (F19) — is built by the absorbed pin and re-driven by this review (red under the leak defect at REV, green at FINAL), so no named shape is unbuilt. One shape was probed by this review that the suite does not build: the clean-child corner (a child exiting 0 while an adopted orphan outlives it, `_container_close`'s bounded wait exhausted, the leaf standing) — adjudicated not a build-buried shape: the brief's SHAPES names only the leaf-cleanup shape, F19's carried text already folds the corner (`what the corner adds is only the standing leaf itself`), a corner pin would assert the standing leaf itself (pinning today's construction, including the standing leaf's persistence — no later run reaps a stale `orchestrator-supervisor-*` leaf; the only janitor-class would double as F15's carried seam), its only unheld red class is an unbounded close (a hang, a wall-guard not a shape), the brief freezes `_container_close`'s surface, and the corner is now named in both the module docstring and the `_container_close` docstring — the prose-only treatment stands as delivered.
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: none
INHERITED:
From `docs/research/phase6-supervisor-cleanup-implementer.md`, its `INHERITED` block verbatim:

  Nothing else in the received set is still open: the brief's INHERITED carried F4, F5 and F6 (each fixed at the fixes step), F7 (fixed as recorded in the review that filed it), F9 (fixed at the fixes-2 step), F10 (fixed at the fixes-2 step), F11 and F12 (each `carried`, fixed here with the red evidence above), and F8 (`fixed` as recorded in the grading-seed step, unchanged here). Still open, each copied verbatim with its ID:
    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.

From the same report, the received carried findings' blocks from its FINDINGS section, moved verbatim (the received F19 block's state is fixed by this step — verified by this review above — and it does not ride as open; F20 and F21 ride still open):

  F19 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  The container leaf's removal is claimed (`scripts/supervise_run.py:106`–`:107`, "removed when the child is done") and demonstrated by hand at FINAL (`leaves: []` after every measured drive), but no delivered pin holds it: under a `_container_close`-leaks mutant (the removal loop disabled on a byte-verified scratch) both boundary pins stayed green 2 of 2 drives while empty leaves of the drives stood under the boundary parent — a removal regression would go unheld by the delivered suite. Folded in: the module docstring's removal sentence is also the report's one over-claim corner — the clean-child corner (a child exiting 0 with a document while an adopted orphan outlives it) leaves one leaf standing after `_container_close`'s bounded 20×50ms wait (measured: exit 0, `recovered: false`, the orphan `state=S ppid=3174`, one leaf holding it), which the `_container_close` docstring honestly names ("A leaf still occupied after the budget … is left standing") — the deadline contract does not cover the clean path, the orphan's survival predates the boundary (nothing killed it pre-boundary either), and what the corner adds is only the standing leaf itself. Next action is the next implementer brief's: absorb the leaf-cleanup pin into `tests/test_phase6_supervisor.py` and devolve the module docstring's removal sentence to name the corner.
  FIXED: no regression test of the delivered module's own — the shape is this review's committed probe (`tests/test_review_phase6_supervisor_boundary.py::test_the_deadline_drive_leaves_no_container_leaf`), green at FINAL (`1 passed in 0.95s`) and red under the leak mutant (`1 failed in 6.01s`); it rides until the delivered module absorbs it as its own pin.

  F20 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  The nested-grading survivor class re-sighted at FINAL: this review's first oracle re-drive failed only on the determinism pin's post-run survivor sweep (the assertion at `tests/test_phase3_project_oracle.py:630`) catching a live four-process stack (two `sandbox_launcher.py` in a launcher/shim chain, the `/work/.venv` identity collect runner, the nested `pytest -m not slow`), every member adopted by init (`ppid=3174`), `state=S`, alive 15+ minutes after the grade returned PASS verdicts and the value assertions held — no grade flip, no gate-check FAIL: not the F8/F18 class. All four were SIGKILLed and confirmed gone. The reaping defect's owner is `SandboxRunner._kill` (`src/orchestrator/sandbox.py:1081`–`:1102`): a single capture-then-kill with no sweep to quiescence — the pre-F9 surface the supervisor's own sweep left behind when the phase-6 fixes ported it — and `src/orchestrator/sandbox.py` is OUT OF SCOPE of every phase-6 brief so far. `record.md`'s "left zero survivors … the class is closed by the phase-6 descendant sweep" attribution holds for `scripts/supervise_run.py`'s sweep, not for the corpus's sandbox drives; a second oracle re-drive on the same host otherwise idle returned `6 passed in 536.49s`, so the class is not a standing red — it is the load-borne half the F14/F16 dispositions already govern. Next action is the planner's: a brief in scope of `SandboxRunner._kill` (sweep to quiescence, the supervise_run fix's own pattern) or a ruling folding the corpus's sandbox drives into the F16 load-envelope ruling.
  FIXED: no regression test — the standing survivor sweep that caught the leak (`:630`) is delivered and held; the reaping defect is outside the phase-6 steps' IN SCOPE files; both re-drive lines (red, then green) are recorded here.

  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.

Added by the reviewed step, copied verbatim from the implementer's report:

  F22 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief's review-block copy of the carried F17 finding is truncated mid-sentence: `docs/research/phase6-supervisor-cleanup-brief.md` reads "…Next action is the planner's: a later committed brief's text correction — the boundary sentence... (line truncated to 2000 chars)" (the marker is literally in the committed file; the same artifact also sits in `docs/research/phase6-supervisor-boundary-review-brief.md`). The F17 item itself is intact elsewhere in the same brief (`:20` and `:38`), so nothing is lost, but a verbatim copy of the review-block copy propagates `… (line truncated to 2000 chars)` into the next report; the planner's long-block copy is the source. This report carries F17's intact text.
  FIXED: no regression test — an ORIGIN: BRIEF finding is fixed once a later committed brief's text correction lands; the truncation is prose only and no code or pin rides on it.

Expected dispositions of the received set (rule 8 forms), kept: received F19 fixed by this step (the absorbed pin, re-driven by this review — red under the leak defect at REV, green at FINAL); F13-F17 stay carried; F20 and F21 stay carried (each with its named next action); F11/F12/F18 stay fixed as recorded in the reports that filed them. Added by this review: none.
