Repository navigation
Retire ruled-dead shadows; unset modes default off; shadows expire - #26582
Conversation
Stage 1 of the 2026-11-28 shadow settlement (David, anx card:prod-shadows-settled-retire-the-dead).
ruling: R-20261128-01 (proposed)
- Serve off: MEDIA_NOISE, ACTION_ITEMS_V2, ACTION_ITEM_VALIDITY, STT_VOCAB,
CLIENTS_FROM_SEGMENTS_CHUNKS, CAPTURE_GROUP_CONTAINMENT, SPEAKER_GROUPING_SHADOW,
BATCH_PIPELINE_SHADOW_PERCENT=0, TRANSCRIPTION_SHADOW (stage F); OMI_FLAGS_SOURCE=posthog
on listen, pusher and the Cloud Run backends.
- refactor_modes: an unset mode is off; a frozen, shrink-only legacy set keeps shadow.
- Registry: shadow {readout_by <=21d, metric} block for new _MODE/SHADOW rows; generated
backend/config/shadow_expiry.py turns an expired shadow off in mode().
Co-Authored-By: Claude Opus 5.5 <[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: dc410e6be1
ℹ️ 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".
|
|
||
| def capture_group_containment_mode() -> str: | ||
| value = os.getenv(MODE_ENV, 'shadow').strip().lower() | ||
| value = os.getenv(MODE_ENV, 'off').strip().lower() |
There was a problem hiding this comment.
Document the pipeline retirement and changed default
This changes the containment default from shadow to off, but the commit includes neither the required pipeline change note nor an update to the env contract. backend/docs/listen_pusher_pipeline.mdx:2170 still documents CAPTURE_GROUP_CONTAINMENT_MODE as defaulting to shadow, leaving operators with incorrect configuration guidance. Add a note under backend/docs/listen_pusher_pipeline/changes/ covering the retirement and rollout state, and update the affected default in the contract document, as required by the backend guide.
AGENTS.md reference: backend/AGENTS.md:L164-L164
Useful? React with 👍 / 👎.
… shadow blocks - serving_for() reads the configured mode, so an expired shadow still serves its cohort (F1). - Expiry starts at readout_by + 7 days, as documented (F2). - Registry summaries and listen/pusher doc say default off for the retired families (F3). - shadow: blocks only on refactor_modes *_MODE families, the only readers of the table (F4). - Pusher chart comment names stage F (F5); registry rows keep the compact JSON style. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Panel review-20261128t052728-e26c: SHIP on 3ee3026 (F1 accepted and fixed; F2–F5 fixed). Release issue SCA-5315 covers the merge and roll; it needs batch-custody (lead2) to ack the batch-pipeline-worker |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ee3026185
ℹ️ 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".
| if resolved == 'shadow' and _shadow_expired(name): | ||
| return 'off' |
There was a problem hiding this comment.
Preserve serving behavior in gates after shadow expiry
When a shadow binding with a configured serving cohort expires, serving_for() deliberately keeps returning true for that cohort, but shadow_or_serve() and cohort_configured() now return false because they call mode(). Existing consumers therefore disable serving work despite the explicit preservation in serving_for(): for example, utils/other/daily_recap.py stops selecting the cohort's recipients at the new delivery hour and restores legacy date selection, while generate() still uses the new producer. Make the execution and discovery gates preserve configured serving cohorts while stopping only shadow observation; the current expiry test checks serving_for() alone and misses this inconsistency.
Useful? React with 👍 / 👎.
…lists, speaker-grouping allowlists) (#26828) ## Why SCA-5315: clears the residual config left after stage 1 of the shadow settlement (#26582, merged as `27ee3e849fb4`). The killed-flags audit found these residuals; they are rows 7–12 of Ship's matrix on SCA-5315. Stage 1 already serves both shadows off (transcription shadow kill switch on; speaker grouping shadow off), but the percent and the allowlisted UID still sat in prod config. This PR clears them so the retired shadows carry no live cohort. ## Changes (prod only) | File | Key | Before → after | | --- | --- | --- | | `backend/deploy/runtime_env/prod.overlay.yaml` (+ regenerated `runtime_env.yaml`) | `TRANSCRIPTION_SHADOW_PERCENT` (pusher, backend, backend-sync, backend-sync-backfill) | `'5'` → `'0'` | | same | `TRANSCRIPTION_SHADOW_UID_ALLOWLIST` (pusher) | the allowlisted UID → `''` | | same | `SPEAKER_GROUPING_SHADOW_UID_ALLOWLIST` (listen, pusher) | the allowlisted UID → `''` | | `backend/charts/pusher/prod_omi_pusher_values.yaml` | `TRANSCRIPTION_SHADOW_PERCENT` | `"5"` → `"0"` | | same | `TRANSCRIPTION_SHADOW_UID_ALLOWLIST` | the allowlisted UID → `""` | | same | `SPEAKER_GROUPING_SHADOW_UID_ALLOWLIST` | the allowlisted UID → `""` | | `backend/charts/backend-listen/prod_omi_backend_listen_values.yaml` | `SPEAKER_GROUPING_SHADOW_UID_ALLOWLIST` | the allowlisted UID → `""` | | `backend/deploy/ops/live_only.yaml` | `SPEAKER_GROUPING_SHADOW_UID_ALLOWLIST`, `TRANSCRIPTION_SHADOW_UID_ALLOWLIST` | entries removed | | `backend/deploy/cross_service_known_gaps.json` | `no-uid-literals` gaps for listen/pusher `SPEAKER_GROUPING_SHADOW_UID_ALLOWLIST` and pusher `TRANSCRIPTION_SHADOW_UID_ALLOWLIST` | removed (no UID literal remains) | | `config/diarization-cohort-stages.json` | stage F (retired shadow) `TRANSCRIPTION_SHADOW_PERCENT`, `TRANSCRIPTION_SHADOW_UID_ALLOWLIST` | `"5"` → `"0"`, the allowlisted UID → `""` | | `backend/docs/feature-flag-registry.md` | regenerated by `scripts/render_feature_flag_registry.py` | prod values follow the config | | `backend/tests/unit/test_diarizer_david_cohort.py` | retired stage F: shadow percent 0 and empty shadow allowlist; final-pass assertions unchanged | | The reviewed stage F in `config/diarization-cohort-stages.json` is the stage the prod pusher/Cloud Run bindings must match (validator, cohost gate and cohort tests), so it moves with the config. Every other stage and every final-pass value is unchanged. Not touched: `MEDIA_NOISE_MODE_SERVE_UID_SHA256S`, the Sync `RECORD_WAL_DUPLICATE_SHADOW_*` settings, the Calls Recap and Notes Packet frozen legacy rows, `DEMAND_PROCESSING_UID_ALLOWLIST`, the `BATCH_PIPELINE_*` recovery and UID allowlists, `TRANSCRIPTION_FINAL_PASS_*`, and any stage-2 rows. ## Serving Merging changes no serving state. The change reaches production only through Release deploys: - a full pusher deploy (GKE); - the next Cloud Run train (backend, backend-sync, backend-sync-backfill); - removal of the live-only `SPEAKER_GROUPING_SHADOW_UID_ALLOWLIST` / `TRANSCRIPTION_SHADOW_UID_ALLOWLIST` env from the Cloud Run services that carry it by name (backend, backend-integration, backend-sync, backend-sync-backfill), since they are no longer declared live-only. ## Verification - `compose_runtime_env.py` regenerated `runtime_env.yaml`; `check_runtime_env_compose.sh` reports it up to date. - `bash test.sh` (changed-files selection, 97 files) passed, including `test_render_backend_runtime_env.py`, `test_backend_runtime_env_validator.py`, `test_verify_pusher_cohost_env_diff.py`, `test_sync_two_lane.py` and `test_diarizer_david_cohort.py`. - `backend/scripts/pre-deploy-check.sh` (hermetic: `validate-backend-runtime-env.py --env dev|prod --check-workflows` plus deploy-safety tests, 710 passed). - `scripts/check_feature_flag_registry.py`: no drift. - `scripts/pr-preflight --all`: 52 gates; 51 passed on the first run, `product-invariants` passed after naming INV-MEM-4 below. ## Product invariants affected - INV-MEM-4 — named because `backend/deploy/runtime_env.yaml` is under its locked glob. This PR changes no memory setting: only the transcription and speaker-grouping shadow keys listed above. ## Rollback Revert this commit. 🤖 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/26828?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/26828?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26828&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. -->
What
Stage 1 of the 2026-11-28 shadow settlement (David, anx
card:prod-shadows-settled-retire-the-dead; ruling: R-20261128-01, proposed). Two parts: production stops running the shadows David ruled dead, and new shadows can no longer run forever. Stage 2, a separate PR, deletes the retired code paths.1. Retire the dead shadows (config only, code paths kept for stage 2)
MEDIA_NOISE_MODEoff(overlay + chart); dropped from the implicit-shadow setMEDIA_NOISE_MODE_SERVE_UID_SHA256Sdigest cohort on the four Cloud Run backends (the Release issue lists that env for removal)ACTION_ITEMS_V2_MODE,ACTION_ITEM_VALIDITY_MODE,STT_VOCAB_MODE,CLIENTS_FROM_SEGMENTS_CHUNKS_MODESPEAKER_GROUPING_SHADOW(EXP-004)off, percent0on listen, pusher and Cloud RunBATCH_PIPELINE_SHADOW_PERCENT0in the overlay and in the batch-pipeline-worker prod/staging charts (shadowPercent)omi_runtime_percent{name="batch-pipeline"}=100; 7 d intake 4.55M batch vs 6 not_cohort), so no non-serving owner is left to shadowTRANSCRIPTION_SHADOW_ENABLED/_KILL_SWITCHfalse/true; new diarization cohort stageF(= E with the shadow off)skipped_budgetoutcomes, zero ok/failed;omi_legacy_sync_mode=dark, so it promotes nothingCAPTURE_GROUP_CONTAINMENT_MODEoffin_base.yamland all charts; code defaultoffOMI_FLAGS_SOURCEposthogon listen, pusher and the Cloud Run backendsdual(its workflow hard-codes it; follow-up on the Release issue), llm-gateway staysomiRegistry rows for these families now say
decision: kill,terminal: offwith the ruling innotes. The config_switch rows move torolloutwithreview_by: 2026-12-05as the stage 2 deletion date. No extension or due date moved.2. Guardrails (all four approved by David)
config/refactor_modes.pymode()no longer defaults toshadow._LEGACY_SHADOW_DEFAULTkeeps the old default for five families that still rely on it:CALLS_RECAP,CAPTURE_COVERAGE,LIFECYCLE_V2,NOTES_PACKET_V2,SPEAKER_EVIDENCE. Each is handed to its owner to bind, ramp or retire. A test caps the set so it can only shrink.shadow:block. New_MODE/SHADOWrollout rows created on or after 2026-11-28 must carryshadow: {readout_by, metric}, withreadout_byat most 21 days aftercreated.scripts/render_shadow_expiry.pygeneratesbackend/config/shadow_expiry.py. Fromreadout_by+ 7 days,mode()reads ashadowbinding asoffand logsevent=shadow_expiredonce.serveis never touched. The registry checker fails when the table drifts. The table is empty today.infra/rollout/bin/killed_flags_serving.pyreports kill/terminal-off rows that still serve as non-off on live Cloud Run traffic revisions and GKE deployments. It is read-only and runs underro-prod.Verification
scripts/check_feature_flag_registry.py: OK.compose_runtime_env.py --check: up to date.validate-backend-runtime-env.py --env prod: passed.scripts/test_check_feature_flag_registry.py: 114 passed.tests/unit/test_refactor_modes.py: 21 passed.shadowPercent25 → 0 in prod and staging; the containment registry-row assert), and both pass after the fix.tests/unit/fixtures/containment_long_pair.pycollects no tests.Product invariants affected
runtime_env.yamlchanges only shadow and flag-source bindings. Memory promotion keeps its existing authority: the retired shadows never served memory writes, and the notes and lifecycle families (NOTES_PACKET_V2, LIFECYCLE_V2) are unchanged here, since the Home v3 owner settles them in #26580.Rollout
Release owner merges and rolls (David: "I build, Release ships"). Rollback: revert this PR, or for one family set its env back (
BATCH_PIPELINE_SHADOW_PERCENT=25,SPEAKER_GROUPING_SHADOW=on,TRANSCRIPTION_SHADOW_KILL_SWITCH=false,X_MODE=shadow). Readback after serving:omi_runtime_percent{name="batch-pipeline"}stays 100;killed_flags_serving.pyfinding count drops to the live-only env the Release issue removes.🤖 Generated with Claude Code