From 70e90275c0a08649c314cae5280521bcd29272e6 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 4 Apr 2026 09:36:56 +0000 Subject: feat: acceptance_criteria per story task in elaboration and approval Add AcceptanceCriteria field to elaboratedStoryTask struct, update buildStoryElaboratePrompt schema and rules, pass the value through handleApproveStory into task.Task, and add a test verifying the field is persisted on approved story tasks. Co-Authored-By: Claude Sonnet 4.6 --- internal/api/elaborate.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'internal/api/elaborate.go') diff --git a/internal/api/elaborate.go b/internal/api/elaborate.go index dd51c7d..0cb298d 100644 --- a/internal/api/elaborate.go +++ b/internal/api/elaborate.go @@ -282,9 +282,10 @@ type elaboratedStorySubtask struct { // elaboratedStoryTask is one independently-deployable unit in a story plan. type elaboratedStoryTask struct { - Name string `json:"name"` - Instructions string `json:"instructions"` - Subtasks []elaboratedStorySubtask `json:"subtasks"` + Name string `json:"name"` + Instructions string `json:"instructions"` + AcceptanceCriteria string `json:"acceptance_criteria"` + Subtasks []elaboratedStorySubtask `json:"subtasks"` } // elaboratedStoryValidation describes how to verify the story was successful. @@ -313,6 +314,7 @@ Output ONLY valid JSON matching this schema: { "name": "task name", "instructions": "detailed instructions including file paths and what to change", + "acceptance_criteria": "specific, verifiable conditions a separate reviewer can check — e.g. 'run go test ./... and verify all pass; confirm GET /api/foo returns 200 with expected JSON shape'", "subtasks": [ { "name": "subtask name", "instructions": "..." } ] @@ -330,7 +332,8 @@ Rules: - Subtasks within a task are order-dependent and run sequentially - Instructions must include specific file paths, function names, and exact changes - Instructions must end with: git add -A && git commit -m "..." && git push origin -- Validation should match the scope: small change = build check; new feature = smoke test` +- Validation should match the scope: small change = build check; new feature = smoke test +- acceptance_criteria must be concrete and verifiable by a separate agent — no vague assertions like "code looks good"` } func (s *Server) elaborateStoryWithClaude(ctx context.Context, workDir, goal string) (*elaboratedStory, error) { -- cgit v1.2.3