fix: make gsd_complete_task the only execute-task summary path

This commit is contained in:
Jeremy 2026-04-09 05:12:16 -05:00
parent b02b1b1a81
commit b5937734ca
2 changed files with 7 additions and 5 deletions

View file

@ -69,14 +69,14 @@ Then:
16. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
17. If you discover a non-obvious rule, recurring gotcha, or useful pattern during execution, append it to `.gsd/KNOWLEDGE.md`. Only add entries that would save future agents from repeating your investigation. Don't add obvious things.
18. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
19. Write `{{taskSummaryPath}}`
20. Call `gsd_complete_task` with milestoneId, sliceId, taskId, and a summary of what was accomplished. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, and renders PLAN.md automatically.
19. Use that template to prepare the completion content you will pass to `gsd_complete_task` using the camelCase fields `milestoneId`, `sliceId`, `taskId`, `oneLiner`, `narrative`, `verification`, and `verificationEvidence`. Do **not** manually write `{{taskSummaryPath}}` — the DB-backed tool is the canonical write path and renders the summary file for you.
20. Call `gsd_complete_task` with milestoneId, sliceId, taskId, and the completion fields derived from the template. This is your final required step — do NOT manually edit PLAN.md checkboxes. The tool marks the task complete, updates the DB, renders `{{taskSummaryPath}}`, and updates PLAN.md automatically.
21. Do not run git commands — the system reads your task summary after completion and creates a meaningful commit from it (type inferred from title, message from your one-liner, key files from frontmatter). Write a clear, specific one-liner in the summary — it becomes the commit message.
All work stays in your working directory: `{{workingDirectory}}`.
**Autonomous execution:** Do not call `ask_user_questions` or `secure_env_collect`. You are running in auto-mode — there is no human available to answer questions. Make reasonable assumptions and document them in the task summary. If a decision genuinely requires human input, note it in the summary and proceed with the best available option.
**You MUST call `gsd_complete_task` AND write `{{taskSummaryPath}}` before finishing.**
**You MUST call `gsd_complete_task` before finishing. Do not manually write `{{taskSummaryPath}}`.**
When done, say: "Task {{taskId}} complete."

View file

@ -71,11 +71,13 @@ test("execute-task prompt references gsd_complete_task tool", () => {
assert.match(prompt, /gsd_complete_task/);
});
test("execute-task prompt instructs writing task summary before tool call", () => {
test("execute-task prompt uses gsd_complete_task as canonical summary write path", () => {
const prompt = readPrompt("execute-task");
// The prompt instructs writing the summary file AND calling the tool
assert.match(prompt, /\{\{taskSummaryPath\}\}/);
assert.match(prompt, /gsd_complete_task/);
assert.match(prompt, /DB-backed tool is the canonical write path/i);
assert.match(prompt, /Do \*\*not\*\* manually write `?\{\{taskSummaryPath\}\}`?/i);
assert.doesNotMatch(prompt, /^\d+\.\s+Write `?\{\{taskSummaryPath\}\}`?\s*$/m);
});
test("execute-task prompt does not instruct LLM to toggle checkboxes manually", () => {