REPORT — phase6-supervisor-fixes-review
STEP: phase6-supervisor-fixes (Phase 6: the supervisor's kill-tree fix — F4–F6)
REV: 9b78d7a63ce69a4ed5db5a4f59c1edeaa3652bec   FINAL: 5ce423e97f45688d6808af40fdee8a506c816a98
CHANGED: none — the reviewer writes no code; the step's work commit is FINAL above and the report commit 07169a1 holds only docs/research/phase6-supervisor-fixes-implementer.md.
VERIFIED: scripts/check-scope 9b78d7a63ce69a4ed5db5a4f59c1edeaa3652bec 5ce423e97f45688d6808af40fdee8a506c816a98 docs/research/phase6-supervisor-fixes-brief.md — exit 0, prints `claimed: scripts/supervise_run.py tests/test_phase6_supervisor.py tests/test_review_phase6_supervisor.py`, `tripped: none`, `scope: ok (3 path(s) in 9b78d7a63ce69a4ed5db5a4f59c1edeaa3652bec..5ce423e97f45688d6808af40fdee8a506c816a98)` (REVIEW ACCEPTANCE, run first; the embedded brief copy matches the committed docs/research/phase6-supervisor-fixes-brief.md byte-for-byte).
VERIFIED: scripts/check-tests --fast — `975 passed, 106 deselected in 79.70s (0:01:19)`, exit 0 (matches the report's 975/106; the report's 115.51s is its own run's wall time).
VERIFIED: .venv/bin/python -m pytest tests/test_phase6_supervisor.py tests/test_review_phase6_supervisor.py — `12 passed in 13.25s`, exit 0 (ten delivered pins plus the two unedited review probes; the review file is byte-identical REV..FINAL).
VERIFIED: .venv/bin/python -m pytest tests/test_axis2_robustness.py -m "not slow" — `17 passed, 4 deselected in 4.73s`, exit 0 (matches the report's 17/4).
VERIFIED: .venv/bin/python -m pytest tests/test_phase3_project_oracle.py — `5 passed in 371.99s (0:06:11)`, exit 0 (green at FINAL; duration is the lottery's draw, see F8).
VERIFIED: scripts/check-static — exit 0; the gated `ruff check --select BLE001,S110 src/orchestrator` prints `All checks passed!`; the advisory run prints `Found 104 errors.` (104, unchanged from REV; the edited pin module adds no advisory finding).
VERIFIED: scripts/check-docs — exit 0, prints `376 Total (in 274ms) 174 Unique 376 OK 0 Errors` (the gate's own printed line, rule 14; counts match the report's 376/174/376/0).
VERIFIED: git diff 9b78d7a63ce69a4ed5db5a4f59c1edeaa3652bec 5ce423e97f45688d6808af40fdee8a506c816a98 --stat touches only docs/research/phase6-supervisor-fixes-brief.md, scripts/supervise_run.py, tests/test_phase6_supervisor.py (no committed test edit outside IN SCOPE; tests/test_review_phase6_supervisor.py stands unedited beside the absorbed probes).
VERIFIED: the whole-surface kill live at FINAL, each face re-driven by this review (methods in SHAPES): (a) the session-escaped fixture shape — supervisor-as-subprocess with an in-group and a session-escaped grandchild — both dead at the exit and both still dead 15s after; (b) the in-group shape — the grandchild dead at the fixed deadline+1.5s point; (c) the real-head `--budget 8` scripted-environment drive — exit 1, empty stdout, five peak descendants all dead at the exit, no sandbox_launcher alive at the exit and none 15s after, against REV's four survivors. Faces (a)–(c) attacked-and-not-falsified.
VERIFIED: the absorbed probes and their mutants on a scratch worktree at FINAL (byte-verified against `git show 5ce423e:…` before each run, reverted after): the lone-child-kill mutant (`process.kill()` for the killpg+sweep block) red on the merged tree pin at tests/test_phase6_supervisor.py:416 (`AssertionError: grandchild 2496091 survives the deadline kill`, `1 failed in 3.75s`); the double-launch mutant red on the child-head pin at :466 (`assert 2 == 1`); the dropped-secret mutant red at :473 (environment-equality assertion); the added-variable mutant red at :473. Both probe names live in the delivered module (`test_the_deadline_kill_reaches_the_tree_at_a_fixed_time_and_the_whole_surface_after_the_exit`, `test_the_child_head_receives_the_whole_environment_and_runs_once`). Extra mutants: a reordered/extended argv (`--json --quiet`) goes red on the child-head observation (delivered and review copies); a second child launched after the recovery goes red at :466; a dropped non-ORCHESTRATOR variable (PATH) stays green — the observation's documented boundary is the ORCHESTRATOR_* set, so the miss is by design, not a gap.
NOT VERIFIED: the full `scripts/check-tests` (no `--fast`): the run reds environmentally, not on the code — /tmp is a 1M-inode tmpfs at 100% use during the run (`OSError: could not create numbered dir`, `OSError: [Errno 28] No space left on device`), so 21 FAILED + 235 ERROR are tmp-path setup failures across unrelated modules; the four sampled non-inode-looking failures (guard-disable zero-charge, milestone7 approval-timeout, probe-oracle open-defects driver, loader envelope) pass in isolation (4 passed), and the r08 isolation battery plus a sandbox pin pass in isolation (9 passed). The pre-commit hook's double coverage plus the green `--fast` battery (975 passed) close the deliverable's own surface; the slow battery needs no run of its own for this step.
FINDINGS:
  F9 | SEVERITY: P1 | ORIGIN: CODE | STATE: carried
  The descendant sweep cannot reach a process forked between the chain capture and the group kill, nor one already reparented out of the chain: a racing fixture child that forks session-escaped `sleep 60` grandchildren every ~5ms across the 2s deadline leaves 3 of 331 forked PIDs alive after the exit — always the final three forks (2495117, 2495118, 2495119 of 331), i.e. born after `_descendants` walked /proc; and a doubly-escaped orphan (a session-escaped middleman that spawns a session-escaped sleeper then exits, so the sleeper is adopted by PID 3174/systemd before the deadline) survives the kill still adopted out-of-tree (`state=S ppid=3174` after exit 1). The delivered sweep is capture-then-signal over numeric PIDs with no re-walk and no container boundary, so anything born-or-reparented after the snapshot is outside the surface by construction.
  FIXED: no regression test — both reds are this review's hand-driven probes on scratch fixture children (`/tmp/kilo/q1d_window2.py`, `/tmp/kilo/q1e_rerun.py`), not committed pins; no committed module was edited by this review. Next action is the planner's per rule 13: re-walk-and-sweep to quiescence (capture, kill, re-capture until the chain is empty or a bounded retry budget expires), or an OWNER ruling narrowing the whole-tree sentence to the captured-at-deadline surface; the PID-reuse corner needs no action (capture-to-kill is adjacent statements, pid_max 4194304, no I/O between — recycle inside the window is not a live shape).
  F8 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  The phase3 oracle fixture's gate-check grade is a hypothesis-seed lottery, not a load margin: tests/test_phase3_project_oracle.py's `project_oracle_context` builds the manifest with `gate_timeout_seconds=60.0` (`:215`), and `oracle._run_probe` covers the probe-tree copies, the identity digests, and the in-sandbox gate execution in that one deadline (`src/orchestrator/oracle.py:632`, the SIGALRM budget at `:636`–`:639`, the CANDIDATE_TIMEOUT maps at `:701`–`:705`, `:732`–`:734`) — while the frozen corpus's unseeded in-sandbox suite duration swings run-to-run against a fresh per-run hypothesis database, so a heavy draw past the deadline flips correct grades instead of timing out loudly for a real reason. The lottery is real and outside this step: both oracle files are byte-identical REV..FINAL (empty diff), the 60.0s fixture value stands against `build_project_oracle`'s 300.0 default (`src/orchestrator/project_oracle.py:583`), and the line is green at FINAL (`5 passed in 371.99s`) after reds the implementer already recorded at REV with none of this step's changes in the tree. The `carried` names an owner that can act: the fixture's owner raises `gate_timeout_seconds` toward 300.0 or pins the in-sandbox gate's hypothesis seed/profile. A green-at-FINAL oracle run is not this step's deliverable — the carried lottery rides to the Record, it does not block the kill-tree fix.
SHAPES: two shapes this review probed live that the suite does not build (the pins drive fixture children by the brief's design — "without running a real trial" — so no committed pin launches the real scripts/smoke_run.py through the supervisor):
  1. The real-head whole-process-tree kill — `sys.executable scripts/supervise_run.py --budget 8` from the repository root with the scripted environment (`ORCHESTRATOR_WORKDIR=<fresh tmp> ORCHESTRATOR_OWNER=phase6-review ORCHESTRATOR_CAP=500 ORCHESTRATOR_AUTHORIZED_AT=2026-01-01T00:00:00Z ORCHESTRATOR_AUTH_METHOD=phase6-review-probe ORCHESTRATOR_SEEDS=1001 ORCHESTRATOR_REQUIRE_CONFORMANCE=0`), the descendant tree sampled by a /proc parent-chain walk every 150ms during the run and sandbox_launcher presence checked at the exit and 15s after. GREEN at FINAL: exit 1, empty stdout, the five peak descendants all dead at the exit, no sandbox_launcher alive at the exit and none 15s after. The shape is otherwise pinned by the merged tree pin (the fixture session-escaped grandchild, no survivor after the exit).
  2. The capture-window races — a ~5ms racing forker of session-escaped sleepers across a 2s deadline (3 of 331 tail forks survive), and a doubly-escaped orphan reparented to init before the deadline (survives adopted out-of-tree). Both RED at FINAL by construction (finding F9); no committed pin builds them.
TRIPPED: none
PROPOSED ROWS: none
METHOD FRICTION: none
INHERITED:
Nothing in the received set is still open: the fixes brief carried F4, F5 and F6 (each `carried`), and all three are fixed at FINAL — F4 fixed by the descendant-chasing kill over the captured surface (session-escaped grandchild dead after the exit, pinned at tests/test_phase6_supervisor.py:432; real-head `--budget 8` leaves no descendant at the exit or 15s after), F5 fixed by the absorbed discriminating member (fixed-time assertion at :416, red under the lone-child-kill mutant), F6 fixed by the absorbed child-head observation (tests/test_phase6_supervisor.py:450, red under the double-launch, dropped-secret, and added-variable mutants) — and F7 stays `fixed` as recorded in the review that filed it, unchanged. Added by this review, each carried finding with its ID:
  F9 (P1, ORIGIN: CODE, carried) — the descendant sweep cannot reach what is born or reparented after the chain capture: tail forks of a racing forker (3 of 331) and a doubly-escaped orphan adopted by init survive the deadline kill by construction. Next action is the planner's per rule 13: re-walk-and-sweep to quiescence or an OWNER ruling narrowing the whole-tree sentence to the captured-at-deadline surface.
  F8 (P2, ORIGIN: CODE, carried) — the phase3 oracle fixture's gate-check grade is a hypothesis-seed lottery (60.0s fixture deadline vs unseeded in-sandbox draws, green at FINAL). Next action is the fixture's owner: raise `gate_timeout_seconds` toward the 300.0 default or pin the in-sandbox gate's hypothesis seed/profile.
