exp(codex): print dispatch tuples from SDD scripts — v2 chokepoint for PRI-2672

Run-2 dispatch-4 autopsy: after compaction, the codex-tools role table
fell out of context and the controller reasoned itself into an inherited
sol@max reviewer — the harness's own 'inherited parent model is preferred'
plus SKILL.md's 'most capable model' outvoted the compaction summary's
distilled 'terra/high' line. Its introspection named the only artifact it
actually consults at the moment of dispatch: the review-package output.

So the role tuple now rides the script output, reprinted fresh every
round, immune to compaction by construction:
- task-brief prints role=implementer terra/high fork_turns=none
- review-package prints per role via a new leading --role flag
  (task-review default | re-review | final-review), and SKILL.md call
  sites pass the flag at the re-review and final-review sites
- SKILL.md Model Selection now defers to platform role tables and the
  printed dispatch hints, closing the 'most capable model' loophole
- codex-tools.md tells the controller to copy the printed tuple verbatim

Harness detection considered and rejected: gating the print on CODEX_CI
risks a silent no-op in exactly the environment that needs it; the line
is labeled '(codex spawn_agent)' instead, and CC controllers — whose
templates carry their own model fields — can ignore it.

Experiment branch for PRI-2672 validation; not for merge without eval
evidence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Drew Ritter
2026-07-21 14:30:12 -07:00
parent 3921dc9998
commit d123bde46e
5 changed files with 81 additions and 7 deletions

View File

@@ -165,6 +165,48 @@ PLAN
echo " got: $rp_explicit"
fi
# --- dispatch hints ride the script output ---
if [[ "$brief_out" == *"dispatch (codex spawn_agent): role=implementer fork_turns=none model=gpt-5.6-terra reasoning_effort=high"* ]]; then
pass "task-brief prints the implementer dispatch hint"
else
fail "task-brief prints the implementer dispatch hint"
echo " got: $brief_out"
fi
if [[ "$rp_out" == *"dispatch (codex spawn_agent): role=task-reviewer fork_turns=none model=gpt-5.6-terra reasoning_effort=high"* ]]; then
pass "review-package defaults to the task-reviewer dispatch hint"
else
fail "review-package defaults to the task-reviewer dispatch hint"
echo " got: $rp_out"
fi
local rp_rereview
rp_rereview="$(cd "$repo" && "$SDD_SCRIPTS/review-package" --role re-review plan-a.md HEAD~1 HEAD)"
if [[ "$rp_rereview" == *"role=scoped-re-reviewer fork_turns=none model=gpt-5.6-terra reasoning_effort=medium"* ]]; then
pass "review-package --role re-review prints the medium-effort hint"
else
fail "review-package --role re-review prints the medium-effort hint"
echo " got: $rp_rereview"
fi
local rp_final
rp_final="$(cd "$repo" && "$SDD_SCRIPTS/review-package" --role final-review plan-a.md HEAD~1 HEAD)"
if [[ "$rp_final" == *"role=final-reviewer fork_turns=none model=gpt-5.6-terra reasoning_effort=high"* ]]; then
pass "review-package --role final-review prints the final-reviewer hint"
else
fail "review-package --role final-review prints the final-reviewer hint"
echo " got: $rp_final"
fi
rc=0
(cd "$repo" && "$SDD_SCRIPTS/review-package" --role bogus plan-a.md HEAD~1 HEAD >/dev/null 2>&1) || rc=$?
if [[ "$rc" -eq 2 ]]; then
pass "review-package rejects an unknown --role with exit 2"
else
fail "review-package rejects an unknown --role with exit 2"
echo " exit: $rc"
fi
# --- Worktree isolation: a linked worktree resolves its own workspace ---
local wt="$TEST_ROOT/wt"
( cd "$repo" && git worktree add -q "$wt" -b wt-feature )