diff options
| author | Claudomator Agent <agent@claudomator.local> | 2026-03-26 09:28:17 +0000 |
|---|---|---|
| committer | Claudomator Agent <agent@claudomator.local> | 2026-03-26 09:28:17 +0000 |
| commit | f66fde80bf5759faa75d3c294e99abbb75dd2cdf (patch) | |
| tree | 8e25d577d1916bdf53f052c36e6c49ba2956b199 /internal/executor/executor.go | |
| parent | a13ec6aa94550bce5caaee6bc01e690cabb5d4dc (diff) | |
update createValidationTask to list named acceptance criteria in instructionsstory/acceptance-criteria
Replace raw ValidationJSON in validation task instructions with a
formatted per-criterion checklist when acceptance_criteria entries are
present. Falls back to the raw JSON blob when AcceptanceCriteria is
empty. Adds TestCreateValidationTask_InstructionsIncludeNamedCriteria.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/executor.go')
| -rw-r--r-- | internal/executor/executor.go | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go index 6aef736..6ffedc7 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -565,13 +565,35 @@ func (p *Pool) createValidationTask(ctx context.Context, storyID string) { return } - var spec map[string]interface{} + type validationSpec struct { + Type string `json:"type"` + AcceptanceCriteria []struct { + Name string `json:"name"` + Verification string `json:"verification"` + TestRef string `json:"test_ref,omitempty"` + } `json:"acceptance_criteria"` + } + var spec validationSpec if err := json.Unmarshal([]byte(story.ValidationJSON), &spec); err != nil { p.logger.Error("createValidationTask: failed to parse ValidationJSON", "storyID", storyID, "error", err) return } - instructions := fmt.Sprintf("Validate the deployment for story %q.\n\nValidation spec:\n%s", story.Name, story.ValidationJSON) + var instructions string + if len(spec.AcceptanceCriteria) > 0 { + var sb strings.Builder + fmt.Fprintf(&sb, "Validate the deployment for story %q.\n\nFor each acceptance criterion, verify it and report PASS or FAIL:\n", story.Name) + for _, c := range spec.AcceptanceCriteria { + if c.TestRef != "" { + fmt.Fprintf(&sb, "- %s: %s [test: %s]\n", c.Name, c.Verification, c.TestRef) + } else { + fmt.Fprintf(&sb, "- %s: %s\n", c.Name, c.Verification) + } + } + instructions = sb.String() + } else { + instructions = fmt.Sprintf("Validate the deployment for story %q.\n\nValidation spec:\n%s", story.Name, story.ValidationJSON) + } now := time.Now().UTC() vtask := &task.Task{ |
