REPORT — phase4-recursive-planning-integration-provider-implementer
STEP: phase4-recursive-planning-integration-provider (the scripted provider at the pilot seam, its routing into the recursive arms, and the replay evidence)
REV: 1a4c0a72dd388ca1a2adb3f76b265529035331f8   FINAL: afc5316b5d3b3111704830849efcd2257b3366fe
CHANGED: src/orchestrator/trial_driver.py — recursive arms route through planning_pilot.propose_decomposition via a module-level scripted provider; admitted payload forwarded unmutated; refusals recorded and propagated; decomposition_provider_id and decomposition_provider_records added to TrialMetrics and the routing metric group
CHANGED: tests/test_planning_pilot_routing.py — new slow-marked module building all seven named shapes with four real arm trials plus one injected-provider refusal trial
CHANGED: docs/research/phase4-recursive-planning-integration-provider-implementer.md — this report
VERIFIED: scripts/check-tests --fast — 950 passed, 42 deselected, 74.17s (the new module's 12 tests are slow-marked and deselected)
VERIFIED: .venv/bin/python -m pytest tests/test_planning_pilot_routing.py — 12 passed, 7.31s
VERIFIED: .venv/bin/python -m pytest tests/test_phase3_project_oracle.py — 5 passed, 232.58s
VERIFIED: scripts/check-static — exit 0 (gated BLE001/S110 clean; 104 advisory B/SIM findings, all pre-existing)
VERIFIED: scripts/check-docs — exit 0 (315 links OK)
VERIFIED: .venv/bin/python -m pytest tests/test_milestone6_acceptance.py — 7 passed, 34.14s (extra regression on the metric groups and the four-arm comparison)
NOT VERIFIED: none
FINDINGS:
  F1 | SEVERITY: P1 | ORIGIN: CODE | STATE: carried
  `Controller.node_depth` (and the pilot's `_node_depth_from_state` that delegates to it) walks CHILD_OF in the wrong direction: `propose_decomposition` records `from_node_id=child, to_node_id=parent`, but `_node_depth` filters `to_node_id == current` and treats `from_node_id` as the parent, so it walks down from a node's existing children. At proposal time the proposing parent has no children yet, so the depth read is always 0 and the pilot's `MAX_PROPOSAL_DEPTH` guard and the controller's `maximum_depth` run limit never bind; a depth-unbounded provider would be admitted.
  FIXED: no regression test — the defect is in `src/orchestrator/controller.py` and `src/orchestrator/planning_pilot.py`, which the brief lists as OUT OF SCOPE; the brief's refusal shape was satisfied with a SCOPE refusal (a bound that does bind). Evidence: a direct relation dump showed `node_depth(report-format)=0` for a leaf at depth 2 and `node_depth(root)=1` for the root; the pilot's own tests hand-build relations with the opposite direction (`from_node_id=parent, to_node_id=child`), so `tests/test_planning_pilot.py` cannot see it.
  F2 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: declined
  The No-mutation shape says the children, coverage and dependencies the reducer admits "are exactly the structures the guard returned". Literally this is unsatisfiable: `Controller.propose_decomposition` adds `contract.parent_proposal` (and default budget id/allocation) to the copies it builds for the event, and the brief forbids changing that method. The single consistent reading is "the driver forwards the producer payload without editing it"; the controller's normalization is its own documented admission behaviour applied to its own copies.
  FIXED: n/a — declined, not a defect. The reading is enforced by the No-mutation test, which asserts the producer payload stays pristine after the run (`parent_proposal` absent from the captured guard payload) while the logged child carries exactly that one added field.
SHAPES: none beyond the seven named shapes; every named shape is built by a real trial. The guard-refusing probe injects `_refusing_provider` at the `(state, parent_node_id)` seam via the module global, runs a full trial, and proves the refusal never reaches the log while the module spy proves the real provider is otherwise called.
TRIPPED: PILOT-R2 — its "bounds admit exactly one recursive level" claim is not enforced, because the pilot's depth read is vacuous (F1); the fixed target's two levels are still what runs, so no trial observes deeper proposals.
PROPOSED ROWS: none
METHOD FRICTION:
- `docs/templates/report.txt` says to append the template verbatim and fill it in, but the template also carries the "when CLOSE OUT is yes, the PLANNER appends this" stanza for the CLOSEOUT block. I followed the committed implementer report (`docs/research/detection-a-cancel-by-dispatch-implementer.md`) and ended my report at INHERITED, leaving the CLOSEOUT block to the PLANNER. The template is silent on whether the implementer copies that stanza.
- The acceptance note says a new module under `tests/` breaks the project oracle and that "both the fast suite and the commit hook deselect it". The mechanism is not stated: the new module's tests must be slow-marked so the oracle's internal `scripts/check-tests --fast` (`-m "not slow"`) deselects them. I inferred this from the other trial-running modules; it worked, and the oracle is green. Recorded because the note reads as an unavoidable breakage rather than a convention to follow.
INHERITED:
F1 | SEVERITY: P1 | ORIGIN: CODE | STATE: carried — `Controller.node_depth` walks CHILD_OF in the wrong direction, so the pilot's depth bound and the controller's maximum_depth limit are vacuous in production (out of scope; see FINDINGS).
