Skip to content

Add guarded batch worker shadow-percent writer (SCA-5315) - #26825

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/sca5315-batch-shadow-percent
Dec 1, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/sca5315-batch-shadow-percent

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add a Release-operated writer for the two production batch worker Deployments. Each Kubernetes server dry-run must return a complete Deployment spec equal to the live spec with only the literal BATCH_PIPELINE_SHADOW_PERCENT value changed.
  • Bind each write to the current UID, resourceVersion and exact old env entry. Record each successful response in a journal for the guarded 0 → 25 inverse and for recovery after a partial forward.
  • Document Release's admission, recovery and rollout readback commands. The writer is a standalone CLI and requires an explicit apply command and admission receipt.

Verification

  • make preflight passed all 14 selected checks.
  • python3 -m unittest discover -s .github/scripts -p 'test_worker*.py' passed 93 tests.
  • Isolated Kubernetes v1.34.0 accepted the two-target server previews, 25 → 0 writes and 0 → 25 inverse. The forward preview left live state unchanged and the inverse restored both original pod-template hashes.
  • On the same isolated API, a metadata-only change invalidated T4's resourceVersion between dry-run and write. The CAS refused T4 after primary succeeded. The journal-backed inverse selected primary alone and restored its original template. T4 was unchanged during the inverse.
  • The production read-only identity observed 25 on both templates. GKE denied Deployment patch permission for both, so the production admission receipt is pending a Release-authorized preview. This PR made zero production writes.

SCA-5315

View guided diff Turn on auto-fix

@Git-on-my-level
Git-on-my-level merged commit 0736f70 into main Dec 1, 2026
53 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/sca5315-batch-shadow-percent branch December 1, 2026 00:35
Git-on-my-level added a commit that referenced this pull request Dec 1, 2026
…26839)

## What changed and why

Update the Listen evidence workflow's `reviewed_scripts_tree` from
`fc54ba6c0c1a407b709acf9cf964c4868210cc93` to
`8f7869ce5f401d53040abdac398c2d810ca81f26`, the `.github/scripts` tree
of remote `main` at `2b0a79b82c86f3feeb03923b08fc4d08c2da0c60`. The
stale pin fails the Listen workflow contract test and blocks staged
evidence before Python runs. This one-line re-pin follows
[#26732](#26732) and tracks
SCA-5315.

The initial tree delta to `912027199fa9b50413b9b4a2977e97cfd40a4348`
added `worker_shadow_percent_only.py` and
`test_worker_shadow_percent_only.py`. Both Git blobs match the
independently reviewed
[#26825](#26825) commit
`65dc10b126e7d808bb45b9b3afb5716a70e510e6`. These additions are outside
the Listen evidence execution path.

Since that tree,
[#26835](#26835) changed only
the `BASELINE` image digest in `pusher_image_only.py` and
`pusher_image_only_detect.py` under `.github/scripts`, from `fd5fb969…`
to `b2e9996b…`. Both Pusher script blobs on current `main` match #26835
commit `8b0142795b86c56ea34d5cb96b793540851a4340`. The Pusher scripts
are outside the Listen evidence execution path.

## Product invariants affected

- INV-DATA-1. The workflow continues to enforce the exact reviewed
scripts tree before running staged evidence code.

## How it was verified

- Queried remote `refs/heads/main`, resolved its `.github/scripts` tree,
and compared the old-to-new trees and both added blobs against the
reviewed head.
- On Apple M1 Max, the named Listen regression test failed on the old
pin. All 41 tests in
`backend/tests/unit/test_listen_overlay_workflow.py` passed with the
re-pin.
- `actionlint .github/workflows/gcp_backend_listen_helm.yml` and `git
diff --check` passed.
- Repository preflight and PR metadata validation passed.

## Tests

The existing
`test_evidence_uses_control_sha_and_exact_candidate_not_deploy_for_evidence`
covers the pin against the checkout's scripts tree. Verification used
local tests without dispatching a workflow.

## UI evidence

UI-Evidence: none -- workflow constant only

## Failure class (fixes)

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/26839?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="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26839?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26839&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.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