Repository navigation
fix(release): harden desktop qualification lanes — independent machines, docker-daemon health, resilient venv - #10363
Merged
Conversation
…health typesense selection Cross-review found two real gaps in the first cut: 1. One self-hosted `qualify` job routed to any matching runner meant a sick-but-online David machine could absorb the only fallback attempt and the mini would never try. Split into independent `qualify-m1-studio` and `qualify-m4-mini` lanes on machine-unique labels (omi-qual-m1-studio / omi-qual-m4-mini, applied to both runners via the API). A plan-fallbacks job reads runner online-status so an offline machine is skipped instead of queue-stalling the per-tag concurrency group (~24h); a failed status query fails open to both lanes. verdict passes iff ANY lane published evidence. 2. typesense_runtime() auto-picked docker on `which docker` alone, so a broken daemon sank the lane even with a native binary present. Now probes `docker info` (_docker_daemon_healthy, 15s timeout); a dead daemon falls through to native typesense-server, and prerequisite_report distinguishes 'docker daemon' from 'docker missing'. The two machine lanes are enforced byte-identical after steps: by the release-flow contract test. Custom runner labels registered in .github/actionlint.yaml. Verified: test_desktop_release_flow_contract 19 OK; dev-harness 50 passed; release-process guards passed; actionlint exit 0; make preflight passed. Failure-Class: FC-single-machine-release-gate
…v exact-patch fallback) The live Codemagic-lane test on v0.12.111 (build 6a61554646) failed at 'Qualify the exact candidate on the hermetic stack': error: No download found for request: cpython-3.11.15-macos-aarch64-none make: *** [setup-backend] Error 2 make setup-backend runs 'uv python install 3.11.15' (exact patch), but a freshly brew-installed uv on the ephemeral Codemagic Mac has a python-build-standalone index that lacks that exact patch, so the venv-provisioning added in #10354 hard-broke the lane it was meant to enable. Provision resiliently: try make setup-backend (exact-patch CI parity), and on failure fall back to a venv on the pinned MINOR version + 'uv pip sync' of the exact platform lock (pylock.macos.toml). The lockfile still pins every dependency exactly; only the interpreter patch floats to what uv can actually fetch. Also documents the 3-lane qualification structure in desktop/macos/AGENTS.md. Verified: exercised the fallback against the real backend — uv venv --python 3.11 + uv pip sync pylock.macos.toml → python -c 'import uvicorn, fastapi' OK. bash -n qualify-desktop-beta.sh OK; release-process guards passed; release-flow contract 19 OK; dev-harness 50 passed. Failure-Class: FC-single-machine-release-gate
Applies black --line-length 120 to the two test files touched by this PR; #10354 merged via --no-verify and skipped the pre-commit auto-format.
…086)
actionlint (with its embedded shellcheck) exited 1 on the three
'Create immutable qualification evidence' steps: $BETA_EVIDENCE_ASSETS was a
word-split string (SC2086). Replace with a bash array expanded via the
empty-safe, set -u/bash-3.2-safe guard ${arr[@]+"${arr[@]}"}. This removes
all SC2086 from the workflow (main still carried 2), and the two machine lanes
stay byte-identical.
Note: not CI-gated (repo-checks runs actionlint -shellcheck "", disabling
shellcheck), but broadening the pre-existing pattern from 2 to 3 occurrences
was worth cleaning up to 0.
Verified: actionlint … → exit 0, 0 SC2086; guarded array expansion checked at
runtime under set -euo pipefail (empty→no args, populated→quoted per-arg);
release-flow contract 19 OK; dev-harness 50 passed; guards passed.
test-qualification-swift-cache.sh intermittently failed (~1 in 3 local runs, and on this PR's CI) with "lock destination collision". The lock waiter checked `-e "$LOCK_DIR"` and `! -d "$LOCK_DIR"` as two separate stats, so when a concurrent holder released the lock (rm -rf) between them, `-e` saw the dir and `-d` saw it already gone — a legitimate release misreported as a fatal collision. Read the lock path type with a single lstat (`stat -f '%HT'`, macOS-only like the rest of this script): a directory is a legit holder (retry), a symlink or regular file is a real persistent squat (fatal), and a vanished path is transient (retry). One syscall removes the race. Verified: 8/8 consecutive test-qualification-swift-cache.sh runs pass (was ~1-in-3 failing); stat type detection checked for dir/file/symlink/absent. Failure-Class: none
Two problems surfaced once #10354 wired dev-harness-unit-tests into the manifest and this PR made the lane prefer a local interpreter: 1. run-tests.sh reached for uv whenever it was on PATH, so an unwritable ~/.cache/uv (sandboxed preflight envs) failed the lane even though a local pytest would do. Prefer an interpreter that already imports pytest + python-dotenv (backend venv, then python3) — no uv cache/network — and fall back to uv only in bare envs, then with UV_CACHE_DIR redirected to a writable temp dir. Real pytest failures still fail the lane. 2. test_python_resolver's checkout-with-spaces case built its subprocess env as `os.environ | {...}`, inheriting the PYTHON the Makefile exports under `make preflight`. That defeated the resolver's backend/.venv fallback it was asserting (real python3 then couldn't open a script the temp repo omits). Clear PYTHON like its two sibling tests already do. Verified: PYTHON=... pytest <spaces-test> now passes; make preflight → dev-harness-unit-tests PASS (9.06s); suite 50 passed via the ambient-python3 path (no uv). Failure-Class: none
…gelog Sibling qualification-runner helper to qualify-desktop-beta.sh, which is already exempt. Internal release infrastructure, no user-facing app surface.
… Actions The codemagic-lane minted one Omi Bot token and used it for both the external Codemagic build (QUALIFY_GH_TOKEN) and the in-Actions gh release upload — so the token handed to external CI carried release-write scope. Split into a read-scoped token (permission-contents: read) for candidate reads + the Codemagic handoff, and a write-scoped token (permission-contents: write) used only inside Actions for the evidence upload. External CI now receives only read authority; release-write stays in GitHub Actions. Self-hosted fallback lanes keep a single token by design — they run on trusted runners and never hand a token to external CI. Verified: actionlint exit 0; release-flow contract 19 OK (machine lanes still byte-identical); codemagic-lane tests OK; dev-harness 50 passed; guards passed. Failure-Class: none
…ed token Round-4 review split the codemagic-lane tokens (app-token-read for candidate downloads + the QUALIFY_GH_TOKEN handed to external Codemagic; app-token-write only for the in-Actions gh release upload), but nothing prevented a future edit from re-widening the exported token. Add a contract test asserting every QUALIFY_GH_TOKEN value resolves to app-token-read and the write token appears only immediately before a release upload. Adversarially verified: repointing QUALIFY_GH_TOKEN at app-token-write makes the test fail; restoring it passes. Full contract suite 20 OK.
kodjima33
added a commit
that referenced
this pull request
Jul 23, 2026
…back gating (#10380) ## 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 <!-- 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. -->
kodjima33
added a commit
that referenced
this pull request
Jul 23, 2026
…op timing out (Beta unblock) (#10374) ## Problem — this is why Beta has been stuck since v0.12.103 Every fresh desktop candidate times out in qualification. Root cause, from run [29965341760](https://github.com/BasedHardware/omi/actions/runs/29965341760) (v0.12.111 on David's M1): ``` qualification failed: desktop launch not dispatched within 3600s ``` A cold, from-scratch rebuild of the exact tag compiles **~1190 SwiftPM modules** (FluidAudio, MarkdownUI, Firebase, ONNX, …) *before* the named bundle is even packaged, signed, installed, and launched. On a self-hosted M1 that cold build alone runs ~65 min and dispatches the launch at ~75 min — past the **3600s (60 min)** `DESKTOP_PREPARE_WAIT_SECS` budget. The build log ends at `[1139/1190] Compiling` right at the deadline. It doesn't self-heal: a timed-out build leaves an incomplete `.build` that the qualification swift-cache **fail-closes on**, so the warm retry rebuilds cold and times out again — an unbreakable loop. And the hourly auto-release cuts a new tag (superseding the old one) before any tag's retry can pass. Result: v0.12.99–v0.12.112 all failed qualification; Beta served v0.12.103 for a day. This is the **same boundary already bumped once** (1800s→3600s, run 29904736566, which stalled at `1107/1182`). 3600s was still short. ## Fix Raise the default cold-preparation budget to **5400s (90 min)**, overridable via `OMI_QUALIFY_PREPARE_WAIT_SECS`, covering the observed ~75-min cold path with headroom while staying under the self-hosted job cap. Warm same-SHA retries still finish in a fraction of this. The static timing-contract test is updated to the new default and records the recurrence history. Two-line functional change (`desktop/macos/scripts/qualify-desktop-beta.sh`) plus its contract test. Independent of #10363 (which hardens the *lanes*); this fixes the *time budget* every lane shares. It takes effect for tags cut after merge — so the next hourly `v*-macos` tag is the first that can actually qualify. **Note on the Codemagic lane:** CM's `max_build_duration` is 120 min, so a *cold* CM build (90-min prepare + install + T2) may exceed it; the self-hosted lanes are the reliable cold-build path under the at-least-one-passes verdict, and CM carries warm/incremental builds. Raising CM's budget is a follow-up (touches the same codemagic.yaml workflow as #10363). ## Verification - Reproduced the root cause from the live run log (`not dispatched within 3600s`, build at `[1139/1190]` at the 3600s mark, job window 23:11→00:24 = 73 min). - `bash -n desktop/macos/scripts/qualify-desktop-beta.sh` → OK - Value resolves as an integer for the `SECONDS + DESKTOP_PREPARE_WAIT_SECS` arithmetic; default 5400, `OMI_QUALIFY_PREPARE_WAIT_SECS` override honored. - `bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh` → passed (asserts new 5400 default + 6300 combined bound) - `python3 .github/scripts/check-release-process-guards.py` → passed - `python3 .github/scripts/test_desktop_release_flow_contract.py` → 19 OK **UNVERIFIED until a post-merge tag runs:** that 5400s is actually sufficient end-to-end on the slowest registered runner. If a cold build ever exceeds 90 min, bump `OMI_QUALIFY_PREPARE_WAIT_SECS` on that runner — no code change needed. Failure-Class: new <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10374?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. -->
kodjima33
added a commit
that referenced
this pull request
Jul 23, 2026
## Summary Switch desktop beta release candidates to a fixed **6-hourly schedule** at 12am / 6am / 12pm / 6pm America/New_York, replacing the per-merge push trigger. Cron `0 4,10,16,22 * * *` (UTC; maps to those hours in EDT). ## Changes - `desktop_auto_release.yml`: removed the `push` trigger; schedule is now `0 4,10,16,22 * * *` (was hourly `17 * * * *`). `workflow_dispatch` kept for manual runs. - Contract tests updated: `test_has_one_automatic_candidate_to_beta_authority` now asserts no `push` trigger; `test_workflow_has_no_input_manual_trigger...` asserts the new 6-hourly cron and no push. Removed `test_push_paths_cover_releasable_desktop_paths` + its `_parse_push_filter` helper (no push filter to align anymore). - `desktop/macos/AGENTS.md`: Release Pipeline section updated to the 6-hourly scheduled cadence. ## Behavior Each scheduled tick plans the newest releasable SHA since the last tag; the quiet-window + one-active-release fences still admit at most one candidate at a time. At most 4 candidates/day. DST note: cron is UTC-only, so during EST the local times drift +1h (documented in the workflow). ## Verification - `pytest` plan + flow-contract suites → 26 passed, 37 subtests. actionlint clean. YAML triggers = [workflow_dispatch, schedule], cron `0 4,10,16,22 * * *`. Note: `Desktop Swift Static Contracts` / `test_check_release_process_guards.py` is already red on `main` (21-vs-22 Codemagic step-count from #10363's merge) — pre-existing and unrelated to this diff.
Git-on-my-level
pushed a commit
to Git-on-my-level/omi
that referenced
this pull request
Jul 23, 2026
…robust Two defects found in the merged qualification lanes (BasedHardware#10354/BasedHardware#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 (BasedHardware#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
6 tasks
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
…es, docker-daemon health, resilient venv (BasedHardware#10363) ## Follow-up hardening for the desktop qualification lanes (BasedHardware#10354) BasedHardware#10354 landed the Codemagic-primary + self-hosted-fallback qualification restructure and registered failure class `FC-single-machine-release-gate`. This PR repairs three gaps found by cross-review and by the first live Codemagic-lane run — the merged version does not yet deliver the "any independent machine can qualify" guarantee the class promises. Instance fixes for the same boundary. ### 1. Independent per-machine fallback lanes (cross-review finding) The merged version had a single `qualify` self-hosted job routed to any matching runner, so a sick-but-online David machine could absorb the job and Nik's mini would never try. Replaced with: - `plan-fallbacks` — reads runner online-status via the runners API (`m1_online`/`m4_online`); a failed query fails open. Gates each machine lane so an **offline** runner is skipped instead of queue-stalling the per-tag concurrency group (offline self-hosted jobs queue up to 24h). - `qualify-m1-studio` (label `omi-qual-m1-studio`) then `qualify-m4-mini` (label `omi-qual-m4-mini`) — one lane per physical machine (labels applied to both registered runners via the API). Serialized so the mini lane runs only when the M1 lane did not publish evidence; a sick-but-online machine can no longer absorb the other's attempt. Byte-identical steps after `steps:` (enforced by `test_desktop_release_flow_contract.py`). - `verdict` passes iff `CM_QUALIFIED || M1_QUALIFIED || M4_QUALIFIED`. ### 2. Docker-daemon health in Typesense selection (cross-review finding) `typesense_runtime()` auto-picked docker on `which docker` alone, so a docker CLI with a **dead daemon** sank the lane even with a native binary present. Now probes `docker info` (`_docker_daemon_healthy`, 15s timeout); a dead daemon falls through to native `typesense-server`, and `prerequisite_report` distinguishes "docker daemon" (present-but-dead) from "docker missing". ### 3. Resilient backend venv provisioning (live CM-lane failure) The first live Codemagic-lane test on **v0.12.111** (build `6a61554646f44fbd4070c8cf`) failed at the qualify step: ``` error: No download found for request: cpython-3.11.15-macos-aarch64-none make: *** [setup-backend] Error 2 ``` `make setup-backend` runs `uv python install 3.11.15` (exact patch), but a freshly `brew install`ed uv on the ephemeral CM Mac has a python-build-standalone index that lacks that exact patch — so the venv-provisioning step added in BasedHardware#10354 hard-broke the lane it was meant to enable. Now: try `make setup-backend` (exact-patch CI parity), and on failure fall back to a venv on the pinned **minor** version + `uv pip sync` of the exact platform lock. The lockfile still pins every dependency exactly; only the interpreter patch floats to what uv can fetch. ## Verification Local (all green): - Exercised the venv fallback against the real backend: `uv venv --python 3.11 + uv pip sync pylock.macos.toml` → `python -c "import uvicorn, fastapi"` OK. - `bash -n desktop/macos/scripts/qualify-desktop-beta.sh` → OK - `python3 .github/scripts/test_desktop_release_flow_contract.py` → 19 OK (incl. new multi-lane independence + byte-identical-lanes assertions) - `python3 -m pytest scripts/dev-harness/tests/` → 50 passed (incl. broken-daemon fallback + dead-daemon preflight) - `python3 .github/scripts/check-release-process-guards.py` → passed (post-rebase over BasedHardware#10358's codemagic.yaml change) - `bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh` → passed - `actionlint .github/workflows/desktop_qualify_beta.yml` → exit 0 (custom runner labels registered in `.github/actionlint.yaml`; only the pre-existing SC2086 info remains) - `python3 .github/scripts/check_agents_md_lean.py` → within budget Live (release-infra exercised for real): - Both machine labels applied to the two registered runners; `mac-mini-m4-qualification` already executed a real qualification job end-to-end in BasedHardware#10354's verification. - After merge I will re-run the Codemagic lane on the newest valid candidate to confirm the venv fallback carries it through T2 on the ephemeral Mac. **UNVERIFIED until that run passes** — the fix is proven at the unit/component level (fallback venv imports backend deps) but not yet through a full green CM T2. - Separately, the self-hosted lane is qualifying **v0.12.111** (the real beta-unblock candidate, carrying the BasedHardware#10350 crash fix) on David's M1 via the pre-merge tag script; that run is the operator's actual beta unblock and is independent of this PR. Failure-Class: FC-single-machine-release-gate <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10363?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. -->
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
…robust Two defects found in the merged qualification lanes (BasedHardware#10354/BasedHardware#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 (BasedHardware#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
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. -->
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
…op timing out (Beta unblock) (BasedHardware#10374) ## Problem — this is why Beta has been stuck since v0.12.103 Every fresh desktop candidate times out in qualification. Root cause, from run [29965341760](https://github.com/BasedHardware/omi/actions/runs/29965341760) (v0.12.111 on David's M1): ``` qualification failed: desktop launch not dispatched within 3600s ``` A cold, from-scratch rebuild of the exact tag compiles **~1190 SwiftPM modules** (FluidAudio, MarkdownUI, Firebase, ONNX, …) *before* the named bundle is even packaged, signed, installed, and launched. On a self-hosted M1 that cold build alone runs ~65 min and dispatches the launch at ~75 min — past the **3600s (60 min)** `DESKTOP_PREPARE_WAIT_SECS` budget. The build log ends at `[1139/1190] Compiling` right at the deadline. It doesn't self-heal: a timed-out build leaves an incomplete `.build` that the qualification swift-cache **fail-closes on**, so the warm retry rebuilds cold and times out again — an unbreakable loop. And the hourly auto-release cuts a new tag (superseding the old one) before any tag's retry can pass. Result: v0.12.99–v0.12.112 all failed qualification; Beta served v0.12.103 for a day. This is the **same boundary already bumped once** (1800s→3600s, run 29904736566, which stalled at `1107/1182`). 3600s was still short. ## Fix Raise the default cold-preparation budget to **5400s (90 min)**, overridable via `OMI_QUALIFY_PREPARE_WAIT_SECS`, covering the observed ~75-min cold path with headroom while staying under the self-hosted job cap. Warm same-SHA retries still finish in a fraction of this. The static timing-contract test is updated to the new default and records the recurrence history. Two-line functional change (`desktop/macos/scripts/qualify-desktop-beta.sh`) plus its contract test. Independent of BasedHardware#10363 (which hardens the *lanes*); this fixes the *time budget* every lane shares. It takes effect for tags cut after merge — so the next hourly `v*-macos` tag is the first that can actually qualify. **Note on the Codemagic lane:** CM's `max_build_duration` is 120 min, so a *cold* CM build (90-min prepare + install + T2) may exceed it; the self-hosted lanes are the reliable cold-build path under the at-least-one-passes verdict, and CM carries warm/incremental builds. Raising CM's budget is a follow-up (touches the same codemagic.yaml workflow as BasedHardware#10363). ## Verification - Reproduced the root cause from the live run log (`not dispatched within 3600s`, build at `[1139/1190]` at the 3600s mark, job window 23:11→00:24 = 73 min). - `bash -n desktop/macos/scripts/qualify-desktop-beta.sh` → OK - Value resolves as an integer for the `SECONDS + DESKTOP_PREPARE_WAIT_SECS` arithmetic; default 5400, `OMI_QUALIFY_PREPARE_WAIT_SECS` override honored. - `bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh` → passed (asserts new 5400 default + 6300 combined bound) - `python3 .github/scripts/check-release-process-guards.py` → passed - `python3 .github/scripts/test_desktop_release_flow_contract.py` → 19 OK **UNVERIFIED until a post-merge tag runs:** that 5400s is actually sufficient end-to-end on the slowest registered runner. If a cold build ever exceeds 90 min, bump `OMI_QUALIFY_PREPARE_WAIT_SECS` on that runner — no code change needed. Failure-Class: new <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10374?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. -->
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
…ware#10386) ## Summary Switch desktop beta release candidates to a fixed **6-hourly schedule** at 12am / 6am / 12pm / 6pm America/New_York, replacing the per-merge push trigger. Cron `0 4,10,16,22 * * *` (UTC; maps to those hours in EDT). ## Changes - `desktop_auto_release.yml`: removed the `push` trigger; schedule is now `0 4,10,16,22 * * *` (was hourly `17 * * * *`). `workflow_dispatch` kept for manual runs. - Contract tests updated: `test_has_one_automatic_candidate_to_beta_authority` now asserts no `push` trigger; `test_workflow_has_no_input_manual_trigger...` asserts the new 6-hourly cron and no push. Removed `test_push_paths_cover_releasable_desktop_paths` + its `_parse_push_filter` helper (no push filter to align anymore). - `desktop/macos/AGENTS.md`: Release Pipeline section updated to the 6-hourly scheduled cadence. ## Behavior Each scheduled tick plans the newest releasable SHA since the last tag; the quiet-window + one-active-release fences still admit at most one candidate at a time. At most 4 candidates/day. DST note: cron is UTC-only, so during EST the local times drift +1h (documented in the workflow). ## Verification - `pytest` plan + flow-contract suites → 26 passed, 37 subtests. actionlint clean. YAML triggers = [workflow_dispatch, schedule], cron `0 4,10,16,22 * * *`. Note: `Desktop Swift Static Contracts` / `test_check_release_process_guards.py` is already red on `main` (21-vs-22 Codemagic step-count from BasedHardware#10363's merge) — pre-existing and unrelated to this diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up hardening for the desktop qualification lanes (#10354)
#10354 landed the Codemagic-primary + self-hosted-fallback qualification restructure and registered failure class
FC-single-machine-release-gate. This PR repairs three gaps found by cross-review and by the first live Codemagic-lane run — the merged version does not yet deliver the "any independent machine can qualify" guarantee the class promises. Instance fixes for the same boundary.1. Independent per-machine fallback lanes (cross-review finding)
The merged version had a single
qualifyself-hosted job routed to any matching runner, so a sick-but-online David machine could absorb the job and Nik's mini would never try. Replaced with:plan-fallbacks— reads runner online-status via the runners API (m1_online/m4_online); a failed query fails open. Gates each machine lane so an offline runner is skipped instead of queue-stalling the per-tag concurrency group (offline self-hosted jobs queue up to 24h).qualify-m1-studio(labelomi-qual-m1-studio) thenqualify-m4-mini(labelomi-qual-m4-mini) — one lane per physical machine (labels applied to both registered runners via the API). Serialized so the mini lane runs only when the M1 lane did not publish evidence; a sick-but-online machine can no longer absorb the other's attempt. Byte-identical steps aftersteps:(enforced bytest_desktop_release_flow_contract.py).verdictpasses iffCM_QUALIFIED || M1_QUALIFIED || M4_QUALIFIED.2. Docker-daemon health in Typesense selection (cross-review finding)
typesense_runtime()auto-picked docker onwhich dockeralone, so a docker CLI with a dead daemon sank the lane even with a native binary present. Now probesdocker info(_docker_daemon_healthy, 15s timeout); a dead daemon falls through to nativetypesense-server, andprerequisite_reportdistinguishes "docker daemon" (present-but-dead) from "docker missing".3. Resilient backend venv provisioning (live CM-lane failure)
The first live Codemagic-lane test on v0.12.111 (build
6a61554646f44fbd4070c8cf) failed at the qualify step:make setup-backendrunsuv python install 3.11.15(exact patch), but a freshlybrew installed uv on the ephemeral CM Mac has a python-build-standalone index that lacks that exact patch — so the venv-provisioning step added in #10354 hard-broke the lane it was meant to enable. Now: trymake setup-backend(exact-patch CI parity), and on failure fall back to a venv on the pinned minor version +uv pip syncof the exact platform lock. The lockfile still pins every dependency exactly; only the interpreter patch floats to what uv can fetch.Verification
Local (all green):
uv venv --python 3.11 + uv pip sync pylock.macos.toml→python -c "import uvicorn, fastapi"OK.bash -n desktop/macos/scripts/qualify-desktop-beta.sh→ OKpython3 .github/scripts/test_desktop_release_flow_contract.py→ 19 OK (incl. new multi-lane independence + byte-identical-lanes assertions)python3 -m pytest scripts/dev-harness/tests/→ 50 passed (incl. broken-daemon fallback + dead-daemon preflight)python3 .github/scripts/check-release-process-guards.py→ passed (post-rebase over fix(release): bind candidates to build configuration #10358's codemagic.yaml change)bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh→ passedactionlint .github/workflows/desktop_qualify_beta.yml→ exit 0 (custom runner labels registered in.github/actionlint.yaml; only the pre-existing SC2086 info remains)python3 .github/scripts/check_agents_md_lean.py→ within budgetLive (release-infra exercised for real):
mac-mini-m4-qualificationalready executed a real qualification job end-to-end in feat(release): Codemagic-primary desktop beta qualification with self-hosted fallback lanes #10354's verification.Failure-Class: FC-single-machine-release-gate