Skip to content

fix(orb): stop four silent alarm gaps in relay-drain, crash handling, DLQ, and reversal signals - #9179

Merged
JSONbored merged 1 commit into
mainfrom
fix/observability-blind-spots-9128-9133-9136-9139
Jul 27, 2026
Merged

fix(orb): stop four silent alarm gaps in relay-drain, crash handling, DLQ, and reversal signals#9179
JSONbored merged 1 commit into
mainfrom
fix/observability-blind-spots-9128-9133-9136-9139

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Four related ORB observability bugs where the alarm is off exactly when it matters. All four share the same shape: a sentinel/silent-failure/orphaned-data pattern that makes a real incident look like "no data" instead of "firing."

  • orb(observability): the relay-drain staleness alarm is suppressed by its own worst failure — 'never drained' reads -1, and a deploy silences a firing alert #9128 — relay-drain staleness suppressed by its own worst failure. A drain that only ever throws stamped no failure signal anywhere, and "never drained" read a flat -1 that could never cross the Prometheus firing threshold. Fixed: drain failures are now counted (loopover_orb_relay_drain_consecutive_failures, loopover_orb_relay_drains_total{result="failed"}); "never drained" now ages from process boot instead of a flat -1, in both the loopover_orb_relay_drain_seconds_since_last gauge and isOrbRelayRegistrationAlerting; the sibling loopover_clock_skew_sample_age_seconds gauge got the same boot-aging fix (no alert reads it today, but the same hole would silently defeat a future one). Added LoopoverOrbRelayDrainFailing to catch a flapping drain the existing 30m no-progress alert can't see.

  • orb(selfhost): enabling PostHog silently disables crash-on-unhandled-rejection — a dead worker loop now survives inside a 'healthy' process #9133 — enabling PostHog silently disabled crash-on-unhandled-rejection. enableExceptionAutocapture captured a rejection but never rethrew or exited, silently downgrading a fatal crash-and-restart into a dead worker loop inside a still-"200 OK" process. Fixed: installSelfHostCrashHandlers (new, src/selfhost/process-lifecycle.ts) is now the sole, unconditional source of truth for both uncaughtException and unhandledRejection, installed first thing in main(), independent of whether telemetry is configured. enableExceptionAutocapture is now false so posthog-node never installs a competing listener (avoiding both a double-captured exception and its foreign-listener-count heuristic silently changing its own exit behavior). The stale comment asserting posthog-node's autocapture already covered this is corrected. Deferred (noted, not implemented): asserting worker-loop liveness in /health — flagged as a real followup, out of scope for this batch.

  • orb(observability): the queue-backlog alerts deactivate during the DB incident they exist to catch, and both DLQ-rate surfaces are structurally always zero #9139 — queue-backlog alerts deactivate during the exact DB incident they exist to catch; DLQ-rate always zero. A throwing gauge sampler in renderMetrics vanished entirely (no series, no counter), so every queue-backlog alert silently went INACTIVE during a Postgres outage — precisely the moment they exist to fire. Fixed: sampler failures are now counted (loopover_metrics_sampler_errors_total{metric}) and a -1 sentinel is emitted so the gauge's absence is itself visible; new LoopoverMetricsSamplerFailing alert. Added LoopoverObservabilityExporterDown, a generic up==0 rule scoped to the exporters that are always co-started with Prometheus/Alertmanager themselves (node-exporter/cadvisor/redis/observability-stack) — deliberately NOT a blanket rule over every job, since postgres/qdrant/gpu/rees/browserless/backup are each separately profile-gated and would misfire permanently on an install that never enabled that add-on. Added LoopoverBackupExporterMissing (absent(loopover_backup_files)) alongside the existing LoopoverBackupMissing, so a dead backup exporter (vs. "backup profile never enabled") is distinguishable — this one is a deliberate always-nudge, documented in the rule's own comment, mirroring the existing sqliteBackupAdvisory boot warning. Fixed alertmanager.yml's LoopOverTargetDown/LoopoverTargetDown capitalization mismatch (the commented inhibit-rule example silently never matched the real rule) and extended test/unit/alerts-metric-name-references.test.ts to assert every alertname="…" reference in alertmanager.yml, including commented examples, resolves to a real rule. loopover_dlq_dead_lettered_recent is now backed by the self-host queue's own recentDeadCount (new DurableQueue method, implemented in both pg-queue.ts and sqlite-queue.ts) — the cloud-worker audit_events source it read before is structurally unreachable on self-host (server.ts never calls worker.queue). The self-host dead-letter path now writes a review_audit row with event_type='dead_lettered' (scoped to jobs with an identifiable repo+PR) — this also directly feeds orb(observability): the orphaned review_targets table silently disables the anomaly alerter, the reputation quality signal, and the AMS bridge — and the reputation half expires to empty around 2026-09-20 #9136's DLQ signal below. Decided-and-documented (not implemented): the dlq.ts webhook self-heal re-drive is Cloudflare-MessageBatch-specific and cannot run on self-host as-is; self-host's own reviveDeadLetterJobs() sweep already provides a comparable (if not identical) generic revival safety net for any dead-lettered job type, including webhooks, so this is not a bare gap — porting the exact rate-limit-aware single-redrive behavior is flagged as a real, separately-scoped followup.

  • orb(observability): the orphaned review_targets table silently disables the anomaly alerter, the reputation quality signal, and the AMS bridge — and the reputation half expires to empty around 2026-09-20 #9136 — the orphaned review_targets table silently disabled the anomaly alerter (partial fix; two sub-parts deferred, documented below). review_targets has had no live writer anywhere since the 2026-06-22 convergence cutover. Fixed: computeAgentHealth's reversal and DLQ signals are repointed off review_targets directly onto the live review_audit ledger — parsing repo/number out of review_audit's own target_id instead of joining review_targets for them, which also fixes a separate bug the join had: review_audit.target_id is owner/repo#123 while review_targets.id is project:kind:owner/repo#123 — a different namespace the join could never actually match, even while review_targets was still live. The recentAutoActions denominator is repointed onto review_audit's own gate_decision rows. Added checkReviewSourceFreshness + loopover_review_source_fresh gauge + LoopoverReviewSourceStale alert — the generalizable fix: any table an ops/reputation module treats as a live, windowed source now gets checked for a row inside its own consumer's window, so the next orphaning is loud instead of silent for months.

    • Deferred, explicitly, with rationale: byStatus/manualRate/stuckRetryable/failed/configIssues/holdOnly in computeAgentHealth, and computeCalibration entirely (recommendedFloor, disputedCloseCount, calibration bins) remain review_targets-sourced and therefore still silently zero — repointing these needs reconstructing a full review-state-machine equivalent from pull_requests + review_audit, which is a substantially larger, separately-scoped rewrite.
    • Deferred, explicitly, with rationale: submitter-reputation.ts's getSubmitterReputation/getSubmitterReputationAcrossInstall/listSubmitterCohortRows (the reputation quality signal, which will expire to permanently empty around 2026-09-20) and ams-miner-cohort.ts (feat(ui): maintainer-facing AMS miner contributor-mix dashboard panel #6488, degrades to present: false) are untouched. Both are correctly flagged by the new checkReviewSourceFreshness's review_targets entry once it goes stale (it already reads stale today, since review_targets has no live writer at all).
    • Because the reputation signal is not restored in this PR, the "suspicion buys less scrutiny" compensating-hold concern the issue raises for the two vision-gate skips does not apply yet — it's a prerequisite for whoever restores the reputation signal next, noted here so it isn't silently missed.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused: one coherent theme (ORB observability blind spots) across four linked issues, no unrelated UI/docs/dependency changes.
  • This follows CONTRIBUTING.md and does not touch site/, CNAME, or **/lovable/**.
  • Maintainer PR (JSONbored) — linked-issue policy doesn't gate a maintainer PR, but every issue below is linked honestly per what was actually fixed vs. deferred.

Closes #9128
Closes #9133
Closes #9139
Addresses #9136 (partial — see Summary above for exactly what's fixed vs. deferred; not closing since the reputation-signal and AMS-cohort sub-parts remain unaddressed)

Validation

  • git diff --check
  • npm run typecheck
  • npm run selfhost:validate-observability
  • npm run selfhost:env-reference:check (regenerated apps/loopover-ui/src/lib/selfhost-env-reference.ts after the new GITHUB_APP_SLUG reads in pg-queue.ts/sqlite-queue.ts)
  • npm run db:schema-drift:check
  • npm run db:migrations:check
  • npm run docs:drift-check
  • npm run manifest:drift-check
  • Targeted npx vitest run + --coverage on every touched src/** file individually: 100% statements/branches/lines on every new/changed line (the only uncovered lines reported anywhere are pre-existing, unrelated to this diff — verified by line number against the diff).
  • npm run test:changed (full affected-test sweep): 455 files, 11165 tests, all passing, 0 failures.
  • Full unsharded npm run test:coverage, npm run test:ci, npm audit --audit-level=moderate, ui:build/ui:test/ui:lint/ui:typecheck, test:workers, build:mcp/test:mcp-pack — intentionally left to CI per explicit instruction for this batch; every individually-affected test file was run locally with coverage instead (see above).

If any required check was skipped, explain why:

  • The full npm run test:ci / npm run test:coverage / npm audit gate was intentionally not run locally for this PR — CI runs it, and targeted per-file coverage + a full test:changed sweep (11165 tests) were run locally instead to keep iteration fast across a four-issue batch. src/server.ts is ignored in codecov.yml (module-scope serve() side effect, same as packages/discovery-index/src/server.ts), so the wiring changes there (gauge registrations, the installSelfHostCrashHandlers call site, bootAtMs threading) are exempt from patch coverage by design; the underlying logic each wiring line calls is separately, fully unit-tested.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text (alert annotations, log lines) stays sanitized and low-noise.
  • No auth/cookie/CORS/GitHub App/Cloudflare/session changes in this PR.
  • No API/OpenAPI/MCP surface changed.
  • No UI changes.
  • No changelog edits.

Notes

… DLQ, and reversal signals

Four related observability blind spots where the alarm was off exactly when it mattered:

- Relay-drain staleness (#9128): a drain that only ever throws stamped no failure signal at
  all, and "never drained" read a flat -1 that could never cross the firing threshold. Counts
  drain failures (loopover_orb_relay_drain_consecutive_failures), ages "never drained" from
  process boot instead of -1 in both the seconds-since-last gauge and
  isOrbRelayRegistrationAlerting, and applies the same boot-aging fix to the clock-skew sibling
  gauge. Adds LoopoverOrbRelayDrainFailing to catch a flapping drain the existing 30m no-progress
  alert can't see.

- PostHog vs. unhandled rejections (#9133): enableExceptionAutocapture captured a rejection but
  never rethrew or exited, silently downgrading a fatal crash-and-restart into a dead worker loop
  inside a still-"healthy" process. installSelfHostCrashHandlers (new) is now the sole,
  unconditional source of truth for uncaughtException/unhandledRejection, installed first thing in
  main(); enableExceptionAutocapture is now off so posthog-node never competes with it.

- Queue/metrics blind spots during a DB incident (#9139): a throwing gauge sampler vanished
  entirely (no series, no counter); every queue-backlog alert silently went inactive during
  exactly the DB outage they exist to catch. Counts sampler failures
  (loopover_metrics_sampler_errors_total) and emits a -1 sentinel so absence is visible. Adds a
  generic up==0 rule for the always-co-started observability-bundle exporters, and an absent()
  rule for a dead backup exporter. Backs loopover_dlq_dead_lettered_recent with the self-host
  queue's own recentDeadCount (the cloud-worker audit_events source is unreachable on self-host).
  Writes a review_audit dead_lettered row from the self-host dead-letter path. Fixes
  alertmanager.yml's LoopOverTargetDown/LoopoverTargetDown capitalization mismatch and extends the
  metric-name-reference drift test to cover alertmanager.yml's alertname references too.

- Orphaned review_targets (#9136): repoints the anomaly-alerter's reversal and DLQ signals off the
  dead review_targets table onto the live review_audit ledger directly (also fixing a target_id
  namespace mismatch that meant the old join could never match even while review_targets was
  live). Adds checkReviewSourceFreshness, a generalizable staleness check + alert so the next
  table a downstream module silently stops writing is loud, not silent. byStatus/manualRate/
  stuckRetryable/failed, computeCalibration, submitter-reputation.ts, and ams-miner-cohort.ts
  remain review_targets-sourced -- deferred, see the PR description for the full scope.

Closes #9128
Closes #9133
Closes #9139

Advances #9136
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 243d43a Commit Preview URL

Branch Preview URL
Jul 27 2026, 05:54 AM

@JSONbored
JSONbored merged commit 6f29f74 into main Jul 27, 2026
7 checks passed
@JSONbored
JSONbored deleted the fix/observability-blind-spots-9128-9133-9136-9139 branch July 27, 2026 05:55
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 1 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.42MB 1 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-BFhyxt8R.js (New) 2.17MB 2.17MB 100.0% 🚀
assets/tanstack-vendor-CORFnVCQ.js (New) 803.04kB 803.04kB 100.0% 🚀
assets/docs.fumadocs-spike-api-reference-BgS-kSH_.js (New) 442.88kB 442.88kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-DH5gLRoo.js (New) 201.71kB 201.71kB 100.0% 🚀
assets/modal-DMDkpgrk.js (New) 184.39kB 184.39kB 100.0% 🚀
assets/client-B5XXcieT.js (New) 146.06kB 146.06kB 100.0% 🚀
assets/self-hosting-configuration-BoW7kL9o.js (New) 101.39kB 101.39kB 100.0% 🚀
assets/maintainer-panel-QeIGCfHI.js (New) 79.0kB 79.0kB 100.0% 🚀
assets/routes-B1f3gnb0.js (New) 35.77kB 35.77kB 100.0% 🚀
assets/owner-panel-Bmm4tL3F.js (New) 27.52kB 27.52kB 100.0% 🚀
assets/app-ClQrKHgk.js (New) 25.78kB 25.78kB 100.0% 🚀
assets/ui-vendor-S4ijg7GB.js (New) 22.28kB 22.28kB 100.0% 🚀
assets/miner-panel-BMxK6el0.js (New) 20.24kB 20.24kB 100.0% 🚀
assets/app.runs-BL0k3-v0.js (New) 20.22kB 20.22kB 100.0% 🚀
assets/api._op-E_KVVqnC.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-Bt4kJoPu.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/docs._slug-BP8qnTO2.js (New) 15.37kB 15.37kB 100.0% 🚀
assets/playground-panel-DgOBizEB.js (New) 14.43kB 14.43kB 100.0% 🚀
assets/fairness-BDTZI_uB.js (New) 10.6kB 10.6kB 100.0% 🚀
assets/app.audit-7ZzMJ3RF.js (New) 10.08kB 10.08kB 100.0% 🚀
assets/app.config-generator-dXRdGTc-.js (New) 10.06kB 10.06kB 100.0% 🚀
assets/maintainers-BMyvrxaI.js (New) 8.06kB 8.06kB 100.0% 🚀
assets/miners-SsZaCTy_.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-C9mSXL0_.js (New) 7.74kB 7.74kB 100.0% 🚀
assets/commands-panel-DDmvqGkJ.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/maintainer-workflow-BcCuInPo.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-CRkAUXbX.js (New) 6.15kB 6.15kB 100.0% 🚀
assets/repos._owner._repo.quality-C0qQQQUx.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-B92V6gV6.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/docs.index-IJ9scOQ9.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/api.index-BSBpWbn_.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-Dk_f-4Zv.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-CdH-dVMS.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-CIyuG64F.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-DfrRN5D_.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-BhJPjQAX.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tabs-BCSwhlRh.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-Cq-UhbbW.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-D1ycYGG0.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-COq2VPd2.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-Ubfknk4i.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/app.owner-Cw3kGNJH.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-BqVX88UW.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-BprIW18T.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-BrWrj0Rb.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-CHXyZtAK.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-BBNeAQ5_.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-COwdHs75.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-C5Hyiuvb.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-CKOsZx-b.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-DFrn51IK.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-Cvm7pJ4y.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-BXBMA7Tk.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/list-checks--m7N_28a.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/compass-Ctw3Xuuy.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-Ls-wNMiR.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/message-square-CGQYXvXJ.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-tcR9deUb.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-DDAuG_OS.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-AsiFPrDg.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-B2HLKh1o.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-jbB1yazC.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/add-scalar-classes-DeJbEOwJ.js (Deleted) -2.17MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-B4ZO9PHT.js (Deleted) -803.04kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-DcCvObhL.js (Deleted) -442.88kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-uHDPW65F.js (Deleted) -201.71kB 0 bytes -100.0% 🗑️
assets/modal-5-NrVVLW.js (Deleted) -184.39kB 0 bytes -100.0% 🗑️
assets/client-_bZEbloi.js (Deleted) -146.06kB 0 bytes -100.0% 🗑️
assets/self-hosting-configuration-Clri3J5L.js (Deleted) -101.39kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-CJVQjxPs.js (Deleted) -79.0kB 0 bytes -100.0% 🗑️
assets/routes-C47JiqCj.js (Deleted) -35.77kB 0 bytes -100.0% 🗑️
assets/owner-panel-6Ftbmyvn.js (Deleted) -27.52kB 0 bytes -100.0% 🗑️
assets/app-BUdDr_Hf.js (Deleted) -25.78kB 0 bytes -100.0% 🗑️
assets/ui-vendor-D2xF876d.js (Deleted) -22.28kB 0 bytes -100.0% 🗑️
assets/miner-panel-GXnGYtZN.js (Deleted) -20.24kB 0 bytes -100.0% 🗑️
assets/app.runs-Jo0oAY0O.js (Deleted) -20.22kB 0 bytes -100.0% 🗑️
assets/api._op-DeNOpRQh.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-BtnlW0V6.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/docs._slug-qutJjiaX.js (Deleted) -15.37kB 0 bytes -100.0% 🗑️
assets/playground-panel-aIz7NKUH.js (Deleted) -14.43kB 0 bytes -100.0% 🗑️
assets/fairness-C3bjhAXb.js (Deleted) -10.6kB 0 bytes -100.0% 🗑️
assets/app.audit-BDjATJWH.js (Deleted) -10.08kB 0 bytes -100.0% 🗑️
assets/app.config-generator-BQ1-n0o7.js (Deleted) -10.06kB 0 bytes -100.0% 🗑️
assets/maintainers-Blc3td7Z.js (Deleted) -8.06kB 0 bytes -100.0% 🗑️
assets/miners-DWxdTEly.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-44qqnHdb.js (Deleted) -7.74kB 0 bytes -100.0% 🗑️
assets/commands-panel-Beinj28u.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-nTasPKP5.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-GqOLdnLa.js (Deleted) -6.15kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-Bi4dDp2v.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-CMsnTZOB.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/docs.index-rOsiynp3.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-CCQCicHH.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-SRrv-kYR.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-D0Q-tQYM.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-9WCvcPVS.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-BUU_BHB4.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-CYrOzsXd.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tabs-sVTAzfrq.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-DZNg7vap.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-UksDPVEw.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-DcRoEUJp.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-BJkB6YI6.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/app.owner-D83LLNqq.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-BpbLZ_0a.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-CS405Gta.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-u1KNH_4l.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-BNZ9SuT-.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-D1rX1Mew.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-hS5z6pDy.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-DLJaETYE.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-D2o2bCF9.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-BqEBEFUV.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-CvAigVqp.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-BA8WxGPd.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/list-checks-BHh5fLpu.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/compass-DCUAwm_m.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-L7cu4_Du.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/message-square-DGVekwJN.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-CNUHKdhV.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-DFXF2jw1.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-R3t2eVq4.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-CnLXYsCn.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-i6D7Wmiw.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.68%. Comparing base (fbd1ed1) to head (243d43a).
⚠️ Report is 9 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9179      +/-   ##
==========================================
- Coverage   93.90%   92.68%   -1.22%     
==========================================
  Files         817      818       +1     
  Lines       81039    81099      +60     
  Branches    24611    24625      +14     
==========================================
- Hits        76096    75167     -929     
- Misses       3568     4848    +1280     
+ Partials     1375     1084     -291     
Flag Coverage Δ
backend 93.50% <100.00%> (-1.69%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/ops.ts 99.33% <100.00%> (+0.09%) ⬆️
src/selfhost/clock-skew.ts 100.00% <100.00%> (ø)
src/selfhost/dlq-recent.ts 100.00% <100.00%> (ø)
src/selfhost/metrics.ts 100.00% <100.00%> (ø)
src/selfhost/monitored-work.ts 100.00% <100.00%> (ø)
src/selfhost/posthog.ts 99.34% <ø> (ø)
src/selfhost/process-lifecycle.ts 100.00% <100.00%> (ø)
src/selfhost/sqlite-queue.ts 99.61% <100.00%> (+<0.01%) ⬆️

... and 3 files with indirect coverage changes

JSONbored added a commit that referenced this pull request Jul 27, 2026
…w_targets (#9136)

getSubmitterReputation, getSubmitterReputationAcrossInstall, and
listSubmitterCohortRows read `review_targets` over a 90-day recency
window -- but review_targets has had no live writer since the 2026-06-22
convergence cutover, so that window reads a shrinking set that goes
permanently empty around 2026-09-20 (following #9015's partial fix and
#9179's repoint of the anomaly-alerter's reversal/DLQ signals).

Repointed onto the same live ledgers #9179 and getSubmitterCadence (#9015)
already read: review_audit's pr_outcome rows (the realized outcome, not
just the bot's own prediction) joined to pull_requests for the submitter's
login, restricted to each target's LATEST pr_outcome row so a redelivered
webhook can't double-count. ams-miner-cohort.ts required no changes --
it consumes listSubmitterCohortRows directly and picks the repoint up
for free; its stale doc comments are updated to match.

Before restoring the signal, give evaluateVisualVisionGate's and
evaluateScreenshotTableVisionGate's `low_reputation` skip a compensating
advisory finding: silently skipping the one extra AI check a low-reputation
submitter's confirmed visual change would otherwise get reproduces #9015's
"suspicion buys less scrutiny" shape.

Remaining scope, tracked under #9136: ops.ts's computeAgentHealth
(byStatus/byVerdict/failedRows/manualRate/stuckRetryable/failed) and
computeCalibration still read review_targets directly. Deferred because
review_targets' non-terminal states (queued/reviewing/error/error_retryable)
and the attempt-exhausted 'failed' bucket have no live per-target
equivalent post-cutover -- gate_decision's own `decision` column only
ever records 'merge' | 'close' | 'hold', not the full status enum
review_targets tracked. See the PR description for the full reader
inventory.
JSONbored added a commit that referenced this pull request Jul 27, 2026
…w_targets (#9136)

getSubmitterReputation, getSubmitterReputationAcrossInstall, and
listSubmitterCohortRows read `review_targets` over a 90-day recency
window -- but review_targets has had no live writer since the 2026-06-22
convergence cutover, so that window reads a shrinking set that goes
permanently empty around 2026-09-20 (following #9015's partial fix and
#9179's repoint of the anomaly-alerter's reversal/DLQ signals).

Repointed onto the same live ledgers #9179 and getSubmitterCadence (#9015)
already read: review_audit's pr_outcome rows (the realized outcome, not
just the bot's own prediction) joined to pull_requests for the submitter's
login, restricted to each target's LATEST pr_outcome row so a redelivered
webhook can't double-count. ams-miner-cohort.ts required no changes --
it consumes listSubmitterCohortRows directly and picks the repoint up
for free; its stale doc comments are updated to match.

Before restoring the signal, give evaluateVisualVisionGate's and
evaluateScreenshotTableVisionGate's `low_reputation` skip a compensating
advisory finding: silently skipping the one extra AI check a low-reputation
submitter's confirmed visual change would otherwise get reproduces #9015's
"suspicion buys less scrutiny" shape.

Remaining scope, tracked under #9136: ops.ts's computeAgentHealth
(byStatus/byVerdict/failedRows/manualRate/stuckRetryable/failed) and
computeCalibration still read review_targets directly. Deferred because
review_targets' non-terminal states (queued/reviewing/error/error_retryable)
and the attempt-exhausted 'failed' bucket have no live per-target
equivalent post-cutover -- gate_decision's own `decision` column only
ever records 'merge' | 'close' | 'hold', not the full status enum
review_targets tracked. See the PR description for the full reader
inventory.
JSONbored added a commit that referenced this pull request Jul 27, 2026
…le clock skew in broker mode, and bound the upstream-drift fallback fetch (#9230)

* fix(upstream): bound the raw-github fallback fetch with a timeout (#9165)

fetchTrackedSource's raw-GitHub fallback was the only fetch in ruleset.ts
without a timeout, so a stalled raw.githubusercontent.com connection hung
the whole scheduled refreshUpstreamDrift job. Route it through the same
timeoutFetch every other call site in the file already uses, and confirm
the Promise.all fan-out degrades per-source rather than all-or-nothing.

Sweep the rest of src/ for the same bare-fetch shape: three GitHub calls
in github-oauth.ts (device-flow start/poll, web-OAuth code exchange) and
one call each in linear-adapter.ts and registry/sync.ts had no timeout
and are now bounded the same way.

* fix(selfhost): sample clock skew in broker mode and alert on staleness (#9156)

recordClockSkewFromResponse's only call site is inside the local GitHub
App JWT mint path, which a brokered self-host never reaches (mintInstallationToken
returns from the broker branch first) -- so a brokered deployment's clock
skew gauge read a hard 0, indistinguishable from "clock is fine". Sample
it from fetchBrokeredInstallationToken's own response instead, on both
success and failure.

0 is a real, reachable skew value (a perfectly synced clock), so it can't
double as "never sampled" -- clockSkewSecondsSample() now returns NaN
until the first real sample lands.

The companion loopover_clock_skew_sample_age_seconds gauge (added in #7000
precisely so a stale reading is distinguishable from a fresh one) was wired
to zero alert rules and zero dashboard panels. Add LoopoverClockSkewSampleStale
(fires past 2h, tolerating normal ~hourly mint-timing jitter) and the
matching Grafana stat panel.

* fix(review): repoint the reputation quality signal off orphaned review_targets (#9136)

getSubmitterReputation, getSubmitterReputationAcrossInstall, and
listSubmitterCohortRows read `review_targets` over a 90-day recency
window -- but review_targets has had no live writer since the 2026-06-22
convergence cutover, so that window reads a shrinking set that goes
permanently empty around 2026-09-20 (following #9015's partial fix and
#9179's repoint of the anomaly-alerter's reversal/DLQ signals).

Repointed onto the same live ledgers #9179 and getSubmitterCadence (#9015)
already read: review_audit's pr_outcome rows (the realized outcome, not
just the bot's own prediction) joined to pull_requests for the submitter's
login, restricted to each target's LATEST pr_outcome row so a redelivered
webhook can't double-count. ams-miner-cohort.ts required no changes --
it consumes listSubmitterCohortRows directly and picks the repoint up
for free; its stale doc comments are updated to match.

Before restoring the signal, give evaluateVisualVisionGate's and
evaluateScreenshotTableVisionGate's `low_reputation` skip a compensating
advisory finding: silently skipping the one extra AI check a low-reputation
submitter's confirmed visual change would otherwise get reproduces #9015's
"suspicion buys less scrutiny" shape.

Remaining scope, tracked under #9136: ops.ts's computeAgentHealth
(byStatus/byVerdict/failedRows/manualRate/stuckRetryable/failed) and
computeCalibration still read review_targets directly. Deferred because
review_targets' non-terminal states (queued/reviewing/error/error_retryable)
and the attempt-exhausted 'failed' bucket have no live per-target
equivalent post-cutover -- gate_decision's own `decision` column only
ever records 'merge' | 'close' | 'hold', not the full status enum
review_targets tracked. See the PR description for the full reader
inventory.

* chore(cf): regenerate worker-configuration.d.ts after rebasing onto main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment