REPORT — phase4-recursive-planning-integration-fixes-review
STEP: phase4-recursive-planning-integration-fixes (the continuation fixes — the CHILD_OF depth walk and the full-suite profile leak)
REV: f74a9f0a8b236278f765496b80ec6a8238f9384b   FINAL: 6dc55f8927e03d771f98aec53b5e273af2b90968
CHANGED:
  docs/research/phase4-recursive-planning-integration-fixes-review.md — this report.
  No other file: no new probe module was needed. Every named shape is built by delivered code; the attacks were settled by pre-image reads, the runs below, and one diff-verified scratch mutant. Mutant ran on a `git worktree` of 6dc55f8 in /tmp/kilo/scratch-walk with `.venv` symlinked and was diff-verified against `git show 6dc55f8:src/orchestrator/controller.py` (the mutant changed only the two walk lines) before its result was trusted.
VERIFIED:
- REVIEW ACCEPTANCE `scripts/check-scope f74a9f0a8b236278f765496b80ec6a8238f9384b 6dc55f8927e03d771f98aec53b5e273af2b90968 docs/research/phase4-recursive-planning-integration-fixes-brief.md` — "scope: ok (6 path(s) in f74a9f0..6dc55f8)", exit 0. Measured range: 61e6d07 (PLANNER, the brief, touching only the brief file) → 6dc55f8 (IMPLEMENTER work, `Actor: IMPLEMENTER`, 5 files: `src/orchestrator/controller.py`, `tests/test_phase2_general_target.py`, `tests/test_planning_pilot.py`, `tests/test_planning_pilot_routing.py`, `tests/test_review_depth_walk.py`) → dd15bca (the report commit) → bc692fe (this review brief). None are commits of my session.
- The brief embedded in the review brief is byte-identical to the committed `docs/research/phase4-recursive-planning-integration-fixes-brief.md` (only my extraction's trailing review instructions differed).
- `scripts/check-tests --fast` — 950 passed, 45 deselected, 66.24s (report: 67.95s; counts equal).
- `pytest tests/test_phase2_general_target.py tests/test_planning_pilot_routing.py` — 19 passed, 33.46s (2 failed / 17 passed at REV).
- `pytest tests/test_planning_pilot.py tests/test_review_depth_walk.py` — 144 passed, 0.40s.
- `pytest tests/test_phase3_project_oracle.py` — 5 passed, 237.10s (report: 208.92s; green both).
- `scripts/check-static` — exit 0; 104 advisory B/SIM items listed, none gating (matches the report's claim).
- `scripts/check-docs` — exit 0; 316 links OK, 0 errors.
- `scripts/check-tests` (full, my own run for the suite-context shape) — 995 passed, 564.21s. The report's claim (995 passed in 401.95s) is confirmed on counts; the duration drifts with the host.
- Scratch mutant of the delivery (walk reverted to `to_node_id == current` → `from_node_id`): `pytest tests/test_review_depth_walk.py` — 3 failed, 0.37s. Going red needs the walk change, so the delivered green is bound to the fixed walk direction.
NOT VERIFIED:
- None of my own claims. F3's counterfactual half stays NOT VERIFIED as inherited (nested-oracle scratch unfaithful on this host, prior review); it rides F3's carried state.
FINDINGS:
  F6 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  Header-only absorption of the depth probe leaves two of the three maintained pins with names that state the bug's behaviour — the opposite of what they enforce. `test_a_depth_two_leaf_reads_depth_zero_and_the_root_reads_subtree_height` (tests/test_review_depth_walk.py:129) now asserts the truth (root reads 0, depth-2 leaf reads 2, lines 134-136) while its name claims "leaf reads depth zero and the root reads subtree height" — the inverted read the pin forbids; `test_the_pilot_depth_guard_never_refuses_a_node_at_depth_two` (line 141) now asserts the BOUNDS refusal (payload None, admitted false, refusing_stage BOUNDS, lines 163-166) while its name claims the guard never refuses. The diff f74a9f0..6dc55f8 changes only the module header (lines 4-17), so `CHANGED`'s "no test-body change" claim is TRUE, and the header does record the absorption — what it does not record is that the names still describe the red observation. Against the brief's absorption language ("absorbed as maintained pins of the enforced property"), the bodies pin the enforced property but the names misdocument it; a reader of the suite would find two pins asserting the fixed defect.
  FIXED: no regression test — carried; the remedy is a rename (or an explanatory sentence in the header), which belongs to the next brief that touches this file. The pins are otherwise correct, green in my runs, and red under the walk-revert mutant.
  F7 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  The implementer report's residual accounting is mis-voted both ways and its INHERITED drops received items that are still open. Measured: `git diff --no-renames --name-only f74a9f0..6dc55f8` is the brief file plus the five work files; matching against the store's trigger globs, the diff trips `PILOT-R1` (planning_pilot.py, controller.py, reducer.py — controller.py touched) and `PILOT-R10` (controller.py, planning_pilot.py — touched), and does NOT trip `PILOT-R2`–`PILOT-R6` (their globs name decomposition.py, planning_pilot.py, model.py — none touched; planning_pilot.py is not in the delivery at all). The report's TRIPPED names only `PILOT-R2`, so it omits both tripped IDs and names an untripped one; R5's record.md prose "the diff trips `PILOT-R1`–`PILOT-R6`" (docs/record.md:44) is falsified as a measurement — 5 of those 6 IDs are untripped and R10 was never listed. Under the store's own sentence (docs/residuals.md:56, "A tripped trigger is then a finding: fixed with red evidence, or carried into the closeout with its reason"): R1's trip carries with its reason (the diff touches only the depth walk — no connection between guard and admission is rewired — and the wiring constraint is pinned green by `test_admitted_payload_is_forwarded_unmutated`; carried in the passing runs above); R10's trip is discharged as a finding by its recorded standing rationale (trusted-code circumvention is recorded as not claimed solved; the walk change mints no capability). Separately, the report's INHERITED omits the seven residual rows it received verbatim (`PILOT-R1`–`R6`, `R10` — accepted, still open), keeping only F2–F4 and the R5 re-note; the rows are re-carried verbatim below, so the pass-down is repaired here.
  FIXED: no regression test — carried; docs/residuals.md itself (planner-maintained) was never wrong, so this is report accounting only, for the planner's consumption of this review.
SHAPES: none unbuilt — with reason. The review brief's named shapes are all built by delivered code (the three depth pins, the phase-2/routing suite-context pair, the seven routing shapes) and were re-run green here; the remaining attacks were pre-image, diff, and ordering measurements that needed no new probe, so no hand-built shape was left standing.
TRIPPED: none by this review's own diff (this report is a docs/research file; no residual trigger glob names docs/). The step's own measured verdicts are in F7: `PILOT-R1` and `PILOT-R10` tripped, `PILOT-R2`–`PILOT-R6` untripped.
PROPOSED ROWS: none (the absorbed pins need no open-defect registration per R5; the store already holds all seven retained rows).
METHOD FRICTION: none — the review brief, the report template, and the store's tripped-trigger sentence covered every step of this review.
ANSWERS TO QUESTIONS TO ATTACK:
1. F2's `carried` is the right state under R6. Measured: `test_admitted_payload_is_forwarded_unmutated` is byte-identical between f74a9f0 and 6dc55f8 (extracted and diffed — 0 lines), and it still pins transit immutability exactly: dependency edges must not ride in children, the payload forwarded in transit is compared against what the event admits, and the recorded divergence is the controller's own admission normalisation — `controller.py:742` is `contract["parent_proposal"] = proposal_id` in `Controller.propose_decomposition`, which the guard's return cannot carry. R6 settles the meaning as transit immutability and defers the re-word to the API-shape brief, and the frozen provider brief cannot be edited in this step — a real defect left unfixed is carried, never declined. F2 rides INHERITED verbatim with the pinning test intact.
2. The FIXED claim is about the continuation-fixes brief (this step's own brief), not the frozen provider brief. Confirmed against the committed file: `docs/research/phase4-recursive-planning-integration-fixes-brief.md`'s ACCEPTANCE note contains the "Slow-mark convention (the acceptance note F3 asked for)" paragraph, verbatim-matching the embedded copy. The prior brief's note still omits it — the provider implementer's report carries it only as friction text (its report line 26) — which is why F3 is `carried`: the defect lives in the frozen prior brief and its substance was recorded forward into the one the next implementer actually reads. The FIXED line is truthful as written.
3. Every leg of F4's FIXED claim holds, measured from git, not from the report. (a) Between f74a9f0 and the work commit 6dc55f8 there is exactly one commit, 61e6d07, and it is the PLANNER brief commit touching only `docs/research/phase4-recursive-planning-integration-fixes-brief.md` (1 file, +140). (b) `scripts/check-scope f74a9f0 6dc55f8 docs/research/phase4-recursive-planning-integration-fixes-brief.md` prints "scope: ok (6 path(s))", exit 0. (c) The report's line `REV: f74a9f0…   FINAL: 6dc55f8…` honours R6: REV names the step's base (the parent of the brief commit), is NOT claimed to be FINAL's parent (FINAL's parent is 61e6d07, the brief), and FINAL names the work commit — not the report commit dd15bca that holds it. R6's prescription ("a self-referential brief sha is impossible") is exactly what the delivered field now does.
4. Per-ID verdicts, measured by matching `docs/residuals.md` globs against `git diff --no-renames --name-only f74a9f0..6dc55f8` (rows byte-verified verbatim between the brief's fence and the store): `PILOT-R1` tripped (controller.py) — carried with its reason, the wiring constraint intact and pinned green; `PILOT-R10` tripped (controller.py) — carried on its recorded standing rationale; `PILOT-R2` NOT tripped — its globs (decomposition.py, planning_pilot.py) are untouched, and its R5 re-note's enrollment is measured-enforced again (the three depth pins green in my runs), so the carried note's interval is closed; `PILOT-R3`–`PILOT-R6` NOT tripped (globs untouched). Rule 4 makes each tripped trigger a finding fixed with red evidence or carried with its reason — R1 and R10 carry with reasons; neither was ever named in the implementer's TRIPPED, and rule 4's other half (`INHERITED` completeness) fails for the rows: see F7, carried.
5. Falsified in part, as a new finding (F6): the report's own claim is literally true (header records absorption; no test-body change — the diff shows only header lines 4-17 changed, and `git show 6dc55f8:tests/test_review_depth_walk.py`'s bodies assert the enforced property), but the header-only absorption leaves two maintained pins whose names assert the behaviour the brief names as forbidden ("subtree height is not depth"; a guarded refusal where the name says "never refuses"). The correct disposition under the brief's absorption language: the bodies stand as maintained pins, and the names await a rename by the next brief at this seam — carried here as F6 rather than silently accepted.
6. Attacked and NOT falsified — no module leaves a binding mutated past its own trials. Write surface measured: `set_model_profile` is called only at the three phase-2 sites (tests/test_phase2_general_target.py:218/236/723, each paired to a captured restore at 226/255/740 — the delivered capture-before-mutation fix); `set_model_client_factory` at `test_axis1_patch_producer.py:177/190`, `test_axis2_robustness.py:356/369`, `test_batch6_residuals.py:197-210` (capture/restore of the original), `test_phase0_defects.py:288/301`, and the delivered routing fixture (pins at import, restores the found factory). `test_axis1_patch_producer.py` is alphabetically the first binding-touching module in collection order, so the default-restoring restores (factory → None) are not masking any leak, and nothing mutates at import time. `test_batch5_retry.py` (178, 274), `test_verifier_mutations.py` (472, 530-577), and `tests/test_milestone6_acceptance.py` (220 — not in the brief's list) read the bindings and never write them. The sanction's whole check is the full suite: 995 passed in 564.21s on my own run — the report's 995-passed claim stands on counts.
INHERITED:
F2 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The brief's No-mutation shape as written is unsatisfiable: the event's children carry `const parent_proposal` (and the controller's defaults), which the guard's return cannot (verified: tests/test_planning_pilot_routing.py:321-322 vs controller.py:742). The single consistent reading ("the driver forwards the producer payload without editing it; the dependency edges go through the dependencies argument") is implemented and pinned by the delivered test; the literal shape text stands as written in the frozen brief. Closeout: carried, not declined; the wording belongs to an OWNER/planner re-wording, and the next implementer brief at this seam inherits the pinning test and the divergence explanation.

F3 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The implementer brief's acceptance note omits the slow-mark convention for new test modules under tests/, on which its own named oracle command's green depends (verified mechanically: pytest.ini's `slow` marker, `check-tests --fast` = `-m "not slow"`, the oracle's internal gate at src/orchestrator/project_oracle.py:731, the deselecting pre-commit hook, and measured-green constructive half on this host). Misfiled as METHOD FRICTION by the implementer; re-filed here as the brief defect it is. The counterfactual half (unmarked module breaks the oracle) is NOT VERIFIED — nested-oracle scratch unfaithful on this host.

F4 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The implementer brief's `REV:` field names the pre-brief HEAD (1a4c0a7...) which cannot be this step's base (its brief commit consumes R2 in docs/record.md, so check-scope over that sha fails: "docs/record.md is in the diff and not in IN SCOPE"); the implementer's report propagated the field as its base claim — a claim not declared against its source, which stands (the work's actual base is 2b269fc, afc5316's parent). The next implementer brief's REV must name the revision the implementer builds on, and a copied verbatim field must at least be confirmed to name an ancestor-parent of the work's commit before it is claimed.

F6 | SEVERITY: P2 | ORIGIN: CODE | STATE: carried
  Two absorbed pins keep names that state the bug's behaviour, opposite to what they enforce (see F6 above for the finding and remedy).

F7 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  The implementer report's residual accounting mis-votes TRIPPED (names `PILOT-R2`, omits `PILOT-R1`/`PILOT-R10`) and its INHERITED omitted the residual rows (see F7 above); these rows are re-carried here.

R5's re-note on `PILOT-R2`: its "bounds admit exactly one recursive level" enrollment is measured-unenforced until F1 is fixed. F1 is fixed in this step; once the depth pins are green the enrollment is measured-enforced again, and the carried note records the interval.

Residual rows as received (still open), copied verbatim from `docs/residuals.md` and byte-verified against it (fenced so the store's relative evidence links are not re-resolved from this directory):

```
| ID | State | Trigger | Risk | Rationale | Evidence |
| --- | --- | --- | --- | --- | --- |
| `PILOT-R1` | accepted | `src/orchestrator/planning_pilot.py`, `src/orchestrator/controller.py`, `src/orchestrator/reducer.py` | mutable admitted payload (wiring constraint): the caller holds a mutable reference to the admitted payload, and a post-return mutation of a child's scope survives the reducer's re-validation. Any integration must therefore not mutate a payload between the guard and event admission. | the admitted payload is mutable; the reducer's re-derivation runs at admission and on replay, so the guard's result is only as safe as the wiring keeps it | [pilot re-review 3](research/phase4-recursive-planning-pilot-re-review-3.md) |
| `PILOT-R2` | accepted | `src/orchestrator/decomposition.py`, `src/orchestrator/planning_pilot.py` | single-layer containment (F1): scope, budget and bounds admit exactly one recursive level; deeper proposals are legitimate work the guard will refuse | the pilot's mandate is deliberately one level deeper than FIXED_ONE_LEVEL and no more | [pilot re-review 3](research/phase4-recursive-planning-pilot-re-review-3.md) |
| `PILOT-R3` | accepted | `src/orchestrator/model.py`, `src/orchestrator/planning_pilot.py` | `RunState.clone()` is for replay snapshotting, not authority isolation (deepcopy kept): a future model provider must be handed the isolated `provider_state`, never the live state — if a provider is given the live state it can rewrite its own bounds | the pilot spec's threading warning; the live state was handed over exactly once, at the producer seam | [pilot re-review 3](research/phase4-recursive-planning-pilot-re-review-3.md) |
| `PILOT-R4` | accepted | `src/orchestrator/planning_pilot.py` | `parent_scope` is an assertion, not a restriction: containment is multi-scope and refusal is by comparison with the derived parent, not by trusting the argument. Multi-scope containment reaches only one level — a grandchild of a multi-scope parent may not propose | the contract reads `owned_scope: Sequence[str]` as a plural, and S5.4 in R3 of the option (e) review stands | [pilot re-review 3](research/phase4-recursive-planning-pilot-re-review-3.md), [option (e) review](research/phase4-option-e-review-report.md) |
| `PILOT-R5` | accepted | `src/orchestrator/planning_pilot.py`, `src/orchestrator/decomposition.py` | all-glob parent refused: `scope_contained` treats a bare `**` or `*` parent as a containment failure and refuses every child | conservative rather than unsafe; the fixed target owns `src/**`, so its proposals are unaffected | [pilot re-review 3](research/phase4-recursive-planning-pilot-re-review-3.md), [option (e) review](research/phase4-option-e-review-report.md) |
| `PILOT-R6` | accepted | `src/orchestrator/planning_pilot.py` | proposal content is not derivable (shape only): the checks prove shape, budget, bounds and one level of containment — never that a proposal is the right decomposition. If the future model path validates only shape, a well-formed wrong tree is admitted | the independent oracle and the acceptance grading remain the correctness authority; the guard's job is admissibility, not quality | [pilot re-review 3](research/phase4-recursive-planning-pilot-re-review-3.md) |
| `PILOT-R10` | accepted | `src/orchestrator/controller.py`, `src/orchestrator/planning_pilot.py` | in-process trusted-code circumvention of the admission capability: the capability is not reconstructible from data, but trusted code running in-process can hold or mint one and admit anything — if untrusted code is ever loaded in-process, the capability boundary does not hold | R1's prevention-shape ruling: the capability's threat model is data-only reconstruction, and trusted-code circumvention is recorded here rather than claimed solved | [owner rulings](record.md#owner-rulings) (R1) |
```

Rule 2 governs the planner's copy of INHERITED above. Everything in it is still open at this step's close: F2, F3, F4 as received; F6 and F7 as findings carried by this review; the re-note and the seven residual rows as received.

--- when CLOSE OUT is yes, the PLANNER appends this to the step's LAST report only, copying and
    adding no judgement: ---
CLOSEOUT
DECLINED: none
DIVERGENCES CLOSED: none
