mirror of
https://github.com/obra/superpowers.git
synced 2026-06-11 21:29:07 +08:00
Validated 2026-06-10 (all gates pass): go-fractals 54.1-54.7 min / $12.81-14.31 (baseline 64.9 / $16.07); svelte-todo 55.0 min / 19.3M / $14.99 (baseline 79.7 / 27.3M / $20.98); planted-defect pass $2.77. Dispatch-model discipline 3/3 runs after moving model: into the templates as a REQUIRED line. Full experiment log: evals docs/experiments/2026-06-10-sdd-cost-experiments.md
43 lines
1.1 KiB
Bash
Executable File
43 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Extract one task's full text from an implementation plan into a file the
|
|
# implementer reads in one call, so the task text never has to be pasted
|
|
# through the controller's context.
|
|
#
|
|
# Usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]
|
|
# Default OUTFILE: <git-dir>/sdd/task-<N>-brief.md — unique per repo
|
|
# instance, so concurrent sessions cannot collide.
|
|
set -euo pipefail
|
|
|
|
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
|
echo "usage: task-brief PLAN_FILE TASK_NUMBER [OUTFILE]" >&2
|
|
exit 2
|
|
fi
|
|
|
|
plan=$1
|
|
n=$2
|
|
[ -f "$plan" ] || { echo "no such plan file: $plan" >&2; exit 2; }
|
|
|
|
if [ $# -eq 3 ]; then
|
|
out=$3
|
|
else
|
|
dir=$(git rev-parse --git-path sdd)
|
|
mkdir -p "$dir"
|
|
dir=$(cd "$dir" && pwd)
|
|
out="$dir/task-${n}-brief.md"
|
|
fi
|
|
|
|
awk -v n="$n" '
|
|
/^```/ { infence = !infence }
|
|
!infence && /^#+[ \t]+Task[ \t]+[0-9]+/ {
|
|
intask = ($0 ~ ("^#+[ \t]+Task[ \t]+" n "([^0-9]|$)"))
|
|
}
|
|
intask { print }
|
|
' "$plan" > "$out"
|
|
|
|
if [ ! -s "$out" ]; then
|
|
echo "task ${n} not found in ${plan} (no heading matching 'Task ${n}')" >&2
|
|
exit 3
|
|
fi
|
|
|
|
echo "wrote ${out}: $(wc -l < "$out" | tr -d ' ') lines"
|