- main.go's wiring was untested (the test built its own copy of the
router, so dropping auth in main or re-registering POST /query as
public stayed green). Routing is now one function, buildMux, which
main calls and the tests call: it constructs the bearer middleware
itself, registers public handlers only for patterns on a fixed
allowlist (a public REST pattern would beat the authenticated
catch-all by specificity), refuses an empty token, and returns an
http.Handler so nothing can add a route to the result.
- hyperguild CLI: PassRate sent no token and would 401. Every request
now goes through brainClient.do, which adds it; the test covers
Query, Write and PassRate and is named for that.
- ResolveIngestPath returns one refusal for every bad path; the raw
EvalSymlinks error let a caller probe which server files exist and
leaked the brain directory.
- PROJECT.md (and derived adapters) and the pass-rate runbook state
that the REST API needs BRAIN_MCP_TOKEN and is tailnet/in-cluster.
Refs #149
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two corrections after the #73 investigation: (1) the router routes cold
(nil pass-rate) calls to the LOCAL fast tier, not cloud — the earlier
"pay in on cloud" description was wrong (per policy.go). (2) Note that
pass-rate logging was broken until v0.11.1 (#73) and is now verified;
reset the window to 2026-06-30→07-14. Refs #73, #35.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The #35 data gate stays at zero because pass-rate only accrues from review/
debug calls *through the routing pod* — Crush, cloud chat, and the local
.skills all bypass it. Document the connect → route → flywheel steps, the
endpoints (koala:30310/mcp + routing-mcp.d-ma.be), the cold-start behavior
(nil pass-rate routes cloud until passes accrue past the 0.90 floor, then
local qwen36 activates), the 50-invocation / 2026-07-10 target, and the
Berget fallback. Refs #35.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>