summaryrefslogtreecommitdiff
path: root/skills/executing-plans/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'skills/executing-plans/scripts')
-rwxr-xr-xskills/executing-plans/scripts/task-done7
-rwxr-xr-xskills/executing-plans/scripts/task-start6
2 files changed, 10 insertions, 3 deletions
diff --git a/skills/executing-plans/scripts/task-done b/skills/executing-plans/scripts/task-done
index e5fc6a9..d6400b4 100755
--- a/skills/executing-plans/scripts/task-done
+++ b/skills/executing-plans/scripts/task-done
@@ -20,7 +20,10 @@ 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; }
+# The repository the workspace and ledger belong to (see sdd-repo); BASE and
+# HEAD are read there, not in the bare cwd.
+repo=$("${BASH:-bash}" "$sdd/sdd-repo" --with-commit)
+git -C "$repo" 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"
@@ -47,6 +50,6 @@ fi
last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) || last="(no output)"
[ -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)"
+line="Task $n: complete (commits $(git -C "$repo" rev-parse --short=7 "$base")..$(git -C "$repo" 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
index fab75b5..04f1c65 100755
--- a/skills/executing-plans/scripts/task-start
+++ b/skills/executing-plans/scripts/task-start
@@ -20,9 +20,13 @@ plan=$1
n=$2
sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)"
+# BASE comes from the same repository the brief is written into (sdd-repo
+# also refuses one with no commit yet), not from the bare cwd.
+repo=$("${BASH:-bash}" "$sdd/sdd-repo" --with-commit)
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; }
+base=$(git -C "$repo" rev-parse --verify HEAD)
echo "brief: $brief"
-echo "base: $(git rev-parse HEAD)"
+echo "base: $base"