feat(hyperguild): brain query subcommand

Adds 'hyperguild brain query <topic>' against the brain HTTP REST
/query endpoint. Default human output prints path + score + title;
--json passes through the response envelope. --limit overrides the
default 5-result cap.

runBrainWrite remains a stub for Task 5.
This commit is contained in:
2026-05-03 21:37:39 +02:00
parent ed4966927c
commit cd5f3c0175
4 changed files with 142 additions and 3 deletions
+1 -2
View File
@@ -35,8 +35,7 @@ func TestDispatch_UnknownSubcommand_ReturnsTwo(t *testing.T) {
func TestDispatch_KnownSubcommand_RoutesAndReturnsExitCode(t *testing.T) {
var out, errBuf bytes.Buffer
code := dispatch(context.Background(), []string{"brain"}, strings.NewReader(""), &out, &errBuf)
// At this point, brain still returns the not-implemented error → exit 1.
code := dispatch(context.Background(), []string{"mode"}, strings.NewReader(""), &out, &errBuf)
assert.Equal(t, 1, code)
assert.Contains(t, errBuf.String(), "not implemented")
}