Skip to content

Harden desktop release control plane without a new service #9415

Closed

Description

@Git-on-my-level

Problem

Omi Desktop beta/stable publication is operationally coupled to the monolithic production Python backend even when the release itself is beta-only.

This became concrete during the v0.12.69+12069-macos beta rollout:

  1. The candidate built, signed, notarized, and passed signed-artifact smoke checks.
  2. Tier-2 qualification reported suspected pre-existing failures/harness drift, tracked in Classify macOS Tier-2 beta qualification failures: real regressions vs harness drift #9414.
  3. An explicit operator decision accepted those known deviations for beta only.
  4. desktop_promote_beta.yml then failed at its first control-plane mutation:
POST https://api.omi.me/v2/desktop/releases
HTTP 404

The relevant endpoints exist in current repository source and development, but the production Python backend serving api.omi.me does not have them. Because beta clients read the public appcast from api.omi.me, advancing only the beta channel currently requires deploying the entire production Python backend first.

Failed workflow: https://github.com/BasedHardware/omi/actions/runs/29129451860
Candidate: https://github.com/BasedHardware/omi/releases/tag/v0.12.69%2B12069-macos
Qualification/drift investigation: #9414

This is not a request to weaken stable promotion. It is a request to make desktop release control capability-versioned, auditable, fail-fast before expensive work, and honest about operator waivers — without standing up a new long-lived service.

Non-goal

Do not extract a desktop-release-control service. The control-plane surface is cold/low-QPS (~1k LOC of routes plus workflows). A new Cloud Run/Helm/CI/on-call unit adds operational cost without removing today's real pain: deploy lag vs repo source, multi-surface dual-writes, binary qualification, and Codemagic Docker gaps. Keep the routes in the existing Python backend on api.omi.me.

Stable promotion also still couples to Rust desktop-backend deploy (desktop_promote_prod.yml). Extracting Python routes alone would not make release control fully independently deployable.

Current coupling and failure modes

The current beta workflow updates several surfaces:

  • immutable release manifest via POST /v2/desktop/releases;
  • explicit beta pointer via POST /v2/desktop/channels/promote;
  • GitHub Release metadata;
  • legacy Firestore/Rust appcast bridge;
  • GCS beta redirect artifacts;
  • API caches.

Problems:

  1. Beta publication can require a broad production backend deployment when desktop routes are missing on api.omi.me.
  2. Repository source can be ahead of the deployed control-plane contract. CI validates code, not capabilities at api.omi.me.
  3. Missing endpoint capability is discovered late — after Codemagic build + qualification.
  4. Qualification is modeled as binary. Metadata can express qualifiedBeta: true, but not “automated T2 failed; operator waived for beta; stable remains blocked.”
  5. Multiple mutable publication surfaces can partially diverge. Pointer, legacy bridge, GitHub metadata, redirect, and cache updates are sequential; a failure after pointer advance leaves partial state.
  6. Automatic qualification currently assumes Docker on a Codemagic macOS worker. Missing Docker fails after the expensive artifact build.
  7. promote_channel requires qualification.passed == true on the immutable manifest (backend/database/desktop_update_channels.py), so a honest waiver cannot be expressed without lying or rewriting history.

Target architecture (cheap / maintainable)

1. Keep routes in the monolith; gate on deployed capability

Leave /v2/desktop/* in backend/routers/updates.py behind api.omi.me. When desktop control-plane routes or schemas change, deploy the production Python backend (or confirm it is already live) before tagging/Codemagic.

Add a production capability endpoint:

{
  "manifest_api": 1,
  "channel_pointer_api": 1,
  "qualification_schema": 2,
  "supports_operator_beta_waiver": true
}

Desktop candidate planning and promotion must preflight this endpoint before expensive work:

python3 backend/scripts/desktop_release_preflight.py \
  --base-url https://api.omi.me \
  --required-manifest-api 1 \
  --required-pointer-api 1 \
  --required-qualification-schema 2 \
  --dry-run

If capability is missing, stop before tagging/Codemagic with an actionable message naming the required backend deploy. First ship of /capabilities itself is a one-time monolith deploy; after that, preflight prevents repeating the .69 failure mode.

Optional later optimization (only if backend deploys for desktop-only changes become painful): a thin independent deploy path for the existing updates module (same code, separate Cloud Run/Helm release, LB path route to api.omi.me/v2/desktop/*). That is still not a new product service with its own datastore/auth story — defer unless Phase 1 proves insufficient.

2. Model beta waivers explicitly; keep manifests artifact-only

Do not represent an operator waiver as an automated T2 pass. Separate immutable artifact facts from append-only decisions.

Immutable manifest (artifact facts only):

{
  "release_id": "v0.12.69+12069-macos",
  "source_sha": "d96c58aa28a0c419bc7d0915211f044b5a3a959f",
  "zip_sha256": "...",
  "dmg_sha256": "...",
  "ed_signature": "..."
}

Append-only decision/events (separate collection or decision doc keyed by release_id — not rewritten into the manifest):

candidate-published
automated-qualification-failed
beta-waiver-approved
beta-pointer-advanced
stable-nominated
stable-promoted

Example decision payload:

{
  "qualification": {
    "automated": {
      "tier": "T2",
      "passed": false,
      "evidence_asset": "qualification-evidence.json"
    },
    "decision": {
      "status": "waived-for-beta",
      "actor": "davidzhang",
      "timestamp": "2026-07-10T23:04:46Z",
      "reason": "Suspected pre-existing failures/harness drift; tracked in #9414",
      "tracking_issue": "https://github.com/BasedHardware/omi/issues/9414"
    }
  }
}

Policy:

Qualification state Beta Stable eligibility
Automated T2 passed Allowed Eligible after nomination/soak gates
Audited operator waiver Allowed Blocked until a clean qualification supersedes it
Failed without waiver Blocked Blocked
Missing evidence Blocked Blocked

Workflow inputs for manual waiver only (automatic Codemagic → promote path must hard-refuse these):

override_failed_qualification=true
override_confirm=I-ACCEPT-BETA-QUALIFICATION-RISK
override_reason=<single-line rationale>
override_issue=https://github.com/BasedHardware/omi/issues/...

Stable promotion must reject any release whose current qualification decision is waived-for-beta, even if it has soaked cleanly. Existing audited break_glass on desktop_promote_prod.yml remains the emergency path and stays distinct from beta waiver.

3. Make the channel pointer the commit boundary

The explicit channel pointer remains the only authoritative publication state. Firestore already transactionally advances desktop_update_channels against desktop_release_manifests.

Define the commit boundary clearly:

canonical pointer advance  ← commit
  ├─ appcast / download resolution   ← derived on read
  ├─ GCS redirect                    ← idempotent reconciler
  ├─ GitHub display metadata         ← idempotent reconciler
  └─ legacy Firestore/Rust bridge    ← idempotent reconciler

Promotion should atomically advance the pointer. GitHub metadata, redirects, and legacy bridge updates should be idempotent reconcilers. After pointer commit, projection failures must not fail-closed in a way that requires re-promoting; they should be safely retryable (reconcile job / workflow re-run) with drift alerts. Preserve last-known-good Redis LKG semantics; one cache owner only (the monolith).

Eventually remove the legacy bridge after old clients age out (separate milestone; not required to fix .69-class failures).

4. Fail fast on runner/Docker capability; prefer existing builders

Check runner capabilities before accepting expensive work. Missing Docker should fail before an expensive build where possible.

Prefer fixing/using a Codemagic (or existing trusted) lane that guarantees Docker over standing up a self-hosted macOS+OrbStack fleet for a few releases per week. If a trusted self-hosted runner is still required, treat it as an ops milestone with explicit ownership — not the default path.

Recommended split remains:

  1. Codemagic builds, signs, notarizes, packages, and smokes the signed artifact.
  2. T2 runs only on a runner that guarantees required capabilities and uploads evidence.
  3. GitHub promotion consumes artifact hashes plus the qualification decision.

5. Deployed-contract checks on release workflows only

Add required pre-release checks against the actual target environment:

  • required endpoints exist;
  • capability versions are sufficient;
  • request/response schemas match;
  • an authenticated dry-run can validate manifest and promotion requests without writing;
  • current stable and beta pointers resolve;
  • the appcast output matches those pointers.

Scope these to release/promote workflows, not ordinary backend PRs (avoid coupling feature CI to prod availability). Source-level OpenAPI tests remain useful but are not sufficient.

Implementation plan

Phase 0 — Unblock the control plane

  • Deploy (or confirm live) the missing /v2/desktop/* routes on production api.omi.me.
  • Add GET /v2/desktop/capabilities and an authenticated no-write preflight/dry-run.
  • Wire capability preflight into tag planning and beta promotion before Codemagic dispatch.

Phase 1 — Honest qualification + fail-fast

  • Add explicit audited beta-waiver schema as separate decision/events, not manifest mutation.
  • Update promote_channel / promote workflows to accept waived-for-beta for beta only.
  • Make stable promotion reject waived releases (clean T2 must supersede).
  • Hard-refuse override_* on automatic promote path; allow only manual workflow_dispatch.
  • Check Docker/runner capability before expensive build/T2 where possible.
  • Complete baseline/drift work in Classify macOS Tier-2 beta qualification failures: real regressions vs harness drift #9414.

Phase 2 — Pointer commit / projection reconcile

  • Make explicit pointer advance the sole commit in desktop_promote_beta.yml.
  • Convert GitHub metadata, GCS redirects, and legacy bridge writes into idempotent reconcilers.
  • Add drift alerts across pointer/appcast/redirect/GitHub/legacy projections.
  • Document reconcile re-run procedure; never move the pointer again to fix projections.

Phase 3 — Optional simplification (defer)

  • Retire legacy Rust/Firestore appcast bridge after compatibility window (hard sunset + proxy/bridge hit metrics).
  • Only if desktop-only backend deploys remain painful: thin independent deploy path for the existing updates module (same code, LB path route) — still not a new service.
  • Continue migrating scripts off GitHub KEY_VALUE as shadow control plane toward pointer + decision docs.

Acceptance criteria

  • Promotion fails before candidate build if the deployed control-plane contract is incompatible.
  • Operator beta waivers are first-class, honest, typed, and auditable — and are not stored as qualification.passed: true.
  • Automatic promote cannot waive; only manual typed override can.
  • A beta-waived release cannot be promoted stable without a later clean qualification.
  • Channel publication commit is one atomic pointer update; projection failures are idempotently reconcilable without re-promoting.
  • T2 runs only where required capabilities (including Docker when needed) are guaranteed, with preserved evidence.
  • Deployed-contract checks verify production capability on release workflows rather than assuming repository source is live.
  • Existing stable and beta clients continue using the same public appcast/download URLs.
  • No new long-lived desktop-release-control service is introduced.

Safety constraints

  • Stable promotion remains manual and roll-forward-only.
  • Never allow a beta waiver to imply stable qualification.
  • Never expose release mutation endpoints publicly without service-authenticated, audited authorization.
  • Do not let GitHub Release metadata become the sole source of truth.
  • Preserve last-known-good stable and beta pointers during reconciliation failures.
  • Do not accept product-backend ADMIN_KEY on any new mutation surface “for compatibility” if a thinner deploy path is later added — prefer OIDC or a dedicated release credential with narrow rights.
  • Live contract tests must not gate ordinary backend PRs.

Activity

  1. added
    enhancement
    backend
    on Jul 10, 2026
  2. changed the title [-]Decouple desktop beta/stable release control plane from the monolithic Python backend[/-] [+]Harden desktop release control plane without a new service[/+] on Jul 10, 2026
  3. Git-on-my-level commented on Jul 10, 2026

    @Git-on-my-level
    MemberAuthor

    Honestly idk if we need this

  4. added
    docs-tooling
    p3
    and removed
    docs-tooling
    p3
    on Oct 6, 2026
  5. undivisible commented on Oct 15, 2026

    @undivisible
    Collaborator

    Already fixed on main: Main now has /v2/desktop/releases in backend/routers/updates.py:1208 plus desktop_beta_admission_control.yml and rollback/breakglass workflows.

    Closing. Reopen if you still see it on the latest build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backenddesktopdocs-toolingenhancementp3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions