Repository navigation
SCA-3499: Retire the shared-live GPU pull - #26336
Git-on-my-level wants to merge 1 commit into
Conversation
David's 2026-11-21 ruling (survey item 19) retires the shared-live GPU pull: it was off in the overlay and live everywhere, and the M3 readout that would have justified a canary never arrived by 11-20. Removing it changes no production behaviour. Removed: - BATCH_PIPELINE_SHARED_LIVE_ENABLED from the flag registry (moved to the retired ledger), runtime_env base/overlay, both backend-listen charts, the worker chart, the deployment-setting classification and the cross-service coupled-flag list. - SchedulerPolicy.shared_live, config.batch_pipeline.shared_live_enabled, the policy snapshot getter and env key. - Scheduler(pool=...) and the live pool: the GPU reservation table writes, the gpu-idle acknowledgement, the shared-GPU exclusivity checks, the shared-live park reasons and the live-pool pull gate. - PoolCapacity.shared_with_live/live_queue_age_seconds/gpu_utilization/ memory_headroom_bytes/gpu_id and the shared-live branch of limits(). - The /v2/batch-pipeline/gpu-idle route, its request model and its route-policy manifest row; PullRequest.pool. - ProviderConfig's shared_live pool kind and its 120 s unit/padded caps; the worker now rejects any pool kind other than dedicated_batch. - Serving.queue(pool)/pull(pool), the shadow runner's shared-live gate, the dual-store GPU-reservation reconcile and the pipeline-sim trace field. - Tests that exercised the removed path, and the docs that described it. The gpus table stays registered in the jobstore schema: it is inert with no writers, and dropping it is a separate migration. Co-authored-by: Omi Control OpenCode (DeepSeek V4.1 Flash) <[email protected]> Co-authored-by: multica-agent <[email protected]>
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d4416c5a6
ℹ️ 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".
| class PullRequest(WorkerRequest): | ||
| limit: int = Field(default=8, ge=1, le=32, strict=True) | ||
| pool: Literal['batch', 'live'] = 'batch' | ||
| capacity: PoolCapacity |
There was a problem hiding this comment.
Add the required pipeline retirement change note
This retirement changes the transcription worker's pool contract and removes worker RPC fields, but the commit contains no note under backend/docs/listen_pusher_pipeline/changes/ (checked the changed-file list and searched that directory for the retirement). backend/AGENTS.md requires audio/transcription changes to “add a note” there in the same PR. Add a dated note recording the removed interfaces, retired flag state, and verification evidence so the pipeline's operational change history includes this retirement; the edits to individual worker documents do not fulfill that requirement.
AGENTS.md reference: backend/AGENTS.md:L164-L164
Useful? React with 👍 / 👎.
| class PullRequest(WorkerRequest): | ||
| limit: int = Field(default=8, ge=1, le=32, strict=True) | ||
| pool: Literal['batch', 'live'] = 'batch' | ||
| capacity: PoolCapacity |
There was a problem hiding this comment.
Record retirement in the required pipeline change note
This retirement changes the transcription worker's admission and RPC contracts, but the commit adds no note under backend/docs/listen_pusher_pipeline/changes/ (verified against the changed-file list and a repository search for this retirement). backend/AGENTS.md requires audio and transcription changes to add a note there in the same PR. The updates to individual batch-worker documents do not replace that required pipeline record; add a dated note covering the removed flag, pool and RPC behavior, rollout state, and verification evidence.
AGENTS.md reference: backend/AGENTS.md:L164-L164
Useful? React with 👍 / 👎.
|
Superseded by #26425 — the same removal re-cut on current |
|
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! |
…SCA-4434) (#26344) ## DESIGN: SCA-4434 Lane A. Goal: 95% of deliberate v3 Finishes show a first Home card within 60 s. David approved the extra STT spend at about 23:45Z on 2026-11-25. This revision answers the Owners DESIGN review at 83ea3fe the independent reviews at 9397a50, cc33310, 4b89d6f (SHIP) and 34222fe (SHIP, with one P2 and four P3s fixed here), 3a75ec5 (SHIP; the Owners-required P3-a privacy fix and P3-b to P3-e are in this head), and the Owners and Release design changes on SCA-4434 (02:23Z and 02:25Z on 2026-11-26). **What it reads and writes.** - The fast first transcript (`backend/utils/conversations/v3/fast_finish.py`) reads the same retained audio packs from GCS it reads today. - It writes the same provisional transcript through `update_conversation_segments`, fenced inside its transaction, and then the same manual-end cut. - Nothing new is stored in Firestore. Admission no longer reads the conversation row before the pass; the pass reads it once (one fewer Firestore read per Finish). - **New in Redis:** one counter per UTC day, `v3_fast_finish:long_audio_seconds:<day>` (26 h TTL), for the fleet-wide long-recording budget. Only long passes touch it: one `GET` before a slot is taken, one `INCRBYFLOAT`+`EXPIRE` pipeline to reserve, and one `INCRBYFLOAT` to settle, all on a client with 1 s connect and read timeouts. Cloud Run backend services already get `REDIS_DB_HOST` from `gcp_backend.yml`, and v3 code already uses `database.redis_db`. **One end-to-end deadline: 45 s from record admission** (`PASS_DEADLINE_SECONDS`). That leaves about 15 s of the 60 s first-card budget for the write, the builder and Home. - **Where the clock starts.** Both the 60 s budget and `WALL_SECONDS` start at record admission, when `_manual_finish_admitted` runs (`backend/utils/batch_pipeline/live.py:449`), not at the Finish tap. The time from the tap to admission (upload, seal, admission) is outside both. The production readback below (Finish to first visible card) is measured from the tap and includes it. - **What counts.** Slot wait, every Firestore call (refresh, funding, privacy, the post-chunk refresh, write and cut), every retained-audio reference read, both language probes, chunk queue wait, provider requests and one retry. - **How each part is bounded.** - **Every Firestore call of a chunked pass is bounded** (Owners' blocker; short passes too). The pass runs each call on a small dedicated pool (`fast_finish_io`, 8 workers) and waits only until its bound: the deadline for the row refresh, funding and privacy (the language probe's privacy check included), and `WRITE_GRACE_SECONDS` (1.5 s) past it for the post-chunk refresh, the transcript write and the cut. Past its bound the call is abandoned (cancelled if it has not started; a running one ends on the client's own timeouts), the pass yields `deadline` and the slot is released within the deadline plus 2 s. Reads accept `timeout=`, but `firestore.transactional` commits do not (the installed client's `Transaction._commit` takes no timeout), so abandonment is used uniformly. - **The write is fenced, and the cut never follows an abandoned write.** The default writer's in-transaction guard refuses a transaction body that starts, or reruns after contention, past the bound. It checks the time again after the fence's own reads (34222fe P3), so nothing is written. The pass calls the cut only after the write returned `True` inside its bound. A commit already sent when the pass stops can still land, but only without a cut from this pass. Because the transaction read the conversation document, a cut or lock committed after that read either waits behind the commit or aborts it; on the rerun the guard refuses. Serial kill-switch passes keep today's unbounded calls and the bare fence. - The pass checks the deadline before every reference it reads, including several references inside one chunk. - Each reference's storage metadata and download timeouts are capped to what is left (`read_reference(read_budget=ArtifactReadBudget(deadline, ...))`). The serial kill-switch path keeps today's 30 s and 60 s. - Under `verification_stt_deadline`, a provider request's connect, pool, write and read timeouts share what is left (`budget_timeout`) instead of each taking all of it. - **Language probes are bounded as a whole** (34222fe P2). The vendor probe and the self-hosted gate keep each part of their own timeouts (connect 2 s; read, write and pool 8 s and 6 s), each capped to what is left (`probe_timeout`); with 40 s left the gate keeps 2 s connect and 6 s read. Because those parts add up, and an httpx read timeout is per read, the whole language resolution also runs on `fast_finish_io` and is abandoned at the deadline, so the pass stops as `deadline` and the slot is released within the deadline plus 2 s. A probe with under `PROBE_MIN_SECONDS` (3 s) left is skipped and the row's language is kept; the pass goes on. The time is checked before the privacy read, so an abandoned resolution makes no reads (P3-b), and again after it. An abandoned probe that already passed privacy may still finish in the background; its result is dropped and its audio was charged when it was allowed. - **Chunk send minimum** (P3-e): a chunk's first request is sent only with at least `CHUNK_SEND_MIN_SECONDS` (5 s) left. With less it would almost certainly time out, so it is not paid for and the pass yields `deadline`. The retry keeps its 10 s minimum. - That context also turns off the provider's own retry and Soniox credit failover for these requests. Batch keeps both. - **At the deadline** the pass cancels its queued chunks, waits at most `STOP_GRACE_SECONDS` (2 s) more for running ones, writes nothing, releases its slot and yields to batch with the bounded outcome `deadline`. A request still running then ends on its own timeouts, and its result is dropped. - **An early stop** (`provider_error`, `privacy_blocked`, `audio_error`) sets a stop flag. No running chunk sends another request or retry, and a chunk checks the flag again after its privacy answer, just before it is charged and sent. Queued chunks are cancelled, and the slot is released as soon as the requests already in flight end. **Short and long, against the deadline.** A pass is long only when its audio exceeds 20 minutes (`MAX_SECONDS`), never because of its chunk count. - A short pass keeps 4 chunks in flight, whatever its chunk count. Up to about 19.8 minutes is one round. A 19.9-minute unit (5 chunks) or a six-minute Finish split into six units takes two rounds, still on the short slots. - A long pass keeps 3 in flight and is capped at 9 chunks: three rounds, up to about 44.6 minutes. - A 2-hour recording is 25 chunks, about nine rounds of 3, so it returns `too_long` before any read or spend. **Fairness.** - Length, canary and daily-cap refusals are decided from the units alone, before any slot is taken (`fast_finish.screen`). A Finish they refuse is counted as `too_long`, `long_canary` or `long_cap`, never `busy`, and never holds or waits for a slot. - Short and serial passes share two pass slots. A long pass takes its own single slot. - A short Finish waits up to 10 s, inside its deadline, for a slot instead of answering `busy`. - On the 6-worker `fast_finish_chunk` pool, a long pass's 3 in flight always leave 3 workers for short Finishes. - Memory per process: at most 11 chunk buffers (about 106 MB), plus one per pool worker for a request a stopped pass left running, plus one decoded pack per pass. This is independent of recording length. A cancelled chunk job waiting in the pool's queue now drops its buffer at once (34222fe P3), so queued cancelled jobs hold no audio. The per-chunk privacy check runs on the chunk pool itself, not on `fast_finish_io`. During a Firestore brownout a started chunk can sit in that check holding its buffer until the coordinator's own bound (deadline plus 2 s) releases the slot; the check then ends on the client's timeouts. In that window the bound is soft by at most the six pool workers' buffers. **Privacy at every send.** - Privacy is asked before any audio is read, as before. - It is asked again inside every chunk job just before its provider request and before its retry, so a chunk that waited in the shared pool's queue is asked when it actually starts. - It is asked right before the language probe posts audio to the vendor (Modulate language ID) or the self-hosted classifier (`before_probe` / `before_self_probe`). - A refusal stops the pass. Cancellation stops queued work. A request already dispatched may finish, but its result is never written. The in-transaction fence on the write is unchanged. - **One denial ends the pass** (Owners, SCA-4434 03:36Z; review P3-a; race closed after the afb7e49 review P3-1). The pass's privacy authority is sticky, with the denial held in a `threading.Event` because chunk jobs on several pool threads set and read it. What the code guarantees: when any check refuses or errors, the denial is recorded before that check returns. From then on every later check answers False without asking, including the self-hosted (shadow) gate's, the vendor probe's, every chunk dispatch and every retry. A check whose read was already in flight answers False when it returns, whatever it read. Each chunk reads the denial again immediately before it is charged and sent, alongside `stop`. So no probe of either kind, chunk request or retry starts after a denial is recorded, and the pass ends `privacy_blocked`. The only send it cannot recall is a request that had already started before the denial was recorded; its result is never written. **Firestore per Finish.** - Privacy is one check before the audio plus one per chunk dispatch, per retry and per language probe, instead of one per unit. - That is the same as today for a Finish of 5 minutes or less (2 checks), and 1 to 4 more for longer short Finishes. - A canary long Finish costs 6 to 11 checks plus its two refresh reads (one before the chunks, one before the write), the funding gate and one write. Admission's own extra read of the row is gone, so every Finish reads it once fewer than before. - Each check is one batch-privacy transaction on the owner's privacy document. At about 190 Finishes a day that is an estimated few hundred to about 1,000 extra reads a day, and about 16 extra writes a day (transcript plus cut wake for canary long Finishes). This is far below the 10M/day review line. **Provider audio-seconds per Finish.** - Each Finish costs its own audio, plus 3 s per fixed cut (silence cuts add nothing), plus a resend of any chunk that fails once, plus at most 30 s for a language probe when the language is undeclared. - Up to 20 minutes this is under 1% above today. - The added spend is long Finishes, about 32 a day in the 12 h baseline: - **At the 25% canary:** about 8 a day, about **4 audio-hours a day** at a 30-minute mean. - **At 100%:** about 11 to 16 audio-hours a day, the approved "about 11+". - **Fleet bound:** `CONVERSATIONS_V3_FAST_FINISH_LONG_DAILY_SECONDS=7200` (kept; Owners confirmed 7,200 s) per UTC day **across the fleet**, in the shared Redis counter above, so it survives scaling and restarts. - **Reserve:** a long pass reserves the most it can send: every chunk twice (its one retry) plus one 30 s probe clip, about 3,666 s for a 30-minute Finish. It uses `INCRBYFLOAT`, and the reservation is taken back at once if that went over the cap. Retries therefore can never push the day past the cap (34222fe P3). While passes run, the counter reads high. Against the 7200 s default only one 30-minute pass's reservation fits at a time across the fleet (two would need 7,332 s), and after it settles to about 1,818 s the next one fits. At the 25% canary (about 8 long Finishes a day) a concurrent second long Finish is rare and falls back to batch as `long_cap`; raise the cap if the readback shows that happening. - **Settle:** the reservation is settled down to the audio actually sent (overlaps, retries and the vendor probe included; chunks never sent are refunded). The settle runs in the background on `fast_finish_io`, after the slot is released, and is best effort. - **Under the deadline** (34222fe P3): the reserve is one pipeline round trip on a client with 1 s connect and 1 s read timeouts. A pass reserves only with at least `RESERVE_MIN_SECONDS` (3 s) left, so the reserve ends before the deadline. With less left it refuses as `deadline` and reserves nothing. - **Fails closed:** when Redis errors or takes over 1 s, the long pass is refused as `long_cap`. Two passes racing for the last room may both be refused, but neither can push the day over. - The in-process counter is removed. The percentage is the operative limit; the cap is the hard backstop, and the 24 h report reads both the counter and `audio_seconds_total`. **Provider capacity.** - Per backend-integration process, concurrent prerecorded requests from fast finish rise from at most 2 (one serial request per pass slot) to at most 6, the chunk pool. In prod that pool resolves to `STT_PRERECORDED_MODEL=parakeet,modulate-velma-2`. - Fleet worst case is 6 times the process count. I have no measured hosted Parakeet capacity figure to state, so the stop thresholds below watch its 429/5xx rate and latency. - With one retry per chunk, a pass fails only when a chunk fails twice. At a 2% request failure rate, a 9-chunk pass loses about 0.4% instead of about 17% with no retry. **Canary and stop rules.** - **Exposure.** Long Finishes (over 20 minutes) go through the chunked path for `CONVERSATIONS_V3_FAST_FINISH_LONG_PERCENT=25` of owners (salted uid bucket; outside it, `long_canary`), within the daily cap above (past it, `long_cap`). Finishes up to 20 minutes are not gated: their audio is unchanged. - **Stop expansion or roll back** (`LONG_PERCENT=0`) if any of these holds in the first 24 h: - long-path audio (`audio_seconds_total{path="long"}`, which includes the vendor probe clip, the same audio the cap charges) is over 6 h a day; - `deadline` plus `provider_error` is over 30% of long passes; - chunk queue p95 is over 5 s; - `busy` is over 5% of passes; - prerecorded provider 429/5xx on backend-integration is over twice its baseline. - **Kill the whole chunked path** (`CHUNKED=off`) if short-pass `written` share falls below its baseline, or short-pass `provider_error` or `deadline` is over 5%. - **24 h report** after serving: - `sum by (path) (increase(omi_conversations_v3_fast_finish_audio_seconds_total[24h]))`, converted to audio-hours and multiplied by the provider contract rate for the cost, checked against `GET v3_fast_finish:long_audio_seconds:<day>`; - outcomes by label; - wall p95; - chunk queue p95; - provider error rates. - **Expand to 100%** only after a clean report. **Production number that proves it** (same 12 h prod window and query as the baseline, after serving): - Fast-card share of Finishes **at least 95%** (baseline 55/96). - Finish to first visible card, **wall-clock p95 60 s or less**. - Supporting readback: `omi_conversations_v3_fast_finish_wall_seconds` p95 (from record admission, not the tap; every written pass) under 45 s, plus `{outcome}`, `chunks`, `chunk_seconds`, `chunk_queue_seconds` and `audio_seconds_total{path}` (vendor probe included). **Rollback.** - `CONVERSATIONS_V3_FAST_FINISH_LONG_PERCENT=0` stops long passes only. - `CONVERSATIONS_V3_FAST_FINISH_CHUNKED=off` on `backend-integration` restores one serial request per unit, the 20-minute cap and today's slot behaviour. - Both are config changes. Provisional segments already written are replaced by the batch record projection as usual. To roll back the code, revert this PR. Failure-Class: none ## What changed and why - **Split.** `chunk_plan` produces chunks of 5 minutes or less. A cut goes in a retained-audio silence of at least 1 s near the even length. Otherwise it falls at the even length with a 3 s overlap. The remaining audio is shared evenly. - **Stitching** (re-review P3.1). At a fixed cut, the earlier chunk owns lines that start before the overlap's middle. **Every** later line that starts before the earlier chunk's last line ended is compared against it (`join`). - Words, which carry their own timing, go by time. - Utterances (Parakeet and Modulate return utterances lasting seconds, with no word timings) go by text (`seam`). Where the head of the later text repeats the end of the earlier text, the repeat is dropped. A clipped word is allowed on either side (the earlier chunk's last, the later chunk's first), and the clipped fragments are dropped too. Otherwise each such line loses the share of its tokens that falls before the earlier chunk's last end. - Parakeet's `[0, 0]` fallback spans its whole chunk instead of being dropped. - **Long versus short by duration, not chunk count** (re-review P2): `pass_class` and the `audio_seconds_total` path label both use more than 20 minutes of audio. - **Screening before any slot** (re-review P3.5): `fast_finish.screen` runs in `live.py` before slot acquisition and again inside the pass. - **Language route once per pass.** `pre_recorded.prerecorded_bytes_route` (kept in `pre_recorded.py`, where its local `batch_language` import already was) now takes `before_probe` / `before_self_probe`. `prerecorded_from_bytes` keeps its behaviour and takes an optional `route`. - **Deadline module** (cc33310 review P3.4): `verification_stt_deadline`, its ContextVar, `budget_timeout` and `probe_timeout` live in the new leaf module `utils/stt/prerecorded_deadline.py`. It imports no other `utils.stt` module, so `pre_recorded`, `batch_language` and `language_gate` import it at top level with no cycle, and `pre_recorded.verification_stt_deadline` is re-exported unchanged. `fast_finish` imports `pre_recorded`, `prerecorded_deadline` and `batch_language.MAX_PROBE_SECONDS` at top level and adds no function-local imports (only `live.py` imports `fast_finish`, lazily, as before). - **Hard wall** (9397a50 P3.4, cc33310 P2): - `budget_timeout` makes the request phases share one budget. This tightens the speaker-tag verifier's `verification_stt_deadline` the same way, since it was the same per-phase issue. - `probe_timeout` caps each part of the vendor probe's and the self-hosted gate's own timeouts to what is left. Under no caller deadline both keep their defaults. - Reads are bounded per reference, and every Firestore call is bounded by abandonment (see DESIGN), with the write fenced in its transaction. - The stopped-pass wait is bounded to the deadline plus 2 s. An early stop blocks further dispatches and retries and returns when the in-flight requests end (cc33310 P3.3). - **No leaked reservation** (cc33310 P3.2): `row['started_at']` is read before `LONG_BUDGET.reserve`, so a row without it returns `error` with nothing reserved. - **Small fixes from the 3a75ec5 review:** the `get_fast_finish_io_executor` docstring now says the pool also runs the language resolution and the background budget settles (P3-c). A chunk job takes its buffer with `holder.pop()` inside `try/except IndexError`, so a holder the stopped pass emptied at that moment reads as abandoned (P3-d). - **Daily cap by audio sent, fleet-wide** (9397a50 P3.3; Owners and Release). It is a shared Redis counter per UTC day that fails closed; the in-process counter is gone. The flag registry, overlay comment, runbook and change note say it is a fleet bound. `AUDIO_SECONDS{path}` includes the vendor probe clip, so the readback and the cap count the same audio. - **Unchanged from the previous revision:** the deadline, slots, window, privacy at dispatch, one retry and the canary. New bounded outcomes are `deadline`, `long_canary` and `long_cap`. Metrics are unlabelled histograms for chunks per pass, chunk seconds, chunk queue seconds and wall seconds, plus an audio-seconds counter labelled `path=short|long`, all in the `cloud_run_gmp_sync.yaml` keep rule. - **Flags.** - `CONVERSATIONS_V3_FAST_FINISH_CHUNKED`: `ops_kill`, declared on prod `backend` and `backend-integration`. - `CONVERSATIONS_V3_FAST_FINISH_LONG_PERCENT`: rollout, with a dated ramp to 2026-12-10, declared `25` on prod `backend-integration`. - `CONVERSATIONS_V3_FAST_FINISH_LONG_DAILY_SECONDS`: config, declared `7200`. - All are registered in `config/feature-flags.yaml` and `deployment-setting-classification.json`. `runtime_env.yaml` and the registry are regenerated. - **Multi-unit Finishes (8 units or fewer)** are written in one pass, and the cut is stored only after the whole transcript is written, so no partial window can lock. - **Pipeline-lab stand-in.** With CHUNKED on by default, main's admission stand-in handed the pass a unit with no retained references. The chunked plan was empty, so the pass ended `empty` before any STT call, and `audio_single_recording_finish`, `finish_double_tap` and `finish_single_recording_fast` failed (measured at c7c0042). Now the stand-in gives the unit one lab reference over the recording, which `live.read_reference` reads as silence. `ops.install` scripts the chunked path: `_transcribe_words` answers each chunk with the scripted lines in its window and counts `transcribe_calls`, and `prerecorded_bytes_route` is replaced, so no language probe runs. CHUNKED stays on in the lab, and the serial kill-switch stub is unchanged. Fast-finish segments carry uuid4 ids that summarisation prompts cite. The lab's fake LLM gateway seeds its answers from the prompt, so it now renames random UUIDs in first-seen order before seeding (the rule `determinism.py` already applies to run artifacts). Its answers then repeat, and the repeat comparison is unchanged. Harness only; no production code changed. Known limit: diarization labels are per chunk, so the same provisional `SPEAKER_00` in two chunks may be two different people. Provisional rows claim no speaker number, and the canonical transcript replaces them. ## Overlap with open PRs (for Release ordering) None of #26332, #26335 or #26336 had landed. Separately, main had moved 17 commits and conflicted with this branch in `backend/deploy/cloud_run_gmp_sync.yaml` (main edited the same keep regex), so origin/main at 220610c was merged in, and again at 3e42abf (the same keep-regex conflict, resolved the same way). It was refreshed onto repaired main at afab956 (after #26382) with no conflicts. The conflict was resolved by taking main's rule and keeping this PR's fast-finish chunk-metrics alternative; `runtime_env.yaml` and the registry re-render unchanged. `git merge-tree` of this head with each PR head: - **#26332** (SCA-4489, Finish-to-Home SLI). It overlaps on four files: - **Textual conflicts in `config/feature-flags.yaml` and `backend/docs/feature-flag-registry.md` only.** It inserts `CONVERSATIONS_V3_FINISH_HOME_SLI` right above `CONVERSATIONS_V3_FAST_FINISH`, beside this PR's three new rows. Resolve by keeping both rows, then re-render the registry. - **`backend/utils/batch_pipeline/live.py` merges cleanly.** Its hunk is `@@ -433,13` in `_manual_finish_admitted`: it imports `finish_home_sli` and calls `observe_route(uid, conversation_id, 'batch')` before `single = ...`. This PR changes the same function: the deadline at entry, the bounded `read`, `screen` before slot acquisition, and `row=None` passed to `run`. - **`backend/utils/conversations/v3/fast_finish.py` merges cleanly.** Its hunk is `@@ -353,6` in `_run`: `observe_route(..., 'fast')` after `if written is False: return 'superseded'` and before the cut. This PR rewrites `_run` (bounded calls, fenced write, `_bounded(cut, after)`); the merged call lands in the same place, after the write and before the cut. - **Order:** either PR can go first. If `observe_route` does any I/O, it sits outside this PR's Firestore bounds and should be cheap or bounded. - **#26335** (SCA-3684): `prod.overlay.yaml`, `runtime_env.yaml`, `deployment-setting-classification.json` and the registry merge cleanly. Its overlay hunk `@@ -1919,6` is the closest to this PR's `backend-integration` env block. Re-run `compose_runtime_env.py` and `render_feature_flag_registry.py` after whichever lands second. - **#26336** (SCA-3499): its conflicts are in the registry, the flag file and `backend/charts/batch-pipeline-worker/templates/deployment.yaml`, all against content already on main (its base predates the shared-live retirement and the SCA-3503 retirements), not against this PR's rows. Its overlay hunks (`@@ -972/-1352/-1743/-2131`) do not touch the fast-finish env lines. Same regeneration step. ## Product invariants affected - INV-MEM-4: not affected. The only shared-code changes are: - two lazily built executor getters in `backend/utils/executors.py` (`fast_finish_chunk`, `fast_finish_io`); - a behaviour-preserving `prerecorded_bytes_route` helper inside `utils/stt/pre_recorded.py`; - the deadline context moved into `utils/stt/prerecorded_deadline.py`, with the deadline-shared request and language-probe timeouts. No memory intake, consolidation or promotion path changes. ## How it was verified All commands ran from `backend/` in the lane worktree on `lane/ff-long-multi`, through `omi-heavy run` with bounded timeouts. Layer: hermetic unit tests. There was no live provider call and no deploy. - `bash test.sh tests/unit/test_conversations_v3_fast_finish_chunked.py tests/unit/test_conversations_v3_fast_finish.py`: 112 and 115 passed, 3 of 3 runs. New for the 3a75ec5 review: - **afb7e49f review P3-1 and P3-2**, deterministic with events and a barrier, no sleeps. The denying chunk is held where it raises `_Refused` until the others decide, so the coordinator cannot set `stop` first and hide a missing check: - three chunks dispatched at once. Chunk A's privacy read errors, while chunk B's read, already in flight, answers True only after the denial is recorded. B (and C) send nothing, and the pass ends `privacy_blocked`. This fails without the two new checks, 3 of 3 runs; - three chunks whose first requests all go out (barrier), then all fail. The first retry check errors, and the other chunks' retry reads answer True after the denial. Only the three first requests are ever sent. This replaces the single-chunk retry test and fails with the sticky wrapper removed, 3 of 3 runs (as does the first test); - the reviewer's scratch race test (30 runs), run here as a temporary uncommitted copy, passes 30 of 30 with the fix and fails 17 of 30 without the new checks. - the shadow gate's privacy check **refuses**, and separately **errors**, then every later check would allow. The route asks the shadow gate, the vendor probe, then the gate again. All three answer False, privacy is asked only twice (before the audio and by the shadow gate), and no probe is sent. No chunk is uploaded, no probe audio is charged to `AUDIO_SECONDS` or the fleet budget, and the pass ends `privacy_blocked`. Both cases fail without the fix; - a resolution abandoned at the deadline makes no privacy read when it later reaches the probe; - with under 3 s left the probes are skipped without a privacy read; - a chunk is not sent with under 5 s left (`deadline`); - tests that use a sub-second deadline on purpose set `CHUNK_SEND_MIN_SECONDS` to 0. New for the 34222fe review: - a vendor probe and a self-hosted gate that are slow in every phase. The reviewer's 8 s case is scaled to 0.8 s left: each phase runs to its capped timeout, about 2.4 s in total. The pass returns `deadline` before the deadline plus grace in both cases. Both fail without the outer bound; - with under 3 s left, both probes are skipped after the privacy check, the row's language is kept, the pass goes on and no probe audio is charged; - with the cap set to exactly one reservation (2 × 1,818 + 30 s), a pass that retries every chunk writes and stays within the cap, and a racing reservation during it is refused; - a long pass with under 3 s left returns `deadline` and reserves nothing; - a Redis settle that takes 1 s does not hold the pass (it returns in under 0.8 s), and the settle still lands; - the write guard raises after a fence whose reads outlast the bound; - when the pool is blocked, every cancelled queued chunk job's buffer holder is empty after the pass stops. New for the Owners and Release changes: - through `_manual_finish_admitted` with a 0.6 s deadline (at least 0.5 s for `test_real_clock_budget_ratchet`) and a Firestore row refresh that stalls 5 s: the pass counts `deadline` and both slots are free again within the deadline plus 2 s; - a transcript write whose commit stalls past its bound: the pass returns `deadline` within the deadline plus 2 s and calls no cut. When the stalled transaction body then runs, its guard raises and nothing is written. A write inside its bound runs fence, then write, then cut, in that order; - fleet budget on a shared fakeredis: reserve then settle up (retry and probe), full refund of a pass that sent nothing, over-cap reservations taken back at once, one key per UTC day with a TTL of at most 26 h; - two simulated processes (two budget objects on one Redis): after process A's long pass, process B is refused `long_cap`; - Redis down: `screen`, `run` and `reserve` refuse long passes as `long_cap` (also when only the reserve pipeline fails), and short passes still write; - a chunk whose privacy answer arrives after the pass stopped sends and charges nothing. This test fails without the new stop check; - with 40 s left the gate keeps 2 s connect and 6 s read; with 3 s left every part is at most 3 s; the vendor probe keeps (2, 8, 8, 8) with 40 s left; - `test_conversations_v3_fast_finish.py`: the pass is handed no row and reads its own (live.py's duplicate read removed); an undecodable row read by the pass is `ineligible`. New for the cc33310 review: - through `_manual_finish_admitted` with a 0.6 s deadline (at least 0.5 s for `test_real_clock_budget_ratchet`) and a storage read that stalls until its timeout: the read's timeout is capped to at most 0.6 s, the pass counts `deadline`, and both slots are free again within the deadline plus 2 s (without the read budget it is a 30 s read); - the serial kill-switch path still reads without a budget; - one 300 s chunk over ten packs, each read 0.15 s, with a 0.2 s deadline: at most two references are read; - a slow refresh, funding or privacy call ends the pass as `deadline` with no audio read; - a long row with no `started_at` returns `error` with nothing left reserved; - after an early `provider_error` the chunks still running take no retry and the pass returns in under 1 s (the deadline is 45 s); the same holds after a privacy refusal at one chunk's dispatch; - the self-hosted gate sends nothing once the deadline has passed and is unchanged without a deadline; - `AUDIO_SECONDS{path="long"}` includes the 30 s vendor probe clip. New for the 9397a50 review: - both review seam probes, which fail before this fix: "epsilon zeta" is no longer duplicated, and a clipped "o …" head keeps "store" while dropping "sto"; - words joined by time; - a six-minute 6-unit Finish and a 19.9-minute single unit stay short (window 4, `path=short`) and run while a long pass holds the long slot; - a non-canary or over-cap long Finish is counted `long_canary` or `long_cap` with the long slot busy, never `busy`; - the language probe refused by privacy at send, with nothing charged; - an allowed probe charged at 30 s; - the cap charged with a retry (the sum of all requests sent); - a stopped pass returns in under 1 s while its request runs 1.5 s; - `budget_timeout`, verifier and probe timeouts summing within the deadline. - Related suites: 104 files (adding `test_redis_db_client_factories.py`), After the refresh onto afab956, 150 files passed: the 104 related files (the chat test included, repaired by #26382), the pipeline-lab tests (main's new `finish_privacy_refused_fast_finish` scenario included) and the ratchet. Earlier, on the tree merged at 3e42abf, 103 passed. `test_chat_stream_error_fallback.py` fails on the merged tree with `ImportError: cannot import name 'speaker_evidence_erasure' from 'utils.observability'`. That comes from main's #26311 (`utils/metrics.py` imports the new module while the chat test harness stubs `utils.observability`). Every file in that import chain is identical to origin/main, so it is a main breakage, not this PR's; it passed before the merge. They cover pre-recorded STT, `batch_language`, the language gate and the serving language probe, speaker-tag verification, teaching placement, batch_pipeline_live, executors, runtime env compose/validator, projection pump deploy target, flag budget, background task ratchet and others. `test_empty_capture_recovery.py` was left out: it fails on this host only because the native Opus library is missing. - Pipeline lab at 98c2321, CI's command (`scenario run --jobs 4 --repeat 2 --json --stt replay`), all 13 scenarios with CHUNKED on: 12 passed, and `finish_after_second_close` is its committed strict xfail. 0 nondeterministic and 0 repeat differences. The five scenarios that reach summarisation on fast-finish words (`audio_single_recording_finish`, `finish_after_reconnect_late_transcript`, `finish_double_tap`, `finish_next_opens_before_close`, `finish_single_recording_fast`) each end with B written, with a gist and 1 action item. New test: the fake gateway gives one answer when only random ids in the prompt differ, and a different answer when the words differ. With the renaming disabled, fresh ids gave equal answers 0 of 20 times. The determinism, LLM-proxy and fake-upstream-oracle tests: 36 passed. Earlier, at 729f357: A guard run reached the real STT provider zero times and stopped any call to it. It counted each `_transcribe_words` chunk stub call and each serial `_transcribe` call: - `audio_single_recording_finish`: chunk stub 1, serial 0, real provider 0; `fast_finish` B written; vendor stt 2/2 (1 chunk plus 1 cassette play); - `finish_after_reconnect_late_transcript` and `finish_after_long_reconnect_gap`: chunk stub 1, serial 0, real provider 0; B written; stt 1/1; - `finish_after_second_close`: no fast-finish pass runs (the xfail's product gap: B never gets the Finish), so 0 calls of any kind, stt 0/0; - `finish_double_tap` and `finish_single_recording_fast`: B written, stt 1/1. The two fast-finish suites plus `test_pipeline_lab_scenario.py` and `test_pipeline_lab_stage_reuse.py`: 294 passed. - pyright on the changed modules (`fast_finish`, `live`, `pre_recorded`, `prerecorded_deadline`, `batch_language`, `language_gate`, `executors`): 0 errors. `pre_recorded.py` stays at its 1659-line base. `render_feature_flag_registry.py --check-parsers` passed, and `compose_runtime_env.py` regenerated the runtime env. `scan_async_blockers.py`, `scan_import_time_side_effects.py` and `check_module_stub_pollution.py` all reported 0 violations. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Publishes the worker’s attached retirement patch from SCA-3499. The stable patch ID matches the original commit
9d46ce649c.The patch removes the default-off shared-live GPU pull flag, its runtime path, registry entry, tests and documentation. It retains the jobstore GPU table.
The worker reported passing targeted unit and contract checks. Firestore and Postgres emulator integration checks remain unverified.
The original patch conflicts with current
mainin the worker Helm deployment template, the flag registry documentation andconfig/feature-flags.yaml. Resolve these conflicts on a worker host and rerun the affected checks before panel sign-off. Release owns merge and serving verification.