Router vs default scoreboard

Task 12296 · Queued · Coder · created · updated

Epic 12251, child C5. Needs C3a's `routing_decisions`. ## Original requirement (verbatim) Ask 4 (part): "Shadow writes decisions and grades them against the actual dispatch, with a "router vs default" scoreboard" Epic Done means (verbatim): "With the ledger present and routing OFF, every dispatch still has a routing_decisions row in Shadow and the scoreboard shows router vs default survival and cost over a period"; "In Recommend, … the accepted/overridden rate is recorded." ## Settled decisions - D4: operator plane always sees all orgs; an org Admin sees their org's scoreboard only when the org has `intelligent_routing`. - R11: per period 7/30/90 days (default 30), per org and project: decisions count; router = actual agreement rate; Recommend accepted/overridden/no-response; exploration share per project against its knob; survival and cost per success for router-pick vs default with intervals ("Awaiting outcome ledger" until C9). - AD8 (overrides BA A12): the scoreboard lives in the Command center area as a "Routing" tab, not under Agents (Agents is plan-gated by the provider grid). Operator variant on the same page with `is_operator`. ## Approach (Architect §4.9) - `agent_router/scoreboard.py`; `GET /api/routing/scoreboard?period=7|30|90&project_id=` org-scoped, 404 without the plan feature; `GET /api/operator/routing/scoreboard` behind `require_operator`, per-org rows by display name. - Per scope: `dispatches` (count of final rows), `agreement` (router_pick == actual), Recommend accepted/overridden/no-response counts, exploration share vs `experiment_budget_share` (read with a default of 0.10 if C2's column is not merged yet is NOT allowed — C2 lands in the same phase; read the column if present and otherwise show the share without the knob; C9 finalises), per-config dispatch breakdown, `survival`/`cost_per_success` per `used` group as `{state:'awaiting_ledger'}`. - UI: Command center "Routing" tab (org) and operator variant; "Awaiting outcome ledger" shown in words, never blanks or zeros. Credentials & reach: - Dev UI: `me/jaah/debug/main/operator-login` (operator + tenant switch) and `org/console/dev-login` — verified. - AC1 fallback oracle (Audit › Sessions count comparison): same logins — verified. Out of scope: changing account quota semantics or spillover; training a model from scratch; routing analysis personas before coder tasks have data; public marketplace billing; any ledger metric definition (owned by the outcome ledger epic). MUST NOT compute survival or cost-per-success here (C9 reads them from the ledger). Done means: - AC3 Scoreboard router vs default survival and cost (pre-ledger part). → Verify: on dev as operator, open the operator Routing scoreboard and pick 30 days. Observe per-org rows with decisions count, agreement rate, and … Before §6, observe "Awaiting outcome ledger", not blanks or zeros. As an org Admin of an org without the feature, observe no scoreboard link and a 403/404 on the route (D4). - AC6 display: accepted / overridden / no-response counts per period and project render (recording is C4's). - AC1 fallback oracle: the operator scoreboard `dispatches` count equals the number of sessions started on Audit › Sessions for the same window on dev. - API tests: period filter, project filter, 404 without feature, operator route refuses non-operators, operator rows carry display names only. - Quality floor: tab works at 390px without page-level horizontal scroll; labels per ui-copy-standards; no enum names in the UI. - Gates (AC16): `./dc check quick` green; changed-area suites green; merge lane `./dc check full` green.

Activity

  • Draft
  • Ready