Skip to content

SCA-3691: retire the separate audio merge worker phase - #26026

Merged
Git-on-my-level merged 7 commits into
mainfrom
agent/m1-studio-zcode-glm-5-3/b934d4030ea3
Nov 22, 2026
Merged

Git-on-my-level merged 7 commits into
mainfrom
agent/m1-studio-zcode-glm-5-3/b934d4030ea3

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

Retires the never-provisioned separate audio-merge worker phase: AUDIO_ARCHIVE_SEPARATE_MERGE_ENABLED and AUDIO_MERGE_WORKER_URL are kill rows in the flag registry (David's 2026-11-17 quality-ladder docket ruling, recorded on SCA-3682; delivery tracked as SCA-3691 under SCA-3684). Dark for five weeks; no merge worker exists; the handler URL already covers dispatch.

Current head: 6ff7b8dea9d7ffc525f1e095437d5e83ac160be4

Serving neutrality, verified on every committed surface before deletion:

  • Dispatch: _audio_merge_handler_url resolved to AUDIO_MERGE_WORKER_URL only when the SEPARATE_MERGE phase admitted a uid. The enable flag is false on every surface, so dispatch always resolved to AUDIO_MERGE_HANDLER_URL. After this PR it still does, unconditionally. Note the enable flag was the only cohort gate in prod: AUDIO_ARCHIVE_PERCENT (shared with COALESCE) is 100 on every prod surface and 0 on dev, so setting the flag would have admitted every owner with no ramp. Dispatch would have moved to the worker only once AUDIO_MERGE_WORKER_URL was also set, and it was empty on every surface. Two regression tests pin this: one sets the prod condition (percent 100, flag true, worker URL set) and asserts the phase stays unadmitted and dispatch/audience stay on the handler URL; the other feeds a token whose audience is the worker URL through the real verifier and observes the 403. Both fail when the old list-audience verifier is restored (mutation-checked).
  • Inbound OIDC audience: verify_audio_merge_cloud_tasks_oidc accepted [handler_url, worker_url]; the worker URL is empty on every surface, so the effective audience was always the single handler-URL string. After this PR the audience is exactly that string.
  • Queued deliveries: every task already in the audio-merge queue was enqueued with the handler URL as its OIDC audience, so the token Cloud Tasks mints at delivery is one the handler still accepts. No enqueuer can request a worker-audience token anymore. This is established by code reading and the two unit tests, not by observing a live delivery; a real one needs a production enqueue, which is outside this change's authorization.
  • Custody/paid work untouched: the merge queue, invoker SA, per-user encryption, raw audio ownership and the paid merge path are unchanged — this only deletes the never-taken dispatch branch and its audience expansion.

Serving state, from two sources:

  • Committed config at main 4119fa3a78: the flag false and the worker URL '' on all 13 composed-manifest surfaces, in the base source, and on all four prod/dev listen and pusher chart values files. No overlay names either key.
  • A read-only ro-prod sample at about 08:20Z: the flag is false on the traffic-serving revisions of backend, backend-integration, backend-projection-pump, backend-sync and backend-sync-backfill, with the worker URL present and empty; both keys are absent on desktop-backend and omi-enterprise-backend; and all 20 Ready prod-omi-backend-listen pods and all 18 Ready prod-omi-pusher pods have the flag false and the worker URL present with an empty value (the API omits an empty value; the deployed chart renders value: ""). I did not exec into pods to read the process environment.

Changes

  • backend/config/audio_archive.py: remove the SEPARATE_MERGE phase branch (unknown phases still fail closed via the final return False).
  • backend/utils/cloud_tasks.py: _audio_merge_handler_url() drops the uid/worker branch; both enqueue paths and the audio-merge OIDC verifier use the plain handler URL.
  • Deploy: remove both envs from backend/deploy/runtime_env/_base.yaml; backend/deploy/runtime_env.yaml regenerated with compose_runtime_env.py (13 surfaces × 2 keys, all false/''); removed from the prod/dev listen and pusher chart values; removed from config/deployment-setting-classification.json.
  • Registry: both rows moved from flags: to the 2026-11-22 group in retired: (reintroduction guard); backend/docs/feature-flag-registry.md regenerated against main, most recently 63214b77cba.
  • Runbook sync-ingest-archive.md: drop the phase row, the never-used separate-worker provisioning paragraph, the separate-worker cost row, and the stale "worker" mentions.
  • Change note: backend/docs/listen_pusher_pipeline/changes/2026-11-22-separate-merge-retirement.md (required by backend/AGENTS.md for audio changes).
  • Tests: delete the two SEPARATE_MERGE-specific tests and the now-unused import; add the two regression guards above; drop the retired keys from the runtime-env and pusher chart contract fixtures.

Coordination

Testing (bounded, on head 6ff7b8dea9; suites re-run after the third merge)

  • Audio merge/archive suites (test_audio_merge_tasks, test_audio_merge_destructive_deferral, test_audio_placement_merge, test_audio_chunk_archive_listing): 41 passed.
  • Runtime-env and pusher-config suites (10 files, incl. test_backend_runtime_env_validator, test_verify_pusher_config_references): 680 passed.
  • scripts/test_check_feature_flag_registry.py: 110 passed.
  • python3 scripts/check_feature_flag_registry.py: feature-flag registry: OK; python3 backend/deploy/compose_runtime_env.py --check: runtime_env.yaml is up to date. Both re-run at this head; the reintroduction guard for the two names is active in the checker run.
  • The full pre-push gate passed at this head before the push (the PR body supplied via OMI_PR_BODY_FILE for invariant discovery).
  • On the earlier head the same-shaped suites passed (65 audio-merge + sync-ingest-archive; 336 runtime-env + pusher-config; test_sync_v2.py 193; the other cloud_tasks consumer files per file or in small groups). The merge after that head touches none of this PR's files, and the patch-vs-main is line-for-line identical, so those runs carry.
  • Pre-existing and not from this change: large mixed test batches error identically on a pristine base, and test_sync_transcription_prefs.py errors 59/59 identically on a pristine base.

Panel review

omi-panel review round 1 (review-20261122t062934-a741: luna + deepseek completed, glm-flash launch failed) returned FIX-FIRST with 6 findings. F1–F5 accepted and fixed in this PR (retired-list entries, change note, runbook worker mentions, inert-env regression test, unused import); F6 rejected as another lane's ruling record. Round 2 (review-20261122t070503-ff43, same two models) returned SHIP with 3 findings, all mine to fix. My PR body wrongly said the cohort percent was 0 everywhere and wrongly called the reintroduction guard latent, and a docstring still said "merge worker". Round 3 (review-20261122t072621-21a2) returned SHIP with 2 nits. The change note overstated that the flag alone would have moved dispatch, and the guard now observes a worker-audience token being refused. Round 4 (review-20261122t080133-6456) on 507018b2c9 returned SHIP with 1 nit and no change required: the AUDIO_ARCHIVE_PERCENT row note, left for its owning lane. Every round ran on two of three models (luna and deepseek); glm-flash failed to launch each time.

No fresh panel round was run on the three merge commits; their diff against main is line for line the round-4 diff. Luna recorded carry-forward SHIP verdicts on SCA-3691 — first at the earlier head (10:05Z), then at the current head 6ff7b8dea9.

Product invariants affected

  • INV-MEM-4

AUDIO_ARCHIVE_SEPARATE_MERGE_ENABLED and AUDIO_MERGE_WORKER_URL are
kill rows in the flag registry (David's 2026-11-17 bulk ruling): dark
for five weeks, no separate merge worker was ever provisioned, and the
worker URL is empty on every serving surface (Cloud Run manifest and
the prod/dev listen and pusher charts), so the dispatch always resolved
to AUDIO_MERGE_HANDLER_URL and the inbound OIDC audience list always
collapsed to that single handler URL. Deleting the phase is
serving-neutral: queued deliveries carry handler-URL audience tokens
that the verifier still accepts, and no enqueuer can mint a
worker-audience token anymore.

Removes the SEPARATE_MERGE phase admission, the per-uid worker dispatch
branch, and the extra audience entry; keeps the merge handler URL as
the sole dispatch target and OIDC audience. Drops the env from the
composed runtime manifest (regenerated via compose_runtime_env.py), the
four chart values files, the deployment classification, both registry
rows (doc regenerated), the runbook phase row and its never-used worker
provisioning paragraph, and the two phase-specific tests.
Panel review round 1 fixes. Move both rows into the registry's retired
list so the checker fails on reintroduction (doc re-rendered), add the
listen/pusher change note the backend guide requires for audio changes,
drop the runbook's remaining separate-worker cost row and deletion
mention, and remove the import the deleted tests left behind.

Add a regression test: with a leftover worker URL and the retired enable
flag set, the phase stays unadmitted and both dispatch and the OIDC
audience remain the single handler URL string.
Panel review round 2. The verifier docstring still said the token is minted
for a "merge worker"; the handler is the only acceptor now. The change
note also records why the phase was dark in prod: AUDIO_ARCHIVE_PERCENT is
100 there, so the enable flag alone gated admission.
Panel review round 3. The guard only asserted the audience argument; it
now feeds a token whose audience is the retired worker URL through the
real verifier and observes the 403. Restoring the old list-audience
verifier fails both guards. The change note also says that dispatch
needed a non-empty worker URL as well as the flag.
@Git-on-my-level
Git-on-my-level force-pushed the agent/m1-studio-zcode-glm-5-3/b934d4030ea3 branch from e7e2161 to 507018b Compare November 22, 2026 08:01
…stry

#26007 (SCA-3683) landed first and conflicted on the generated registry
doc. Resolved by re-rendering backend/docs/feature-flag-registry.md and
re-composing backend/deploy/runtime_env.yaml. For all 17 files of this PR
the patch against main is line for line the patch reviewed at 507018b;
the four reviewed commits are unchanged.
@Git-on-my-level
Git-on-my-level merged commit dd5bd86 into main Nov 22, 2026
75 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-zcode-glm-5-3/b934d4030ea3 branch November 22, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant