Repository navigation
Description
What: The router lane serves judgment entries live from the GPU serving host on every message and every tool call, with a 10% holdout, outage handling and one-step adapter rollback.
Why: Procedures such as design or verification methods apply without their trigger words appearing, so only a judgment model can serve them, and the user ruled to ship it now.
So what: Cue is live on rocky, cavallo, and bestia. This stays open because rocky retries Cue during an outage (toolboxmd/chromeria#271).
Parent
Outcome
The serving server starts a router request at the pre-tool moment and collects it at the tool result, and scores at every user message. The router scores the 9 trained AgentsMD entries in scope, serves fires above the validation threshold with their "applies when" line first, and logs every candidate. 10% of sessions, chosen at session start, get no router injections while would-fires are still logged.
Elon record
- Requirements and who asked: ship router serving now; run at every message and tool call with latency hidden behind the tool run; start with the 9 trained AgentsMD entries; 10% comparison group without router serving (user, 2026-10-12); one GPU request at a time and deadline drops; rescore with the tool result after failures; adapter rollback (gap reviews).
- Deleted: shadow mode and a go-live quality gate; a semantic prefilter; a pack ceiling; a server-side log with window text.
- Bottleneck: the serving server and log; router availability depends on the serving host (host work Issue), not a blocker because outages are logged and local lanes are unaffected.
- Checked myself: router latency about 620 ms median with 9 entries on the serving GPU for the base model (the deployed adapter's latency is not yet measured); held-out precision and recall of the chosen adapter; the before-action delivery research. Close-out 2026-10-14: live moments on rocky, cavallo, and bestia; bestia Cue health, journal, and the rollback log. The remaining gap is rocky re-arming during the overnight stop (Cue client on rocky retries the service after marking it down chromeria#271).
Acceptance criteria
- The router serves on live sessions with end-to-end latency per caller (mean, median, p90, timeout rate) measured on the deployed adapter.
- Windows exist on the serving host only in memory; logs hold ids, scores and moment references.
- A connect failure marks the remote unavailable machine-wide with a periodic probe; later calls skip the router and local lanes are unaffected; a slow call logs
timeoutfor that call only. Local lanes and per-call timeouts held. The skip held on bestia and did not hold on rocky (Cue client on rocky retries the service after marking it down chromeria#271). - 10% of sessions are holdout for router injections, recorded per session, with would-fires logged.
- Rolling back to the previous adapter is one step and logged.
Non-goals
- Retraining, speed variants and window format (router training track Router: a local model that matches the judge on unseen entries within one second #4).
- Admitting captured entries (capture Spec Capture: write lasting lessons from agent sessions into the owner that serves them #2).
Blocked by
Required proof
- A day of live logs with router outcomes, latency per caller, holdout share and one outage handled; the rollback check. Recorded 2026-10-14: the live span is the whole period since go-live (rocky 15.6 h from 2026-10-13 15:35Z), including the overnight stop. The outage skip on rocky is the open part.
Activity
lukemaj commentedon Oct 13, 2026
Model (2026-10-13). Cue (this router lane) serves with Qwen3-Reranker-4B plus the trained
q4b-cloudadapter, run as int8 W8A8 and compiled, on the serving GPU. Measured about 340 ms per message against about 620 ms in bf16. The user asked whether Cue uses an int8 model; it does, and it is the 4B model, not a 3B one. An explicit user confirmation of the 4B size is not on record yet.Standing decisions from 2026-10-12, unchanged: ship now, no shadow mode (wrong fires are accepted and will be changed if they prove annoying or harmful), 10% holdout of sessions.
lukemaj commentedon Oct 13, 2026
User confirmed 2026-10-13: Cue runs Qwen3-Reranker-4B with the q4b-cloud adapter, int8 W8A8 compiled.
fix(server): Cue never throws into the server and its probe survives …
fix(cue): answer every request, keep config mode, log restart results…
fix(cue): ship the W8A8 variant's threshold picked on the deployed ke…
chore(server): keep Cue's internal constants unexported
lukemaj commentedon Oct 13, 2026
Handoff: Cue lane implemented, service live on bestia, Chromeria not yet deployed (2026-10-13)
State: the Cue service runs on bestia; no Chromeria calls it yet, because each machine's Chromeria needs the PR build and a restart (planner's go-ahead per machine). None of the five acceptance criteria is checked off: they need live sessions.
PRs (independent review round 2 running on each head)
c815cbeb0d11e0cue/cue_urlconfig,checkfor both stores; the Cue service, unit, rollback (v0.2.0)1f86923contextmd-cue/with pinned texts (v17.1.0, closes agentsmd#220)Round 1 found one blocker in each of chromeria#227 (a non-
http:cue_urlcould exit the server) and contextmd#36 (malformed citation markup dropped the request; README gaps against ADR 0001). Both are fixed and in review again.Live on bestia (contextmd
74882a8, runbook236a7cd)contextmd-cue.serviceon100.116.0.2:8710. Active variantq4b-cloud-step64-w8a8c(Qwen3-Reranker-4B + q4b-cloud step-64, merged, W8A8, compiled); previous variantq4b-cloud-step64-bf16.eval.py report):contextmd-cue rollbackswitched to bf16 (serving within about 5 s,restart: ok, 584 ms median), and a second rollback switched back to W8A8 (95 s warm restart). All three switches are in~/.local/state/contextmd-cue/deployments.jsonl.Latency on the deployed adapter (synthetic callers; live per-caller numbers follow the Chromeria deploy)
272 dev windows sent as
/scorerequests (items up to the message, 9 entries), sequential, from each machine:GPU time alone: median 321 to 327 ms, p90 558 to 566 ms. Consequence: with the 650 ms wait at a user message, about 7 to 9% of message moments will log
timeout. Pre-tool requests hide behind the tool run.Next actions
~/.config/contextmd/serving.json(only after step 2, since an older server rejects unknown keys and stops serving):"cue": ["~/dev/toolboxmd/agentsmd/contextmd-cue"], "cue_url": "http://100.116.0.2:8710". This needs AgentsMD at 17.1.0 or later in each clone.moments.cue_ms,cue_wait_ms,cue_status; holdout share; one outage (systemctl --user stop contextmd-cuefor a few minutes showsconnect_failed, thennot_called, then recovery by the probe).Rollback: variant:
contextmd-cue rollbackon bestia (README). Code: swapapp/andapp.previous/. Turn Cue off on a machine: removecue/cue_urlfrom itsserving.json; this takes effect on the next moment with no restart. Remove the service: ContextMD README, "Cue service".lukemaj commentedon Oct 13, 2026
Update: independent review round 2 passed on all three heads (chromeria#227
c815cbe, contextmd#36b0d11e0, agentsmd#2211f86923), and CI is green. They are ready to merge. Deploy steps 2 to 4 of the handoff above are unchanged. Filed toolboxmd/agent-observer#72 (publishing cost by Issue finds no sessions).feat(cue): Cue entry loader and the Cue service for the GPU serving host
fix(cue): answer every request, keep config mode, log restart results…
fix(cue): ship the W8A8 variant's threshold picked on the deployed ke…
3 remaining items
fix(server): Cue never throws into the server and its probe survives …
chore(server): keep Cue's internal constants unexported
fix(server): Cue's window always keeps the current user message
feat(server): ContextMD's Cue lane scores every message and tool call
fix(server): Cue never throws into the server and its probe survives …
chore(server): keep Cue's internal constants unexported
fix(server): Cue's window always keeps the current user message
test(server): give #240's path-key test config the Cue fields
feat(server): ContextMD's Cue lane scores every message and tool call (…
lukemaj commentedon Oct 13, 2026
Deploy note (2026-10-13, Chromeria
a6fc44664607, Cueq4b-cloud-step64-w8a8c): live moments scored on all three machines. bestia and cavallo user messages:okin 286 and 288 ms. rocky, first minutes aftercue/cue_urlwere added (15:34:58Z): tool resultsok9 (590 ms average, 1,120 ms max),timeout3,lost5; user messagesok1 (383 ms, window 3,799 characters),timeout2 (waited 652 and 655 ms against the 650 ms limit). The rocky-to-bestia round trip runs about twice the other machines', so rocky's user-message wait is often too short; worth watching in the day-one numbers.lukemaj commentedon Oct 13, 2026
Rocky's Cue latency and a bestia outage (2026-10-13).
tailscale statuson rocky shows bestia asactive; relay "waw", so rocky reaches the Cue service (100.116.0.2:8710) through a Tailscale relay (DERP) rather than directly. cavallo shows the samerelay "waw"line. That fits rocky's round trip of about 590 ms against 286 to 288 ms measured from bestia and cavallo live moments earlier; a direct path was not measured, because:/healthall time out. The Cue service runs there, so Cue is down for every machine.connect_failedat 15:47Z, then onlynot_called(machine-wide unavailable); exact-key serving continued (1,261 momentsok, 0 failed). The 30-second/healthprobe should restore Cue when bestia returns.Next: once bestia is back, compare
tailscale ping bestia(direct vs DERP) and/healthtiming from rocky; if the path stays relayed, a direct connection (for example a LAN route or opened UDP) is the fix rather than a longer Cue wait.lukemaj commentedon Oct 13, 2026
Correction to my earlier relay note: rocky's Cue latency is the model, not the network. Bestia came back (rebooted about 16:10Z);
tailscale statuson rocky now showsdirect 10.101.5.27:41645,tailscale ping bestia5 ms,/healthabout 10 ms (cavallo: also direct, 13 to 30 ms). The earlierrelay "waw"line was taken while bestia was going offline.Rocky, 288
okCue calls in the 30 minutes after recovery (fromcue_json):cue_ms)ms)queue_ms)Service time grows with the window: under 500 tokens 265 ms, 500 to 1,500 tokens 403 ms, 1,500 to 3,000 tokens 480 ms. The 286 to 288 ms seen on bestia and cavallo came from fresh test threads with 58-token windows. So rocky's user-message waits (650 ms limit) miss when windows are long; over the same 30 minutes: user messages 20
ok, 1timeout; tool results 266ok, 12timeout, 37lost. Levers, if the miss rate matters: a shorter window, a faster adapter, or a longer user-message wait; the network is not one.lukemaj commentedon Oct 14, 2026
Close-out, read-only, 2026-10-14. Four of the five acceptance items hold. The outage skip does not hold on rocky, so this stays open. Counts only; no window text.
Elon record, checked myself: rocky, cavallo, and bestia
contextmd.sqliteopenedfile:...?mode=ro; bestiacontextmd-cuejournal,deployments.jsonl, and/health. No rollback and no restart.Serves live, on the deployed adapter
q4b-cloud-step64-w8a8cRound trip is
cue_msoncue_status=ok. Timeout rate istimeout / (ok + timeout), which leaves out the outage skips.Every ok row names that adapter. Nine entries are scored on each ok moment (rocky 2,589 moments, 23,301 scores, 695 at or above 0.5625). Fires on the non-holdout arm were injected (rocky 120, bestia 79, cavallo 4).
Timed-out rows do not store a window size (rocky 376 timeouts, 0 with
window_tokens). Among rocky ok user messages the round trip rises with the window: under 500 tokens median 297 ms (n=32), 500 to 1,499 median 411 (n=47), 1,500 to 2,999 median 566 and p90 640 (n=15), against the 650 ms wait. Among rocky ok tool results, 1,500 to 2,999 tokens median 636 ms with 495 of 1,057 over 650 ms, and 3,000 or more median 906 ms with all 140 over 650 ms. The longer-span miss rate belongs with toolboxmd/chromeria#248.Windows stay off disk
cue_jsonis at most 105 characters. Its keys arems,queue_ms,window_chars,window_tokens,window_cut, andsequences, all numbers or a bool. Intent reasons are at most 7 characters. The service journal from 2026-10-13 (224 messages) has startup lines, torch noise, and broken-pipe tracebacks, and no window markers.~/.local/state/contextmd-cue/holds onlydeployments.jsonl.Holdout
The arm is one bit per session, stable for the whole session (0 sessions with both values).
outcome=holdout)Rocky also injected 1 exact-key match on a holdout moment (plus passed 5, lifted 1, suppressed 4). The arm withholds Cue fires. Exact-key serving still happens there.
Outage: fail-open holds; the skip does not, on rocky
contextmd-cue.serviceinactive at 2026-10-13 19:52:42Z, started 2026-10-14 06:21:55Z, bound 06:23:36Z, adapterq4b-cloud-step64-w8a8c, threshold 0.5625. This matches the runbook stop and the morning start.Rocky in that window: first row
connect_failedat 19:52:42Z, thennot_calledfrom 19:52:52Z. Totals:not_called1,142,connect_failed60,started41,lost10,timeout2. Moment statusok1,378 and exact-keyinjected8, so local serving kept going. The skip did not stay: 42 times anot_calledrun was followed bystartedorconnect_failed. Around 22:00Z that pair repeated about once a minute, withnot_calledin between. Heartbeats kept a ~30 s beat, and the longest gap was under 90 s, so this was one living process. Filed as toolboxmd/chromeria#271.Bestia, from its first row in the window (05:47:10Z
connect_failed) until the bind: onlynot_called. Firstok06:24:03Z. Moment statusok557, exact-keyinjected4.A timeout does not itself take the machine down. Of 376 rocky timeouts, the next Cue row was
ok271,timeout84,lost19,not_called2. Bothnot_calledfollow-ons are inside the stop (19:52:45Z and 21:07:05Z).Cavallo sent no Cue rows during the stop.
Rollback
One step, logged, not run again this close-out.
deployments.jsonl: 2026-10-13 11:47:45Zq4b-cloud-step64-w8a8ctoq4b-cloud-step64-bf16, restart ok; 11:48:37Z back, restart ok. Status now: activeq4b-cloud-step64-w8a8c, previousq4b-cloud-step64-bf16,/healthok, threshold 0.5625. The command iscontextmd-cue rollback.Acceptance
#11 is closed. contextmd#36 merged as
5221283, chromeria#227 merged asa6fc446.feat(server): ContextMD's Cue lane scores every message and tool call (…
feat(server): ContextMD's Cue lane scores every message and tool call (…