REPORT — phase4-recursive-planning-integration-api-shape-review
STEP: phase4-recursive-planning-integration-api-shape (Phase 4: the admission capability, the two mint points, and the constructor rename)
REV: 41ec3303c9c184138f5ca3201f40fc00ba9ce7de   FINAL: 98988d44515cb0f088885c3b6d5f6f6c051c6fec
CHANGED:
  docs/research/phase4-recursive-planning-integration-api-shape-review.md — this report.
  No other file. No new probe module: F9 is settled by git evidence alone, and F10's reproducer is a hand probe of trusted-code construction — a suite test for it would pin either the overclaim or a `PILOT-R10` closure the brief declines, and no named shape is unbuilt (see SHAPES).
VERIFIED:
- REVIEW ACCEPTANCE `scripts/check-scope 41ec3303c9c184138f5ca3201f40fc00ba9ce7de 98988d44515cb0f088885c3b6d5f6f6c051c6fec docs/research/phase4-recursive-planning-integration-api-shape-brief.md` — "tripped: PILOT-R1 PILOT-R2 PILOT-R3 PILOT-R4 PILOT-R5 PILOT-R6 PILOT-R10 PILOT-R10", "scope: ok (13 path(s) in 41ec330..98988d4)", exit 0.
- The brief embedded in the review brief is byte-identical to the committed `docs/research/phase4-recursive-planning-integration-api-shape-brief.md` at 2f6c3e5 (dispatch) and at HEAD (diff empty both ways), so no FINDING on the copy.
- Work commit measured: 98988d4 is the only `Actor: IMPLEMENTER` commit in 41ec330..98988d4 (12 files, the brief untouched by it); the range's other three commits are `Actor: PLANNER` (c60e398, af4cbca, 2f6c3e5, brief-only). None is a commit of my session.
- `scripts/check-tests --fast` — 960 passed, 45 deselected, 78.62s (report: 960/45 in 91.26s; counts equal).
- `pytest tests/test_planning_pilot.py tests/test_planning_pilot_routing.py tests/test_review_depth_walk.py` — 164 passed, 8.89s (report: 164 in 11.28s).
- `pytest tests/test_crash_recovery.py tests/test_crash_matrix.py tests/test_batch5_recovery.py` — 17 passed, 1.20s (report: 17 in 1.09s).
- `pytest tests/test_milestone2_acceptance.py tests/test_milestone8_readiness.py` — 41 passed, 1.45s (report: 41 in 1.46s).
- `pytest tests/test_milestone2_conformance.py tests/test_milestone3_conformance.py` — 70 passed, 0.34s (report: 70 in 0.49s).
- `pytest tests/test_phase3_project_oracle.py` — 5 passed, 262.91s (report: 5 in 283.38s).
- `scripts/check-static` — exit 0, "All checks passed!" on the gated select (BLE001,S110 over src/orchestrator); 104 advisory B/SIM items listed afterwards, none gating. Matches the report's account.
- `scripts/check-docs` — exit 0, 315 links, 0 errors (matches the report).
- `scripts/check-tests` (full; the reviewer's own suite-context run) — 1005 passed, 470.39s. The 960/45 split above is this run minus the 45 slow cases.
NOT VERIFIED:
- F6's "both renamed bodies were green at REV under their wrong names" rests on the fixes step's VERIFIED. My REV-side evidence is the pre-image read only (`git show 41ec3303c9c184138f5ca3201f40fc00ba9ce7de:tests/test_review_depth_walk.py` shows assertion bodies identical to FINAL). A name defect has no failing assertion to name, so there is no red to re-observe at REV — consistent with F6's `FIXED: no regression test`.
- F9's dispatch timeline is measured from git (parent chain, author==committer dates, and the three planner commit messages' own accounts of dispatch / abort / re-dispatch). The repository holds no dispatch log; if a dispatch ran against a text the log does not show, the reading would change — see answer 7 for the exact evidence and its limit.
FINDINGS:
  F9 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  The implementer report's METHOD FRICTION entry (2) misstates this brief's revision history on two counts. (1) Timing and "rewritten": it places the R7 re-cut and a history rewrite "while this step was already implementing it", but `git log --format='%H %ci %s' --all -- docs/research/phase4-recursive-planning-integration-api-shape-brief.md` plus the parent chain (c39b094 → b430384 → 41ec330 → c60e398 → af4cbca → 2f6c3e5 → 98988d4) shows c60e398 at 16:33:40 ("Re-cut the API-shape brief per R7 before dispatch") and af4cbca at 16:36:04 both before the first dispatch, and 2f6c3e5 at 20:51:23 ("Record the dispatch-time tree state in the brief" — its message: "The first dispatch was aborted mid-implementation and left uncommitted edits … so the re-dispatched implementer neither mistakes them …") after the aborted attempt and before the re-dispatch; 98988d4 at 21:43:07 is the work commit. The chain is linear and `%ai` equals `%ci` on every commit in c39b094..98988d4, so there is no evidence of any git history rewrite. (2) "the acceptance command list changed shape and was re-run as the current brief names it (the phase-3 oracle was added)": `pytest tests/test_phase3_project_oracle.py` is in the brief's ACCEPTANCE from its first commit (`git show c39b094:docs/research/phase4-recursive-planning-integration-api-shape-brief.md`) and unchanged at b430384, 41ec330, af4cbca and 2f6c3e5; the list's only change across the brief's history is the check-scope REV sha (f98ea9d → 41ec330 at the re-cut). The entry's opening half is true — GOAL and named shapes unchanged (af4cbca..2f6c3e5 touches CONTEXT only; the re-cut touches INHERITED/RESIDUALS/REV and the re-copied template) — what it gets wrong is when, what, and that any rewrite ran under a live implementer.
  FIXED: no regression test — a report-history misstatement has no failing assertion to name; the git measurements above are the evidence.
  F10 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The Two-mint-point shape's "construction outside those paths is impossible or refused" claims more than the brief's own threat model delivers. Falsified-with-reproducer at FINAL (hand probe importing `orchestrator.controller` from `src`): `copy.copy(cap)` over a capability from `_mint_admission_capability([child("c1")])` yields a second `AdmissionCapability` with `admits([child("c1")]) is True` (slot copy preserves the module-private mint nonce by identity) — working authority constructed outside both mint points and not refused; and `AdmissionCapability.__new__(AdmissionCapability)` constructs an instance without refusal (`isinstance` is True; `admits` then raises AttributeError, so the object is non-functional but construction was not refused — which also contradicts the class docstring's "construction without the module-private mint nonce is refused"). Both are in-process trusted-code acts, and GOAL plus `PILOT-R10` place exactly those outside the capability's threat model ("in-process trusted-code circumvention stays outside the threat model"; OUT OF SCOPE declines closing `PILOT-R10`). The data-only half is intact (see answer 2): direct construction is refused in three variants with `WorkflowError`, and pickle round-trip and deepcopy reconstruct non-functional objects. The clause should read data-only construction, matching the Capability shape's "a caller holding only data cannot construct one"; as written it invites a reader to claim a third-mint closure that `PILOT-R10` does not buy.
  FIXED: no regression test — an ORIGIN: BRIEF finding is fixed once a later committed brief corrects the text; none has at this commit.
SHAPES: one probed property the suite does not build — serialization reconstruction resistance (a pickled or deep-copied `AdmissionCapability` must not remain working authority). Probed by hand at FINAL: `pickle.loads(pickle.dumps(cap))` and `copy.deepcopy(cap)` both give `isinstance`-true objects whose `admits` is False, so the property holds; `tests/test_planning_pilot.py`'s `TestAdmissionCapabilityIsRequired` / `TestTheOnlyTwoMintPoints` pin direct-construction refusal and name the two mint points, and nothing pins the round-trip. Not a defect (the named shapes are each built and green — see answer 1 and the shape map in answer 2); listed because the suite would not notice a future change that made pickle or deepcopy round-trips work. F10's `copy.copy` half is not listed as a shape: it is a trusted-code duplicate of held authority (equivalent to aliasing), not a property the suite should pin.
TRIPPED: PILOT-R1 PILOT-R2 PILOT-R3 PILOT-R4 PILOT-R5 PILOT-R6 PILOT-R10 PILOT-R10
PROPOSED ROWS: none (the planner maintains docs/residuals.md).
METHOD FRICTION: none against the method's steps or `docs/templates/report.txt`. One loose label in my own review brief was resolved rather than worked around: its question 4 names "the `decomp-1`/`decomp-2` corpus recordings" in `conformance.py`, but no `decomp-2` literal exists at FINAL and `decomp-1` is a proposal id in tests/test_crash_matrix.py:69,160 and tests/test_crash_recovery.py:227; `conformance.py`'s two decomposition recordings use `f"decomp-{run_id}"` at lines 221 and 284 — the same two sites the brief's own CONTEXT names as `conformance.py:220,283`. Exactly one reading is consistent with that CONTEXT, and answer 4 takes it and says so. A defect in a brief is a FINDING; this is not one (the line numbers disambiguate uniquely), so it is recorded here as the measurement note it is.
ANSWERS TO QUESTIONS TO ATTACK:
1. F8's rename class — completeness and reading; F6's `fixed` claim. Completeness: attacked-and-not-falsified. Swept every `propose_decomposition` identifier at FINAL (`git grep -n propose_decomposition 98988d4 -- tests/ src/orchestrator/{controller,planning_pilot,trial_driver,conformance}.py`). Test names: the only name that ever embedded the retired unguarded sense is `test_propose_decomposition_blocks_dependents_only`, now `test_admitted_decomposition_blocks_dependents_only` (tests/test_milestone2_acceptance.py:968); no `def test_*propose_decomposition*` remains (the three `*propose*` names left — `test_a_parent_at_the_pilot_depth_may_not_propose`, `test_a_parent_below_the_depth_may_propose`, `test_a_misstated_proposed_count_is_refused` — name the pilot's propose act and still make `pilot.admit_proposal` / `pilot.propose_decomposition` calls). Assertion messages: none embed the entry name (grep for assertion lines naming it is empty). Docstrings: two references remain and both are accurate rather than stale — tests/test_review_depth_walk.py:13 cites `Controller.propose_decomposition`'s RELATION_RECORDED as the production write site, and that method still emits it (`admit_derived_decomposition` delegates into its body; controller.py:253 is the same citation inside `_node_depth`); the test-local docstring that used to claim the test's own call was retargeted ("Uses the controller's own ``admit_derived_decomposition`` twice"). The five retargeted modules (test_crash_recovery, test_crash_matrix, test_batch5_recovery, test_milestone2_acceptance, test_milestone8_readiness) contain no `propose_decomposition` string at all. Reading: rename-with-the-entry is right. The Pin-name shape's rule is name-states-the-enforced-property; a name stating `propose_decomposition` over a call to `admit_derived_decomposition` states a call the test no longer makes — F6's class exactly ("names that state the bug's behaviour, opposite to what they enforce"). It is the only reading consistent with that rule, the implementer took it, and F8 names the reading — correct under the brief's "exactly one reading" clause. F6's `fixed` claim: verified against `git show 41ec3303c9c184138f5ca3201f40fc00ba9ce7de:tests/test_review_depth_walk.py` and `git show 98988d44515cb0f088885c3b6d5f6f6c051c6fec:tests/test_review_depth_walk.py`. Both pins renamed (`test_a_depth_two_leaf_reads_depth_zero_and_the_root_reads_subtree_height` → `test_the_root_reads_depth_zero_and_a_true_depth_two_leaf_reads_two_and_subtree_height_is_not_depth`; `test_the_pilot_depth_guard_never_refuses_a_node_at_depth_two` → `test_the_pilot_depth_guard_refuses_a_proposal_at_a_true_depth_two_node_at_bounds`); assertions unchanged (pin 1: `node_depth == 0`, `node_depth == 2`; pin 2: payload None, `admitted` False, `refusing_stage == "BOUNDS"`, `accepted_children == 0`); the only body delta is pin 2's tuple unpack for the three-value return (`payload, record, _capability =`), which is not an assertion. The third pin (`test_maximum_depth_run_limit_refuses_decomposition_past_the_limit`) is untouched and its name already states its property. Attacked-and-not-falsified.
2. `Two-mint-point shape` — falsified-with-reproducer on the wording clause (F10), attacked-and-not-falsified on the mint claim. Method: real store runs plus constructor probes at FINAL. Direct construction refused in all three variants (`AdmissionCapability()`, `AdmissionCapability(bound_digest="deadbeef")`, `AdmissionCapability(mint=object(), bound_digest=...)`) with `WorkflowError("an admission capability cannot be constructed from data…")`. pickle round-trip of a minted capability: unpickles `isinstance`-true with `admits` False (the nonce is module-level `object()` identity and does not survive serialization). `copy.deepcopy`: `admits` False likewise. `copy.copy`: `admits` True — F10. `dataclasses.replace`: TypeError (not a dataclass). `AdmissionCapability.__new__(AdmissionCapability)`: constructed without refusal, `admits` raises AttributeError — F10's second half. Subclass with `admits` overridden via `__new__`: working forgery — trusted code, `PILOT-R10`'s exact residual. Private-mint reachability: `from orchestrator.controller import _MINT, _mint_admission_capability` imports and both mint working capabilities — trusted code, `PILOT-R10` ("trusted code running in-process can hold or mint one"). No path hands a capability to a caller that never passed the guard: `planning_pilot.propose_decomposition` returns one only after `admit_proposal` succeeds (all three refusal arms set `capability = None`; observed `payload=None cap_is_none=True record_admitted=False` on a refused proposal), and `Controller.admit_derived_decomposition` mints and passes it straight into `propose_decomposition` without ever returning it. The suite's shape map is complete on the named list: `TestAdmissionCapabilityIsRequired` (Capability), `TestTheOnlyTwoMintPoints` (Two-mint-point), `TestDigestBinding` (Digest-binding), `TestDerivedOnlyNaming` (Derived-only naming), `TestNoMarkerField` (No-marker), `test_admitted_payload_is_forwarded_unmutated` (Transit immutability), the two renamed depth pins (Pin-name).
3. `Digest-binding shape` — attacked-and-not-falsified. Full-path probe (mint via `pilot.admit_proposal`, submit via `controller.propose_decomposition` on a real store): a capability minted over children A is refused at a submission whose children digest differs (children B) — `WorkflowError("…the submitted children digest differs")`. The digest covers exactly the admitted children: not a constant (three different children lists → three distinct sha256 digests; `_children_digest([c1])` deterministic across calls); not coverage alone (same children with different `criterion_coverage` still bind and admit — observed `ACCEPTED ids=['RUN-A']` — while different children with the same criterion shape, `c1` vs `c2` both `criterion_ids=["AC"]`, are refused); not dependencies alone (`_children_digest` reads only `list(children)`; children plus a DEPENDS_ON edge riding the `dependencies` argument admit — `ACCEPTED ids=['RUN-C', 'RUN-D']`). The guarded mint binds exactly the structures the guard admitted: `admit_proposal` deep-copies (`proposed = [copy.deepcopy(dict(child)) for child in children]`) and returns `proposed, _mint_admission_capability(proposed)`, and a post-return mutation of a deep copy is refused (suite's `TestDigestBinding` third case, re-run green). A refused proposal hands out `capability=None` (observed).
4. `Derived-only naming shape` — attacked-and-not-falsified. Model-routed reachability of `admit_derived_decomposition`: none. The model-routed forward is `trial_driver._route_decomposition` → `planning_pilot.propose_decomposition` → `_admit_routed_decomposition` → `controller.propose_decomposition(..., admission_capability=capability)`, and `_admit_routed_decomposition`'s source contains no `admit_derived_decomposition` (tests/test_planning_pilot.py's `test_the_derived_route_entry_declares_the_derived_only_route` pins that with `inspect.getsource`, alongside `"derived" in Controller.admit_derived_decomposition.__name__` and the derived path as `_admit_decomposition`'s caller). Provider output is data and never selects a controller entry. A trusted-code caller can invoke `admit_derived_decomposition` directly — that is the derived mint itself, `PILOT-R10`. On the corpus recordings (labels resolved per METHOD FRICTION above): conformance.py's use of the derived entry is correct. Both recordings — `_record_decomposition_conflicts_replan` (call at 221) and `_record_dependency_guard` (call at 284) — build deterministic controller-driven corpora (`_decomposition_children(run_id)` fixed children, `ScriptedExecutor` scripts, no provider, no trial arm): the deterministic derivation admission path, exactly like `trial_driver._admit_decomposition`. They do not model a run that must hold a capability: the capability is admission-time authority and never event content (R1's no-marker rule — `TestNoMarkerField` asserts no `source`/`marker`/`admission_capability` key on the payload, event, or capability structure), and both routes land identical `DECOMPOSITION_ADMITTED` payloads (`test_both_routes_land_the_same_decomposition_admitted_payload_and_dependency_edges`, re-run green). A corpus built through the derived entry therefore records the same observables a capability-holding run would. The crash fixtures' `decomp-1` sites (test_crash_matrix.py:69,160; test_crash_recovery.py:227) are the same class — deterministic interrupted-decomposition fixtures — and their retarget to the derived entry is likewise correct.
5. `Transit immutability shape` — attacked-and-not-falsified; the report's claim is TRUE. Verified with the blobs, not the account: extracted `test_admitted_payload_is_forwarded_unmutated` by AST source segment from `git show 41ec3303c9c184138f5ca3201f40fc00ba9ce7de:tests/test_planning_pilot_routing.py` and `git show 98988d44515cb0f088885c3b6d5f6f6c051c6fec:tests/test_planning_pilot_routing.py` — 1591 bytes each, byte-identical. The whole-file diff is exactly the fixture spy's two lines (146 and 150): the unpack `payload, record, capability = original(...)` and the matching `return payload, record, capability`. Nothing else in the file differs. The pin still asserts what the shape names — dependency edges must not ride in children, coverage/dependencies/children forwarded equal to the event's, the guard's copy free of `parent_proposal`, and the event's `parent_proposal` equal to `payload["proposal_id"]` (the controller's deterministic admission normalisation).
6. Observable behaviour — attacked-and-not-falsified for all four arms. The named acceptance modules and the conformance corpus are green (counts in VERIFIED). The four arms are pinned in tests/test_planning_pilot_routing.py: `test_direct_and_fixed_one_level_keep_their_unrouted_behaviour` (DIRECT: provider `NONE`, zero provider records, zero `DECOMPOSITION_ADMITTED`; FIXED_ONE_LEVEL: provider `DERIVED`, exactly one decomposition at the root, `fixed.nodes == 4`); `test_routed_structure_equals_derived_structure` over `_ROUTED_ARMS` (RECURSIVE_LAZY, RECURSIVE_CONCURRENT) against `plan_decomposition`'s derived structure (node ids, scopes, criterion ids, budget allocations, coverage, dependencies); `test_every_arm_records_its_decomposition_provider_id` (SCRIPTED / SCRIPTED / DERIVED / NONE); and the byte-identical transit pin parametrized over `_ROUTED_ARMS`. `scripts/check-tests` (full, 1005 passed) covers the slow experiment cases the named modules deselect, and `tests/test_milestone2_conformance.py` / `tests/test_milestone3_conformance.py` (70 passed) confirm the reducer's replay authority is unaffected — the capability is not event content, so the corpus's mutation surface is unchanged.
7. METHOD FRICTION entry (2) vs `git log` — falsified, filed as F9. Evidence and its limit are in NOT VERIFIED and the finding. In short: c60e398 (16:33:40, "Re-cut the API-shape brief per R7 before dispatch") and af4cbca (16:36:04) precede the first dispatch; 2f6c3e5 (20:51:23) followed the aborted attempt and preceded the re-dispatch (its message addresses "the re-dispatched implementer" about "The first dispatch [that] was aborted mid-implementation"); 98988d4 (21:43:07) is the work commit. No brief revision ran under a live implementer, `%ai` equals `%ci` on every commit in c39b094..98988d4 (no rewrite evidence), and the acceptance list never gained the phase-3 oracle (it is at c39b094 already; the list's only delta is the check-scope REV sha). The entry's two template points are legitimate friction and are not carried beyond this attack, per the review brief; the history misstatement is a defect in the report and is therefore a FINDING, not friction.
INHERITED:
F7 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  The implementer report's residual accounting mis-votes TRIPPED (names `PILOT-R2`, omits `PILOT-R1`/`PILOT-R10`).

R7 withdrew F7's INHERITED half as a finding against correct behaviour — rule 3 selects residuals per brief, and the implementer's exclusion of the seven rows was right — so F7 stands only as its wrong-`TRIPPED` half, quoted above.

F8 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The rename mandate names only F6's two pins and is silent about in-scope test identifiers that embed the retired unguarded entry name: retargeting `test_propose_decomposition_blocks_dependents_only` to `admit_derived_decomposition` without renaming it would re-open F6's class (a name stating `propose_decomposition` over a call that no longer makes it). Exactly one reading is consistent with the Pin-name shape's name-states-the-enforced-property rule — such identifiers are renamed with the entry — and this step took it: the test is `test_admitted_decomposition_blocks_dependents_only` (tests/test_milestone2_acceptance.py).
  FIXED: no regression test — an ORIGIN: BRIEF finding is fixed once a later committed brief states the rule in text; none has at this commit, so this is carried into the closeout for the ruling rather than declined.

F9 | SEVERITY: P2 | ORIGIN: DOCUMENT | STATE: carried
  METHOD FRICTION entry (2) misstates the brief's revision history and the acceptance list's history (see F9 above for the git measurements).

F10 | SEVERITY: P2 | ORIGIN: BRIEF | STATE: carried
  The Two-mint-point shape's "construction outside those paths is impossible or refused" overclaims the data-only threat model (see F10 above for the reproducer and the fix).

Rule 2 governs the planner's copy of INHERITED above. Everything in it is still open at this step's close: F7 and F8 as received; F9 and F10 as findings carried by this review. F6 is not re-carried — this step fixed it (answer 1). No residual rows ride here; rule 3 re-selects them per brief.

--- 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
