Skip to content

fix(release): robust Codemagic qualification handoff + fail-open fallback gating - #10380

Merged
kodjima33 merged 1 commit into
mainfrom
kodjima33/qualification-lane-handoff-fix
Jul 23, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
kodjima33/qualification-lane-handoff-fix

Conversation

@kodjima33

@kodjima33 kodjima33 commented Jul 23, 2026 •

Copy link
Copy Markdown
Collaborator

Two robustness defects in the merged qualification lanes (#10354/#10363)

Cross-review found two real gaps in the multi-lane qualification, neither covered by the existing tests. Both keep the "at least one lane qualifies a healthy candidate" guarantee honest.

1. Codemagic artifact handoff was shape-fragile (and unverified end-to-end)

The CM lane publishes build/qualification/** (JSON). Codemagic exposes recognized build outputs (.app/.dmg/.zip/…) as top-level artefacts but packages arbitrary files matching a directory/** glob into a single zip artefact. desktop_codemagic_qualification.py only matched a top-level qualification-result.json, so a zipped artefact would make the driver fail to find the result → every CM qualification silently falls through to the self-hosted lanes, defeating the CM-primary design.

fetch_result_artifact now prefers a top-level file and otherwise extracts the result from a zip artefact by basename (so an internal path like qualification/qualification-result.json still resolves). The driver adapts to whatever shape Codemagic produces, so the digest-pinned codemagic.yaml needs no change.

Honesty note: all prior live CM test builds died at the venv step (fixed separately in #10374), so a real CM build never produced this artefact — the handoff stays UNVERIFIED end-to-end until #10374 lets a CM qualification complete. This PR makes the driver correct for both artefact shapes and covers them with tests; the live confirmation is a follow-up once a green CM build exists.

2. plan-fallbacks did not fully fail open

The gh api runner-status step fails open, but a failure in the earlier token-generation step fails the whole plan-fallbacks job with empty outputs. The lanes gated on m{1,4}_online == 'true', so empty != 'true' → both self-hosted fallbacks skipped — re-creating the single-machine outage on any token hiccup.

Gate now fails open: m{1,4}_online != 'false' — a lane is skipped only when the planner explicitly reports the runner offline. A planner failure now lets the fallbacks attempt.

Verification

  • python3 .github/scripts/test_desktop_codemagic_qualification.py → 13 OK (new: extract-from-zip, prefer-top-level-over-zip, zip-without-result-fails)
  • python3 .github/scripts/test_desktop_release_flow_contract.py → 20 OK (asserts != 'false' fail-open gating on both lanes; == 'true' explicitly forbidden)
  • actionlint .github/workflows/desktop_qualify_beta.yml → exit 0
  • python3 .github/scripts/check-release-process-guards.py → passed
  • bash scripts/dev-harness/run-tests.sh → 50 passed
  • bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh → passed
  • make preflight → (see checks)

Failure-Class: FC-single-machine-release-gate

Review in cubic

…robust

Two defects found in the merged qualification lanes (#10354/#10363), neither
covered by the existing tests:

1. Codemagic artifact handoff was unverified and shape-fragile. The CM lane
   publishes build/qualification/** (JSON), and Codemagic packages arbitrary
   files matching a directory/** glob into a single zip artefact rather than
   exposing each as a top-level artefact. desktop_codemagic_qualification.py
   only matched a top-level 'qualification-result.json', so a zipped artefact
   would make every CM qualification silently fall through to the self-hosted
   lanes — defeating the CM-primary design. fetch_result_artifact now prefers
   the top-level file and otherwise extracts the result from a zip artefact by
   basename. Regression tests cover both shapes + zip-missing-result.

2. plan-fallbacks did not fully fail open. The gh-api status step fails open,
   but a failure in the earlier token-generation step fails the whole job with
   empty outputs, and the lanes gated on 'm{1,4}_online == true' → empty !=
   true → BOTH self-hosted fallbacks skipped, re-creating the single-machine
   outage on any token hiccup. Gate now fails open ('!= false'): a lane is
   skipped only when the planner explicitly reports the runner offline.

Verified: test_desktop_codemagic_qualification 13 OK (incl. zip cases);
test_desktop_release_flow_contract 20 OK (asserts fail-open gating);
actionlint exit 0; check-release-process-guards passed; dev-harness 50 passed;
qualification bootstrap contract passed.

Note: end-to-end CM handoff on a real green build stays UNVERIFIED until the
cold-build timeout fix (#10374) lets a CM qualification build complete; the
driver is now correct for whatever artefact shape Codemagic produces.

Failure-Class: FC-single-machine-release-gate
@kodjima33
kodjima33 merged commit 7fcb3e7 into main Jul 23, 2026
28 of 31 checks passed
@kodjima33
kodjima33 deleted the kodjima33/qualification-lane-handoff-fix branch July 23, 2026 05:03
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
…back gating (BasedHardware#10380)

## Two robustness defects in the merged qualification lanes
(BasedHardware#10354/BasedHardware#10363)

Cross-review found two real gaps in the multi-lane qualification,
neither covered by the existing tests. Both keep the "at least one lane
qualifies a healthy candidate" guarantee honest.

### 1. Codemagic artifact handoff was shape-fragile (and unverified
end-to-end)
The CM lane publishes `build/qualification/**` (JSON). Codemagic exposes
recognized build outputs (`.app`/`.dmg`/`.zip`/…) as top-level artefacts
but packages arbitrary files matching a directory/`**` glob into a
**single zip artefact**. `desktop_codemagic_qualification.py` only
matched a top-level `qualification-result.json`, so a zipped artefact
would make the driver fail to find the result → **every CM qualification
silently falls through to the self-hosted lanes**, defeating the
CM-primary design.

`fetch_result_artifact` now prefers a top-level file and otherwise
**extracts the result from a zip artefact by basename** (so an internal
path like `qualification/qualification-result.json` still resolves). The
driver adapts to whatever shape Codemagic produces, so the digest-pinned
`codemagic.yaml` needs no change.

*Honesty note:* all prior live CM test builds died at the venv step
(fixed separately in BasedHardware#10374), so a real CM build never produced this
artefact — the handoff stays **UNVERIFIED end-to-end** until BasedHardware#10374 lets
a CM qualification complete. This PR makes the driver correct for both
artefact shapes and covers them with tests; the live confirmation is a
follow-up once a green CM build exists.

### 2. `plan-fallbacks` did not fully fail open
The `gh api` runner-status step fails open, but a failure in the
**earlier token-generation step** fails the whole `plan-fallbacks` job
with empty outputs. The lanes gated on `m{1,4}_online == 'true'`, so
empty `!= 'true'` → **both self-hosted fallbacks skipped** — re-creating
the single-machine outage on any token hiccup.

Gate now fails open: `m{1,4}_online != 'false'` — a lane is skipped only
when the planner **explicitly** reports the runner offline. A planner
failure now lets the fallbacks attempt.

## Verification
- `python3 .github/scripts/test_desktop_codemagic_qualification.py` → 13
OK (new: extract-from-zip, prefer-top-level-over-zip,
zip-without-result-fails)
- `python3 .github/scripts/test_desktop_release_flow_contract.py` → 20
OK (asserts `!= 'false'` fail-open gating on both lanes; `== 'true'`
explicitly forbidden)
- `actionlint .github/workflows/desktop_qualify_beta.yml` → exit 0
- `python3 .github/scripts/check-release-process-guards.py` → passed
- `bash scripts/dev-harness/run-tests.sh` → 50 passed
- `bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh` →
passed
- `make preflight` → (see checks)

Failure-Class: FC-single-machine-release-gate


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