Repository navigation
fix(backend): hold sync full processing until merges settle - #23919
Merged
Merged
Conversation
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the durable enrichment outbox for a bounded quiet window and debounce smart-merge survivor refreshes. Preserve explicit processing, leases and relevance gates; cap automatic material late-content finalization. Failure-Class: FC-sync-enrichment-before-merge-settles Co-Authored-By: Claude Opus 5.5 <[email protected]>
Defer budget-paused and unsettled effects without losing outbox custody, recheck account deletion at receipt commit, and release queued holds on rollback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep raw captures on their existing backlog-choice path and prevent demand priority from bypassing a deferred lazy-effects settlement deadline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep receipt completion active for existing held rows when the admission kill switch is off, including budget-choice work with a dormant automatic wake. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Git-on-my-level
added a commit
that referenced
this pull request
Oct 29, 2026
## Problem SYN-003 W5 timing triage attributes 1,084.3 s (99.9%) of the 1,085.5 s live-row overlap to legacy intake appends, 0 s to batch projection, and 1.2 s to a donor bridge. All of that snapshot overlap was written in W5. This is timing attribution, not a measured lexical would-drop fraction. The fleet safety-WAL switch bypassed the cohort incoming capture-proof + lexical policy. W5 also could not certify widening gates 4 or 5: 76 nonempty batch assignments into seven existing live rows produced zero fresh-append observations, and ordinary stamp growth was not measured. Explicit targets rejected for device mismatch also created sync rows without discovery, reporting `created_unknown/discovery_skipped`. ## Fix - Consume append, ordinary stamp and refusal markers once at the shared post-commit assignment boundary, before indexing/followup, for legacy intake and batch projection. Receipt replays and failed commits emit nothing new; repeat observations carry zero appended seconds. - The admitted lineage policy composes with the shipped fleet safety-WAL fuzzy dedupe on live targets: capture-proven lexical drops run first, then exact retries, then the unchanged fleet matcher on the survivors. Both passes contribute to final append, live-overlap and repeat-drop seconds. Non-cohort users retain the fleet path. Capture-refactor serving proposals remain subordinate to lineage lexical novelty checks and may not drop a lexical abstention. The incoming proof helper now uses the existing committed-transcript run/lifetime validator for persisted source-frame receipts, instead of the WAV-context validator that always abstained without WAV context. Receipt-only evidence remains unproven; audio trimming still requires WAV context. - Attach numeric speech observations to each content plan after dedupe, using final survivors and the frozen eligible original-live timing union. Fleet safety dedupe and lexical-dedupe-off paths remain measurable. Invalid/over-budget timing is unknown. The bounded `lineage_admitted` boolean lets widening readers exclude non-cohort fleet observations without identifiers. An abandoned live plan cannot leak measurements onto a sync size rollover. - Restart rejected explicit-target assignments for one bounded metadata discovery, rechecking caller/privacy/deletion fences. Hints are observation-only and cannot become targets; gate 3 observes real clear/overlap/unknown lookup results. - Keep the Cloud Tasks concurrency probe inside the worker-owned paid STT leaf. Current main (#23919) defers full note processing for merge settlement, so a gate at that later processor cannot test the upload worker lease. The gauntlet still requires HTTP 409 for the concurrent delivery and exactly one STT invocation. Early responses and gate failures report bounded HTTP/status and stage booleans, with no response text, paths or fixture identities. Finite zero-length donor intervals now contribute 0 s without invalidating the bridge; inverted/nonfinite timing stays unknown. They remain stored and never become deletion proof. The missing measurements came from caller-owned emission and dedupe-owned timing. The shared consumer and real batch-entry regression tests prevent that class across writers and policies. Existing SYNC_LINEAGE switches, allowlist and batch admission retain their semantics. No content or identifiers enter telemetry. ## Validation - **6,693 passed across 195 files** through `backend/test.sh`: sync, lineage, live-dedupe, batch pipeline/projection, capture, safety-WAL and processing-hold suites, including the gauntlet diagnostic/wiring regressions. - **10,306 passed across 396 files**: the exact PR CI shard-4 contract, `backend/scripts/run-unit-ci.sh --changed-files <paths> --shard 6/4`, selecting the full 2,367-file backend suite before sharding. - The original `test_revision_does_not_zero_live_slop` remains unmodified and passes. Its new cohort variant uses no capture proof and checks one append line with 0 appended seconds, 0 live-overlap seconds and 16 repeat-drop seconds. The capture-proven repeat plus novel-speech regression remains intact and passes in capture `off`, `shadow` and `serve` modes. - The full local `npm run test:sync-cloud-tasks-stack:emulator` gauntlet passed with main #23919 integrated and the processing hold enabled. Before moving the probe, the same merged code reproduced CI's failure: the worker correctly returned HTTP 200 / done after STT while full note processing stayed held. The provider-boundary regression failed before the probe fix and passes after it. - `make preflight`: **36 checks passed**. Full backend typecheck: **0 errors**. - Tests and preflight run at `nice -n 15` through workspace `bin/omi-heavy`, retaining file isolation and normal timing/network guards. Ambient Firebase/service-account credentials are removed; unit tests use `/dev/null` ADC, a synthetic project and the CI-default Redis port, while integration uses isolated loopback Firestore/Redis and deterministic provider leaves. No production endpoint or GCP tier was used. ## Rollout and rollback Ships on, no new flag, no cohort widening. Existing gating remains unchanged. Rollback: revert this PR. No production data or GCP access was used, and this PR does not deploy or rewrite historical observations. Markers remain transient, with at-most-once emission attempts and no durable outbox; lost observations still block widening as unknown. ## Product invariants affected none Failure-Class: new New class: `FC-commit-observation-bypassed-by-writer`; its reusable guards exercise the real batch entry point, policy independence, replay/failed-commit silence, invalid timing, and rejected-target discovery with fence rereads. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23925?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/23925?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23925&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)
This was referenced Oct 29, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 29, 2026
The Sync Cloud Tasks concurrency gauntlet must hold paid STT inside the upload worker lease. PR #23919 (merge `0dee519a`) deferred full note processing until merge settlement, so waiting for that processor could never enter the gate. Current main already moved the call to STT; this finishes that fixture contract and makes the hold behavior executable. - Rename the gate, evidence and diagnostics to STT throughout the fixture and its callers. - Pin `SYNC_PROCESSING_HOLD_ENABLED=true` for normal scenarios. The held concurrency scenario verifies one STT call, Redis fencing before pipeline work and during STT, completed upload/ledger readback, pending conversation hold, and a durable deferred enrichment obligation with zero full-processor calls. - Run the same concurrency scenario with the hold disabled and require exactly one eagerly persisted full-processing result. Terminal duplicate delivery must repeat neither STT nor full processing in either mode. Product behavior, worker budgets and CI timeouts are unchanged. Failure-Class: none This is test-fixture phase drift after a deliberate product scheduling change; no existing semantic failure class describes it. Why isn't this a shared primitive instead? Both hold modes use the same STT gate and `_assert_full_processing_policy` verifier in the existing blocking emulator gauntlet, rather than adding a separate guard. The regression instance is merged PR #23919, with the supplied bisect showing its parent passes and merge fails waiting for the processor gate. ## Product invariants affected none (test harness and fixture only) ## Validation - Related units: 154 passed across `test_sync_cloud_tasks_stack_ci_wiring.py`, `test_sync_stack_postgres_hook.py`, `test_sync_processing_hold.py` and `test_sync_reprocess_coalesce.py` (separate pytest processes). - Full gauntlet: passed via `nice -n 10 backend/testing/sync_cloud_tasks_stack/run.sh --state-dir /Volumes/Ephemeral/scratch/gauntlet-holdfix-20261029/full`, under `omi-heavy` (both hold modes, all legacy Sync and batch scenarios, plus 5 passing Firestore shard-spread integration tests). - Preflight: `make preflight` passed all 33 selected checks; `scripts/pr-preflight --pr-body-file` also passed all 33 checks on commit `d3981e1de54`. - GCP tier: none; all services are local emulators/fakes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23935?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/23935?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23935&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. --> ## Main CI follow-up The backend unit failure is independent of the Sync gauntlet: main currently fails `tests/unit/test_app_client_schema_inventory.py::test_inventory_separates_generated_backed_adapters_from_raw_manual_dtos` because account deletion is the remaining manual Dart response adapter after #23873/#23897. The fix is split into [PR #23936](#23936). This PR excludes the app change; its unit checks need a rerun after the main-branch fix lands.
Git-on-my-level
added a commit
that referenced
this pull request
Oct 29, 2026
A silence-split conversation currently buys full notes before Jev decides to absorb it. This moves automatic absorption to the shared relevance-to-notes boundary, so raw donors never buy notes/title/tasks/memories or run their derived effects. Late sync bridges also keep every already-processed identity instead of deleting a summarized donor after its maximum hold expired. Failure-Class: FC-sync-enrichment-before-merge-settles This is occasion architecture step 2 following #23919 and #23920. The fix extends the existing shared processing/hold primitive with a pre-notes absorption boundary and transactional donor fence. Historical generated title-only results without rich-note receipts keep their identity; known-owner deterministic minima receive raw-title provenance independently of the first-summary cohort and remain mergeable before full notes. Product invariants: INV-MEM-4, INV-TASK-2. Existing memory promotion and task-authority rules remain; donor intelligence is suppressed and canonical processing uses the same authorities. ### Design and path audit - **Live smart/Jev merge:** budget and relevance gates run first, then the bounded existing Jev decision, then full notes only if the row survives. The absorb transaction rechecks live job ID/revision, dispatch generation, lease epoch/expiry, deletion and both content revisions. A completed rich row cannot newly become a donor. The donor's committed cleanup resumes under the existing durable job after errors or rollback. - **Canonical refresh:** before-notes absorbs delegate to the existing durable enrichment outbox. Further absorbs share the 600-second quiet window and 3,600-second maximum hold. A processed survivor supplies the baseline; at least 30 seconds of new speech or 80 words permits one automatic late run. A donor that has never completed derived processing bypasses the immaterial cutoff and forces a full survivor refresh, preserving its action items and memories. Ordinary unchanged/immaterial work settles without paid notes or vectors. A budget denial at the maximum hold settles the hold and merge ledger without re-arming; earlier denials keep their outbox wake. Raw survivors still pass relevance on their first full run. - **Offline sync / late bridges:** intake already assigns content before enrichment. Beyond step 1's hold, assignment now prefers a processed canonical and replans excluding any other processed would-be donors, so late content cannot merge away existing notes. Explicit live targets and manual speaker owners retain priority; incoming content remains appendable. - **Untitled self-heal:** recovery currently does not merge. Raw/minimum recovery now uses the same pre-notes decision; rich recovery rows and explicit user-ended rows retain their identities. - **`sync_merged_into` chains:** workers resolve to the canonical row and transfer durable custody before acknowledging the donor. Cycles, deletion, leases, privacy and revision fences remain. No donor full run is used to resolve a chain. - **Desktop/pendant capture groups:** these are shared-speech metadata associations, not destructive transcript merges. Both transcripts can contain unique speech and retain independent relevance/processing. Existing primary identity-evidence refreshes remain fingerprint-deduplicated and capped at three attempts per group. Collapsing these independent transcripts is not introduced here. - **Cross-device duplicates:** overlap hints do not delete, discard or append secondary transcripts; coverage grouping also remains metadata-only. No unproven speech is suppressed. Home row absorption remains step 3b; no UI change. - **Other owners:** batch record lanes retain their merge-before-projection authority; the legacy merger never claims their rows. Manual merges remain explicit user intent over completed sources with the existing durable merge job. - **Explicit ends:** client finalize, first open, user reprocess, funded backlog choice and manual merge stay immediate, and successful explicit processing satisfies an outstanding hold without consuming its late-run allowance. ### CI integration repair Retry routing follows the canonical shared persistence-fence exception so a handled retryable 409 stays retryable after the helper extraction. Current main now supplies the generated account-deletion wire adapter (#23936); this PR carries no duplicate client adapter. UI-Evidence: none -- this PR changes backend processing only; no widgets, navigation, copy, layout or user-visible behavior changed. ### Aggregate production baseline (read only) Tier: **ro-prod**, only in a subshell sourced with `~/.local/bin/gcp-agent-env.sh ro-prod`. No production writes, account/document reads, API calls to api.omi.me or secrets output. Fixed window: **2026-10-28 01:35:36.946711 UTC through 2026-10-29 01:35:36.946711 UTC**. GKE in-cluster Prometheus `sum(increase(...[24h]))` estimates, rounded below; counters count events/attempts, not unique conversations. Re-querying the fixed window can shift counter estimates slightly as scrape samples settle. | Path | Observed 24h aggregate | Already-processed-then-merged evidence | | --- | ---: | --- | | Smart/Jev | 1,269.55 absorbs; 1,278.54 successful survivor refreshes | Existing code places all new decisions after `_get_structured`/completed persistence. Exact rich-note donor count is unavailable from the old metric. | | Desktop/pendant groups | 218.59 applied joins | 0 destructive merges by code; grouping happens after member processing and retains both transcripts. | | Cross-device hints | 663.74 hints | 0 destructive merges by code; hints do not suppress either transcript. Coverage-fold metric has no series (unknown activity). | | Untitled self-heal | 0 merges by code | `SERVER_RECOVERY` was excluded by the old `capture_end` gate. Recovery volume is not measured by a merge counter. | | Sync assignment / bridge | ~945.6K merged intake operations; ~51.4K creates | Includes appends, not a count of processed donors. The old metrics cannot isolate processed-donor absorbs. | | Redirect chains / flatten | 1,350.56 absorbed flatten events | Not a chain-depth histogram or count of processed donors; redirects are followed before callback processing. | Queries: `sum(increase(omi_conversation_smart_merge_decision_total{mode="merge",decision="merge",reason="absorbed"}[24h]))`; refresh and flatten equivalents grouped by outcome/reason; `sum by(event,outcome)(increase(omi_product_event_total{event=~"capture_group_joined|duplicate_capture_detected"}[24h]))`; `sum by(outcome)(increase(omi_sync_intake_total[24h]))`. Sync hold and bridge-retraction series were absent. GKE and Cloud Run scrape coverage differs; do not infer zero or fleet totals from missing series. Two metadata-only Firestore COUNT aggregations (smart donor `merged_at` window, with/without `summary_output_present=true`) returned `FailedPrecondition`; no index was created or document fetched. The new bounded `omi_conversation_merge_processing_stage_total{stage,donor_notes}` measures actual note-bearing donors separately after rollout. This PR does not invent an exact rich-note waste rate or dollar estimate from event counts. Planning estimate for the same 24h baseline: about **1,279 added pre-notes Jev calls/day**, using 1,278.54 successful survivor refreshes as a proxy for eligible candidate volume; there is no direct eligible `SYNC_UPDATE` Jev-call counter. About **1,270 donor notes runs/day** are avoided, using the 1,269.55 absorbs as a proxy. Jev's rate card is $42,000 micro-USD per million input tokens ($0.000042 per 1,000 input tokens; output is unpriced). At an assumed 1,000 input tokens/call, 1,279 calls cost about **$0.054/day**; actual mean input tokens are unavailable in this aggregate, so spend scales linearly with token usage. The refresh and absorb counters describe adjacent outcomes in this flow and are not added together. ### Verification Line-Count-Exception: backend/utils/sync/pipeline.py | 3919 -> 3935 | mirror max-hold terminal settlement in the frozen legacy callback so both callback bodies remain structurally identical. #### Review follow-up (2026-10-29; head `440544dbe2eccb98eaf7a11657447ae038071964`) - A funded refresh denied at the one-hour maximum now settles the processing hold and merge refresh without re-arming a quiet-window wake. The frozen sync callback mirrors this behavior to preserve callback parity. - A donor with no completed derived processing bypasses the immaterial cutoff and uses the existing full survivor refresh, which extracts its derived effects. This is the cheaper correct path versus a separate donor extraction run; the regression test uses a 40-word, 20-second donor. - Focused verification: `BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-23931-review-followup-tests.txt nice -n 10 bash test.sh` from `backend/` passed the callback-parity, occasion-merge, and process-usage files. The tests cover max-hold budget denial and the 40-word donor. - Push preflight passed all 40 checks against `f60de9b011ec70cfcab05fde0a6c2669a652ab02`; backend typecheck had 0 errors; runtime-image contracts passed; all 15 selected backend unit test files passed. GitHub CI returned **GREEN OPEN CLEAN MERGEABLE** on this exact head with **0 pending, 0 failed**. - Prior review head `080863f6e46`: `BACKEND_UNIT_TEST_FILE_LIST=/tmp/occasion-focused-49.txt nice -n 10 bash backend/test.sh` through `omi-heavy` exited **0** across **49 selected backend unit files** (**513 passed, 1 deselected; 13 dependency warnings**), covering smart/Jev merges, sync assignment and redirects, capture groups, holds, leases, deletion fences, explicit ends, retry/rollback and the kill switch. - The standalone flag-budget suite passed **21 tests** with the one-second fast-unit guard active. Replacing the Python YAML loader with the safe C loader preserves safe parsing and removes the timing overrun; the duration exception added by newer `origin/main` was removed as unnecessary. - Occasion-specific suite: **56 cases passed** for historical title-only receipt protection, raw-minimum provenance, real structuring/finalizer boundaries, late-bridge protection, donor ancestry and SDK contention. - CI regression follow-up: **524 passed across 11 files**; the shared generated account-deletion adapter test also passed locally (**6 tests**). No workflow, timeout, skip or test-duration exception was added. - `make preflight`: **40 checks passed** against current main `e0cc9e13096f` on head `080863f6e46`. - Backend typecheck: **0 errors**; async blocker gate: **0 findings**. No live endpoint or production canary was run. - The first exact-head GitHub run exposed the flag-budget test exceeding its one-second fast-unit guard (21 assertions still passed). The safe C loader fixes the runtime without a duration exception. GitHub CI passed all **57 checks** on prior head `80f52633746`. Integrated head `ffb346aefd3` passed all **58 checks** on retry after its first attempt had no assertion failures but exceeded the shard-5 720-second budget by 8 seconds. Prior review head `080863f6e465` passed **58 GitHub checks**: 0 pending and 0 failed. `~/.local/bin/ci-wait 23931 BasedHardware/omi 90` returned **GREEN OPEN CLEAN MERGEABLE**. The review follow-up below records the current head separately. ### Rollout and rollback Default **on for every processing host**. Independent `CONVERSATION_MERGE_BEFORE_PROCESSING` ops kill switch is registered in `config/feature-flags.yaml` and the backend flag budget; owner rollout-meetings; review 2026-11-28. Coordinator deploy train owns production promotion; this draft does not deploy. After deployment, observe the new stage/note-presence counter, smart-merge rejects/failures, finalization failures and summary debt/max-hold outcomes for one full hold window. Verify no automatic `before_notes` donor has notes and no held canonical loses its wake. Jev now sees transcript excerpts without a generated donor summary; merge precision/recall must be checked on the rollout train before claiming product acceptance. Rollback: set `CONVERSATION_MERGE_BEFORE_PROCESSING=false` on every processing host. It restores post-notes live merging, legacy sync donor selection and immediate live survivor refresh; live-only merge holds drain through their stored wakes/repair sweep; mixed sync work retains the independent step-1 window and committed donor cleanup remains retryable. `SYNC_PROCESSING_HOLD_ENABLED` is independent. No historical data rewrite. Unverified: production deployment/behavior, rich-note waste percentage, Cloud Run-only events, Jev accuracy with an empty donor summary, and destructive unification of metadata-only capture-group transcripts. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23931?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/23931?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23931&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)
Git-on-my-level
added a commit
that referenced
this pull request
Oct 29, 2026
…n every backend PR (#23960) ## Summary Two CI/deploy guards David approved 2026-10-29: 1. **Listen deploy pre-mutation guard** (`gcp_backend_listen_helm.yml`): new optional `workflow_dispatch` input `expected_sha`. The existing admission step — which already proves prod checkouts are ancestors of fresh `origin/main` — now also fails closed unless the checked-out commit **contains** the pinned full SHA, before any helm/kubectl mutation. This mirrors the containment rule `gcp_backend.yml` applies to `release_sha` (same malformed/zero-SHA rejection, same version-proof `cat-file` object check) and the ancestry admission `gcp_incluster_guards.yml` applies to `source_sha`. Blank keeps today's unpinned behavior so every existing caller keeps working; unpinned manual dispatches emit a notice. **Callers that should pass it:** `bin/omi-deploy-prod listen SHA` / `build-only SHA` (workspace deploy driver; it already holds the full reviewed SHA) and any manual prod dispatch of this workflow. Rollout `train.sh` does not dispatch this workflow (it only conflict-checks it) and needs no change. Dev chart-only auto-push runs keep the unpinned default. 2. **Contract gauntlets follow the full backend scope** (`backend-hermetic-e2e.yml`): the Listen Pusher and Sync Cloud Tasks Stack Gauntlets no longer gate on per-suite path regexes; both run whenever the hermetic scope admits the PR (any `backend/` change, `package(.lock).json`, or this workflow), under the same `full_ci` tier rule. The merge gate aggregation is unchanged — `applies=false` still expects `skipped`, fork deferral still stays neutral. #23919 rewrote sync processing under `backend/utils/sync/**` and `backend/database/**`, matched neither per-suite regex, and both gauntlets skipped green while main went red unseen. ## CI cost impact Measured 2026-10-29: Listen Pusher Stack Gauntlet median **8.3 min** (n=11 main pushes), Sync Cloud Tasks Stack Gauntlet median **7.1 min** (n=8 PR runs). A backend PR that previously matched neither filter now adds **~15.3 runner-minutes** (~8-9 min wall-clock, the two jobs run in parallel). `ci-budget.yaml`: gauntlet expected runs 19/13 -> 62/day each (matching hermetic-e2e's sampled backend-PR frequency), +718 Linux minutes/day, forecast 14367.4 — Linux cap 13660 -> 14380 with rationale; listen workflow jobs take the one-minute trigger-change bump. ## Product invariants - INV-DATA-1 ## Failure-Class declaration Failure-Class: none Workflow wiring only, no runtime behavior change; no `fix:` commit in this PR. ## Evidence - `actionlint` clean on both workflows; both parse, `check-deployment-concurrency.py`, `check-direct-backend-production-admission.py`, `check_ci_budget.py --base origin/main` all pass. - Backend unit shard (test.sh, BACKEND_UNIT_TEST_FILE_LIST): `test_listen_pusher_stack_ci_wiring.py` (5), `test_sync_cloud_tasks_stack_ci_wiring.py` (5), `test_workflow_contracts.py` (94), `test_check_unit_test_discovery.py` (14) — all pass. - Guard dry-run: the shipped admit script extracted from the workflow and executed in a fixture repo passes blank/equal/ancestor/dev-env cases and fails closed on non-contained, short, non-hex, and all-zero SHAs. - #23919 replay: its 36-file list (34 under `backend/`) yields `applies=true` with both old per-suite regexes unmatched (gauntlets skipped — the hole); under the new logic both gauntlets run. `backend/utils/sync/pipeline.py` and `backend/database/**` matched the old sync regex nowhere; non-backend changes stay out of scope. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23960?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/23960?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23960&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. -->
ocakciomursel-pixel
pushed a commit
to ocakciomursel-pixel/omi
that referenced
this pull request
Oct 29, 2026
…n every backend PR Two .github guards David approved 2026-10-29: 1. gcp_backend_listen_helm.yml: new optional workflow_dispatch input expected_sha. The admission step that already proves prod ancestry now also fails closed unless the checked-out commit contains the pinned full SHA, before any helm/kubectl mutation (the containment rule gcp_backend.yml applies to release_sha; plain cat-file type check per the git 2.54 peeling note). Blank keeps today's unpinned behavior so existing callers keep working; a notice marks unpinned manual dispatches. 2. backend-hermetic-e2e.yml: the Listen Pusher and Sync Cloud Tasks gauntlets now follow the full hermetic scope instead of per-suite path filters. BasedHardware#23919 rewrote sync processing under backend/utils/sync/** and backend/database/**, matched neither per-suite regex, and both gauntlets reported green "skipped" verdicts while main went red unseen. The merge gate aggregation is unchanged: applies=false still expects skipped. ci-budget.yaml refreshed accordingly: gauntlet expected runs 19/13 -> 62/day each (+718 Linux min/day, forecast 14367.4, Linux cap 13660 -> 14380), and the listen workflow's trigger-change bumps record the new dispatch input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
WAL pieces can receive full notes and derived processing before being absorbed, and every content revision or smart merge can refresh the survivor again. This adds a default-on, bounded quiet window to automatic sync full processing. It preserves cheap server-minimum titles and episode intake attachment, explicit processing and the existing leases, relevance/deletion/live-capture fences, redirect custody, finalization jobs and refresh checkpoints.
Step 0: measured baseline, with coverage limits
Read-only baseline observations collected 2026-10-28 at 19:15–19:37 UTC, with the index diagnostic at 19:57 UTC and a merge-counter follow-up at 21:40 UTC (local 2026-10-29); each metric query uses its rolling seven-day window, using ro-prod only. No production writes, signed-in API requests, transcript reads or secret output. David's UID was loaded only from the supplied mode-0600 file; only aggregate metadata was emitted.
sum(increase(omi_notes_agent_runs_total[7d]))sum(increase(omi_notes_agent_estimated_cost_usd_sum[7d]))sum by (lane_id,model) (increase(llm_gateway_requests_total[7d]))omi:auto:conv-structure; includes retries/model turns and lacks source or canonical conversation IDsum by (outcome) (increase(omi_conversation_smart_merge_refresh_total[7d])),outcome=refreshed; completion checkpoint, no sync/live or canonical ID labels; excludes failed/fenced workmode=merge, decision=mergesum by (mode,decision) (increase(omi_conversation_smart_merge_decision_total[7d])); does not record whether the donor had a summarysummary_output_present=truesummary_output_present=trueAn exact full-processing runs per FINAL conversation for sync versus live and fleet merged-with-summary total remain unmeasured, not zero. The notes series has only a
stopapplication label and exports no source or conversation identity; the run counter is scraped from pusher, not Cloud Run sync. Gateway request counts distinguish models but do not identify final canonical conversation lineage. Read-only Firestore collection-group aggregation queries (7-day total, merged-with-summary, and proposed final-source cohorts) returnedFailedPreconditionbecause the required group indexes are unavailable. A diagnostic confirmed:The query requires a COLLECTION_GROUP_ASC index for collection conversations and field created_at. No indexes were created and no fleet document scan was substituted. The account counts are not extrapolated to fleet. The observed proxy is 80 discarded summaries / 373 surviving rows = 0.214; that is not the re-processing multiplier. Step 0 is therefore partial and needs an approved aggregate source with lineage/run identity to finish.Code trace:
utils/sync/assignment.pyadvancessync_content_revisionwhen transcript content lands;intake_completion.complete_sync_intakeenrolls_merged, thenpipeline._reprocess_merged_conversationspreviously ran SYNC_UPDATE immediately unless an existing coalescing policy was enabled. Its durable equivalent isutils/enrichment/callback.py. Smart-mergeabsorb_payloadsadvances both merge and sync content revisions;finish_absorb → refresh_survivor → _refresh_claimedpreviously regenerated full processing per absorb. Revision counts measure writes, not processor invocations.Design
delegated_revisionreceipt. Further absorbs can proceed only after that durable handoff. The worker retains the existing smart-merge lease, processing checkpoint and vector completion. Live-only refreshes keep their existing path.Validation
BACKEND_UNIT_TEST_FILE_LIST=<focused list> nice -n 10 bash backend/test.sh: 337 tests passed across 12 files, including held donor zero-run custody, one settled parent run, material late-content cap, max-hold/watermark safety, kill-switch draining, revision-fenced completion, consumer dispatch, legacy/canonical callback parity, leases and existing relevance protections.nice -n 10 backend/.venv/bin/python backend/scripts/scan_async_blockers.py --dirs backend/routers backend/utils: passed.make preflight: 40 checks passed. PR-body preflight and the mandatory push hooks passed, including Python typechecking, formatting and runtime source closure. GitHub CI is tracked by this draft PR's checks.zoneinfobefore the module-isolation snapshot: 100 repeated isolated loads reproduced a fatal native reference-count error without prewarming; the prewarmed reproducer exits cleanly, and 17 daily-summary tests pass. Production timezone behavior is unchanged.Failure-Class: new
New class:
FC-sync-enrichment-before-merge-settles; reusable guard:backend/tests/unit/test_sync_processing_hold.py.Product invariants: INV-MEM-4 (canonical promotion authority) and INV-TASK-2 (capture suggestion authority). Hold admission runs before their existing writers; completion receipts run after existing effects. Neither memory promotion nor task capture policy changes.
Line-Count-Exception: backend/database/conversations.py | 4589 -> 4635 | The revision-fenced completion receipt belongs beside existing conversation persistence and uses its transactional storage boundary.
Line-Count-Exception: backend/utils/sync/pipeline.py | 3855 -> 3919 | Mirror the active canonical enrichment callback under the existing C2 parity guard until legacy sync retirement; hold policy itself lives in a small shared module.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3387 -> 3403 | Record successful explicit sync processing after its existing effects return so the pending timer cannot duplicate that full run.
FIX-FIRST review resolution
sync_processing_hold.heldis true, including after the quiet deadline if full processing is still budget-paused. It reloads and fingerprints the settled revision before applying effects. Explicit demand cannot bypass this deferred prerequisite or immediately re-enqueue the worker ahead of its new deadline. A new settled effects mark clears that deferral. Both worker paths retain the effects obligation; the near-deadline regression observes no effects/checkpoint before settlement and one application using the new notes afterward.account_deletions/{uid}before writes, uses the shared deletion policy and refuses pending/completed/malformed markers. Cancelled/billing-failed markers retain the established restored-access behavior. Strict Firestore regressions prove a marker created after the worker read prevents both full and skipped completion receipts.These are shared worker/storage primitives, covered by behavioral regression tests; no new static guard or workflow is added. Validation:
BACKEND_UNIT_TEST_FILE_LIST=<focused list> nice -n 10 bash backend/test.shpassed 235 tests across five files, including the rollback-to-lazy settlement regression. The expanded run passed 1095 tests across 16 files (one deselected), including the seven Firestore query/index guard files, demand processing, silent redrive and funded processing. Async blocker scan and PR metadata preflight passed.Rollout / rollback
Ship on by default:
SYNC_PROCESSING_HOLD_ENABLEDis an ops kill switch registered in both the feature registry and flag budget (owner rollout-meetings, budget review 2026-11-28). No default-off cohort. Coordinator's normal backend train owns deployment; this draft PR does not deploy. Observeomi_sync_processing_hold_total{outcome}, queue age, first-summary completion, sync failures and late-cap counts; verify lower paid runs per canonical final conversation when the missing measurement source is available.Rollback: set
SYNC_PROCESSING_HOLD_ENABLED=false. New intake follows the prior coalescing settings, the enrichment sweeper rotates future queued hold wakes to process now on its next bounded discovery pass (active leases remain fenced), and smart-merge survivor refresh returns to its immediate path. Stored content and existing queued custody remain intact. No historical-data rewrite, STT policy/language-gate change, new workflow, CI timeout change, force push or skip flag.🤖 Generated with Claude Code