Skip to content

fix(ci): sign the dev backend release probe for its Firebase project - #12264

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:fix/dev-probe-signer
Aug 26, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:fix/dev-probe-signer

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Failure-Class: FC-release-probe-signer-identity

Product invariants affected

  • INV-DATA-1

This change does not move any Firebase or Firestore project. firebase_auth_project_id
stays based-hardware on every lane; only how the probe signs changes.

What is broken

Every manual development backend deploy fails deterministically at the
Gate backend candidate on known audio step:

{"suite": "omi_firebase_release_probe_token", "stage": "custom_token_signing",
 "error_class": "permission_denied", "status": "FAIL"}

Reproduced today on runs 32992789266 and 32994463647 (both af8a490afc), and at
07:29:24Z on the unrelated commit d5c6d75 — so this is not a regression from
today's merges.

The blast radius is quiet and bad: candidate revisions are deployed --no-traffic,
the gate fails before promotion, the tag is torn down, and dev keeps serving the old
revision. Development has been silently refusing new deploys — dev is still on
0300eb2, which is why PR #12258's rate-limit change never reached it.

Root cause

firebase_auth_project_id: based-hardware is correct and deliberate: the
development backend verifies user tokens against the production Firebase project.
firebase_release_probe_token.py says so, and _validate_firebase_id_token_claims
enforces aud == based-hardware. So this is not a wrong-project string to swap.

The defect is the signer, introduced by 224b2c5 ("fix(dev): harden realtime
provider proof", 2026-07-14). That commit split the single project_id input into
project_id (Secret Manager + deploy identity) and firebase_auth_project_id
(token audience). Before the split both were based-hardware-dev, so the deploy
identity signed for its own project. After the split the audience was corrected
but the signer was not: the probe still calls IAM signJwt as the
based-hardware-dev deploy identity, and Identity Toolkit only accepts a custom
token whose signer is authorized for the Firebase project — hence 403
permission_denied at custom_token_signing. 404eb82 carried it verbatim into
the shared composite action.

#12019 diagnosed this correctly and plumbed an escape hatch,
firebase_probe_signer_service_account ← vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT.
That variable has never existed (it is absent from both repo variables and the
development environment), and using it would also require a
roles/iam.serviceAccountTokenCreator grant. The hatch stayed empty and the lane
stayed dead.

The fix

Adopt the resolution that already works for the identical split, one workflow over.
.github/workflows/desktop_backend_auto_dev.yml deploys into based-hardware-dev
with FIREBASE_AUTH_PROJECT_ID: based-hardware and signs locally with the
Firebase project's own key: it stages the environment-owned GCP_SERVICE_ACCOUNT
secret in a mode-0600 runner file and passes --signer-credentials-file. That lane
is green today (run 32999384549), and .github/AGENTS.md:23 prescribes exactly this
shape.

firebase_release_probe_token.py::_read_signer_credentials already rejects a signer
whose project_id does not match firebase_auth_project_id, so the credential
cannot silently drift.

No IAM change is required — local signing needs no serviceAccountTokenCreator
grant. Secret Manager access was never the problem: secret_access succeeded in the
failing runs; the failure was at the later custom_token_signing stage.

The named-signer input is left in place and is only consulted when no credential is
supplied, so nothing that sets it changes behaviour.

sync_ledger_fence_cutover.yml carries the same split in its development lane and is
wired the same way. Its production lane deploys into based-hardware and keeps
signing with its active identity, so production is byte-identical there.

Proof

  • backend/tests/unit/test_firebase_release_probe_token.py — the failure class's
    existing canonical_prevention_artifact — gains two tests: the development deploy
    lane must supply a Firebase-project signer, and the probe action must stage that key
    as transient, owner-only material that does not outlive the probe.
  • All 36 selected preflight checks pass locally.
  • The real proof is the next development deploy: the gate reaching PASS and traffic
    actually shifting.

🤖 Generated with Claude Code

Review in cubic

The known-audio gate authenticates against the production Firebase project
(based-hardware) because the development backend verifies user tokens there.
Since 224b2c5 split project_id from firebase_auth_project_id, the gate
corrected the token *audience* but kept signing with the development deploy
identity, which Identity Toolkit will not accept for another project. Every
manual development backend deploy has failed at
custom_token_signing/permission_denied since then, so development has been
silently refusing new deploys: candidates were built --no-traffic and never
promoted.

BasedHardware#12019 plumbed an escape hatch, firebase_probe_signer_service_account, but the
variable it reads has never been set and needs an IAM grant to be usable.

Sign locally with the Firebase project's own key instead. That is what
desktop_backend_auto_dev.yml already does for the identical project split, and
what .github/AGENTS.md prescribes: stage the environment-owned
GCP_SERVICE_ACCOUNT in a mode-0600 runner file, let the token minter reject
signer-project drift before the key is used, and delete the key after the probe.
No IAM change is required. The named-signer input stays available and is only
consulted when no credential is supplied.

sync_ledger_fence_cutover.yml carries the same split in its development lane and
is wired the same way; its production lane deploys into based-hardware and keeps
signing with its active identity.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit d06e220 into BasedHardware:main Aug 26, 2026
31 of 32 checks passed
Git-on-my-level added a commit that referenced this pull request Aug 27, 2026
…12274)

The manual development backend deploy ran its post-promotion smoke against
https://api.omi.dev, which has never resolved: the omi.dev zone exists but the
api record is NXDOMAIN, so smoke_what_matters_now.py could not reach anything
and failed with "could not reach the deployed backend". That failed the deploy
after traffic had already shifted and triggered the traffic restore, rolling the
promotion back.

Development's real public API host is api.omiapi.com, which matches the rest of
the development domain family (parakeet.omiapi.com, nllb.omiapi.com,
pusher.omiapi.com in backend/deploy/runtime_env/dev.overlay.yaml) exactly as
production uses the omi.me family. It serves /ready 200 today.

Making api.omi.dev real was rejected: the codebase already uses it as the
canonical fake hostname in mobile production-routing tests, so giving it a live
record would undermine those fixtures.

This defect was introduced by 933fdf7 on the same day as the probe-signer
defect fixed in #12264, and stayed invisible because the probe failed first.
Run 33008079463 is the first development deploy to reach this step.

The step is guarded to the manual development lane; the production smoke keeps
its own api.omi.me path untouched.

Co-authored-by: Claude Fable 5 <[email protected]>
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