diff --git a/planner/planner-agent.sh b/planner/planner-agent.sh index 2595e9f..a7e8dc0 100755 --- a/planner/planner-agent.sh +++ b/planner/planner-agent.sh @@ -92,7 +92,7 @@ Update STATE.md by merging the new commits/issues into the existing snapshot. - No more than 30 bullet points — be concise and factual - If current STATE.md is empty, build the snapshot from scratch using the git log and issues -Output ONLY the bullet list — no preamble, no markdown fences, no explanation." +IMPORTANT: Output ONLY the updated bullet list. No summary of changes, no meta-commentary, no preamble, no markdown fences, no explanation of what you did. Just the bullets starting with '- '." PHASE1_OUTPUT=$(timeout "$CLAUDE_TIMEOUT" claude -p "$PHASE1_PROMPT" \ --model sonnet \ @@ -106,6 +106,12 @@ Output ONLY the bullet list — no preamble, no markdown fences, no explanation. exit 1 fi + # Validate output starts with bullet points (reject meta-commentary) + if ! echo "$PHASE1_OUTPUT" | head -1 | grep -q '^- '; then + log "ERROR: phase 1 output is not a bullet list — got: $(echo "$PHASE1_OUTPUT" | head -1)" + exit 1 + fi + # Atomic write TEMP_STATE=$(mktemp "${STATE_FILE}.XXXXXX") printf '%s\n' "$PHASE1_OUTPUT" > "$TEMP_STATE"