summaryrefslogtreecommitdiff
path: root/internal/executor/preamble_test.go
diff options
context:
space:
mode:
authorClaudomator Agent <agent@claudomator>2026-03-11 11:01:21 +0000
committerClaudomator Agent <agent@claudomator>2026-03-11 11:01:21 +0000
commited94896372686ce3a032e8f3d76144eb83e2d8cc (patch)
treeb471345a92c4b90673637db54e1f46b9cd8a5511 /internal/executor/preamble_test.go
parent4f83d35fa47bc71b31e0f92a0927bea8910c01b6 (diff)
feat: require agents to write a final summary before exiting
Add a mandatory '## Final Summary' section to planningPreamble instructing agents to output a 2-5 sentence summary paragraph (headed by '## Summary') as their last output before exiting. Adds three tests to verify the section and its required content are present in the preamble. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/preamble_test.go')
-rw-r--r--internal/executor/preamble_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/executor/preamble_test.go b/internal/executor/preamble_test.go
new file mode 100644
index 0000000..448ad3a
--- /dev/null
+++ b/internal/executor/preamble_test.go
@@ -0,0 +1,26 @@
+package executor
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestPlanningPreamble_ContainsFinalSummarySection(t *testing.T) {
+ if !strings.Contains(planningPreamble, "## Final Summary (mandatory)") {
+ t.Error("planningPreamble missing '## Final Summary (mandatory)' heading")
+ }
+}
+
+func TestPlanningPreamble_SummaryRequiresMarkdownHeader(t *testing.T) {
+ if !strings.Contains(planningPreamble, `Start it with "## Summary"`) {
+ t.Error("planningPreamble does not instruct agent to start summary with '## Summary'")
+ }
+}
+
+func TestPlanningPreamble_SummaryDescribesRequiredContent(t *testing.T) {
+ for _, phrase := range []string{"What was accomplished", "Key decisions made", "Any issues or follow-ups"} {
+ if !strings.Contains(planningPreamble, phrase) {
+ t.Errorf("planningPreamble missing required summary content description: %q", phrase)
+ }
+ }
+}