Add routing pod to README architecture diagram and env vars table. Add routing MCP endpoint to .context/PROJECT.md. Regenerate derived context adapters via task context:sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.6 KiB
3.6 KiB
Project context
Identity
- Name: supervisor
- Owner: Mathias
- Client: personal
- Repo:
- Status: active
Stack
- Primary language: Go
- UI layer: HTMX + Templ (when applicable)
- Fallback languages: Python, TypeScript (justify in PR if used)
- Build: Task (taskfile.dev), not Make
- Containers: Docker (compose for dev, k3s for deploy)
- Target infra: koala (GPU workloads), iguana (services), flamingo (edge)
Conventions
Code style
- Go: follow
golines,gofumpt,golangci-lintwith project config - Tests: table-driven, in
_test.gonext to source,testifyfor assertions - Errors: wrap with
fmt.Errorf("operation: %w", err), no naked returns - Naming: stdlib conventions, no stuttering (
http.Clientnothttp.HTTPClient)
Architecture preferences
- Prefer standard library over frameworks (net/http over gin/echo)
- Dependency injection via constructor functions, not containers
- Configuration via environment variables, parsed at startup into a typed struct
- Structured logging via
slog
Git
- Conventional commits:
feat:,fix:,chore:,docs:,refactor: - Branch naming:
feat/short-description,fix/short-description - PRs: one concern per PR, description explains why not what
Security
- No secrets in code, ever — use env vars or SOPS-encrypted files
- Client data never leaves local network unless explicitly cleared
- Dependencies: audit with
govulncheckbefore adding
MCP endpoints
Two MCP servers expose this project's tooling, both reachable over Tailscale:
brainathttp://koala:30330/mcp— preferred path forbrain_query,brain_write,brain_ingest,brain_ingest_raw, andsession_log. Hosted by the ingestion service directly.supervisorathttp://koala:30320/mcp— skill workers (tdd_red,tdd_green,tdd_refactor,review,debug,spec,retrospective,trainer,tier). Will shrink as skill workers move to SKILL.md in a later migration.routingathttp://koala:30310/mcp— Mode 2 routing pod. Advertises the same four cost-routable skills as the supervisor (review,debug,retrospective,trainer) but per-call decides whether to use a local model or Claude based on the brain's/pass-rateresponse. Bearer auth viaROUTING_MCP_TOKEN(opt-in). Onlymode client-localregisters this endpoint; Mode 1 and Mode 3 do not.
The brain HTTP REST API (/query, /write, /ingest, /ingest-raw,
/ingest-path, /backfill-refs) remains available on the same port (3300) for
shell scripts and non-MCP clients.
The brain HTTP REST API also serves a read-only GET /pass-rate?skill=X&window=Y
endpoint that aggregates final_status counts from session logs and returns
{skill, window, pass, fail, skip, total, pass_rate}. Plan 6 (routing pod)
reads this to decide whether to route skill calls to local models. Pass rate
is null when no logged invocations are in the window.
Agent instructions
When acting as a coding agent on this project:
- Read this file and all
SKILL.mdfiles in.skills/before starting work - Run
task checkbefore committing (lint + test + vet) - If unsure about a convention, check
DECISIONS.mdor ask - Never modify files outside the project root without explicit permission
- When adding a dependency, explain why in the commit message
- For client projects: never send code or context to cloud APIs — use local models via LiteLLM