From b5937734ca1ead5e53bc7b982f5cb875009197dd Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 9 Apr 2026 05:12:16 -0500 Subject: [PATCH] fix: make gsd_complete_task the only execute-task summary path --- src/resources/extensions/gsd/prompts/execute-task.md | 6 +++--- src/resources/extensions/gsd/tests/prompt-contracts.test.ts | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/resources/extensions/gsd/prompts/execute-task.md b/src/resources/extensions/gsd/prompts/execute-task.md index f1f22fe86..ddf3fa1d7 100644 --- a/src/resources/extensions/gsd/prompts/execute-task.md +++ b/src/resources/extensions/gsd/prompts/execute-task.md @@ -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." diff --git a/src/resources/extensions/gsd/tests/prompt-contracts.test.ts b/src/resources/extensions/gsd/tests/prompt-contracts.test.ts index 7c1092641..486bccb4e 100644 --- a/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +++ b/src/resources/extensions/gsd/tests/prompt-contracts.test.ts @@ -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", () => {