SIGN IN SIGN UP

feat: record the proxy's observed routing order per model family

The dashboard has no way to show which account order the load balancer
actually uses for a model family: peek()/isPrimary is contractually
side-effect-free but family-agnostic and blind to usage telemetry, and
select() cannot serve as a display source because it writes session_start
and mutates strategy-internal state. Simulating the order on a fresh
strategy instance would systematically diverge for the stateful
strategies (least-used's recency map, session-affinity's affinity map).

Whenever an operator asks "who serves Fable traffic right now", the only
truthful source is the decision the selector just made — today that
exists only as the transient "Selected N accounts" log line.

Now the proxy records exactly that decision: right after the existing
log line it stores {family, ordered accounts, model, timestamp} in a
process-local, display-only singleton (last write wins per family,
attributed via the same effectiveModel the capacity filter routed on),
and GET /api/routing/observations serves a copy. The recorder is
wrapped defensively so telemetry can never break the request path, and
the module contract forbids the router from ever reading it back.

Considered simulating the ranking (fresh instance + read-only store) —
rejected because cold instances lack the in-memory state that IS the
ordering for two of four strategies; observation cannot drift.
M
Matthias Breddin committed
62dceedd459e840d75f0126839d45a0a350b6e34
Parent: 9f38949