Commit Graph

224 Commits

Author SHA1 Message Date
Mathias Bergqvist
d09f7fe7d8 feat: add tier detection package
Probes Anthropic and LiteLLM endpoints to detect the current operating
tier (Full / LANOnly / Airplane) so downstream code can gate model
selection and managed-agent availability without manual configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:28:29 +02:00
Mathias Bergqvist
d18fa0dd59 fix(ingestion): validate required query field in Query handler
Empty or whitespace-only queries would silently pass through to search,
returning meaningless results. Also removed the Domain field from
queryRequest — it was accepted but silently ignored since search.Query
has no domain parameter, which would confuse callers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:27:02 +02:00
Mathias Bergqvist
e20edd6ca9 feat(ingestion): add query and write HTTP handlers
Implements POST /query (BM25 search via internal/search) and POST /write
(raw file persistence to brain/raw/) as an api.Handler struct. Filename
is auto-generated when absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:24:51 +02:00
Mathias Bergqvist
caf18c9acb fix(ingestion): consistent error handling in search walk
Both walk-level errors and ReadFile failures now use best-effort
semantics (warn via slog, continue) instead of mixed abort/silent-skip.
filepath.Rel error is now propagated from the callback instead of
discarded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:23:03 +02:00
Mathias Bergqvist
3c1f6edf3e feat(ingestion): add full-text wiki search package
Implements search.Query which walks brainDir/wiki/**/*.md, scores files
by term-frequency across query tokens, and returns results sorted by
score descending. Uses only stdlib — no external search deps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 20:18:57 +02:00
Mathias Bergqvist
6c485489bf chore: scaffold ingestion Go module 2026-04-17 20:16:59 +02:00
Mathias Bergqvist
f76c150041 docs: add hyperguild architecture design spec
Full vision for the hyperguild SDO: monorepo structure, two-layer brain
(declarative wiki + parametric training data), operating tiers, MCP tool
surface, session log format, retrospective + trainer workers, and four
implementation phases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 19:53:32 +02:00
Mathias Bergqvist
48d2d7dd73 fix: remove committed binary and stop leaking API key in prompt
Remove cmd/supervisor/supervisor binary from git (was accidentally
committed) and add it to .gitignore. Move LITELLM_API_KEY from the
prompt string into the subprocess env, preventing it from appearing
in error log output when JSON parsing fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 08:49:44 +02:00
Mathias Bergqvist
d60c11c260 feat: wire all components in main.go
Replaces the stub with the actual supervisor entrypoint: loads config,
reads supervisor CLAUDE.md and tdd.md, constructs the executor and TDD
skill, registers them, and starts the HTTP/MCP server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 08:39:39 +02:00
Mathias Bergqvist
2d40bee089 feat: register supervisor MCP server and add task targets 2026-04-17 08:34:13 +02:00
Mathias Bergqvist
d8d2009dfd feat: add supervisor CLAUDE.md, tdd skill prompt, and env example 2026-04-17 08:31:37 +02:00
Mathias Bergqvist
1f79cb6cef feat: add TDD skill with red/green/refactor handlers 2026-04-17 07:44:04 +02:00
Mathias Bergqvist
8b3fd1d28b fix: initialize tools slice to empty rather than nil in registry 2026-04-17 07:41:00 +02:00
Mathias Bergqvist
edf47af8cf feat: add MCP HTTP server with JSON-RPC 2.0 transport 2026-04-17 07:40:57 +02:00
Mathias Bergqvist
4255514bab feat: add skill registry with tool routing 2026-04-17 07:40:20 +02:00
Mathias Bergqvist
91b98aed34 feat: add executor that spawns claude and parses JSON result 2026-04-17 07:39:26 +02:00
Mathias Bergqvist
4c00b55ca5 feat: add model routing table with three-layer priority 2026-04-17 07:37:43 +02:00
Mathias Bergqvist
8b8ada2676 feat: add config package with env-var loading 2026-04-17 07:37:19 +02:00
Mathias Bergqvist
d3d81cab20 feat: add Result type with JSON schema and validation 2026-04-17 07:33:06 +02:00
Mathias Bergqvist
dc574eca1a chore: initialize go module and cmd skeleton 2026-04-17 07:04:08 +02:00
Mathias Bergqvist
5e130e1965 chore: ignore .worktrees/ directory 2026-04-17 06:59:45 +02:00
Mathias Bergqvist
7d108b2911 docs: add supervisor MCP server implementation plan
12 TDD tasks covering: Go module, Result type, Config, Models,
Executor (claude --print), Registry, MCP server, TDD skill,
main wiring, config files, Taskfile/MCP registration, smoke test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 06:56:48 +02:00
Mathias Bergqvist
848001f27f docs: add supervisor MCP server design spec
Captures the full architecture: Go MCP server on flamingo, Claude
supervisor+worker instance, LiteLLM/Ollama gradual delegation, TDD
as first skill, language-agnostic test runner detection, structured
JSON output contract, and three-layer model selection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 22:57:10 +02:00
Mathias Bergqvist
92c9c42e24 chore: scaffold supervisor from project template 2026-04-16 21:50:53 +02:00