Skip to content

config(listen): fold live media-noise and short-clip-floor values into the listen chart - #25651

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/listen-drift-fold
Nov 18, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/listen-drift-fold

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Why

The listen roll that puts conversations v3 on live captures is refused by the train's drift gate. Three backend-listen keys are live but absent from the chart:

  • MEDIA_NOISE_MODE=shadow and MEDIA_NOISE_MODE_SERVE_PERCENT=0, carried by the LISTEN_PRIVATE_VALUES_YAML privateEnv overlay since 2026-11-04;
  • NOTES_SHORT_CLIP_FLOOR=true, set by kubectl set env after lead2 f9bdc4 (2026-11-11) rolled back the false experiment.

The forensics are in the omi-workspace run record data/run-2026-11-17-v3-resume/drift-forensics-{A,B}.md.

What

This change is preservation-only: each value equals what serves now, so the rendered pod is unchanged.

  • Listen chart: prod_omi_backend_listen_values.yaml now pins MEDIA_NOISE_MODE: shadow, MEDIA_NOISE_MODE_SERVE_PERCENT: "0" and NOTES_SHORT_CLIP_FLOOR: "true".
  • Composed manifest: prod.overlay.yaml mirrors the same three values for gke.backend-listen, and runtime_env.yaml is regenerated.

Not changed:

  • STT cap keys stay as they are. STT_CAP_DISPATCH_ENFORCEMENT and _COHORT are owned by the private overlay by design; test_stt_cap_cohort_lanes pins the manifest at false and an empty cohort.
  • Private values stay private. The media-noise serve digest list stays in the private overlay and never enters Git.
  • Silence read skip is left alone. BATCH_PIPELINE_SILENCE_READ_SKIP_ENABLED is Git-ahead: the serving listen image predates the flag, so rendering false changes nothing.

Safe inverse: delete the added entries. Live stays the same, and the code defaults are the same values.

Verification

  • compose_runtime_env.py was regenerated, and check_runtime_env_compose.sh reports it up to date.
  • The three keys are classified config in config/deployment-setting-classification.json, and check_deployment_secret_boundary.py passes.
  • The three keys are allowlisted as listen-only in verify_pusher_cohost_env_diff.py for prod, because pusher leaves them unset at the same code defaults. The co-host gate and its 84 tests pass.
  • scripts/pr-preflight passed all 46 checks.
  • pytest passed, 2246 tests, covering:
    • the listen helm defaults and helm env overrides;
    • the runtime-env validator, manifest compat and sources;
    • the drift check, media-noise policy and STT cap cohort lanes.

Product invariants affected

  • INV-MEM-4 (runtime_env.yaml is a locked path; only three listen env values that already serve are pinned, no memory promotion behavior)

Failure-Class: none

UI-Evidence: none -- deploy config only

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

…o the listen chart

Preservation-only: MEDIA_NOISE_MODE=shadow, MEDIA_NOISE_MODE_SERVE_PERCENT=0
and NOTES_SHORT_CLIP_FLOOR=true are what backend-listen serves today; pinning
them in the chart clears three train drift rows without changing the pod.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Panel review-20261118t040928-42db F1 (privateEnv still overrides the media-noise chart values): rejected as intended. This PR only makes the chart match what serves, so the drift gate stops flagging those keys and a full chart re-render keeps the same values. The private overlay stays the source for the media-noise values until they're retired by 11-22 under David's 11-17 ruling. Editing the protected secret needs David's approval and is out of scope here.

@Git-on-my-level
Git-on-my-level merged commit 401f9ed into main Nov 18, 2026
69 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/listen-drift-fold branch November 18, 2026 04:24
Git-on-my-level added a commit that referenced this pull request Nov 20, 2026
…e Helm privateEnv overlay (#25660)

## Summary

Private backend-listen env values (the STT cap fallback cohort and the
media/noise digest serve list, both uid-bearing) were rendered as
literals by every listen Helm roll from the GitHub prod secret
`LISTEN_PRIVATE_VALUES_YAML` through the chart's `privateEnv` overlay.
No deploy render, drift checker or train gate could see what a listen
roll writes, so every listen train hit an unwaivable
`LISTEN_PRIVATE_VALUES_YAML incomplete` row (owner brief: omi-workspace
`data/run-2026-11-17-v3-resume/brief-listen-private-values.md`).

This moves the values out of the render:

- **Secret Manager → External Secrets → per-name secretKeyRef.** One
Secret Manager JSON document `LISTEN_PRIVATE_ENV`; a dedicated prod
ExternalSecret in the backend-secrets chart (`dataFrom.extract`,
`refreshInterval: 0s`) syncs it into
`prod-omi-backend-listen-private-env`, a Secret only listen references
(the shared backend secret is loaded whole via envFrom elsewhere, so it
is not used). The listen chart's new `privateSecretEnv` declares the
**names**; the template renders one `secretKeyRef` (`optional: false`)
per name, drops public entries of the same name, and refuses a non-empty
`privateEnv` while it is set. Per-name refs rather than `envFrom`
because a chart `env` entry silently beats an `envFrom` key of the same
name, and so the names stay declared in Git.
- **Three private names.** `STT_CAP_DISPATCH_COHORT` and
`MEDIA_NOISE_MODE_SERVE_UID_SHA256S` (uid-bearing), plus
`STT_CAP_DISPATCH_ENFORCEMENT`, which stays private by ruling (lead2
4e5e71/45689e, b2cf73: keep it in the private set; no public fold-back).
The listen chart no longer carries a public enforcement or cohort
literal that could be mistaken for the live value; the historical chart
`false` was never the live value. MEDIA_NOISE mode/percent and lanes
were already public (#25651).
- **Workflow (existing file only).** The deploy path no longer reads the
GitHub secret. New prod-only `mode: private-env-migrate` (rolls nothing)
reads the secret inside the protected job, checks its name set and that
folded public names equal the chart, writes one `LISTEN_PRIVATE_ENV`
version via WIF, applies the backend-secrets chart, force-syncs, and
reports per name only `same`/`changed`. A new pre-roll step **"Prove
private listen env is unchanged"** runs after the secret sync and before
the listen Helm upgrade: every declared name must be present and
non-empty in the synced Secret, and where any serving template
(Deployment or ReplicaSet with pods) still carries a literal, the values
must be identical — otherwise nothing is deployed. Helper:
`.github/scripts/listen_private_env.py` (never prints a value or hash).
- Runtime manifest, validators, both drift checkers, feature-flag
registry and docs follow; new runbook
`backend/docs/runbooks/listen-private-env.md` (changing a value = new SM
version → force-sync → rollout restart; never a code deploy).
`backend/deploy/runtime_env/README.md` replaces the live-edit shortcut
with the sanctioned path.

- `verify_pusher_cohost_env_diff.py`: listen's enforcement and cohort
are now references, not env literals, so they are pusher-only names in
the comparison (pusher keeps its public observe-only values).
`.github/ci-budget.yaml` records the new dispatch option (no new
trigger, no PR runs).

The meta-repo train gate change that recognises this "private-free"
source (no overlay request id; references only; ExternalSecret-Ready
row) ships separately in omi-workspace.

## Rollout / cutover (not done by this PR)

1. IAM (done 2026-11-18 ~05:55Z with David's human login, authorized by
David for this change only): created the empty secret
`LISTEN_PRIVATE_ENV` in `based-hardware` (automatic replication, no
version), and granted `omi-ci-deployer-prod`
`roles/secretmanager.secretVersionAdder` on that one secret. ESO already
has project-level accessor.
2. After merge: dispatch `mode=private-env-migrate` (prod; no listen
roll) — expect every name `effect=same`.
3. Next off-peak listen train (coordinated): the gate shows the two
literal→reference rows as `reviewed`; the in-job guard proves byte
equality before Helm.
4. Rollback of the cutover roll: `mode=rollback` (Helm restores the
previous revision whose stored values carry the literals). Rollback of
this PR before step 3: revert; the deploy path would then need the
overlay again (the GitHub secret is untouched).
5. Later cleanup: delete the GitHub secret and the
`evidence`/`private-env-migrate` modes after a clean soak.

Until step 2 completes, a listen roll from main fails closed at the
guard (ExternalSecret not Ready) before any listen mutation. Cloud Run
deploys also apply the backend-secrets chart and will create the (not
yet synced) ExternalSecret; that is inert.

## Product invariants affected

- INV-DATA-1 — the listen deploy workflow changes, but no routing,
endpoint, Firebase/Firestore project or protected authority does. Only
the source of two existing listen env values moves, from a rendered
literal to a Secret Manager reference in the same prod project, and the
values themselves are unchanged.
- INV-MEM-4 — `runtime_env.yaml` is regenerated for the listen env
sources only (three secret references). No memory intake, consolidation
or promotion setting changes.

Also held by this change:

- Private listen values never appear in a rendered manifest, a workflow
log, or Git; only names and `same`/`changed`.
- A listen roll cannot change a private value; a private value change
cannot ride a code deploy.

## Tests

- New: `backend/tests/unit/test_listen_private_env.py`
(migrate/guard/sync with fake kubectl/gcloud; no value leaks; every
serving ReplicaSet checked), backend-secrets ExternalSecret render test,
listen chart render tests (references only, privateEnv refused,
credential names refused).
- Updated: `test_listen_helm_env_overrides.py` (workflow: secret only in
evidence/migrate steps; guard ordering; migrate never rolls),
`test_check_cloud_run_env_drift.py`, `test_stt_cap_cohort_lanes.py`,
`test_listen_workload_identity_chart.py`,
`test_backend_secrets_chart.py`.
- `helm template` prod/dev, `actionlint`,
`check_deployment_secret_boundary.py`, `check_feature_flag_registry.py`,
`check_runtime_env_compose.sh` pass locally.

Failure-Class: none

🤖 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/25660?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/25660?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F25660&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. -->
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