diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-09-18 18:38:59 +0000 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-09-18 18:38:59 +0000 |
| commit | 8412aaf0385cbfd850675093f01b16c88052f268 (patch) | |
| tree | 88ae48d06c4d104d65e35d345e65f7c210189564 /skills/executing-plans/scripts/task-done | |
| parent | b36e0829c6d0140e93cfef2ca599b1b07d4a7797 (diff) | |
Release v6.4.0: diagnosing-superpowers and movie skills, Native execution, OpenCode 2.0, Muse, and Qwen Code supportrelease/v6.4.0
Everything on dev since the v6.3.0 merge-back (777ceb5), as one commit.
Full notes: RELEASE-NOTES.md, v6.4.0 section.
Claude-Session: https://claude.ai/code/session_01PRUnVUm4g4EcP9eNjAiT2B
Diffstat (limited to 'skills/executing-plans/scripts/task-done')
| -rwxr-xr-x | skills/executing-plans/scripts/task-done | 52 |
1 files changed, 52 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" |
