Repository navigation
ci(listen-helm): roll the listen-edge chart by admitted digest (plan D D2 wiring; needs David's .github naming) - #23100
Conversation
…D D2 wiring) Deploy wiring for the listen-edge GKE chart (#23088). NOT merged until David names the .github change (same pattern as P8/B2); nothing deploys by itself. - .github/workflows/gcp_backend_listen_helm.yml: new workflow_dispatch input listen_edge_image_digest (blank = the listen-edge release is untouched). When set: login to GCR, read the image config (docker buildx imagetools inspect, as deploy-backend-stack does for service_images), admit it through backend/scripts/admit_listen_edge_image.py, materialize the prod LISTEN_EDGE_PRIVATE_VALUES_YAML privateEnv file with the same hygiene as LISTEN_PRIVATE_VALUES_YAML, and after backend-listen is verified (and the prod NEG reconcile) helm-upgrade backend/charts/listen-edge by digest with a 600 s rollout wait, status report, pod listing and private-file cleanup. mode=rollback and the push-to-main auto path do not touch listen-edge. - backend/scripts/admit_listen_edge_image.py: the digest must be exactly gcr.io/<project>/listen-edge@sha256:<64 hex> for this project, and the image config must carry the checked-out SHA as both the org.opencontainers.image.revision label and OMI_RELEASE_SHA (how the build-only train stamps it). Refused before any registry read otherwise. - tests/unit/test_admit_listen_edge_image.py: 19 cases (blank reads nothing; tag/other project/other image/short or uppercase digest/pair shape/lists refused without a registry read; other SHA, label without matching env, unlabelled, short admitted SHA, registry failure refused; main writes the GitHub env file and exit codes). - config/deployment-setting-classification.json: LISTEN_EDGE_PRIVATE_VALUES_YAML is a secret. - .github/ci-budget.yaml: refreshed for the new input; per the B2 precedent the workflow rationale records the change and both jobs take a budget bump (helm-upgrade 5 -> 15 min for the admitted-digest edge rollout wait, neg-coverage-exporter 10 -> 11 recording the trigger change). No PR runs. 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.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c67bd60c90
ℹ️ 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".
…checkout contains Review round 1 (GLM, SHIP with one P2): prod checks out fresh main, so requiring the image's revision label to equal the checked-out SHA made the documented rollback-by-digest and chart-only re-pass paths dead once main moved past the build-only SHA. Apply the listen image_tag rule to the digest instead: the revision label must equal the image's OMI_RELEASE_SHA stamp and be a commit in this repository that the checked-out source contains (git cat-file + merge-base --is-ancestor, injectable for tests). The admission also outputs LISTEN_EDGE_IMAGE_REVISION, refuses a null image config (multi-arch index) with a clean error instead of an AttributeError, and the input description, step comments and runbook say the same thing. ci-budget.yaml re-refreshed for the description. Tests: 23 (ancestor admitted, foreign commit refused after the registry read, label/env mismatch refused before the ancestry check, null config refused).
|
GLM review round 1 (lane p41-d2, P2 — fixed in 4a7a025. Prod checks out fresh Minor — fixed in 4a7a025. A null image config (multi-arch index) is now a clean Minor — rebutted (kept). Minor — noted, unchanged. Development never reads Round 2 reviews the delta |
|
Monitor run (context c50705659e) — review-triage update, no code changes needed:
|
Address the Codex P2: the D2 wiring deploys listen-edge as a GKE service, but runtime_images.json listed it only under native_images with no services entry, so role->image->service contract checks kept treating the production workload as undeployed. - services.listen-edge: gke/realtime, native listen-edge image, the listen workflow as deployer, image_built_elsewhere digest-admission reason (mirrors messaging-maintenance). - role_map_errors: native_images join the role->image->service map — a native entry may be a service image/current_image when its own role matches; a native current_image requires an image_built_elsewhere reason (no workflow builds a native image in its deploy); a native image serving no declared service is now rejected. - tests: completeness assertion covers native_images; three rejection variants (unregistered native service, wrong role, missing reason).
|
Monitor run (context 3cc52446be) — addressed the Codex P2 in Register listen-edge as a deployed runtime service (commit
Verified: |
Resolve gcp_backend_listen_helm.yml: keep both new dispatch inputs — listen_edge_image_digest (plan D D2, this lane) and break_glass_lock (B5 prod-train lock, from main). Resolve ci-budget.yaml rationales for the two listen-helm jobs and the workflow entry to record both inputs; keep the D2 budget bumps (11/15) and main's expected_runs_per_day.
…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).
…e gateway and pusher deploys, workers digest for the maintenance job (#23090) ## Summary The **code half** of the plan B B3 role-image cutover (`backend/docs/runbooks/role-image-cutover.md`, plan B §9f.4). **Merging changes nothing any service deploys:** every new input defaults blank, the fat builds stay the default path, and no deploy, publish run or registry write happens here. The cutover trains (first build-only publish, then gateway → pusher → maintenance job) stay with the lead. 1. **`gcp_llm_gateway.yml` input `gateway_image_digest`** (blank = build and ship `llm-gateway:<sha7>` exactly as today). With a `backend-gateway` digest from a build-only run of the admitted SHA, the run skips its own build, deploys `gcr.io/<project>/backend-gateway@<digest>` through the already-digest-aware `deploy-llm-gateway.sh` (`image.repository` + `image.digest`, B2), proves the rolled-out Deployment template runs that exact reference, and runs the Cloud Run VPC probe and the smoke pod from the same image. 2. **`gcp_backend_pusher.yml` input `pusher_role_image_digest`** (development only; production rejects it). A `backend-pusher` digest skips the fat build and deploys through the unchanged live-capacity gate, Helm release and receipts. The **production qualification flow now admits `backend-pusher`**: `verify_pusher_promotion_evidence.py --expected-repository` takes the comma-separated pair `gcr.io/based-hardware-dev/pusher,gcr.io/based-hardware-dev/backend-pusher`, the receipt must name the repository the evidence qualified, and the promotion keeps that repository name (`gcr.io/based-hardware/backend-pusher@<digest>`). 3. **New `backend/scripts/admit_role_image.py`**: single-service admission for the standalone deploys. The repository is never caller-supplied; it is derived from `runtime_images.json` (`services.<name>.image`), and the digest must be `sha256:<64 hex>`, labelled `org.opencontainers.image.revision=<deployed SHA>` and carry that role's `OMI_ROLE` — the same properties `resolve_service_images.py` enforces for the stack train. Anything else fails before any mutation. 4. **`messaging_operations.py desired_job`** admits exactly `gcr.io/based-hardware/backend@sha256:…` (today) or `gcr.io/based-hardware/backend-workers@sha256:…` instead of any `based-hardware` repository; `maintenance-job.json` is unchanged (the image is still substituted at reconcile time). 5. **Runbook** B3 checklist now carries the verified dispatch inputs, the maintenance-job commands, and the one remaining pusher step (below). ## `.github` naming — recorded David named the B2 **build-job** change on 2026-10-21 ("do it", `briefs/p8-arch-b2-ci.md`). **He named these deploy-workflow input edits on 2026-10-22 ~02:20Z: "You can do those workflow PRs and merge them"** (recorded in the P49 lead brief, 10-22 02:25Z, for both this PR and #23100). Merge authorization is complete; the lead executes the merge after TRAIN Q DONE (Cloud Run → listen → pusher) per the P49 plan. | Workflow | Edit | Why it is needed | |---|---|---| | `.github/workflows/gcp_llm_gateway.yml` | New `workflow_dispatch` input `gateway_image_digest` (default `''`); new step "Admit role-image digest opt-in" (runs `backend/scripts/admit_role_image.py --service llm-gateway`); "Build and Push Docker image" gated on the input being blank; deploy step passes `IMAGE_REPOSITORY`/`IMAGE_DIGEST` to `deploy-llm-gateway.sh` and verifies the Deployment template image; probe and smoke `--image` fall back to the role reference | Production gateway ships only through this workflow, which still builds its own `llm-gateway` image; the B3 cutover (gateway first) cannot deploy the published `backend-gateway` digest without an input that admits it | | `.github/workflows/gcp_backend_pusher.yml` | New `workflow_dispatch` input `pusher_role_image_digest` (default `''`, development only, rejected for prod in "Validate Environment Input"); new step "Admit role-image digest opt-in" (`--service pusher --prefix PUSHER_IMAGE`); fat build and "Resolve immutable development Pusher image" gated on the input being blank; the prod qualification step reads the evidence's repository, requires it to be `pusher` or `backend-pusher`, passes the allowlist to the verifier and promotes under the same repository name | Pusher is second in the ruled cutover order; its prod path only deploys dev-qualified digests, so the qualification flow must accept the `backend-pusher` image, and development needs a way to run the role image before that | Note: both pusher workflows and `verify_pusher_promotion_evidence.py` are promotion-contract files (`CONTRACT_FILES`), so this PR changes `contract_fingerprint()`: dev qualification runs older than the merge stop promoting. Merging also triggers `gcp_backend_pusher_auto_deploy.yml` (development) because `gcp_backend_pusher.yml` is in its path filter; that run produces the fresh qualification. Either effect is development-only. ## Still needed before the production pusher cutover (not in this PR) Qualification evidence is produced only by `gcp_backend_pusher_auto_deploy.yml`, which builds the fat `pusher` image. For a `backend-pusher` digest to be promotable, that workflow has to deploy `backend-pusher` — another `.github` change for David to name — then one green run on the cutover SHA supplies `pusher_image_digest` + `pusher_dev_qualification_run_id`. The gateway and maintenance-job cutovers need nothing beyond this PR plus the lead's build-only publish run. ## Product invariants affected - INV-DATA-1 Both workflows keep their production routing authorities untouched: environments, projects, WIF providers, registries and service names are unchanged; the new inputs only select which already-published image of the same project and admitted SHA a deploy runs, and a blank input is today's behaviour. ## Review (GLM family, `infra/rollout/bin/review.sh`, rounds 1–2) Round 1 (full, head `0dfe7ea3e6`): **SHIP** — no P0/P1; 2 P2, 3 minor. Round 2 (delta, head `6ade66c99f`): **SHIP**. Verdicts and full findings: `/Volumes/Ephemeral/scratch/two-lane-lead/review-23090-r1.md` / `-r2.md` (lane-local). - P2 stale runbook line (`messaging-channels.md` offered the Artifact Registry digest form `desired_job` now rejects) — **fixed** in `6ade66c99f`. - P2 "`backend-pusher` prod lane unreachable end-to-end" — **by design and disclosed** above: the auto-deploy workflow still qualifies the fat image; this PR makes the flow accept `backend-pusher` so the later named change can complete the cutover. - Minor: empty-`image_repository` case guard, `KeyError` on an incomplete registry entry, inline interpolation of the digest inputs — **all fixed** in `6ade66c99f` (inputs now reach the shell through `env:`). - Open follow-up (round-2 P2, defense-in-depth, same trust boundary as the pre-existing `break_glass_reason` pattern): `Validate Environment Input` and the break-glass steps still interpolate free-text dispatch inputs into bash. A follow-up should convert every free-text input in these two workflows to `env:`-passing. ## Verification | Layer | Command | Result | |---|---|---| | Unit (backend, `backend/test.sh` under `omi-heavy`, `nice -n 19`) | run 1: `test_admit_role_image.py`, `test_resolve_service_images.py`, `test_messaging_operations.py`, `test_verify_pusher_promotion_evidence.py`, `test_runtime_image_contracts.py`; after the delta: `test_admit_role_image.py`, `test_pusher_deployment_control_workflow.py`, `test_llm_gateway_deploy_contract.py`, `test_workflow_contracts.py`, `test_messaging_operations.py` | 184/184, then 188/188; 0 failed | | Static contract | `backend/scripts/runtime_image_contracts.py check` | passed, 19 registered images (source closures, workflow smoke markers, role map) | | Formatting | `black --check -l 120 --skip-string-normalization` on the changed Python files | clean | | CI | full PR matrix on `6ade66c99f`: `python role images` ✓, `listen-edge image` ✓, Static Contracts ✓, Formatting ✓, Hygiene ✓, Backend unit shards 1–6 ✓, PR Metadata Preflight ✓, CodeQL ✓, Analyze ✓ | 36 pass, 0 fail | | Image size / cold start on the private base | lead's first build-only publish run | pending (not this lane) | Workflow wiring is asserted by `test_admit_role_image.py` (parses both YAMLs: blank defaults, step conditions, env-passed inputs, allowlist, empty-repository guard, promotion repository derivation). No deploy was run and no image was built or pushed from this lane.
What changed and why
Plan D D2 deploy wiring (lane
p41-d2), stacked on #23088 (the chart). It lets the lead roll thelisten-edgeGKE chart through the existing listen workflow by an admitted image digest from the build-only train. Nothing deploys by merging this, and the.githubchange is named by David (see the table below)..github/workflows/gcp_backend_listen_helm.yml(existing workflow; no new.githubfile): newworkflow_dispatchinputlisten_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.pyreads the image config and refuses anything that is notgcr.io/<this project>/listen-edge@sha256:…whose revision label (org.opencontainers.image.revision) equals itsOMI_RELEASE_SHAstamp and is a commit in this repository that the checked-out source contains (the listenimage_tagancestor-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 materializesLISTEN_EDGE_PRIVATE_VALUES_YAML(privateEnv, e.g. the sharedEDGE_SHADOW_TOKEN) with the same hygiene asLISTEN_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=rollbacktouches the listen release only (edge rollback is by digest orhelm 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_YAMLis 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 arecloud-run-only(proddeploy_targets=allis 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'sbuild-role-imagespublish)..githubnaming — recorded.github/workflows/gcp_backend_listen_helm.ymllisten_edge_image_digest; three admission steps (GCR login, buildx, digest admit); prod private-values materialize/cleanup; one Helm upgrade step forbackend/charts/listen-edge+ pod listing, all gated on the inputprodenvironment, WIF deployer) and reads a new protected-environment secret nameLISTEN_EDGE_PRIVATE_VALUES_YAML<env>-omi-listen-edgerelease in<env>-omi-backendNamed 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.shwithALLOW_WORKFLOW_EDIT=1and 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, branchlane/p41-d2-wiring, basemain(stacked on #23088, now merged as2f43fb4f83). All local commands underbin/omi-heavy run -- nice -n 19.actionlint .github/workflows/gcp_backend_listen_helm.yml: clean. Layer: workflow lint.backend/scripts/check_workflow_contracts.pyon 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.4a7a025178by the ancestor rule above; round 2 reviews that delta.2e45f50b4e4, lane P49): resolvedgcp_backend_listen_helm.ymlby keeping both new dispatch inputs —listen_edge_image_digest(D2) and main's B5break_glass_lock— and the threeci-budget.yamlrationale conflicts (each records both inputs; D2 budget bumps 11/15 kept, main'sexpected_runs_per_daykept). Re-verified undernice -n 19: actionlint clean;check_ci_budget.py --base origin/main,check_deployment_secret_boundary.py --base origin/main,check_workflow_contracts.pyall passed; pytesttest_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.b5fff377503): merging main pulled fix(stt): require stronger language evidence for short probes #23176'stest_batch_audio_language.pyinto this PR's shard selection, wheretest_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--allshards 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, noslowmove.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 inspectagainst GCR is the same calldeploy-backend-stackalready makes forservice_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,mainwrites the GitHub env file; blank input reads nothing. Error paths: tag instead of digest, other project, other image, short/uppercase digest,service_imagespair shape and lists are refused before any registry read; a digest built from a commit the checkout does not contain, a label without matchingOMI_RELEASE_SHA(refused before the ancestry check), an unlabelled/short/unknownrevision, a null image config, a short checked-out SHA and a registry read failure are refused;mainexits 1 withERROR.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