Skip to content

fix(monitoring): prepare oldest-age alerts and production import routing - #24938

Merged
Git-on-my-level merged 11 commits into
mainfrom
fix/n5-oldest-age-flat-alerts
Nov 8, 2026
Merged

Git-on-my-level merged 11 commits into
mainfrom
fix/n5-oldest-age-flat-alerts

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Published correction 20213fb, verified 2026-11-08T23:33:16Z; PR OPEN/unmerged, zero review requests. Review-desk FIX-FIRST findings are fixed: 55-minute per-series observation history, no optional-summary freshness failure, and same-replica summary freshness filtering. All 14 requested monitoring/store suites passed (535 tests, no skips), including 53 real Prometheus scenarios. Complete guarded push hooks passed. Exact-head CI is GREEN: 64 terminal checks, 0 pending/failed. No production action or lifecycle state change.

Symptom and evidence

The N5 scope report measured held assignment age 881815s, quarantine-held age 1835094s, and corrupt record-pending age ~1.794e9s (~57 years) during 2026-11-08T14:03–14:10Z. Held-content snapshot was 6859s stale at 14:08Z, with oldest published age 3678199s (42.6d). An approximately zero enqueue clock poisons the held-age sample.

The aggregate Grafana dry-run measured 66 unprovisioned/changed rules at 2026-11-08T14:05–14:59Z: 17 firing, including five real backlog pages and a false queue-blind page. Worker-plane sampler cadence was ~514s, exceeding the prior 120s freshness budget. BYOK age was 219900s, below 259200s but predicted to cross in ~11h if it keeps aging. These are the reports' historical measurements, not fresh production measurements in this lane.

Evidence: workspace data/run-2026-11-08-retro-fixnow/out-n5-scope.md §§4–5 (source 0dc944b9e02) and out-grafana-dryrun.md (rules at 2958b7c1b369, baseline 027a61e0e951). Import preparation authorized by lane-owner relay of lead2 ruling 699300, 2026-11-08T15:13Z, superseding the dry-run's proposed BYOK page disposition.

Change

  • Held-age sampling skips nonnumeric, boolean, nonfinite and nonpositive leg clocks, walking oldest-first by snapshot cursor with limit(1) per RPC. Metrics sampler fix, not a lifecycle point fix: no row writes, transitions, admission or lifecycle decisions. P3 freeze respected; drain/new-cohort sampling unchanged. Invalid prefixes require additional read-only document reads.
  • New omi-oldest-age-gauge-flat-1h: positive per-series projection-obligation/vendor-held/summary-debt/demand-processing ages with equal 1h maximum and minimum AND an observation at least 3300s old in that window, using time() - min_over_time(timestamp(age)[1h:1m]) >= 3300. Summary ages also require the matching replica timestamp younger than 300s. Positive total for 10m, noData OK. No absent/stale summary-timestamp failure arm; enablement-aware producer-blindness is separate runbook debt. Freshness companions named in verification.
  • New omi-held-content-snapshot-stale: newest fleet snapshot timestamp older than 3600s for 10m; missing snapshot Alerting. Both new rules are active warning/tier agent/audience agent with omi-tier-silent.
  • omi-batch-queue-safety-blind: freshness arm 120s → 900s, retaining 5m pending, page routing and other query arms. Producer cadence and adapter freshness do not change.
  • Five known backlog page rules land paused, with written owner-approved unpause criteria below. Their tiers, thresholds and pending windows remain unchanged; notably held-row-age stays page / >21600s.
  • omi-finalization-byok-dwell-page retains UID, >259200s/1h threshold and source freshness; now active warning/tier agent/audience agent, omi-tier-silent, sibling warning notification timings.
  • Regenerated combined rules and GMP consumer-query inventory, metric declarations, runbooks and offline contracts. Existing vendor-held collector identity is expressed literally for the emitter scanner, pinned equal to its frozen name; emitted identity/labels/behavior unchanged. Corrected the older drain test's original-rule-only review deadline assumption.

The reviewed lifecycle test inventory records BYOK's agent tier and eleven explicit strict known-gap clauses while the borrowed backlog pages are paused under ruling699300. The active-alert assertion is unchanged: each gap remains genuinely red, real unpause produces strict XPASS and forces debt-record removal, and an unreviewed pause still fails. The pre-push fallback now selects pytest filenames, excluding support modules/conftest that collect zero tests; the existing cap regression covers both test-name forms and helper-only changes. Its cap and full-CI requirement are unchanged. The separate fleet-verifier tests now expect exactly the three intentional gated-pause errors; the runtime verifier remains fail-closed. No state/exit/deadline or lifecycle decision is changed.

Day-1 page list

These are all active tier=page rules in the full import. Every row's receiver is explicitly listed; a row is eligible to notify only if its condition and pending window fire. This is routing inventory, not a claim that every row fires at import. The 12 rows marked new/changed set are the retained page guards in the dry-run's 66-rule set; other rows were already in the baseline. Four new/changed page guards remain unevaluable from GMP (N1 debt below). Agent-tier rules, including BYOK and both N5 sampler rules, are muted.

UID Receiver Meaning Import set
tz_parakeet_rps_zero Omi - Services Alerting (Telegram) Parakeet receiving zero traffic for 10+ minutes — possible ILB connectivity or config issue existing baseline
tz_backend_listen_lb_zero Omi - Services Alerting (Telegram) Backend-listen receiving zero LB traffic for 10+ minutes — transcription pipeline may be down existing baseline
tz_backend_listen_pods_zero Omi - Services Alerting (Telegram) Backend-listen has zero ready pods — all replicas are down or failing health checks existing baseline
tz_pusher_connections_zero Omi - Services Alerting (Telegram) Pusher has zero active WebSocket connections for 10+ minutes — live transcription pipeline broken existing baseline
tz_backend_cloudrun_zero Omi - Services Alerting (Telegram) Backend Cloud Run service receiving zero LB traffic for 15+ minutes — API may be unreachable existing baseline
tz_chat_agent_requests_zero Omi - Services Alerting (Telegram) The AI chat agent lane served under 5 requests in an hour; the lowest hour in the preceding week was 18 existing baseline
omi-journey-capture-success-critical Omi - Services Alerting (Telegram) Capture finalization success share below the 90% paging floor while at least 20 journeys were accepted in 30m existing baseline
omi-journey-pusher-success-critical Omi - Services Alerting (Telegram) Pusher session success share below the 90% paging floor while at least 20 journeys were accepted in 30m existing baseline
omi-journey-chat-success-critical Omi - Services Alerting (Telegram) Chat response success share below the 90% paging floor with at least 20 journeys accepted and at least 5 failures in 30m existing baseline
omi-stt-chain-exhausted-page Omi - Services Alerting (Telegram) More than 60% of accepted /v4/listen sessions exhaust the live-STT provider chain in 5m existing baseline
omi-stt-provider-budget Omi - Services Alerting (Telegram) A live STT provider is out of balance or quota - top up the provider named in the alert instance labels. existing baseline
omi-soniox-budget-exhausted Omi - Services Alerting (Telegram) Soniox balance exhausted — top up now existing baseline
omi-slo-live-critical Omi - Services Alerting (Telegram) Live transcription - SLO budget burn (critical) existing baseline
omi-slo-chat-critical Omi - Services Alerting (Telegram) Mobile chat - SLO budget burn (critical) existing baseline
omi-slo-pusher-critical Omi - Services Alerting (Telegram) Pusher session - SLO budget burn (critical) existing baseline
omi-datasource-prometheus Omi - Services Alerting (Telegram) Prometheus alert query path failed or returned no sentinel samples. existing baseline
omi-datasource-cloud-monitoring Omi - Services Alerting (Telegram) Cloud Monitoring alert query path failed or returned no sentinel samples. existing baseline
omi-datasource-gmp Omi - Services Alerting (Telegram) GMP alert query path failed or returned no Cloud Run sentinel samples. existing baseline
omi-capture-summary-never-published Omi - Services Alerting (Telegram) Capture finalization - summary has not published existing baseline
omi-stt-no-full-stage-target Omi - Services Alerting (Telegram) No live STT target has been at cost-routing stage 100 for 10m, so the router serves every session from its availability escape existing baseline
omi-sync-provider-budget-exhausted Omi - Services Alerting (Telegram) Sync/prerecorded transcription jobs are failing because an STT vendor says the account is out of credits or budget existing baseline
omi-device-wal-backlog-over-cap Omi - Services Alerting (Telegram) Device signal wal-backlog-over-cap: distinct devices in the last hour exceed both the floor and 2x the 7-day hourly median. existing baseline
omi-device-wedge-count-cap Omi - Services Alerting (Telegram) Device signal wedge-count-cap: distinct devices in the last hour exceed both the floor and 2x the 7-day hourly median. existing baseline
omi-batch-queue-safety-blind Omi - Services Alerting (Telegram) Batch queue safety cannot measure every queue/retry priority, or its sample has been stale for fifteen minutes. new/changed set
omi-batch-vendor-overflow-spend Omi - Services Alerting (Telegram) Batch GPU overflow has sent more than $50 of fresh audio to Modulate in the last 24 hours new/changed set
omi-finalization-pair-drift Omi - Services Alerting (Telegram) Fresh lifecycle pair drift persists new/changed set
omi-pipeline-upload-503-storm Omi - Services Alerting (Telegram) Backend-sync upload admission exceeds 100 size-class 266-byte 503s/min for 10 minutes. new/changed set
omi-pipeline-firestore-contention Omi - Services Alerting (Telegram) Batch services log more than 20 FirestoreContentionExhausted entries/min for 10 minutes. new/changed set
omi-pusher-storage-queue-critical Omi - Services Alerting (Telegram) Pusher storage work is queuing persistently. new/changed set
omi-pusher-memory-working-set-high Omi - Services Alerting (Telegram) Pusher memory is approaching its container limit. new/changed set
omi-batch-held-backlog-growing Omi - Services Alerting (Telegram) Held batch backlog is growing or at least 10000 units new/changed set
omi-enrichment-queue-depth-page Omi - Services Alerting (Telegram) Enrichment queue is beyond its recent operating range new/changed set
omi-stt-vendor-benched-page Omi - Services Alerting (Telegram) A serving STT vendor remains at a low routing stage new/changed set
omi-incluster-guard-unsafe-page Omi - Services Alerting (Telegram) An in-cluster safety guard reports TRIP or BLIND new/changed set
omi-modulate-credit-page Omi - Services Alerting (Telegram) Modulate has rejected company credit new/changed set

Historically firing page rules are paused; the queue-blind cadence fix should remove its healthy-cycle false positive. Current firing state must be rechecked at deployment. Existing baseline rules were not re-evaluated by the 66-rule dry-run.

Paused at import

Pausing withholds these five known-debt pages while #24731/#24893 drain owners track recovery. No automatic unpause; each requires a separate approved source/provisioning change. Missing/stale observations do not count as recovery.

UID Unpause criteria (thresholds unchanged)
omi-pipeline-held-row-age After #24731/#24893 drain work and the N5 invalid-clock sampler guard reach production, require fresh samples of every held leg below 21600s continuously for 24h. The drain owner must approve a separate unpause change; missing, stale or undated samples do not count as healthy.
omi-batch-unit-unpublished-2h After #24731/#24893 drain work reaches production, require both fresh timeliness and queue sources below 7200s continuously for 24h, with no blind scan. The drain owner must approve a separate unpause change; missing or stale samples do not count as healthy.
omi-enrichment-fresh-dwell After #24893 enrichment drain work reaches production, require fresh, untruncated fresh-cohort observations below 3600s continuously for 24h. The lifecycle owner must approve a separate unpause change; missing or stale samples do not count as healthy.
omi-record-pending-dwell After #24893 record-admission drain work reaches production, require fresh, untruncated record_pending cohort observations below 7200s continuously for 24h. The lifecycle owner must approve a separate unpause change; missing or stale samples do not count as healthy.
omi-pipeline-projection-drain-stall After #24731 projection drain work reaches production, require fresh projection-debt samples and complete delayed turn metrics continuously for 24h: either no pending projection debt, or claim_busy share <=0.5 and progress >=10 rows/s. The drain owner must approve a separate unpause change; missing or stale samples do not count as healthy.

Debt: 22 rules not evaluable from GMP until N1 scrape fixes land

The dry-run could not query the in-cluster-only series through the ro-prod bot; these verdicts are fires-unknown, not healthy. Retro N1 owns listen/pusher scrapes and token, PodMonitoring and record-seal crashloop recovery. Four listed page-tier guards are expected to remain blind until their series exist; verify directly against Grafana's actual in-cluster datasource before import rather than treating GMP absence as acceptance.

  • omi-scrape-backend-listen-metrics
  • omi-scrape-pusher-metrics
  • omi-scrape-llm-gateway-metrics
  • omi-scrape-dg_engine_metrics
  • omi-scrape-stackdriver-metrics
  • omi-scrape-cloud-run-application-metrics
  • omi-scrape-gpu-metrics
  • omi-scrape-parakeet
  • omi-scrape-record-seal-worker-metrics
  • omi-scrape-batch-pipeline-worker-metrics
  • omi-scrape-diarizer-batch-metrics
  • omi-stt-enabled-state-unknown
  • omi-stt-evidence-loss
  • omi-stt-pressure-sampler-stuck
  • omi-stt-snapshot-unready
  • omi-stt-stage-disagreement
  • omi-stt-vendor-benched-page
  • omi-modulate-credit-page
  • omi-pusher-storage-queue-warning
  • omi-pusher-storage-queue-critical
  • omi-pusher-storage-pcm-refusals
  • omi-pusher-memory-working-set-high

Expected firing and design questions

From the historical baseline, snapshot-stale will enter Alerting after 10m if its measured 6859s stall persists, silently at agent tier. Known backlog pages remain paused; BYOK remains silent even when its dwell threshold crosses. Existing retry-age, lifecycle scan-blindness and sentinel warnings remain active agent-muted debt.

Review-desk FIX-FIRST correction: all four series families require at least 55 minutes of per-series timestamp history within the 1h window (1m subquery, five-minute scrape/grid tolerance). This proves an observed span, not continuous scrape coverage, and cannot combine replicas. The existing 10m pending period remains. The standalone summary freshness arm, including or vector(1), is removed entirely: intentional absence, zero or staleness of this optional producer cannot independently fire the rule. Summary flat-age counts require the same replica's sample younger than 300s, excluding retained former lease holders under summary-guarantee.md:109–115. Separate runbook debt: add an enablement/expected-producer signal and a dedicated freshness rule before claiming summary-debt blindness coverage. Current production enablement is not measured here. Offline Prometheus fixtures cover startup, 55-minute eligibility, pending/fire/recovery, cadence, replica separation, disabled/absent/stale timestamps and lease handoff. Review-thread replies are authorized; no review requests or production actions.

Deploy, readback and rollback (not performed here)

  1. Deploy the invalid-clock guard through the normal backend train to backend-integration and batch-worker sampler consumers. Verify each running release identity plus a fresh sampler metric/log; held ages must no longer use epoch-zero clocks. No migration or historical data repair.
  2. After merge, an authorized deployer dispatches grafana_dashboard_provisioning.yml with environment=prod. A main push provisions dev only; live-STT egress import does not carry the N5 rules. No workflow edits or dispatches in this PR.
  3. The separate live-STT coverage verifier currently rejects intentionally paused gated rules (verify_pusher_live_alert_route.py:585–591,664–684); report that debt to the import owner rather than unpausing known backlog to satisfy it. Full provisioning preserves the approved pauses. Read back production definitions with the provisioner without --apply. Require no drift: both N5 UIDs and queries/no-data states, all five pause flags and unpause annotations, queue-blind >=900s, BYOK warning/agent mute, preserved thresholds, receiver routing. Recheck signals on the actual datasource, including the 22 N1-debt rules. Then verify fresh snapshot publication and gauge behavior. Offline tests prove no live notification delivery.
  4. Rollback uses the provisioner's saved backup or a scoped revert/regenerate/reapply through authorized provisioning. Pausing the new sampler UIDs is reversible; revert the clock guard through the backend train if needed. Do not unpause known backlog pages or restore the known 120s false-positive arm as an incidental rollback. No lifecycle/data rollback.

Validation and publication

  • Correction head 20213fb, local/remote/PR readback 2026-11-08T23:21:25Z. Worktree clean; PR OPEN/unmerged, zero review requests. Published with required credential scrubbing, TZ=UTC, OMI_PR_BODY_FILE and 900s backend file budget through bin/omi-heavy.
  • Regenerated/linted 222 combined/split definitions, regenerated GMP query audit, and passed the actual Promtool rule parser. The review correction changes only the flat-age rule query/annotations among those 222 UIDs.
  • Complete publication hooks passed: 51 manifest checks in 814.45s, Pyright (192s), OpenAPI compatibility/schema checks, incremental macOS debug build (16.63s), and pinned formatting. No application launch/install or deployed acceptance.
  • Changed-file unit gate: 565 passed / 86 existing strict known-gap xfails, seven isolated files. This includes all 14 oldest-age tests, with four real Prometheus regressions covering 53 synthetic scenarios, no skips (23:17Z). Startup/short history cannot qualify; sustained flat ages fire after observation history plus pending time, then resolve on change. Optional producer and replica-handoff controls pass. The 98-test sampler suite also passed, including invalid enqueue clocks.
  • All 14 requested monitoring/store suites passed: 535 tests, no skips, verified 2026-11-08T23:33:16Z. Five suites passed in the hook (215 tests); nine complementary suites passed through bin/omi-heavy (320 tests). PROMTOOL_BIN also executed the two older optional semantic regressions. These are two isolated runner commands on the same correction SHA, not a single combined pytest session.
  • Registry prerequisite: #24950, merge fadad03099acbf133fa6461f8f928d606cf6a236 at 2026-11-08T19:20:24Z, covers the overdue flag and UTC date. Merged origin/main without rebasing before publication; no own registry metadata or .github/ edits.
  • Exact-head CI GREEN at 2026-11-08T23:33:16Z: 64 terminal checks, 0 pending/failed, first run on this correction (no retry). scripts/pr-preflight --suggest, draft-body metadata validation and complete publication checks passed. Four related review threads received correction/validation replies. Earlier source-audio CPU-budget timing instability and prior-head retries are recorded in the implementation report; no assertion, duration limit or allowlist was weakened.
  • No production reads or GCP tier used; no deployment, Grafana apply/readback, production historical replay, live notification delivery, merge, review request, bus post, heartbeat or new ANX ask.

Failure-Class: none

This observability/sampler and import-disposition change does not match an existing lifecycle/admission failure class. It changes no lifecycle decision or user row and adds no .github/ definition under the lane boundary. Regression coverage pins invalid-clock walking, query observation history, optional-producer freshness, replica matching, inventory, preserved thresholds, pause recovery criteria and silent agent routing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T23:24:31.022508Z 20213fb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files

You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c144913b1b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"type": "prometheus",
"uid": "prometheus"
},
"expr": "(count(omi_batch_projection_obligation_oldest_age_seconds > 0 and (max_over_time(omi_batch_projection_obligation_oldest_age_seconds[1h]) - min_over_time(omi_batch_projection_obligation_oldest_age_seconds[1h]) == 0)) or vector(0)) + (count(omi_batch_pipeline_vendor_held_oldest_age_seconds > 0 and (max_over_time(omi_batch_pipeline_vendor_held_oldest_age_seconds[1h]) - min_over_time(omi_batch_pipeline_vendor_held_oldest_age_seconds[1h]) == 0)) or vector(0)) + (count(omi_summary_debt_oldest_age_seconds > 0 and (max_over_time(omi_summary_debt_oldest_age_seconds[1h]) - min_over_time(omi_summary_debt_oldest_age_seconds[1h]) == 0)) or vector(0)) + (count(omi_demand_processing_queue_age_seconds > 0 and (max_over_time(omi_demand_processing_queue_age_seconds[1h]) - min_over_time(omi_demand_processing_queue_age_seconds[1h]) == 0)) or vector(0)) + ((time() - max(omi_summary_debt_sample_timestamp_seconds) > bool 3600) or vector(1))",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude former summary samplers from the flat-age count

When the summary-repair lease moves between live replicas, this counts a former sampler's retained positive age as frozen even while the current sampler is updating successfully. In backend/services/summary_debt_repair.py, tick() returns without resetting gauges when claim() loses, and only the winning invocation updates delivery.OLDEST and delivery.SAMPLED_AT. Consequently, a healthy handoff can leave the old replica's age constant indefinitely, triggering this warning after an hour; the separate fleet-wide timestamp check does not suppress that count. Filter the summary-age arm using its matching replica's sample freshness or select the current winning sampler, consistent with the existing contract in backend/docs/runbooks/summary-guarantee.md.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20213fb59ddf.

The summary-age arm now requires its matching replica's omi_summary_debt_sample_timestamp_seconds to be younger than 300s, consistent with the summary-guarantee runbook. A fleet-wide timestamp cannot qualify a retained former sampler. Engine cases cover healthy lease handoff and a fresh timestamp from another replica; neither revives a stale/unmatched age. Optional producer blindness is separate enablement-aware runbook debt.

Validation: all 14 oldest-age tests passed through bin/omi-heavy at 2026-11-08T23:17Z, including four real Prometheus engine regressions covering 53 synthetic scenarios. Regeneration/lint and all 51 publication preflight checks passed. No production import or lifecycle change.

Keep known backlog pages paused with explicit recovery criteria, accommodate worker sampler cadence, and route BYOK dwell as a muted warning.

Failure-Class: none
@Git-on-my-level Git-on-my-level changed the title fix(monitoring): guard held clocks and detect frozen oldest-age gauges fix(monitoring): prepare oldest-age alerts and production import routing Nov 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 492171a138

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"type": "prometheus",
"uid": "prometheus"
},
"expr": "(count(omi_batch_projection_obligation_oldest_age_seconds > 0 and (max_over_time(omi_batch_projection_obligation_oldest_age_seconds[1h]) - min_over_time(omi_batch_projection_obligation_oldest_age_seconds[1h]) == 0)) or vector(0)) + (count(omi_batch_pipeline_vendor_held_oldest_age_seconds > 0 and (max_over_time(omi_batch_pipeline_vendor_held_oldest_age_seconds[1h]) - min_over_time(omi_batch_pipeline_vendor_held_oldest_age_seconds[1h]) == 0)) or vector(0)) + (count(omi_summary_debt_oldest_age_seconds > 0 and (max_over_time(omi_summary_debt_oldest_age_seconds[1h]) - min_over_time(omi_summary_debt_oldest_age_seconds[1h]) == 0)) or vector(0)) + (count(omi_demand_processing_queue_age_seconds > 0 and (max_over_time(omi_demand_processing_queue_age_seconds[1h]) - min_over_time(omi_demand_processing_queue_age_seconds[1h]) == 0)) or vector(0)) + ((time() - max(omi_summary_debt_sample_timestamp_seconds) > bool 3600) or vector(1))",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate summary freshness checks on repair enablement

When summary repair is intentionally disabled, including the code/dev defaults and the supported kill-switch rollback, this freshness arm keeps the entire alert firing despite healthy samplers. config/summary_guarantee.py::repair_enabled() defaults to false, and services/summary_debt_repair.py:106–107 returns before updating SAMPLED_AT in that state. The timestamp therefore remains zero, becomes stale, or is absent, each of which makes this arm contribute 1 indefinitely. Gate this check on whether repair is expected to run, or provision it only for enabled deployments, so disabling an optional producer does not permanently mask the other sampler-health signals behind a false warning.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 20213fb59ddf.

Removed the independent summary freshness failure entirely. Missing, zero or stale timestamps no longer contribute 1; summary flat ages are excluded unless their own replica sample is younger than 300s. The runbook records unknown coverage and a separate future freshness rule requiring an expected-producer/enablement signal. Disabled/zero, absent, stale and healthy-handoff engine controls pass.

Validation: all 14 oldest-age tests passed through bin/omi-heavy at 2026-11-08T23:17Z, including four real Prometheus engine regressions covering 53 synthetic scenarios. Regeneration/lint and all 51 publication preflight checks passed. No production import or lifecycle change.

Keep paused dwell clauses as strict known gaps and declare the reviewed BYOK warning tier. Preserve the separate fleet coverage failure for the three gated pauses. Exclude helper modules from the bounded push test fallback without changing its cap.

Failure-Class: none
Require 55 minutes of per-series timestamp history in the one-hour window. Remove the optional summary producer freshness failure and exclude stale former summary samplers. Pin startup, pending, replica and enablement behavior with offline Prometheus fixtures.

Failure-Class: none
@Git-on-my-level
Git-on-my-level merged commit 6a03440 into main Nov 8, 2026
68 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/n5-oldest-age-flat-alerts branch November 8, 2026 23:49
Git-on-my-level added a commit that referenced this pull request Nov 9, 2026
…#24978)

## Problem

The production monitoring import [run
42585257121](https://github.com/BasedHardware/omi/actions/runs/42585257121)
failed its live verification on the three gated rules intentionally
paused under [#24938](#24938),
ruling 699300. The verifier required every live rule to be unpaused even
when the committed source required a pause.

## Change

Compare live `isPaused` against the committed source in the shared
definition comparator. An explicit source `isPaused=true` authorizes a
live pause; other source values require live `false`. Both the per-rule
check and fleet gate use this comparison. Matching paused rules remain
listed in `PRESENT_BUT_PAUSED` and count as matching.

A committed pause with a live unpause **fails**, because unpausing
bypasses the reviewed hold and its recovery criteria. Missing/malformed
live pause state also fails. Missing rules and all existing query,
routing and definition drift checks remain failures. No rule is
unpaused, no source rule is changed, and no `.github` workflow is
changed.

## Validation

- Unit coverage exercises all four boolean pause combinations in both
per-rule and fleet checks (`gated` and `all`), rejects
missing/nonboolean live states, and preserves missing-rule and
other-definition-drift failures for intentionally paused rules.
- Production/development live-STT import fixtures require the exact
three approved source pauses to pass without hiding their paused report.
- `omi-heavy run -- .venv/bin/python -m pytest -q
tests/unit/test_verify_pusher_live_alert_route.py
tests/unit/test_provision_monitoring_alerts.py` from `backend/`: **155
passed**, 17.44s pytest wall time on commit
`1e1a923a917e09a4e818c78dd0ad3e1a6edd3dfe`.
- `scripts/failure-class validate --pr-body-file
.agent-brief/verifier-paused-pr-body.md --base origin/main --head HEAD
--format text`: passed.
- `omi-heavy run --wait 3600 -- make preflight`: **36 checks passed**,
714.67s, on the same commit.
- Required credential-scrubbed `git push` with
`BACKEND_UNIT_FILE_BUDGET_SECONDS=900` and `OMI_PR_BODY_FILE`:
**passed**. Its 36 manifest checks passed (1051.02s); backend Pyright
reported **0 errors** (existing warnings remain); all **14 selected unit
files / 2378 tests passed** in isolated file processes; pinned Python
formatting passed. No check was skipped via an override.

A green **production proof run needs the next prod monitoring import
(batched David gate)**. No workflow dispatch, Grafana write/readback,
production notification proof or deployment is performed in this PR.

## Product invariants affected

none — this change corrects an operational definition verifier; it
changes no application behavior, account data or alert source
disposition.

Failure-Class: none

The existing alert/query and operator-prerequisite classes describe
different contracts. This change addresses source-approved pause state
comparison and pins it in the shared verifier's behavioral test suite.



<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24978?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24978?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24978&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant