mirror of
https://github.com/obra/superpowers.git
synced 2026-07-23 18:54:07 +08:00
refactor(sdd): platform-owned dispatch hints — shared scripts carry no Codex literals
Responds to maintainer review of this branch: the dispatch-hint lines were hardcoded Codex strings inside shared skill tooling that every harness runs. The per-role hint lines now live in a platform-owned data file, skills/using-superpowers/references/codex-dispatch.hints, and the task-brief/review-package scripts only relay the current role's line. The relay is suppressed when CLAUDECODE is set (Claude Code's dispatch templates already carry model selection) and on any harness with no hints file; unknown harnesses fail toward printing, because a silent no-op in the environment that needs the hint is the failure mode this mechanism exists to prevent. Printing at the moment of dispatch is load-bearing: skill text loaded at session start does not survive context compaction, but script output reprints every round. codex-tools.md's SDD dispatch section shrinks to the behavioral rules (fork_turns: "none" always; copy the printed hint verbatim; reviewer tier never exceeds implementer tier; no effort bumps; the <=0.144 inheritance fallback) and points at the hints file for values. Tests cover the relay path, the per-role efforts, and the new CLAUDECODE suppression case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -165,39 +165,54 @@ 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"
|
||||
# --- platform dispatch hints ride the script output (suppressed on CC) ---
|
||||
local brief_hint
|
||||
brief_hint="$(cd "$repo" && env -u CLAUDECODE "$SDD_SCRIPTS/task-brief" plan-a.md 1)"
|
||||
if [[ "$brief_hint" == *"dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=high"* ]]; then
|
||||
pass "task-brief relays the implementer dispatch hint off Claude Code"
|
||||
else
|
||||
fail "task-brief prints the implementer dispatch hint"
|
||||
echo " got: $brief_out"
|
||||
fail "task-brief relays the implementer dispatch hint off Claude Code"
|
||||
echo " got: $brief_hint"
|
||||
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"
|
||||
local rp_hint
|
||||
rp_hint="$(cd "$repo" && env -u CLAUDECODE "$SDD_SCRIPTS/review-package" plan-a.md HEAD~1 HEAD)"
|
||||
if [[ "$rp_hint" == *"dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=high"* ]]; then
|
||||
pass "review-package relays the default-role hint off Claude Code"
|
||||
else
|
||||
fail "review-package defaults to the task-reviewer dispatch hint"
|
||||
echo " got: $rp_out"
|
||||
fail "review-package relays the default-role hint off Claude Code"
|
||||
echo " got: $rp_hint"
|
||||
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"
|
||||
rp_rereview="$(cd "$repo" && env -u CLAUDECODE "$SDD_SCRIPTS/review-package" --role re-review plan-a.md HEAD~1 HEAD)"
|
||||
if [[ "$rp_rereview" == *"dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=medium"* ]]; then
|
||||
pass "review-package --role re-review relays the medium-effort hint"
|
||||
else
|
||||
fail "review-package --role re-review prints the medium-effort hint"
|
||||
fail "review-package --role re-review relays 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"
|
||||
rp_final="$(cd "$repo" && env -u CLAUDECODE "$SDD_SCRIPTS/review-package" --role final-review plan-a.md HEAD~1 HEAD)"
|
||||
if [[ "$rp_final" == *"dispatch (spawn_agent): fork_turns=none model=gpt-5.6-terra reasoning_effort=high"* ]]; then
|
||||
pass "review-package --role final-review relays the high-effort hint"
|
||||
else
|
||||
fail "review-package --role final-review prints the final-reviewer hint"
|
||||
fail "review-package --role final-review relays the high-effort hint"
|
||||
echo " got: $rp_final"
|
||||
fi
|
||||
|
||||
local brief_cc rp_cc
|
||||
brief_cc="$(cd "$repo" && CLAUDECODE=1 "$SDD_SCRIPTS/task-brief" plan-a.md 1)"
|
||||
rp_cc="$(cd "$repo" && CLAUDECODE=1 "$SDD_SCRIPTS/review-package" plan-a.md HEAD~1 HEAD)"
|
||||
if [[ "$brief_cc" != *"dispatch (spawn_agent)"* && "$rp_cc" != *"dispatch (spawn_agent)"* ]]; then
|
||||
pass "dispatch hints are suppressed under Claude Code (CLAUDECODE set)"
|
||||
else
|
||||
fail "dispatch hints are suppressed under Claude Code (CLAUDECODE set)"
|
||||
echo " brief: $brief_cc"
|
||||
echo " rp: $rp_cc"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user