Skip to content

fix(pusher): bind the promotion contract to Pusher's runtime env slice, not every flag - #22924

Merged
Git-on-my-level merged 2 commits into
mainfrom
fix/pusher-promotion-contract-scope
Oct 20, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
fix/pusher-promotion-contract-scope

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Prod Pusher promotion run 39433983369 (main 11f97372) failed with qualification evidence contract does not match the current promotion contract. The selected dev qualification, run 39423577397, ran on 506592ee. Between those two commits only one contract input changed: flag ruling #22831 (11f97372) removed LIVE_SPEAKER_SPAN_RESOLUTION from backend/deploy/runtime_env{.yaml,/_base.yaml,/dev.overlay.yaml,/prod.overlay.yaml}. Those four files were hashed byte-for-byte into contract_sha256. As a result, any flag ruling for any service invalidated every dev qualification, and prod Pusher could promote only if it was dispatched before the next flag PR merged. Main receives several flag PRs a day, and dev Pusher was red from about 14:30 to 17:15 UTC on 10-20, so prod Pusher has not deployed since before #22839.

What changed:

  • The contract now hashes the promotion scripts and workflows (unchanged list), plus, from the composed runtime_env.yaml, only environments.{dev,prod}.gke.pusher, the shared backend ConfigMap gke.config_map (the prod job writes it before Helm and the Pusher pod envFroms it), and the per-environment project and region scalars. A real Pusher env change still invalidates the evidence; another service's flag ruling no longer does. The prod workflow already re-validates the prod runtime env at the checked-out main before it publishes, and the Pusher image source closure is still diffed separately.
  • pusher_release_receipt.py (the dev writer) imports contract_fingerprint from verify_pusher_promotion_evidence.py (the prod checker). Before this change each file kept its own copy of the file list.
  • The prod selection step runs pip install pyyaml before the verifier, because the projection parses YAML.
  • The mismatch error now says what to do: select a dev run from the current main.

Review

Grok review: no blockers. Both should-fixes are addressed in f145eeb5: gke.config_map is now hashed, and the tests assert contract_fingerprint() itself, including a ConfigMap-change case. For the nit, only an immutable digest is cached now. Residual risks Grok noted, unchanged from before this PR: GitHub-var values for source: environment keys were never hashed, and pip install pyyaml is unpinned (a parser change fails closed on hash mismatch).

Lane / contract

Lane pusher-d0b (10-20 swarm P5 Part A); owner sign-offs for edits to other lanes' files: none

Product invariants affected

  • INV-DATA-1: path match only (.github/workflows/gcp_backend_pusher.yml). The only workflow edit is a pip install pyyaml line in the prod selection step.
    This change does not alter the Firebase/Firestore project or serving endpoints.

Verification

  • backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST = test_verify_pusher_promotion_evidence.py, test_pusher_auto_deploy_paths.py, test_pusher_deployment_control_workflow.py: 63 passed, including the fast-unit CPU guard. Layer: unit.
  • New tests:
    • test_dev_qualification_recorder_output_satisfies_the_prod_promotion_contract: the qualification JSON from record_qualification, which the dev workflow writes, passes the prod validate() with no errors.
    • Unrelated listen or Cloud Run flag flips leave the projection unchanged.
    • A dev or prod Pusher env flip changes the projection.
    • The real manifest yields a dev/prod Pusher projection.
  • Both scripts' CLIs import cleanly when invoked by path, as the workflows do.
  • Not run: a live dev qualification or prod promotion. Merging this changes contract files, so the dev auto-deploy runs again on the merge SHA, and that run is the one to promote.

Rollback

Revert this PR. The old byte-for-byte contract comes back, and dev evidence recorded under the new fingerprint will then fail prod until dev re-qualifies.

Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage

🤖 Generated with Claude Code

…e, not every flag

Prod Pusher promotion 39433983369 (main 11f9737) failed with "qualification
evidence contract does not match the current promotion contract". The dev
qualification 39423577397 ran on 506592e; between the two, flag ruling #22831
edited backend/deploy/runtime_env{.yaml,/_base,/dev,/prod overlay}, which were
hashed byte-for-byte into contract_sha256. Every flag ruling for any service
therefore invalidated every dev qualification, and prod Pusher could promote
only if dispatched before the next flag PR landed on main.

The contract now hashes the promotion scripts and workflows as before, plus
only environments.{dev,prod}.gke.pusher and the per-environment project/region
scalars from the composed runtime_env.yaml. The receipt writer imports the
verifier's contract_fingerprint so the two cannot drift apart. The prod
selection step installs PyYAML before running the verifier.

Tests: the recorder's qualification output passes the prod verifier; an
unrelated listen/Cloud Run flag change keeps the projection; a dev or prod
Pusher env change breaks it.

Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T19:54:55.110178Z f145eeb New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ba581549b

ℹ️ 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".

Comment on lines +92 to +95
projection[name] = {
"pusher": gke["pusher"],
**{key: environment.get(key) for key in RUNTIME_ENV_SCALAR_KEYS},
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include the shared ConfigMap in the Pusher projection

When environments.dev/prod.gke.config_map.entries changes after qualification, this projection—and therefore contract_sha256—remains unchanged, so an older qualification can still authorize production. Pusher consumes that map through envFrom in backend/charts/pusher/templates/deployment.yaml, and the production workflow recreates it from the current manifest before rollout, meaning the promoted process may run with runtime configuration that was never covered by the selected development qualification. Include the relevant gke.config_map contract in this projection while continuing to exclude other services' flags.

Useful? React with 👍 / 👎.

…tract

Grok review on #22924: the prod job writes gke.config_map into
prod-omi-backend-config before Helm and the Pusher pod envFroms it, so a
ConfigMap entry change (e.g. a literal REDIS_DB_HOST) could ship under an old
dev qualification. The projection now includes gke.config_map for dev and
prod. Tests assert contract_fingerprint() itself (not the projection dict) and
cover a ConfigMap change. Only an immutable digest is cached now, so callers
cannot poison later fingerprints by mutating a returned projection.

Failure-Class: FC-promotion-gate-admits-on-recency-not-lineage

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit f382fcc into main Oct 20, 2026
60 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/pusher-promotion-contract-scope branch October 20, 2026 20:06
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