You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(orb): live fleet reversal + reuse telemetry for the homepage hero metrics (#8821)
* fix(orb): export, ingest, and score the superseded reversal in fleet calibration
The fleet pipeline silently dropped reversal_superseded (#8166) at every
hop: the self-host exporter's rev CTE only matched reverted/reopened,
the collector's ingest whitelist downgraded an unknown flag to 'none',
and orb_signals' CHECK constraint would have rejected the value anyway
(swallowed by the best-effort insert). Since supersession is the
one-shot culture's dominant real reversal shape, the fleet's published
reversalRate stayed pinned at 0 and the homepage's reversal-grounded
decision accuracy read a degenerate 100%.
Advances #8820 (the accuracy-number half; the reuse-rate tile is a
separate change).
- orb-collector: rev CTE + flag mapping carry 'superseded' (priority
reverted > reopened > superseded), regression-tested for the
reversal-recorded-after-first-export re-export path
- ingest: whitelist 'superseded'
- analytics: a superseded close disconfirms closePrecision and counts
toward reversalRate exactly like a reopen
- migration 0176: rebuild orb_signals with the widened CHECK
* feat(orb): stream live self-host reuse counters into the public AI-work-reused trend
The homepage reuse-rate trend reads cache hit/miss audit events from
the cloud worker's own ledger, which froze at the self-host cutover
(last event 2026-06-29) — recent weekly buckets fall under the publish
floor, so the hero tile renders a dash beside a decaying sparkline
while the live signal (133k+ cache events) accrues unexported on the
self-hosted instances.
Advances #8820 (the reuse-rate half; the accuracy half is the
superseded-reversal export on this same branch's sibling commit).
- orb-collector: export day-bucketed hit/miss aggregates (counts only,
no repos/PRs) over a 70-day rolling window on the same hourly POST;
fail-safe when the ledger lacks the table
- ingest: validate (strict day format, clamped non-negative counts)
and upsert per (instance, day); malformed rows skipped row-by-row
- public-reuse-rate-trend: fold counters from REGISTERED instances
into the same weekly buckets, unconditional on the own-ledger repo
allowlist (parity with the fleet-accuracy fold)
- migration 0177: orb_reuse_counters
* chore(db): register orb_reuse_counters as a raw-SQL-only table in the drift check
SUM(CASE WHEN event_type LIKE 'github_app.%cache_hit' OR event_type IN (${AI_REVIEW_REUSE_EVENT_TYPES.map(()=>"?").join(", ")}) THEN 1 ELSE 0 END) AS hits,
75
+
SUM(CASE WHEN event_type LIKE 'github_app.%cache_miss' THEN 1 ELSE 0 END) AS misses
76
+
FROM audit_events
77
+
WHERE (event_type LIKE 'github_app.%cache_hit' OR event_type LIKE 'github_app.%cache_miss' OR event_type IN (${AI_REVIEW_REUSE_EVENT_TYPES.map(()=>"?").join(", ")}))
78
+
AND created_at >= ?
79
+
GROUP BY day`;
80
+
81
+
/** Read the rolling reuse-counter window; fail-safe → [] (a counter hiccup must never block the outcome
0 commit comments