P0: routing pod pass-rate instrumentation is broken 3 ways — #35 data gate is unsatisfiable as-coded #73
Closed
opened 2026-06-30 06:30:16 +00:00 by mathias
·
1 comment
No Branch/Tag Specified
main
fix/pipeline-writes-158
fix/edit-path-io-192
fix/create-regular-188
fix/guard-special-179
fix/linkcheck-keeps-write-178
fix/write-dir-redirect-173
fix/tunnel-detect-174
fix/pipeline-root-157
w3/154-mcp-auth-wiring
fix/tunnel-traversal
test/in-brain-targets-171
fix/brain-scan-root-157
fix/graph-wiki-root-157
fix/vectorstore-root-157
fix/notes-root-157
fix/search-root-157
fix/brainwide-root-157
fix/raw-symlinks-153
feat/symlink-tripwire-157
fix/rest-auth-149
fix/123-brain-edit-envelope-check
feat/106-page-aware-extraction
fix/105-source-drift-on-main
fix/104-surface-merge-conflicts-on-main
agent/b1-compile-on-ingest
agent/104-surface-merge-conflicts
agent/105-source-drift
agent/107-loud-unconfigured-alerting
feat/brain-read-edit
fix/capture-i1-refusal-names-target
renovate/configure
feat/consolidate-single-harness
icebox/cmd-routing
feat/brain-pending-promote
fix/close-session-classification-refresh
fix/capture-summarywriter
v0.24.0
v0.23.1
v0.23.0
v0.22.0
v0.21.1
v0.21.0
v0.20.1
v0.20.0
v0.19.1
v0.19.0
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.0
v0.16.1
v0.16.0
v0.15.0
v0.14.0
v0.13.2
v0.13.1
v0.13.0
v0.12.1
v0.12.0
v0.11.2
icebox/cmd-routing-2026-07-01
v0.11.1
v0.11.0
v0.10.0
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.0
v0.1.0
Labels
Clear labels
agent/ready
blocked/client
blocked/supplier
blocked/upstream
risk/high
risk/low
risk/medium
size/l
size/m
size/s
size/xs
status:dispatch
status:dispatched
status:review
status:reviewing
type/chore
type/decision
type/docs
type/feat
type/fix
type/ops
type/research
type/test
Meets the agent-ready contract; authorizes unattended execution
Waiting on the client
Waiting on a supplier
Waiting on an upstream project or vendor
Irreversible, security-relevant, or control plane
Reversible, local, test-covered
Touches shared state, deploys or data
Too big - split it
Under two days
Under half a day
Under an hour
Maintenance, no behaviour change
Human decision required; never agent/ready
Documentation only
New capability
Corrects broken behaviour
Infrastructure, deploy, runtime
Investigate; output is a finding, not code
Test coverage only
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: mathias/hyperguild#73
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The #35 data gate (
/pass-rate?skill=review|debugreaching 50 logged invocations) cannot ever fill as the code stands — not because of low usage, but because the routing pod'ssession_loginstrumentation has three independent defects, each alone sufficient to keep every counter at zero. Discovered 2026-06-30 by an end-to-end smoke test: a realreviewcall routed cleanly tokoala/qwen36-35b-a3b(HTTP 200, 4.8s, real output) yet/pass-ratestayedtotal:0under every skill key.The three bugs
Bug A — success logs
"skip", never"pass"(fatal to the gate)internal/routing/log.go:40-43A successful routed call has
Failed=false→ logsfinal_status:"skip". There is no code path that emits"pass"./pass-ratecomputespass/(pass+fail)(ingestion/internal/api/passrate.go:103) and skips count as neither — sopass_rateisnullforever and the ≥0.90 gate is mathematically unreachable.Fix:
status := "pass"; if e.Failed { status = "fail" }.Bug B — all logs written under
skill:"_routing", not the real skillinternal/routing/log.go:52hardcodes"skill": "_routing". So/pass-rate?skill=reviewand?skill=debug— exactly what #35 measures — read zero even when traffic flows. (Thesession_idis already_routingfromcmd/routing/main.go:68; theskillfield should carrye.Skill.)Fix:
"skill": e.Skill(keepsession_id:"_routing"if desired for grouping).Bug C — the session_log POST is unauthenticated → silent 401
internal/routing/log.gobuilds the POST toBrainURL+/mcpwith onlyContent-Type— noAuthorizationheader. Ingestion's/mcpis bearer-gated (ingestion/internal/mcp/server.goBearerMiddleware + staticToken; confirmed 401 on an unauthenticated call). This is the exact documented footgun: brainknowledge/mcpclient-empty-token-silent-401-envfrom-missing-key— empty token → silent 401, andLogDecisionerrors are best-effort (swallowed withslog.Warn). So even after A+B, nothing logs until the POST authenticates.Fix:
internal/config/routing.go: addBrainMCPTokenfromBRAIN_MCP_TOKEN.internal/routing/log.go:Loggercarries the token; setAuthorization: Bearerwhen non-empty (and validate non-empty at construction per the footgun note).cmd/routing/main.go: thread the token intoNewLogger.k3s/apps/routing/: addBRAIN_MCP_TOKENenv via ExternalSecret (mirrorsupervisor/brain-mcp-token-externalsecret.yaml); the value must match ingestion's accepted static token.Why this matters now
The 14-day window (opened 2026-06-26, kill-date 2026-07-10) and the Berget fallback are gated on this counter. As-coded, the window will hit 2026-07-10 at
total:0and trigger the fallback blaming "hyperguild isn't on the critical path" when the true cause is broken plumbing. The kill-date decision is invalid until these are fixed and one real call is observed incrementingpass.Definition of done
internal/routing/log_test.go): success →final_status:"pass", record carriesskill:"review".BRAIN_MCP_TOKENwired in config + deployment; non-empty validated at construction.reviewcall moves/pass-rate?skill=reviewfrom 0 → 1 (pass).Refs: #35, brain
mcpclient-empty-token-silent-401-envfrom-missing-key, infrac66a195.RESOLVED + verified in production (2026-06-30)
All three bugs fixed (
da9bdc4), shipped through the now-restored CD (b9d0331, run 294 green), deployed via flux. Routing pod runningrouting:b9d0331withBRAIN_MCP_TOKENsynced by ESO (SecretSynced).End-to-end proof — a real
reviewcall through the routing pod (routed tokoala/qwen36-35b-a3b):skill:"review"→/pass-rate?skill=reviewsees it."pass"→pass=1, pass_rate=1.The gate is now genuinely measurable. Closing.