Repository navigation
fix(ci): impersonate a named Firebase signer for the pusher dev qualification probe - #13667
Conversation
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 3/5
- The codebase-wide grep guard in
backend/tests/unit/test_firebase_release_probe_token.pyis unmarked and missing frombackend/tests/slow_guardrail_manifest.txt, so the fast lane runs it only when this test file changes and workflow regressions can bypass it — mark the guard and add it to the manifest.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/tests/unit/test_firebase_release_probe_token.py">
<violation number="1" location="backend/tests/unit/test_firebase_release_probe_token.py:464">
P2: This new guard is a codebase-wide grep of every workflow file but is unmarked and absent from backend/tests/slow_guardrail_manifest.txt, so the fast lane runs it only on PRs that change this backend test file. A PR that edits only `.github/workflows/*` — the exact change this guard exists to police — will not select it, and the signer wiring can regress and merge unnoticed (the documented failure mode in the manifest header, cf. #12701). Mark it `@pytest.mark.slow` and add the file to `backend/tests/slow_guardrail_manifest.txt` so the unconditional slow-guardrail lane runs it.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| return violations | ||
|
|
||
|
|
||
| def test_every_workflow_probe_signer_argument_is_the_documented_variable() -> None: |
There was a problem hiding this comment.
P2: This new guard is a codebase-wide grep of every workflow file but is unmarked and absent from backend/tests/slow_guardrail_manifest.txt, so the fast lane runs it only on PRs that change this backend test file. A PR that edits only .github/workflows/* — the exact change this guard exists to police — will not select it, and the signer wiring can regress and merge unnoticed (the documented failure mode in the manifest header, cf. #12701). Mark it @pytest.mark.slow and add the file to backend/tests/slow_guardrail_manifest.txt so the unconditional slow-guardrail lane runs it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/tests/unit/test_firebase_release_probe_token.py, line 464:
<comment>This new guard is a codebase-wide grep of every workflow file but is unmarked and absent from backend/tests/slow_guardrail_manifest.txt, so the fast lane runs it only on PRs that change this backend test file. A PR that edits only `.github/workflows/*` — the exact change this guard exists to police — will not select it, and the signer wiring can regress and merge unnoticed (the documented failure mode in the manifest header, cf. #12701). Mark it `@pytest.mark.slow` and add the file to `backend/tests/slow_guardrail_manifest.txt` so the unconditional slow-guardrail lane runs it.</comment>
<file context>
@@ -409,3 +430,81 @@ def test_probe_action_stages_the_signer_key_as_transient_owner_only_material():
+ return violations
+
+
+def test_every_workflow_probe_signer_argument_is_the_documented_variable() -> None:
+ """Guards the wiring that unblocked the development Pusher lane.
+
</file context>
The development Pusher qualification lane has failed on every run since 2026-08-31: 7883c81 wired the semantic probe to sign its Firebase custom token as the lane's based-hardware-dev deploy identity while minting for --firebase-project based-hardware, which the token minter rejects fail-closed (signer/project_mismatch). Name the Firebase project's signer from vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT and impersonate it via IAM signJwt -- no key materialized in this backend image builder -- and fail closed in the minter when a named signer belongs to another project. Closes #13448. Co-authored-by: multica-agent <[email protected]>
1fb798b to
c8fc80a
Compare
…p GCP_SERVICE_ACCOUNT key staging (#14516) ## Failure-Class Failure-Class: none ## Summary Credential-rotation Phase C: makes the desktop-backend auto-dev release probe **JSON-free** — the last `secrets.GCP_SERVICE_ACCOUNT` consumption in the lane. The probe now signs Firebase custom tokens via IAM `signJwt` on the named signer (`vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` = `firebase-adminsdk-4z2mm@based-hardware`) instead of staging a base64 service-account key file in the runner. This is the Phase D gate item "desktop soak not JSON-free (probe B64 still staged)". ## Diff areas 1. `desktop_backend_auto_dev.yml`: delete the "Stage candidate probe signer" key-staging step; "Mint candidate probe identity" switches to `--signer-service-account "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT"` with a fail-closed empty-var check (env var sourced in the same step per the minter guard test); cleanup step drops the signer-file rm. 2. `check-desktop-backend-release-policy.py`: required fragments swap from key-staging markers to the named-signer contract (env mapping + flag + empty check). 3. `test_check_desktop_backend_release_policy.py`: fixtures updated; new negative guard asserting the workflow no longer references `secrets.GCP_SERVICE_ACCOUNT`. 4. `deploy-backend-stack/action.yml`: description/comments updated — desktop-backend moved to the named-signer path; `gcp_backend.yml`/`sync_ledger` still supply the credential (untouched behavior). ## Precedent The minter's `--signer-service-account` path is not new: #13559/#13667 landed it for the pusher dev lane (2026-09-13), green since. The IAM prerequisites already exist and are audit-verified: `FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` set in env `development` (2026-09-16T04:21:46Z) and `roles/iam.serviceAccountTokenCreator` for `omi-ci-deployer-dev` bound on `firebase-adminsdk-4z2mm@based-hardware` by david@ at 2026-09-16T04:21:44Z (resource-level, token-signing only — no prod data access). See KB evidence 2026-09-18-iam-grants-and-rows-2-3. ## Verification - `test_firebase_release_probe_token.py` 19 passed (incl. workflow-signer guard tests) - `test_check_desktop_backend_release_policy.py` 37 passed + 58 subtests - workflow grep: zero `secrets.GCP_SERVICE_ACCOUNT` / `FIREBASE_PROBE_SIGNER_B64` / `DESKTOP_BACKEND_PROBE_SIGNER_FILE` - local `make preflight` green ## Risk / rollback If the IAM grant or var were missing, "Mint candidate probe identity" fails closed **before** traffic routing — dev keeps serving the prior revision; `candidate_only=true` dispatches skip the probe entirely and stay green. Rollback = single revert (the grant is inert without the flag). ## Product invariants affected - INV-DATA-1 Preserved: this PR changes only how the development desktop-backend release probe **authenticates its custom-token signing** (IAM signJwt on a named prod-project Firebase SA instead of a staged key file). It alters no routing authority, no serving endpoint, no Firebase/Firestore project binding; the probe still authenticates against `FIREBASE_AUTH_PROJECT_ID=based-hardware` exactly as before and still targets the 0%-traffic dev candidate. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14516?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="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
What changed and why
The development Pusher qualification lane has failed on every run since 2026-08-31T06:42Z, freezing production Pusher on its 2026-08-31 image and stranding the #12663 custom-STT revert on the tier where listen finalization runs (#13448).
Root cause:
7883c816dbwired the stepProbe deployed development Pusher finalization semanticsto mint a Firebase token with--firebase-project based-hardwarewhile signing as this lane's own deploy identity (secrets.GCP_CREDENTIALS,project_id=based-hardware-dev).backend/scripts/firebase_release_probe_token.pyfails closed onsigner_credentials/project_mismatch(latest failing run: https://github.com/BasedHardware/omi/actions/runs/34491105872), so the gate has never passed — and production promotion requires a successfulpusher_dev_qualification_run_idwith no break-glass, so every Pusher release has been blocked since.Fix: sign via the key-free path the minter already supports. The step names the Firebase project's own signer and impersonates it through IAM
signJwt(--signer-service-account), fed fromvars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT— the same variabledeploy-backend-stackalready exposes asfirebase_probe_signer_service_account(gcp_backend.yml:409). No service-account key is materialized (the key-secret guard forbids one in this backend image builder), the step fails closed with an explicit message while the variable is unset, and the minter now also fails closed on the impersonation path (signer_service_account/project_mismatch) when the named signer is not@<firebase-project>.iam.gserviceaccount.com— the same pairing the credentials-file path already enforced.Closes #13448.
Why #13445 is not reused
#13445 was closed at maintainer request; its diagnosis stands, its implementation is not carried over. Its guard accepted any signer env not fed from
secrets.GCP_CREDENTIALS, so an unrelatedsecrets.GCP_SERVICE_ACCOUNTreference made it pass — it validated a coincidental secret name, not the value that actually feeds the signer. The contract test added here pins the dataflow instead: any--signer-service-account "$ENV"argument in any workflow (globbing*.ymland*.yaml) must resolve, inside the same step, tovars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT; every other source — including an unrelatedGCP_SERVICE_ACCOUNT— is rejected. #13445's new failure-class registry entry and checks-manifest trigger widening are also not carried over;FC-release-probe-signer-identityalready covers this class.Product invariants affected
Unchanged by this PR.
--firebase-project based-hardwareis kept exactly as it was: the development backend already authenticates against production Firebase, and this PR does not retarget any protected authority, Firebase project, or serving endpoint. The only change is which principal signs the probe's custom token — from the development deploy identity, which can never sign for that project, to the based-hardware signer named byvars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT.How it was verified
pytest tests/unit/test_firebase_release_probe_token.py tests/unit/test_pusher_deployment_control_workflow.py tests/unit/test_preflight_cloud_run_deploy.py tests/unit/test_pusher_auto_deploy_paths.py tests/unit/test_desktop_release_scripts.py— 71 passed.7883c816dbshipped), the new/extended contract tests fail (test_dev_qualification_runs_real_deployed_semantic_probe_before_recording_pass,test_dev_probe_impersonates_a_named_firebase_project_signer); with the fix they pass.make preflight(local lane) passes.main); the first post-merge run is the real test.Tests
test_dev_qualification_runs_real_deployed_semantic_probe_before_recording_passno longer pins the broken deploy-identity signer.test_dev_probe_impersonates_a_named_firebase_project_signer— regression test for this bug: named-signer wiring, unset-variable fail-closed, no credentials file, no key secret anywhere in the workflow.test_explicit_signer_from_a_foreign_project_fails_closed_before_signing— the minter rejects a foreign-project signer before any IAM call.test_every_workflow_probe_signer_argument_is_the_documented_variableandtest_signer_guard_rejects_the_deploy_identity_and_coincidental_secret_names— repo-wide signer guard covering both extensions, including the fix(ci): sign the pusher dev probe with the Firebase auth project's signer #13445 negative cases.Failure class (fixes)
Failure-Class: FC-release-probe-signer-identity
New guards
test_every_workflow_probe_signer_argument_is_the_documented_variable(with the pusher-specific regression test above) would have caught7883c816dbon the day it landed: the 2026-08-31..2026-09-10 pusher freeze is the incident. It is not a shared primitive because the contract is specific tofirebase_release_probe_token.py's fail-closed pairing of the signer with--firebase-project— the classFC-release-probe-signer-identitywhose canonical prevention artifact this test file already is.What still needs a human (this PR does none of it)
FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT(repository ordevelopmentenvironment) to a based-hardware signer, e.g.[email protected]. It is currently unset; the workflow fails closed with an explicit message until it exists.roles/iam.serviceAccountTokenCreatoron that signer to this lane's deploy identity (theGCP_CREDENTIALSservice account of thedevelopmentenvironment). That service account currently has no IAM bindings. No IAM or production change is made by this PR.gcp_backend_pusher_auto_deployrun onmainis the real qualification; promoting prod Pusher (gcp_backend_pusher.yml) is then a human-triggered run citing the new qualification run id. Merge is not ship: this PR unblocks the lane, it does not deploy prod.The
CONVERSATION_NOTES_V2_ENABLEDdivergence onprod-omi-pusheris intentionally untouched (product behavior, out of scope).