Skip to content

ci(desktop-backend): sign dev release probe via IAM named signer, drop GCP_SERVICE_ACCOUNT key staging - #14516

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:ci/desktop-probe-named-signer
Sep 18, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:ci/desktop-probe-named-signer

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

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.

Review in cubic

@Git-on-my-level
Git-on-my-level merged commit 9a477a5 into BasedHardware:main Sep 18, 2026
40 checks passed
Git-on-my-level added a commit that referenced this pull request Sep 18, 2026
…ate failures (mint-stage suspect) (#14520)

## Failure-Class
None — this is a revert of #14509, not a fix commit (no fix: prefix; see
AGENTS.md failure-class protocol).

## Summary
Reverts #14509: `gcp_backend_auto_dev` returns to the JSON bridge secret
after three consecutive bake failures at the candidate gate
(`what_matters_now` FAIL, sub-second gate duration, others NOT_RUN).
Committed per the PR's own rollback contract. Traffic safety held all
three attempts: candidates stayed 0%, serving never moved
(`backend-8a5c388-35307543774-1`=100%).

## Evidence (three attempts)
1. Attempt 1 (35309620748#1, 05:35Z): gate FAIL 981ms after probe
invocation.
2. Attempt 2 (#2, 05:56Z): identical FAIL.
3. Attempt 3 (#3, 06:54Z): identical FAIL — **after**
`roles/run.invoker` (verified live) AND a self
`serviceAccountTokenCreator` grant on the deployer.
Manual control, same window: coordinator replayed the exact probe
(deployer identity token via impersonation, audience = service URL,
ADMIN_KEY+uid auth, X-Serverless-Authorization) against the candidate
URL → **HTTP 200** at 05:38Z and again post-attempt-3. Discriminator:
manual mint uses human impersonation; the CI mint (`gcloud auth
print-identity-token` with no impersonation flag) runs in a
WIF-federated session — the remaining untested variable. The acceptance
runner intentionally swallows the failure stage/HTTP status (981ms gate
≈ mint-stage failure, not a service round-trip), so the next slice needs
the mint step instrumented or a one-off diagnostic run before
re-landing.

## What this revert does NOT do
- Does not touch #14516 (JSON-free desktop-backend probe — baked green
on main).
- Does not change any IAM grant; the deployer's role set stays as
audited.
- Auto-dev auth returns to `secrets.GCP_CREDENTIALS` (bridge key
`a3dd0875`), the exact pre-#14509 state.

## Next slice (before any re-land)
1. Add a bounded diagnostic to the mint step (or a dispatch-only probe
workflow) that prints the mint subprocess return code class + HTTP
status of the candidate call — no token material.
2. Reproduce the federated mint locally (`gcloud auth login
--update-adc` federated → `print-identity-token` without impersonation)
or via a one-off CI run with the diagnostic.
3. Re-land #14509 content once the mint path is proven green in CI.

## Product invariants affected

- INV-DATA-1

Preserved: this revert only changes the deploy authentication identity
of the development lane back to the pre-#14509 JSON bridge (no routing
authority, endpoint, or project binding changes; `based-hardware-dev`
target unchanged; fail-closed traffic gate unchanged).


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/14520?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. -->
Git-on-my-level added a commit that referenced this pull request Sep 18, 2026
) (#14521)

## Failure-Class
None — docs-only follow-up to #14516 (agentic-instructions contract
line), no fix commit.

## Summary
Completes #14516's spec (its DIFF 4): rewrites the `.github/AGENTS.md`
development desktop-backend acceptance line from the retired key-staging
contract to the live named-signer contract that #14516 landed. The old
line still told agents to stage `GCP_SERVICE_ACCOUNT` in a mode-0600
runner file — contradicting both the workflow and the release-policy
checker on `main`.

New contract line: dev release probes sign via IAM `signJwt` on
`vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` (a
`@based-hardware.iam.gserviceaccount.com` SA matching
`FIREBASE_AUTH_PROJECT_ID`); the deploy identity needs
`roles/iam.serviceAccountTokenCreator` on it; no service-account keys
staged in runners.

## Product invariants affected

- INV-DATA-1

Preserved: documentation-only change to agent instructions; no workflow,
script, routing, endpoint, or project-binding behavior is touched.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/14521?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. -->
Git-on-my-level added a commit that referenced this pull request Sep 18, 2026
… diagnostics) (#14541)

## Failure-Class
Failure-Class: FC-fixture-mock-signature-drift

## Summary
Reverts #14509: `gcp_backend_auto_dev` returns to the JSON bridge secret
after three consecutive bake failures at the candidate gate
(`what_matters_now` FAIL, sub-second gate duration, others NOT_RUN).
Committed per the PR's own rollback contract. Traffic safety held all
three attempts: candidates stayed 0%, serving never moved
(`backend-8a5c388-35307543774-1`=100%).

## Evidence (three attempts)
1. Attempt 1 (35309620748#1, 05:35Z): gate FAIL 981ms after probe
invocation.
2. Attempt 2 (#2, 05:56Z): identical FAIL.
3. Attempt 3 (#3, 06:54Z): identical FAIL — **after**
`roles/run.invoker` (verified live) AND a self
`serviceAccountTokenCreator` grant on the deployer.
Manual control, same window: coordinator replayed the exact probe
(deployer identity token via impersonation, audience = service URL,
ADMIN_KEY+uid auth, X-Serverless-Authorization) against the candidate
URL → **HTTP 200** at 05:38Z and again post-attempt-3. Discriminator:
manual mint uses human impersonation; the CI mint (`gcloud auth
print-identity-token` with no impersonation flag) runs in a
WIF-federated session — the remaining untested variable. The acceptance
runner intentionally swallows the failure stage/HTTP status (981ms gate
≈ mint-stage failure, not a service round-trip), so the next slice needs
the mint step instrumented or a one-off diagnostic run before
re-landing.

## What this revert does NOT do
- Does not touch #14516 (JSON-free desktop-backend probe — baked green
on main).
- Does not change any IAM grant; the deployer's role set stays as
audited.
- Auto-dev auth returns to `secrets.GCP_CREDENTIALS` (bridge key
`a3dd0875`), the exact pre-#14509 state.

## Next slice (before any re-land)
1. Add a bounded diagnostic to the mint step (or a dispatch-only probe
workflow) that prints the mint subprocess return code class + HTTP
status of the candidate call — no token material.
2. Reproduce the federated mint locally (`gcloud auth login
--update-adc` federated → `print-identity-token` without impersonation)
or via a one-off CI run with the diagnostic.
3. Re-land #14509 content once the mint path is proven green in CI.

## Product invariants affected

- INV-DATA-1

Preserved: this revert only changes the deploy authentication identity
of the development lane back to the pre-#14509 JSON bridge (no routing
authority, endpoint, or project binding changes; `based-hardware-dev`
target unchanged; fail-closed traffic gate unchanged).

## v2 note (diagnostics landed first)

This re-land follows #14525: the candidate acceptance runner now records
failure-class diagnostics (mint rc/class, probe HTTP status) in the
acceptance artifact. If this re-land's bake fails again, the artifact
names the exact stage and class — no more blind attempts. Rollback
contract unchanged: gate FAIL keeps traffic on the prior revision.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/14541?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. -->
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