diff options
| author | Jesse Vincent <jesse@primeradiant.com> | 2026-09-17 15:51:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-17 17:14:38 -0700 |
| commit | 2b89c4c3f375ab479c3bc0644a76fea78a0f44bb (patch) | |
| tree | 9e3d16f234fb7ad2045c8fdaa3944176b80bbbb6 /skills/executing-plans/scripts | |
| parent | b070d8258ddb712c67dbaecef384f9eb7a876f5d (diff) | |
Rebuild executing-plans as a first-class inline execution modeinline-execution
A cheaper execution mode alongside subagent-driven development: the
session implements every task itself under the same workspace, ledger
and stopping rules, with one fresh whole-branch review on the most
capable model at the end. Helper scripts task-start/task-done keep the
ledger and test log honest; the final fix pass re-grades findings and
fixes Critical/Important under TDD. writing-plans' handoff, SDD's
when-to-use text and two README lines change to match.
Diffstat (limited to 'skills/executing-plans/scripts')
| -rwxr-xr-x | skills/executing-plans/scripts/task-done | 52 | ||||
| -rwxr-xr-x | skills/executing-plans/scripts/task-start | 28 |
2 files changed, 80 insertions, 0 deletions
diff --git a/skills/executing-plans/scripts/task-done b/skills/executing-plans/scripts/task-done new file mode 100755 index 0000000..dd09871 --- /dev/null +++ b/skills/executing-plans/scripts/task-done @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# Close one task of an inline plan execution in a single call: run the task's +# test command, keep its full output in the workspace, print the tail, and — +# only if the command succeeded — append the completion line to the ledger. +# A failing command records nothing: the task is not complete. +# +# Usage: task-done PLAN_FILE TASK_NUMBER BASE -- TEST_COMMAND [ARGS...] +# BASE is the SHA task-start printed; the completion line records BASE..HEAD. +# Exit: the test command's exit status. +set -euo pipefail + +if [ $# -lt 5 ] || [ "$4" != "--" ]; then + echo "usage: task-done PLAN_FILE TASK_NUMBER BASE -- TEST_COMMAND [ARGS...]" >&2 + exit 2 +fi + +plan=$1 +n=$2 +base=$3 +shift 4 +sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)" + +git rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; } + +dir=$("$sdd/sdd-workspace" "$plan") +log="$dir/task-${n}-tests.log" +ledger="$dir/progress.md" + +# Render the command the way a person would type it, for the ledger line. +cmd="" +for a in "$@"; do + case "$a" in + *[[:space:]\"\;\|\&]*) cmd="$cmd '$a'" ;; + *) cmd="$cmd $a" ;; + esac +done +cmd=${cmd# } + +rc=0 +"$@" > "$log" 2>&1 || rc=$? + +tail -n 5 "$log" +if [ "$rc" -ne 0 ]; then + echo "task-done: test command exited $rc; Task $n NOT recorded (full output: $log)" >&2 + exit "$rc" +fi + +last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) +[ -f "$ledger" ] || printf '# SDD ledger — plan: %s\n' "$plan" > "$ledger" +line="Task $n: complete (commits $(git rev-parse --short=7 "$base")..$(git rev-parse --short=7 HEAD), tests: $cmd → $last)" +printf '%s\n' "$line" >> "$ledger" +echo "ledger: $line" diff --git a/skills/executing-plans/scripts/task-start b/skills/executing-plans/scripts/task-start new file mode 100755 index 0000000..fab75b5 --- /dev/null +++ b/skills/executing-plans/scripts/task-start @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Begin one task of an inline plan execution in a single call: extract the +# task's brief (via subagent-driven-development's task-brief, so both skills +# share one workspace) and record BASE, the commit the task's review range is +# cut from. One tool call instead of two, because every call in an inline +# session is a turn that re-reads the whole context. +# +# Usage: task-start PLAN_FILE TASK_NUMBER +# Prints: +# brief: <path to the task's brief file> +# base: <full SHA of HEAD> +set -euo pipefail + +if [ $# -ne 2 ]; then + echo "usage: task-start PLAN_FILE TASK_NUMBER" >&2 + exit 2 +fi + +plan=$1 +n=$2 +sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)" + +out=$("$sdd/task-brief" "$plan" "$n") +brief=$(printf '%s\n' "$out" | sed -n 's/^wrote \(.*\): [0-9][0-9]* lines$/\1/p') +[ -n "$brief" ] || { echo "task-brief did not report a path: $out" >&2; exit 1; } + +echo "brief: $brief" +echo "base: $(git rev-parse HEAD)" |
