Repository navigation
feat(monitoring): page on recording transcript/summary outcome and blocked projection heads - #25617
Git-on-my-level wants to merge 6 commits into
Conversation
…ocked projection heads From 2026-11-16 18:50Z summaries for finished batch-live recordings fell from ~60% to ~10% for 21 hours with nothing paged. This adds an outcome SLI with an independent denominator (recordings finished 45-15 min ago, three Firestore count aggregations on the serving maintenance leader), a closed walk-stop counter for refused projection heads, five page-tier rules on gmp-cloud-run, first-screen Core Features tiles, and a runbook with backtests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r reader Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ily declarations Panel review review-20261117t170424-bec9 F1, F3, F4: the tiles and runbook now say the share is presence in the 15-45 minute cohort and that a transcript is the first projected unit; every non-log gmp-cloud-run declaration must be read by a rule; the sampler documents why it keeps the last triple during a count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cloud Run intake and the separately deployed GKE ordered merger must not depend on copying a required marker in lockstep. A stale copier previously committed protocol-2 source results without the marker and blocked the owner's projection chain (#25479 / 2026-11-16). This change makes source-marker recovery from the immutable job a permanent counted contract, adds one registry used by intake/alias/fallback producers, both merge paths and projection, and stamps `required_result_markers` on new jobs. A current merger refuses unknown protocol/marker requirements before writing a result or consuming an owner log sequence, leaving work ready for a capable merger. The refusal counter is exported by each GKE worker child's private metrics registry as well as Cloud Run. `BATCH_RESULT_PROTOCOL_GUARD_ENABLED` defaults on; false restores legacy copying. Explicit conflicting versions remain refused; null copies are treated as missing only under a supported explicit job map. A witnessed legacy projector alias-to-own-audio transition may retain its unknown envelope; only that exact known marker transition is interpreted, without modifying the job or accepting unknown requirements. A full provider/usage replay covers it. The registry covers job-authoritative source metadata, not compute capabilities. No capability heartbeat is added: one upgraded replica cannot prove the absence of old workers. New semantic readers still deploy first. A pre-guard worker may omit copies; the reader recovers registered markers from the job. No production access, deploy, merge, requeue, account change, or flag change. #25617's alerting and projection-drain files are unchanged. Validation: 627 tests across 10 focused unit files pass in separate pytest processes via omi-heavy; new regressions cover real admission plus historical merger-copy behavior and successful alias projection/owner watermark advancement, canonical intake through scheduler/merge, wrong-copy refusal, unknown protocols/markers without log mutation, accepted-alias fallback refusal, kill switch, registry completeness, and actual GPU worker /metrics export. The lifecycle writer inventory also passes all 1899 cases through backend/test.sh after updating the reviewed field sites for centralized stamping. See the run record for final preflight/CI results. These are local synthetic transaction/state-machine checks, not runtime acceptance. Pre-push also exposed an existing stale failure-class migration test: it copied a seed that now has a family while asserting the family was absent. Its temporary fixture now explicitly removes that field; the assertion and CLI behavior stay unchanged. Scope panel: scope-20261117t172601-0ddf, launched before implementation. Review panel review-20261117t181832-92dc completed with all six findings triaged: five accepted and addressed (legacy stamping, positional/global completeness checks, operator response and null copies), one rejected because incapable workers must not reinterpret unknown protocols using old slot assumptions. The final source head is being validated after those fixes. No merge/deploy approval is implied. Failure-Class: FC-mirrored-model-omits-new-member Batch-State-Exit: Unsupported result protocol requirements remain result_ready with merge_pending=true and existing audio/result custody; a capable merger commits the same job without repair/requeue. Refusal attempts are counted; no terminal state, new queue, or timer is introduced. Final CI follow-up: a pre-existing concurrency test passed every assertion but repeatedly billed a cold lazy lifecycle-module import to its 1-second call-phase CPU budget. A module-scoped test fixture now loads that same real lifecycle owner during setup, matching the duration guard's documented exclusion of per-process import work. Actual transaction/reconcile code, assertions, production V3 behavior, rollout flags and CPU limits are unchanged. All 26 tests pass canonically; the previously slow call measured 0.14 CPU seconds locally.
Completed batch-live captures retain a finalization job ID after raw-capture handoff. Projection debt admission therefore refused them as `generation_owned`, even when the bound finalizer job was already completed successfully. A pending timestamp from enrichment acceptance also incorrectly prevented a missing due time from being armed. The placeholder-title admission in #25611 did not remove either guard. The projection transaction now verifies the finalizer's owner/conversation/revision, terminal success, completed fanout and immutable non-BYOK custody, then commits generation-bound summary custody with the transcript and armed debt. Active, mismatched, failed and BYOK generations remain fenced, including a completed requires_byok job after the account switch turns off. Pending-only rows retain valid non-future original clocks; malformed/future clocks fall back to acceptance and expired clocks remain unarmed. A malformed finalizer ID refuses debt without aborting transcript projection. Legitimate unbound orphan records keep the existing debt policy without a custody exception. The existing default-on `SUMMARY_PROJECTION_DEBT_ENABLED` switch disables enrollment and the custody exception. Projection and repair continue sharing the conversation-keyed enrichment outbox and its active leases; no new task producer is added. The new unit suite runs Projector -> ProjectionSession -> assignment -> replacement -> real codec -> stored conversation. The original code committed a transcript with no due time. The regression now covers blank/placeholder titles, pending clocks, generation/BYOK fences, kill-switch rollback, SDK deletion semantics, receipt-only acceptance and repair over an active enrichment lease. Literal metadata writes are registered in the lifecycle AST inventory; refusal logs contain only bounded static reasons, no customer/job identifiers. The CI follow-up removes duplicate module parsing and skips expression-only subtrees in the assignment-constant inventory; five cases preserve constants through control flow and nested scopes. All 26 transaction tests remain in the fast lane. A module fixture prepares the real lazy lifecycle/speaker-evidence dependencies before the concurrent-reconcile call, following the existing summary-delivery fixture convention. Import failures still fail the suite; the unchanged whole-file wall limit includes their cost. The replay and every concurrency assertion stay real. No threshold, allowlist, marker, workflow or product/rollout change. Rollback behavior: setting `SUMMARY_PROJECTION_DEBT_ENABLED=false` pauses both new enrollment and repair admission through existing batch-live finalization proofs. It retains their pending/due markers; ordinary already-enqueued enrichment continues independently. Re-enabling restores proof-based admission while the generation, privacy, BYOK, summary and age guards still pass. A pause extending past the repair age window requires a fresh residue count and separate approval before any enrollment/backfill. The flag does not delete receipt metadata or cancel existing enrichment. Validation: guard-enabled authoritative test.sh through omi-heavy passes 36 arming cases, all 26 transaction cases, 259 lifecycle invariants (86 existing xfails) and 1,901 writer-inventory cases. Complete local shards 1/8 (133 files) and 2/8 (156 files) pass with the normal guard enabled and four workers. GitHub checks are authoritative for current-head CI; the owning report links exact-head panel and triage receipts. Full runtime source closure covers all 19 registered images. The selected failure-class gate also exposed a stale missing-family fixture: its temporary definition now explicitly removes the migrated seed family, retaining the original assertions. Historical investigation used ro-prod metadata aggregates only. Server document update_time proves some due markers already existed before November 16; retained finalizer IDs still prevented repair admission under the old predicate. This is a latent projection-admission gap, not a universal absence of due fields or a reconstructed historical arming rate. Owning evidence and full five-question report: `data/run-2026-11-17-discussion-notes-rootcause/lane-f/REPORT.md` on m5-mbp. Follow-up CI/review receipts are in its `ci-followup/` directory. No titles/transcripts/user IDs were emitted by the historical probes. The required dated pipeline note and canonical summary-custody section document the conditional read, custody boundary and rollback. Already-drained enrollment remains proposal-only. The report specifies the exhaustive read-only count and five-field transactional patch, with fresh privacy, generation, age, summary and manual-edit guards. Neither that residue count nor backfill was run. Production writes require David's separate approval. No merge, deploy, flag change, requeue, index creation, record sealing, in_progress backlog or v3 rollout/behavior change. No overlap with #25617 alerting files. Failure-Class: FC-content-write-omits-implied-obligation Line-Count-Exception: backend/database/conversation_finalization_jobs.py | 3639 -> 3640 | Extract the existing collection constant into an import-safe schema module; no finalizer behavior changes.
Use the native safe YAML loader when checking the full feature registry. Keep the flag lifecycle, fail-open policy, and default-on assertions. Failure-Class: none
|
When this PR returns to the merge queue, please update its branch against current |
|
Closing under the approved stale PR disposition. This conflicting alerting branch has no confirmed current paging gap or alert owner. Reopen if the monitoring owner confirms a gap and accepts ownership of the alerts. |
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
What this does
Adds a page on Omi's core promise: a recording gets a transcript and a summary within minutes. It also adds cause-level pages that would have caught the 2026-11-16 projection stall within about 15 minutes.
From 2026-11-16 18:50Z, summaries for finished batch-live recordings fell from about 60% to about 10% for 21 hours, and nothing paged. (#25479 / #25597; the record is in the meta repo under
data/run-2026-11-17-discussion-notes-rootcause/.)This PR is measurement and alerting only. It changes no admission, merge, projection, notes or release behaviour.
Why the existing alerts stayed silent (evidence, read 2026-11-17 16:00–16:40Z)
Checked against live Grafana provisioning (read token), GMP and in-cluster Prometheus (
ro-prod), and Cloud Logging:omi-batch-delivered-share-languageand the "Delivered within 5 min" tileprometheus(in-cluster). Theomi_batch_pipeline_delivered_share_*family exists only in GMP (25 series from backend-integration), so the rule would read NoData, which is configured as OK. The live tile shows "no traffic". The rule was also agent tier, muted byomi-tier-silent. The share is also unsuitable as an outcome signal: its denominator is jobs admitted 20 to 5 minutes ago (sealed units only), it has no lane, and it read 10–40% both before and during the incident with no cliff at 18:50Z.omi_batch_projection_obligation_oldest_age_secondsquarantine_heldreceipts pin it.omi-pipeline-projection-drain-stall,-firestore-contention,-upload-503-stormlogging.googleapis.com/user/omi_pipeline_*log-based metrics were never created in production (gcloud logging metrics list: none of the four exist). The rules read NoData, treated as OK, and the stall rule was paused as well.omi-batch-unit-unpublished-2homi-census-age-p-pending,omi-census-age-pl-*(page)omi_batch_pipeline_census_snapshot_timestamp_secondsreads 0.omi-pipeline-ledger-*omi_pipeline_ledger_refreshed_at_secondsis 0 (the census never ran), andomi_pipeline_ledger_rows{stage}is an in-process up/down gauge that reads negative.omi_closed_to_summary_seconds/omi_accept_to_summary_secondsclosed_to_summaryis dropped by the sync GMP keep list.Root causes, in order:
This PR fixes 2–5 for this promise. Item 1 is a provisioning step for the operator; see Activation.
What's added
omi_batch_pipeline_recording_outcome_{finished,transcribed,summarized}_window_total(plus_sample_age_secondsand_sample_timestamp_seconds).batch_live_v1conversations finished 45 to 15 minutes ago: how many in total, how many withrecord_projection_revision > 0(transcript landed), and how many withsummary_output_present == true.utils/batch_pipeline/recording_outcome.py,database/batch_pipeline_recording_outcome.py).record_seal_repair_oldest_completed. Two new collection-group composites are declared:recording_outcome_summarizedandrecording_outcome_transcribed(the latter has two range fields, ordered lexicographically).BATCH_PIPELINE_RECORDING_OUTCOME_ENABLEDis default on and registered.finished_atis the device clock and uploads arrive hours late, so a "finished 15–45 min ago" cohort has no honest meaning there.omi_batch_projection_walk_stops_total{stop,progress}, one increment per owner-drain turn.projection_walk_stop.STOP_CLASSES. The openblocked_<slug>family folds toblockedorblocked_privacy; the existing turn log line keeps the full token.deploy/cloud_run_gmp_sync.yaml); the gauges already matchbatch_pipeline_.*.gmp-cloud-run. See the table below.gmp-cloud-run.backend/docs/runbooks/recording-outcome.md(what to check first: deployed build per service including the GKE worker image, stop tokens,BATCH_SOURCE_REUSE_ENABLED); batch CONTRACT entry; pipeline change note; monitoring README.Alerts
project_id=based-hardware, cluster=__run__, job=omi-cloud-run-application-metrics, namespace=backend-integration)omi-recording-outcome-fastmax(transcribed / (finished >= 50)) < bool 0.6labelledoutcome=transcript, ormax(summarized / (finished >= 50)) < bool 0.1labelledoutcome=summary, or0 * max(finished)omi-recording-outcome-slowsum(sum_over_time(num[6h])) / sum(sum_over_time(finished[6h])); transcript < 0.70 or summary < 0.25; average cohort >= 50omi-batch-fresh-unprojected-share(max(fresh_unprojected_ratio) > bool 0.1) * (max(fresh_committed_window_total) >= bool 500)omi-batch-projection-heads-blockedsum(increase(omi_batch_projection_walk_stops_total{stop="blocked",progress="none"}[10m])) >= 50omi-batch-result-marker-skewsum(increase(omi_fallback_total{component="sync_dispatch",from_mode="row_source_marker",to_mode="job_source_marker"}[30m])) > 0Threshold sources.
Backtest (read-only production data)
omi-recording-outcome-fastomi-recording-outcome-slowomi-batch-fresh-unprojected-shareomi-batch-projection-heads-blockedowner_drain outcome=turn ... advanced=0 ... stop=blocked_*(non-privacy) lines: 11, 31, 24, 68 and 189 per minute from 18:57Zomi-batch-result-marker-skewblocked_immutable_result_binding_mismatch), first seen at 18:57ZThe fresh and skew rules are verifiable live today:
Notes on the replay:
summary_first_pending_at(transcript) andsummary_completed_at(summary).summary_completed_atwould overstate lateness for old rows. I could not rule that out from the fields alone.The "by about 19:30Z" target is met by the cause pages (blocked heads at about 19:04Z, fresh unprojected at 19:33Z). The transcript leg alone needs until 20:07Z because owners blocked one by one: the cohort share went 0.83 → 0.73 at 19:30 → 0.61 at 19:55. A 0.65 threshold would fire at about 19:50Z, but it sits within 2 points of the healthy floor.
Activation (what needs a deploy)
recording_outcome_summarizedandrecording_outcome_transcribed(gcp_firestore_indexes.yml)count(omi_batch_pipeline_recording_outcome_finished_window_total{namespace="backend-integration"}) == 1and sample age < 120 sgrafana_dashboard_provisioning.yml,environment=prod)omi-batch-fresh-unprojected-shareandomi-batch-result-marker-skewread families that are already in production. They work as soon as they are provisioned.omi-recording-outcome-fastis provisioned before step 3, it pages as blind. That is intended.Not established
owner_drainINFO lines are sampled by theapp-stdout-info-sample90exclusion. Its keep-list mentionsbatch_projection, and the threshold holds either way.Tests
tests/unit/test_recording_outcome_monitoring.py(28 tests): exact production count shapes against a fake count client, bounds, index declarations, collector expiry and failure withdrawal, kill switch, stop-class closure and zero-init, GMP keep list, split/combined equality and lint, page routing, NoData semantics, PromQL thresholds, dashboard placement and datasource.blocked_immutable_result_binding_mismatchturn incrementsstop="blocked",progress="none".PREFIX+METRICS), the drain test's log-metric subset, fresh-guard metric doubles, and the flag budget.bin/omi-heavy, cloud credentials unset):python3 backend/scripts/provision_monitoring_alerts.py --lint: 274 definitions validated.python3 backend/scripts/alert_backtest.py --lint: no failures.🤖 Generated with Claude Code