Repository navigation
fix(stt): require stronger language evidence for short probes - #23176
Merged
Merged
Conversation
Reject the captured six-second Chinese false-English permissions at both selection and worker boundaries while preserving longer and declared routes. Failure-Class: FC-unknown-language-treated-as-model-capability
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 22, 2026
…on the CPU guard test_admitted_short_false_permission_cannot_bypass_worker_barrier[zh-clean_speech-6s-pcm16] measured 1.05s then 1.00s CPU against the 1.00s fail limit on this PR's shard-6 runners (two attempts), under the limit on main's --all shards and locally; the zh 6s PCM16 decode is the test's real work. Same boundary shape and remedy as the Dream retry entries (8d062ad).
Git-on-my-level
added a commit
that referenced
this pull request
Oct 22, 2026
…D D2 wiring; needs David's .github naming) (#23100) ## What changed and why Plan D **D2 deploy wiring** (lane `p41-d2`), stacked on #23088 (the chart). It lets the lead roll the `listen-edge` GKE chart through the existing listen workflow by an **admitted image digest** from the build-only train. **Nothing deploys by merging this**, and the `.github` change **is named by David** (see the table below). - **`.github/workflows/gcp_backend_listen_helm.yml`** (existing workflow; no new `.github` file): new `workflow_dispatch` input `listen_edge_image_digest`. Blank (default, and the push-to-main auto path) leaves the listen-edge release untouched. When set: GCR login + buildx, `admit_listen_edge_image.py` reads the image config and refuses anything that is not `gcr.io/<this project>/listen-edge@sha256:…` whose revision label (`org.opencontainers.image.revision`) equals its `OMI_RELEASE_SHA` stamp **and** is a commit in this repository that the checked-out source contains (the listen `image_tag` ancestor-of-main rule applied to a digest, so an earlier train's digest — or the previous one, for a rollback — stays deployable after main moves on); prod materializes `LISTEN_EDGE_PRIVATE_VALUES_YAML` (`privateEnv`, e.g. the shared `EDGE_SHADOW_TOKEN`) with the same hygiene as `LISTEN_PRIVATE_VALUES_YAML`; **after** backend-listen's own rollout verification (and the prod NEG reconcile) the listen-edge chart is helm-upgraded by digest with a 600 s rollout wait, status report, pod listing and private-file cleanup. `mode=rollback` touches the listen release only (edge rollback is by digest or `helm rollback`, per the runbook). - **`backend/scripts/admit_listen_edge_image.py`** + 23 unit tests (wiring input validation). - `config/deployment-setting-classification.json`: `LISTEN_EDGE_PRIVATE_VALUES_YAML` is a secret. Why the listen workflow and not the train's `service_images`: listen-edge has no current image to cut over from, prod trains are `cloud-run-only` (prod `deploy_targets=all` is rejected), and the listen workflow already serves both environments with the same admission shape (`image_tag` → ancestor of main; here digest → built from a commit the checkout contains). The image itself still comes from the train (B2's `build-role-images` publish). ## `.github` naming — recorded | File | Change | Why it needs David | Risk if merged without naming | | --- | --- | --- | --- | | `.github/workflows/gcp_backend_listen_helm.yml` | New optional input `listen_edge_image_digest`; three admission steps (GCR login, buildx, digest admit); prod private-values materialize/cleanup; one Helm upgrade step for `backend/charts/listen-edge` + pod listing, all gated on the input | Edits a production deploy workflow (`prod` environment, WIF deployer) and reads a new protected-environment secret name `LISTEN_EDGE_PRIVATE_VALUES_YAML` | Workflow policy only: with the input blank every existing step is byte-identical in behaviour; the new steps never run. A set digest can only create/roll the `<env>-omi-listen-edge` release in `<env>-omi-backend` | **Named by David, 2026-10-22 ~02:20Z: "You can do those workflow PRs and merge them"** (recorded in the P49 lead brief, 10-22 02:25Z, covering this PR and #23090). Merge authorization is complete; the lead arms `merge_on_green.sh` with `ALLOW_WORKFLOW_EDIT=1` and merges after TRAIN Q DONE, not this lane. ## Product invariants affected **INV-DATA-1** — path match only (`.github/workflows/gcp_*.yml`). The change adds a listen-edge step to the listen workflow and preserves every existing authority; no desktop-backend GKE deployment authority returns (`.github/scripts/test_check_mobile_production_routing.py`: 12 OK locally). ## How it was verified Repository `BasedHardware/omi`, branch `lane/p41-d2-wiring`, base `main` (stacked on #23088, now merged as `2f43fb4f83`). All local commands under `bin/omi-heavy run -- nice -n 19`. - `actionlint .github/workflows/gcp_backend_listen_helm.yml`: clean. **Layer: workflow lint.** - `backend/scripts/check_workflow_contracts.py` on the changed files: passed. `.github/scripts/check_deployment_secret_boundary.py --base origin/main`: passed. `.github/scripts/check_ci_budget.py --base origin/main`: passed. **Layer: repo checks.** - `pytest tests/unit/test_admit_listen_edge_image.py tests/unit/test_workflow_contracts.py tests/unit/test_listen_helm_env_overrides.py`: **165 passed** (23 new). **Layer: unit.** - `.github/scripts/test_check_mobile_production_routing.py`: 12 OK. **Layer: INV-DATA-1 mutation tests.** - GLM review round 1 (head c67bd60): SHIP with one P2 (equality admission made rollback-by-digest dead once main moved) — fixed in `4a7a025178` by the ancestor rule above; round 2 reviews that delta. - **origin/main merge (2026-10-22, head `2e45f50b4e4`, lane P49)**: resolved `gcp_backend_listen_helm.yml` by keeping both new dispatch inputs — `listen_edge_image_digest` (D2) and main's B5 `break_glass_lock` — and the three `ci-budget.yaml` rationale conflicts (each records both inputs; D2 budget bumps 11/15 kept, main's `expected_runs_per_day` kept). Re-verified under `nice -n 19`: actionlint clean; `check_ci_budget.py --base origin/main`, `check_deployment_secret_boundary.py --base origin/main`, `check_workflow_contracts.py` all passed; pytest `test_admit_listen_edge_image.py test_workflow_contracts.py test_listen_helm_env_overrides.py test_runtime_image_contracts.py`: **227 passed**; `make runtime-image-source-closure`: 19 registered images OK. - **CPU-guard allowlist delta (head `b5fff377503`)**: merging main pulled #23176's `test_batch_audio_language.py` into this PR's shard selection, where `test_admitted_short_false_permission_cannot_bypass_worker_barrier[zh-clean_speech-6s-pcm16]` sat on the 1.00s fast-unit CPU fail limit (1.05s, then 1.00s, two runner attempts) while staying under it on main's `--all` shards and locally (62/62 pass; guard silent locally). Allowlisted that node ID with rationale — the same boundary remedy as the Dream retry entries (`8d062ad3cfa`); no global threshold change, no `slow` move. `test_fast_unit_duration_allowlist_selection.py`: 2 passed. **Not verified** (by design): a real dispatch. The new steps need a published listen-edge digest (the first build-only publish run is the lead's) and a prod/dev environment; `docker buildx imagetools inspect` against GCR is the same call `deploy-backend-stack` already makes for `service_images`. ## Tests `backend/tests/unit/test_admit_listen_edge_image.py` — core path: a digest built from the checked-out SHA or from an ancestor of it yields repository + digest + revision, `main` writes the GitHub env file; blank input reads nothing. Error paths: tag instead of digest, other project, other image, short/uppercase digest, `service_images` pair shape and lists are refused **before any registry read**; a digest built from a commit the checkout does not contain, a label without matching `OMI_RELEASE_SHA` (refused before the ancestry check), an unlabelled/short/`unknown` revision, a null image config, a short checked-out SHA and a registry read failure are refused; `main` exits 1 with `ERROR`. ## UI evidence UI-Evidence: none -- deploy workflow and scripts only. ## Rollback Revert the PR (no runtime effect either way). Operationally: dispatch with a blank digest = no listen-edge change; a previous digest re-rolls the previous image. Failure-Class: none
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.
Six-second synthetic Chinese clips were classified as English at confidence 0.804–0.839, passed the 0.80 permission floor, and produced Latin phonetics through Parakeet. Require 0.90 audio-language confidence for probes shorter than ten seconds. Longer probes keep 0.80, and declared supported languages retain their existing route.
The CPU selector/intake and worker share the floor. Probe duration comes from actual decoded frames, not the provider response; the worker checks its validated unit duration so previously admitted short uncertain metadata also fails closed.
STT_PRERECORDED_SHORT_LID_GUARD_ENABLEDdefaults on; onlyfalserestores the previous floor on the affected CPU or worker runtime. This is independent of the existing language guard. No deploy, account mutation, or replay is part of this PR.The regression fixture records five synthetic clip hashes and their frozen LID decisions. Tests replay those decisions through prerecorded selection, intake freezing and the worker adapter, and check duration boundaries, declared/longer routes and rollback. These are deterministic policy regressions, not a new vendor replay or a general LID-accuracy claim.
Production cost coverage: the exported counters do not join probe duration and confidence to the selected route. The share of Parakeet-routed units with samples under ten seconds and confidence 0.80–0.90, and the resulting daily cost delta, are unmeasurable from current aggregate telemetry. No numeric cost or production misroute-rate claim is made. The policy change is limited to that short uncertain subset.
Validation: 107 focused backend tests passed via
backend/test.sh(audio-language and language-custody suites), andmake preflightpassed. Production/staging acceptance remains unrun; the next train must include the CPU changes and a separate worker image promotion before qualification.Failure-Class: FC-unknown-language-treated-as-model-capability