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
Follow-up to #3717 (part 2 of that issue's two-part ask), which was itself deliberately left
unshipped there: PR #4134 shipped part 1 (the panel description/tooltip clarification on panels
5/6/7) and explicitly deferred "a true additive event-count panel backed by audit_events" as
out of scope, pending investigation of where review_targets.status/.verdict actually gets set
to manual/commented/ignored for gittensory-native PRs.
This issue reports that investigation's result: it surfaced a bigger problem than "which event_type to use."
Finding 1 — no existing audit_events event_type fits (confirms #3717's own suspicion)
Scanned every literal eventType: in src/queue/processors.ts: 78 distinct string literals plus
7 more resolved from named constants (REVIEW_EVASION_CLOSED_EVENT_TYPE, REGATE_REPAIR_ATTEMPT_EVENT_TYPE, REGATE_REPAIR_EXHAUSTED_EVENT_TYPE, CI_STUCK_FINALIZE_GUARD_EVENT_TYPE, REVIEW_NAG_PING_EVENT_TYPE, MONITORED_MENTION_PING_EVENT_TYPE, COMMAND_RATE_LIMIT_EVENT_TYPE). None represent "PR
disposition became manual/commented/ignored" as a discrete event.
Finding 2 (new, more consequential) — review_targets appears to be an orphaned ledger for gittensory-native PRs, not a live one
Looked for the actual write path that sets review_targets.status/.verdict to manual/commented/ignored — the call site a new emission point would need to sit next to. No such write path exists anywhere in the current codebase:
grep across src/** for INSERT/UPDATE against review_targets (or a Drizzle write): zero
hits. The table is deliberately raw-SQL-only, "NOT added to the Drizzle schema" per its own
migration comment (migrations/0050_review_targets.sql).
No SQL trigger in migrations/*.sql populates it either.
Multiple, independent, contemporaneous code comments describe it as legacy/dead for the current (post-convergence-cutover) engine, not just historically:
src/review/public-stats.ts:9 — "The legacy review_targets ledger this used to read was
orphaned by the convergence cutover — nothing writes it anymore."
src/review/public-stats.ts:165 — same claim, restated where the live replacement query
(audit_eventsgithub_app.pr_public_surface_published joined to the pull_requests cache)
is defined.
src/review/ops-wire.ts:5-8 — "ADAPTED TO GITTENSORY'S OWN OUTCOME DATA — NOT reviewbot's review_targets/review_audit (those tables are not populated here)... gittensory's
review-outcome ledger is different."
src/review/stats.ts:19-21 — "decision/reversal/gate-action aggregates still read the legacy review_targets/review_audit ledgers... but the maintainer dashboard's complexity read comes
from the ACTIVE audit_events ledger" — i.e. this dashboard has already been partially
repointed away from review_targets for one metric.
src/review/submitter-reputation.ts:23 — the review_targets-dependent signal is marked
"ADDITIVE + DORMANT."
I could not confirm this against a live production/self-hosted instance — I only have a fresh
git worktree, no bound D1/SQLite. This is exactly the "confirm the hypothesis with real data"
deliverable #3717 itself asked for and that neither #3717's investigation nor PR #4134 fully did
either (both reasoned from reading the query/code, not a live query). That live confirmation is
the necessary first step here — specifically: query the self-hosted maintainer instance's review_targets table for MAX(updated_at) and see whether it is frozen at (or shortly after) the
2026-06-23 cutover, or whether something is still writing to it that this code-only search missed.
As a secondary, mechanical (not live-data) check, I confirmed the query-shape mechanism #3717
already described is real: replaying the panel 5/3 queryText verbatim against an in-memory DB
migrated with this repo's actual migrations/*.sql, a single row inserted as status='manual' and
later UPDATEd to status='merged' (both timestamps inside one window) counts once under "Manual
review" before the update and zero after — it moves to "Merged" instead of accumulating. That part
is solid; it just doesn't tell us whether real rows are still arriving at all.
Why this changes the shape of the ask
If review_targets truly receives no new rows for current gittensory-native activity, then:
The more durable fix likely follows the precedent already set for the public homepage counter
(src/review/public-stats.ts): repoint the dashboard's source of truth to audit_events
(github_app.pr_public_surface_published) joined to the pull_requests cache for terminal
disposition. But that mapping is not mechanical — public-stats.ts's own model has no
manual/ignored/error concept ("Reviewed PRs that never got a published surface... simply don't
appear — there is no ignored/manual/error"), so representing "manual review" and "ignored" in a
live-ledger world needs real design, not a copy-paste.
Requirements (for whoever picks this up)
Confirm live: query a self-hosted maintainer instance's review_targets table directly
(SELECT MAX(updated_at) FROM review_targets, and ideally a status breakdown) to settle whether
it is genuinely frozen or still receiving some writes this code search missed.
If a genuinely new discrete "disposition became manual/commented/ignored" concept is needed for
gittensory-native PRs (rather than reusing pr_public_surface_published + terminal state), design
and add the emission point at whichever call site in src/github/app.ts / src/queue/processors.ts actually decides that disposition today, following the existing dotted event_type naming convention (e.g. github_app.gate_overridden).
Non-goals
Retroactively backfilling event history for the frozen review_targets era. Changing the review_targets/review_audit schema. Anything beyond the maintainer Grafana dashboard.
Context
Follow-up to #3717 (part 2 of that issue's two-part ask), which was itself deliberately left
unshipped there: PR #4134 shipped part 1 (the panel description/tooltip clarification on panels
5/6/7) and explicitly deferred "a true additive event-count panel backed by
audit_events" asout of scope, pending investigation of where
review_targets.status/.verdictactually gets setto
manual/commented/ignoredfor gittensory-native PRs.This issue reports that investigation's result: it surfaced a bigger problem than "which
event_typeto use."Finding 1 — no existing
audit_eventsevent_type fits (confirms #3717's own suspicion)Scanned every literal
eventType:insrc/queue/processors.ts: 78 distinct string literals plus7 more resolved from named constants (
REVIEW_EVASION_CLOSED_EVENT_TYPE,REGATE_REPAIR_ATTEMPT_EVENT_TYPE,REGATE_REPAIR_EXHAUSTED_EVENT_TYPE,CI_STUCK_FINALIZE_GUARD_EVENT_TYPE,REVIEW_NAG_PING_EVENT_TYPE,MONITORED_MENTION_PING_EVENT_TYPE,COMMAND_RATE_LIMIT_EVENT_TYPE). None represent "PRdisposition became manual/commented/ignored" as a discrete event.
Finding 2 (new, more consequential) —
review_targetsappears to be an orphaned ledger for gittensory-native PRs, not a live oneLooked for the actual write path that sets
review_targets.status/.verdicttomanual/commented/ignored— the call site a new emission point would need to sit next to.No such write path exists anywhere in the current codebase:
grepacrosssrc/**forINSERT/UPDATEagainstreview_targets(or a Drizzle write): zerohits. The table is deliberately raw-SQL-only, "NOT added to the Drizzle schema" per its own
migration comment (
migrations/0050_review_targets.sql).migrations/*.sqlpopulates it either.current (post-convergence-cutover) engine, not just historically:
src/review/public-stats.ts:9— "The legacyreview_targetsledger this used to read wasorphaned by the convergence cutover — nothing writes it anymore."
src/review/public-stats.ts:165— same claim, restated where the live replacement query(
audit_eventsgithub_app.pr_public_surface_publishedjoined to thepull_requestscache)is defined.
src/review/ops-wire.ts:5-8— "ADAPTED TO GITTENSORY'S OWN OUTCOME DATA — NOT reviewbot'sreview_targets/review_audit(those tables are not populated here)... gittensory'sreview-outcome ledger is different."
src/review/stats.ts:19-21— "decision/reversal/gate-action aggregates still read the legacyreview_targets/review_auditledgers... but the maintainer dashboard's complexity read comesfrom the ACTIVE
audit_eventsledger" — i.e. this dashboard has already been partiallyrepointed away from
review_targetsfor one metric.src/review/submitter-reputation.ts:23— thereview_targets-dependent signal is marked"ADDITIVE + DORMANT."
(
fix(public-stats): repoint proof-of-power counter to the live ledger) — a deliberate,~2-week-old repointing, not stale leftover text.
pull_requestsas the dominant/live table in the Grafanareporting-exporter's guard, consistent with this.
I could not confirm this against a live production/self-hosted instance — I only have a fresh
git worktree, no bound D1/SQLite. This is exactly the "confirm the hypothesis with real data"
deliverable #3717 itself asked for and that neither #3717's investigation nor PR #4134 fully did
either (both reasoned from reading the query/code, not a live query). That live confirmation is
the necessary first step here — specifically: query the self-hosted maintainer instance's
review_targetstable forMAX(updated_at)and see whether it is frozen at (or shortly after) the2026-06-23 cutover, or whether something is still writing to it that this code-only search missed.
As a secondary, mechanical (not live-data) check, I confirmed the query-shape mechanism #3717
already described is real: replaying the panel 5/3
queryTextverbatim against an in-memory DBmigrated with this repo's actual
migrations/*.sql, a single row inserted asstatus='manual'andlater
UPDATEd tostatus='merged'(both timestamps inside one window) counts once under "Manualreview" before the update and zero after — it moves to "Merged" instead of accumulating. That part
is solid; it just doesn't tell us whether real rows are still arriving at all.
Why this changes the shape of the ask
If
review_targetstruly receives no new rows for current gittensory-native activity, then:PRs tracked/Merged/Closed/Manual review/Commented/Ignored) — not just the three fix(observability): clarify manual/commented/ignored panel semantics on the Reviews & PRs dashboard #3717 focused on — are reading an increasingly stale,non-growing ledger, and will trend toward showing near-zero activity in any window that starts
after the cutover, regardless of real current volume.
would not fix that — it would just be the one panel on the dashboard actually tracking live
activity, sitting next to six that increasingly aren't.
(
src/review/public-stats.ts): repoint the dashboard's source of truth toaudit_events(
github_app.pr_public_surface_published) joined to thepull_requestscache for terminaldisposition. But that mapping is not mechanical —
public-stats.ts's own model has nomanual/ignored/error concept ("Reviewed PRs that never got a published surface... simply don't
appear — there is no ignored/manual/error"), so representing "manual review" and "ignored" in a
live-ledger world needs real design, not a copy-paste.
Requirements (for whoever picks this up)
review_targetstable directly(
SELECT MAX(updated_at) FROM review_targets, and ideally a status breakdown) to settle whetherit is genuinely frozen or still receiving some writes this code search missed.
(bigger, more valuable, matches the
public-stats.tsprecedent) or (b) leave the existing six asa historical/legacy view and add a differently-labeled live panel set alongside (matches fix(observability): clarify manual/commented/ignored panel semantics on the Reviews & PRs dashboard #3717's
original, narrower ask). Either is legitimate; the current state (six stale panels, mislabeled as
live windows even after fix(observability): clarify manual/commented/ignored panel semantics #4134's tooltip fix, which explains the windowing semantics but not the
staleness one) is not.
gittensory-native PRs (rather than reusing
pr_public_surface_published+ terminal state), designand add the emission point at whichever call site in
src/github/app.ts/src/queue/processors.tsactually decides that disposition today, following the existing dottedevent_typenaming convention (e.g.github_app.gate_overridden).Non-goals
Retroactively backfilling event history for the frozen
review_targetsera. Changing thereview_targets/review_auditschema. Anything beyond the maintainer Grafana dashboard.References
review_targetsas orphaned)grafana/dashboards/maintainer-reviews.json(panels 2-7)src/review/public-stats.ts,src/review/ops-wire.ts,src/review/stats.ts