REPORT — phase6-supervisor-boundary-implementer
STEP: phase6-supervisor-boundary (Phase 6: the sweep's whole-tree predicate — F11/F12's out-of-group shapes and the container boundary)
REV: ba9e25e34ae5091e329469aab8c099675741f60d   FINAL: c2186543f356755d2102457b56f0283ffec4e6f0
CHANGED: scripts/supervise_run.py (+278/-78) — the container boundary: the child is forked into its own cgroup v2 leaf and moves itself in between fork and exec (`_container_join`, the pre-exec hook, `:185`; `_container_adopt`, the parent-side fallback, `:198`), the availability measurement (`_container_boundary`, `:142`; `_container_open`, `:167`), and the leaf kill riding every pass of the freeze-and-sweep loop (`_container_kill`, `:209`; the loop and its narration in `run_child`), plus the leaf's bounded removal (`_container_close`, `:237`).
CHANGED: tests/test_phase6_supervisor.py (+191/-12) — the two boundary pins, each `@pytest.mark.timeout(120)`: the escaped forker's recorded-PID liveness assertion at `:656` and the predecessor-exited sleeper's recorded-PID liveness assertion at `:691`; their two fixture scenarios (`escaped-forker`, `double-fork`); the boundary-availability guard the pins ride on (`_boundary_available`, `:362`, called at `:638` and `:676`); and the docstring's shape and red blocks recording which pin covers which shape.
VERIFIED: REVIEW ACCEPTANCE run first at FINAL, before this report's commit — `scripts/check-scope ba9e25e c2186543f docs/research/phase6-supervisor-boundary-brief.md` — exit 0, prints `tripped: none` and `scope: ok (3 path(s) in ba9e25e..c2186543f356755d2102457b56f0283ffec4e6f0)` with `claimed: scripts/supervise_run.py tests/test_phase6_supervisor.py`; the range diff is exactly the two IN SCOPE files plus the pre-existing brief (`aa358f4`), and the work commit `c218654` was written by this step's own session.
VERIFIED: both reds at REV, on a scratch tree cut from `ba9e25e` (`git archive ba9e25e`) with both IN SCOPE files diff-verified byte-identical to `git show ba9e25e:…` (both diffs empty) and the delivered test module copied in uncommitted, the REV supervisor in place — `.venv/bin/python -m pytest 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` — `2 failed in 3.18s`: `AssertionError: 1 of 80 forked PIDs survive the supervisor's exit: [1095130] — the deadline kill does not reach a session-escaped forker's tail forks` at `tests/test_phase6_supervisor.py:656` (`assert not alive`), and `AssertionError: sleeper 1095136 survives the supervisor's exit adopted out-of-tree: the expiry kill does not reach a predecessor-exited sleeper` at `:691` (`assert not _pid_alive`). Each red is the named liveness assertion failing after the supervisor's exit — no error, no collection failure, no hang. The escaped forker's class re-driven three further ways on the same scratch before the skip guard landed: 2 of 81, 3 of 82, 1 of 80 — the review's measured class (2/80, 1/80, 2/77, 3/79, 2/79, always the final tail), and the sleeper's survival is the review's 11-of-11, 10-of-10 structural shape.
VERIFIED: the boundary's availability measured, not assumed — cgroup2 mounted `rw,nsdelegate` at `/sys/fs/cgroup` (read from `/proc/self/mountinfo`), the running process's own cgroup (the tmux-spawn scope under `user@1000.service`) writable with a writable `cgroup.procs`, and a leaf created under it creatable with a writable `cgroup.kill` (kernel 6.12, past the 5.14 introduction of `cgroup.kill`). The join's shape is decided by measurement: moving the child into the leaf after `Popen` returns loses the descendants forked in the launch window — the F12 sleeper stayed in the parent cgroup, `state=S ppid=3174`, and survived the leaf kill — so the delivered join is the child's own write between fork and exec (the pre-exec hook). Measured with the pre-exec join: the leaf holds child + middleman + sleeper, `cgroup.kill` leaves all three dead (the child `Z`, the sleeper gone), the leaf empty, `rmdir` immediate.
VERIFIED: the skip guard measured on the R08 grading sandbox's own environment — a `SandboxPlan` run in a fresh root prints `mountinfo` with no cgroup2, `/sys exists: False`, `/sys/fs/cgroup exists: False`, `/proc entries: 60` — and with `/sys` shadowed by a tmpfs in a user+mount namespace (the same unavailability) the two boundary pins WITHOUT the guard fail on their liveness assertions (2 failed, 11 passed — the mechanism below) and WITH the guard skip (11 passed, 2 skipped, each skip's reason naming the measurement).
VERIFIED: ACCEPTANCE at FINAL, each command as run with its own printed summary — `scripts/check-tests --fast`: `978 passed, 108 deselected in 86.86s (0:01:26)`, exit 0; the same command on the byte-verified REV scratch (`git archive ba9e25e`, the workspace `.venv` symlinked in) prints `976 passed, 108 deselected in 86.97s` — the delta is exactly the two new boundary pins, no test dropped or deselected. `.venv/bin/python -m pytest tests/test_phase6_supervisor.py tests/test_review_phase6_supervisor.py --durations=5`: `15 passed in 17.72s`, slowest five `6.52s call test_review_phase6_supervisor.py::test_the_group_kill_reaches_the_grandchild_before_the_supervisor_exits`, `3.51s call test_phase6_supervisor.py::test_the_deadline_kill_reaches_the_tree_at_a_fixed_time_and_the_whole_surface_after_the_exit`, `2.34s call test_phase6_supervisor.py::test_the_deadline_kill_reaches_a_predecessor_exited_double_forked_sleeper`, `2.20s call test_phase6_supervisor.py::test_killed_child_is_reaped_marked_timed_out_and_drives_recovery`, `0.79s call test_phase6_supervisor.py::test_the_deadline_kill_sweeps_a_racing_forker_to_quiescence` — both boundary pins sit inside the existing pins' envelope, no budget raised. `.venv/bin/python -m pytest tests/test_axis2_robustness.py -m "not slow"`: `17 passed, 4 deselected in 4.71s`, exit 0 (REV's 17/4 unchanged). `.venv/bin/python -m pytest tests/test_phase3_project_oracle.py --durations=5`: `6 passed in 490.83s (0:08:10)`, slowest five `203.92s call test_project_oracle_classifies_the_five_case_corpus_on_a_real_repository`, `164.13s call test_grading_gate_grades_one_candidate_identically_across_consecutive_runs`, `114.67s call test_gate_config_and_test_corpus_neutralization_is_rejected`, `5.90s call test_registry_identity_floors_reject_compensated_replacements`, `1.97s setup`. `scripts/check-static`: exit 0 — the gated `ruff check --select BLE001,S110 src/orchestrator` prints `All checks passed!`; the advisory `B,SIM` run prints `Found 104 errors.` — the REV baseline is also 104, and the test module's additions add none. `scripts/check-docs`: exit 0, prints `388 Total (in 702ms) 180 Unique 388 OK 0 Errors`.
VERIFIED: the work commit's own gate run before it landed — the repository's pre-commit hook ran `scripts/tables.py` (table verification passed, no regeneration needed) and `scripts/check-tests --fast --parallel` (`947 passed in 21.72s`) plus the runner-spawning modules it runs after (`31 passed in 11.33s`), all green.
VERIFIED: F11 and F12 fixed with the red evidence above and green at FINAL — the escaped-forker pin's assertion at `:656` and the predecessor-exited sleeper's assertion at `:691` pass in the FINAL module run above (and the escaped forker's pin in three separate isolated drives at FINAL), and a hand-driven real-head double-fork against the delivered supervisor (`--budget 2`, the fixture's own `sleeper.pid` marker) leaves the recorded sleeper dead after the exit with the delegation's `orchestrator-supervisor-*` leaves at `0` — cleaned up, not leaked.
NOT VERIFIED: the brief's F10-q1e clause — "the F10 q1e boundary shape (the documented init-adopted case the subreaper measurement protects) still survives it" — cannot be satisfied by any container boundary, because it names the same live shape as F12 (F17): the fixes-2 implementer's SHAPES reparented-orphan boundary and the fixes-2 review's F12 variant are both a session-escaped middleman spawning a session-escaped sleeper and exiting before the deadline, the sleeper adopted by init, and cgroup membership is inherited at fork and unchanged by reparenting. What survives in the only consistent reading is measured instead: every committed discriminating member re-driven green at FINAL (the 13 module pins above plus the review module's two probes; nothing outside the brief's own shapes changed verdict). The named boundary moves from "the init-adopted orphan" to "what the child never forked".
NOT VERIFIED: the pid-namespace half of the brief's "cgroup/pid-namespace" boundary — not built and not measured. The cgroup v2 delegation is measured available in this environment (above), so the delivered seam is the cgroup leaf; no `unshare`/`prctl` path was exercised, and a pid-namespace host keeps both the fallback and the pins' skip untested against these shapes.
NOT VERIFIED: a fixed survivor count for the escaped-forker red at REV — the count varies (1, 2 and 3 of 77–82 across four drives) while the class does not (the final tail forks, the last PIDs the forker recorded), the same variance the review's five drives measured.
FINDINGS:
  F17 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief's boundary-fix instruction is internally inconsistent: it requires the double-fork pin to leave no descendant alive after the supervisor exits (GOAL, expected dispositions, the pin's spec) while also requiring that "the F10 q1e boundary shape ... still survives it — the review's discriminating member, re-driven, must stay green or the fix over-reaches" — and the two name one live shape. The F10 q1e shape (the fixes-2 implementer's SHAPES reparented-orphan boundary, probed at `--budget 3`, surviving `state=S ppid=3174`) and F12's reported variant (the fixes-2 review's double-forking fixture child) are both a session-escaped middleman spawning a session-escaped sleeper then exiting before the deadline, and F12's own text calls the shape "the named boundary at a higher fork rate"; F11's text likewise says a subreaper catches the shapes but "also catches the documented init-adopted boundary (measured against the F10 q1e shape)". cgroup membership is fixed at fork and is not changed by reparenting, so no container boundary can catch the F12 sleeper and spare the q1e orphan: they are the same process, reached the same way. The reading taken, per the brief's own instruction ("If exactly one reading is consistent, take it and file a FINDING with ORIGIN: BRIEF that names the reading you took"): the GOAL reading — F11 and F12 fixed by the container boundary with both pins green at FINAL — because the OWNER has not ruled (record.md's Owner-rulings section holds no F11/F12 ruling; its Pending section still queues the rule-13 ownership of the shape ruling, and the brief's own conditional is "If the OWNER has not ruled, deliver the container boundary"), so the narrowing branch is unavailable. The q1e clause is satisfied in the only physically possible sense: no committed discriminating member changed verdict (all 13 module pins and both review probes green at FINAL, above). Next action is the planner's: a later committed brief's text correction — the boundary sentence, F12's "without also catching the documented boundary" clause, and the module docstring's boundary sentence 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.

  F18 | SEVERITY: P1 | ORIGIN: BRIEF | STATE: fixed
  The boundary pins as the brief specifies them — unconditional post-exit liveness assertions — fail inside the R08 grading sandbox, reddening the standing oracle line on a good tree. The nesting is structural: `gate-check-tests` runs the suite's deterministic subset (`check-tests --fast` minus the runner-spawning modules) inside a sandbox whose fresh root mounts no `/sys` and whose `mountinfo` carries no cgroup2 (measured above), so the supervisor's boundary is unavailable there and the sweep alone cannot reach the out-of-group shapes — F11/F12's own finding. Measured on the unguarded intermediate delivery: `.venv/bin/python -m pytest tests/test_phase3_project_oracle.py` went `3 failed, 3 passed in 299.19s (0:04:59)` — the five-case corpus's `ExperimentError: calibration case 'known-good' classified 'FALSE_SUCCESS', expected 'CORRECT_ACCEPTANCE'` at `src/orchestrator/experiment_phases.py:265` (call `36.62s`), the determinism pin's `assert verdicts == [oracle.GRADE_PASS] * runs` at `tests/test_phase3_project_oracle.py:621` (call `178.53s`), and the neutralization test's benign-tree `assert grade_one("gate-check-tests", benign_tree) == oracle.GRADE_PASS` at `:444` (call `75.37s`) — every failure the same nested `gate-check-tests: FAIL` on a known-good tree, probed directly (`oracle.grade_manifest` printing `gate-check-tests: FAIL`, the nested suite at `35.5s` inside its `60.0s` budget: a value failure, not a timeout). The fix rides in scope: both pins measure the boundary's availability through the supervisor's own measurement (`_boundary_available`, `tests/test_phase6_supervisor.py:362`) and skip where no cgroup v2 delegation exists — a skip whose reason names the measurement, and which is also what makes the REV red work (a supervisor without the measurement runs the pin and fails on its assertion). With the guard the oracle line is green again (VERIFIED's `6 passed in 490.83s`) and the sandbox's condition shows `11 passed, 2 skipped`.
  FIXED: the guard at `tests/test_phase6_supervisor.py:362` and its two call sites (`:638`, `:676`); the failing assertions named above were re-driven green by `.venv/bin/python -m pytest tests/test_phase3_project_oracle.py` — `6 passed in 490.83s (0:08:10)` — and the sandbox condition by the `/sys`-shadowed namespace drive — `11 passed, 2 skipped in 7.25s`. (Template note: those assertions live against this step's unguarded intermediate delivery, not at REV — the oracle line's REV baseline is the seed closeout's own FINAL run, `6 passed in 576.05s` at `b852fd4`, whose oracle module and `project_oracle.py` are byte-identical at `ba9e25e` (the intervening commits add only `tests/test_review_phase6_grading_seed.py`) — so the FIXED form names the intermediate run's assertions and the two re-drive commands.)
SHAPES: The reparented-orphan boundary the fixes-2 step named — a fixture child's session-escaped middleman spawning a session-escaped sleeper and exiting, the sleeper adopted by init (`state=S ppid=3174`) — is now the double-fork pin's shape and is dead after the exit at FINAL: hand-driven against the delivered supervisor (the real-head `--budget 2` drive leaves the recorded sleeper dead, the delegation's leaves at `0`) and measured at the mechanism level (an adopted sleeper, `ppid=3174`, cgroup-killed inside the leaf). What replaces the named boundary is recorded in the module docstring: what the child never forked. The launch-window race — a child forking before the container join would put descendants outside the leaf — is probed and closed by construction: a post-`Popen` join loses the in-window forks (the sleeper stayed in the parent cgroup and survived), so the join is the child's own write between fork and exec and no descendant can precede it; like the PID-reuse corner the sweep already rides, the window is empty rather than pinned. The clean-child corner — a child that exits 0 with a document while an adopted orphan survives — is probed: the supervisor exits 0 (`{"code": 0, "timed_out": false, "recovered": false, ...}`, no recovery driven, the clean path never killed and still does not), the orphan survives `state=S`, and one container leaf stands holding it (`orchestrator-supervisor-5w9l9jcr`, `procs: ['1160567']`) — a new, small residue on that corner, bounded by `_container_close`'s budget, not pinned because the deadline contract does not cover the clean path. The no-cgroup environment is probed in the sandbox's own shape (fresh root, no cgroup2, `/sys` absent, `/proc` present) and the boundary pins skip there. Facets claimed unchanged are re-driven at FINAL, the fix touching the expiry kill's surface: the merged tree pin (both members — the in-group grandchild dead at the fixed time and the session-escaped grandchild dead after the exit), the racing-fork pin, the killed-child, lost-child, failing-recovery and the three misuse pins, the child-head pin, and the review module's two probes are all green in the battery lines above.
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: the report template's FIXED form ("the named failing assertion at REV") has no room for a regression authored and fixed inside one step before any commit: F18's red exists only against this step's unguarded intermediate delivery (the oracle line's REV baseline is the seed closeout's green run on a byte-identical module), so the FIXED line names the intermediate run's assertions and the two re-drive commands instead. No other departure: every field here is filled and nothing outside the template is added, and the brief's pin specification against the sandboxed nested gate is filed as a FINDING (F18), not friction.
INHERITED:
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.
