diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-10-22 22:32:48 +0000 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-10-23 03:38:19 +0000 |
| commit | 750ba92008b88850f6ab321706c7f840bbfff503 (patch) | |
| tree | d13ce7fd72c1c8616ed889b9147b63e1b1132f7e | |
| parent | f75c01fd9b320060c301e2c6591dfc74a8436f15 (diff) | |
fix(sdd): task-brief says when a plan's task headings are not in Englishfix/2459-2496-task-brief-headings
task-brief recognizes only the English word `Task` in a task heading.
writing-plans' template shows `### Task N:` but never says the word is
machine-read, so a model writing a plan in Spanish writes `## Tarea 1:`.
task-brief and task-start then report "task 1 not found in plan-es.md
(no heading matching 'Task 1')", which reads as "this plan has no task 1"
and sends the controller looking for a task that is on line 3 (#2496).
When a plan has no Task headings at all, task-brief now prints, before the
existing not-found line, that task headings must use the English word
"Task" whatever the plan's language, and lists up to five headings shaped
like tasks (`<word> <id-with-a-digit>`). A plan that has Task headings,
just not the requested one, still gets only the not-found line, so asking
for Task 9 of an eight-task plan stays quiet.
This deliberately does not accept other words. Plans commonly carry
`Phase 1`, `Chunk 2` and `Step 1` headings, and a word-agnostic rule
would turn them into tasks. Keeping the word fixed in the plans
themselves is a writing-plans wording change, which needs evals.
Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
| -rwxr-xr-x | skills/subagent-driven-development/scripts/task-brief | 13 | ||||
| -rwxr-xr-x | tests/claude-code/test-sdd-workspace.sh | 33 |
2 files changed, 46 insertions, 0 deletions
diff --git a/skills/subagent-driven-development/scripts/task-brief b/skills/subagent-driven-development/scripts/task-brief index 3d4bd02..d95cd59 100755 --- a/skills/subagent-driven-development/scripts/task-brief +++ b/skills/subagent-driven-development/scripts/task-brief @@ -36,12 +36,18 @@ fi # whose ID extends the requested one with a letter or dot is a sub-task and # stays in its brief (### Task 7 keeps #### Task 7a), as it always has. # Depth alone is not enough: plans drift from "## Task 1" to "### Task 2". +# +# The word stays the English literal "Task", whatever language the rest of +# the plan is in. A plan with no Task headings at all usually translated it +# ("## Tarea 1"), so list the headings shaped like tasks before the +# not-found error instead of implying the plan has no task 1 (#2496). awk -v n="$n" ' /^```/ { infence = !infence } !infence && /^#+[ \t]+Task[ \t]/ { id = $0 sub(/^#+[ \t]+Task[ \t]+/, "", id) if (match(id, /^[A-Za-z0-9]+(\.[A-Za-z0-9]+)*/) && substr(id, 1, RLENGTH) ~ /[0-9]/) { + tasks++ id = substr(id, 1, RLENGTH) match($0, /^#+/) subtask = intask && RLENGTH > level && substr(id, 1, length(n)) == n \ @@ -52,7 +58,14 @@ awk -v n="$n" ' } } } + !infence && /^#+[ \t]+[^ \t]+[ \t]+[A-Za-z0-9.]*[0-9]/ && shaped < 5 { shaped_heading[++shaped] = $0 } intask { print } + END { + if (!tasks && shaped) { + print "task-brief: no task headings found. Task headings must use the English word \"Task\" (\"### Task 1: ...\"), even when the rest of the plan is in another language. Headings shaped like tasks:" | "cat >&2" + for (i = 1; i <= shaped; i++) print " " shaped_heading[i] | "cat >&2" + } + } ' "$plan" > "$out" if [ ! -s "$out" ]; then diff --git a/tests/claude-code/test-sdd-workspace.sh b/tests/claude-code/test-sdd-workspace.sh index 667e5a0..22f1774 100755 --- a/tests/claude-code/test-sdd-workspace.sh +++ b/tests/claude-code/test-sdd-workspace.sh @@ -252,6 +252,39 @@ PLAN fi done + # --- Translated task headings: say so instead of "not found" (#2496) --- + cat > "$repo/plan-es.md" <<'PLAN' +# Plan: demo + +## Tarea 1: Banner + +**Archivos:** + +## Tarea 2: Segunda +PLAN + local es_err + rc=0 + es_err="$(cd "$repo" && "$SDD_SCRIPTS/task-brief" plan-es.md 1 "$id_out" 2>&1 >/dev/null)" || rc=$? + if [[ "$rc" -eq 3 && "$es_err" == *'English word "Task"'* \ + && "$es_err" == *"## Tarea 1: Banner"* && "$es_err" == *"## Tarea 2: Segunda"* ]]; then + pass "task-brief on a plan with no Task headings names the headings it saw" + else + fail "task-brief on a plan with no Task headings names the headings it saw" + echo " exit: $rc" + echo " stderr: $es_err" + fi + + # A plan that has Task headings, just not this one, gets the plain error. + rc=0 + es_err="$(cd "$repo" && "$SDD_SCRIPTS/task-brief" plan-ids.md 99 "$id_out" 2>&1 >/dev/null)" || rc=$? + if [[ "$rc" -eq 3 && "$es_err" == "task 99 not found in plan-ids.md (no heading matching 'Task 99')" ]]; then + pass "a missing task in a plan with Task headings gets only the not-found line" + else + fail "a missing task in a plan with Task headings gets only the not-found line" + echo " exit: $rc" + echo " stderr: $es_err" + fi + # --- review-package takes the plan first and lands in its directory --- local git_id=(-c user.email=t@example.com -c user.name=t -c commit.gpgsign=false) ( cd "$repo" \ |
