Skip to content

Desktop Release V2: safe resumable beta/stable promotion engine with candidate-first rollback #9525

Closed as not planned

Description

@Git-on-my-level

Summary

Replace the current loosely coupled beta, nomination and stable workflows with a resumable, fail-closed promotion engine.

The engine must consume an immutable desktop release manifest, deploy a Rust backend candidate at zero traffic when required, prove semantic health, shift traffic explicitly with automatic rollback, and only then cross the roll-forward-only stable-channel boundary.

Evidence from v0.12.70

Nomination failed because a release ID was interpolated into a URL

Canonical beta run 29174822729 successfully created:

  • manifest desktop_release_manifests/v0.12.70+12070-macos
  • macos-beta generation 1 pointing to the exact manifest

Nomination run 29174914736 then failed before mutation with curl exit 22. The workflow constructed:

.../desktop_release_manifests/$RELEASE_TAG

using raw v0.12.70+12070-macos. The REST path decoded + as a space and requested v0.12.70 12070-macos, which correctly returned 404. The exact URL-encoded document returned 200.

The release was unblocked by running the repository's own nomination validator against the encoded exact manifest/pointer, applying only the intended metadata edit, then proving the normal non-break-glass stable checker passed. Future operators must not need this manual recovery.

The deploy action moved traffic before the explicit traffic step

Stable run 29175012320 completed successfully, but its actual boundaries were:

  • backend deploy: 01:22:08Z-01:22:34Z
  • explicit traffic reconciliation: 01:22:34Z-01:22:46Z
  • health identity: 01:22:46Z-01:22:47Z
  • legacy Firestore stable promotion: 01:22:47Z-01:22:49Z
  • canonical stable pointer: 01:22:49Z-01:22:51Z
  • GitHub metadata: 01:22:51Z-01:22:52Z
  • cache clear: 01:22:52Z-01:22:53Z
  • tracking tag: 01:22:53Z-01:22:54Z

The Cloud Run deploy action shifted traffic while the step named Route traffic... was still pending. There was no zero-traffic candidate and no automatic rollback. Before the legacy Firestore PATCH, desktop-backend-00883-tcp and stable .0 were the last simple rollback boundary. After that PATCH, recovery was roll-forward-only.

Finalization left contradictory human metadata

The beta and stable metadata scripts preserved an obsolete waiver saying stable remains blocked pending QA after machine metadata had become stable. It required a separate metadata-only repair.

Target state machine

Implement one per-release state record:

prepared
  -> qualified
  -> beta_candidate_ready
  -> beta_live
  -> soak_accepted
  -> nominated
  -> prod_candidate_ready
  -> prod_backend_live
  -> stable_pointer_live
  -> finalized

Each transition must be:

  • idempotent;
  • lease-protected per environment/service;
  • tied to one release ID and immutable manifest digest;
  • independently observable;
  • resumable after runner death;
  • explicit about whether it is reversible or roll-forward-only.

Required changes

Safe data access

  • Replace hand-built Firestore REST document URLs with a typed client or one central path encoder.
  • Test tags containing +, spaces and other reserved characters.
  • Read back the exact manifest/pointer identity immediately before mutation.
  • Use update preconditions/generations so stale operators cannot overwrite newer pointers.

Candidate-first backend rollout

For backend_required manifests:

  1. Create a Cloud Run revision from the immutable platform digest with no traffic.
  2. Verify revision source, manifest digest, environment contract, secrets and resource settings.
  3. Activate under a temporary tag or protected validation route.
  4. Exercise semantic probes:
    • exact /health release identity;
    • appcast/update-feed generation;
    • authenticated TTS through Redis rate limiting;
    • forced Redis reconnect probe;
    • representative Gemini/chat proxy control;
    • OAuth callback/base URL and Calendar-key dependency readiness.
  5. Remove validation tags.
  6. Snapshot current spec/status traffic.
  7. Shift explicitly and require both surfaces to converge.
  8. Hold a bounded dwell and automatically restore the snapshot on failure.

The deployment action must not shift traffic before the explicit promotion step.

Stable-channel commit and finalizer

  • Treat legacy stable mutation and canonical stable pointer as the documented roll-forward-only boundary.
  • Before that boundary, automatically roll back backend traffic on failed acceptance.
  • After it, rerun idempotent remaining steps rather than attempt to move stable backward.
  • Finalizer must reconcile:
    • canonical beta/stable pointers;
    • legacy release bridge;
    • GitHub machine metadata;
    • human-readable qualification/waiver prose;
    • static downloads;
    • Python and Rust appcasts;
    • cache invalidation;
    • tracking tag.
  • Report incomplete finalization as a first-class state with a paste-ready resume command.

Workflow hygiene

  • Upgrade actions still relying on the Node 20 compatibility override.
  • Separate Python backend, Rust desktop backend and release-control concurrency groups.
  • A branch name must never silently select a production source; use immutable release inputs.
  • Preserve first-failure evidence and exact rollback instructions in the run summary.

Rollout plan

  1. Land the URL-encoding regression fix independently.
  2. Implement plan/read-only mode against current workflows.
  3. Add state records and leases while old workflows remain authoritative.
  4. Run candidate creation and semantic probes without traffic.
  5. Make the engine authoritative for beta.
  6. Complete one beta cycle.
  7. Enable backend traffic promotion with automatic rollback.
  8. Enable stable pointer mutation last.
  9. Delete the superseded workflow paths.

Acceptance criteria

  • v0.12.70+12070-macos and other reserved-character IDs pass workflow tests.
  • Re-running any phase is idempotent.
  • Two operators cannot promote competing desktop releases.
  • Candidate creation changes no live traffic.
  • Semantic probes run against the exact candidate.
  • Deploy action cannot move traffic implicitly.
  • Forward and rollback traffic converge in spec and status.
  • Failure before stable mutation restores the exact snapshot automatically.
  • Failure after stable mutation produces a deterministic roll-forward resume.
  • Human and machine release metadata converge without manual editing.
  • App-only releases skip backend phases.
  • Hard cancellation leaves a detectable/recoverable lease and state.
  • Run summary contains exact manifest, digest, revision, pointer generations, boundary crossed and recovery action.

Related issue pack

Dependency graph

#9526 ──> #9525 ──> blocking phase-aware gates in #9523
   └────────────────> canonical identity checks in #9523

#9524 ── independent implementation lane
   ├────────────────> semantic runtime probes consumed by #9525
   └────────────────> bounded runtime telemetry consumed by #9523

Dependencies and rollout ordering

Activity

  1. added
    enhancement
    maintainer
    p1
    needs-maintainer-review
    workflow-review
    on Jul 12, 2026
  2. Git-on-my-level commented on Sep 8, 2026

    @Git-on-my-level
    MemberAuthor

    Closing as superseded. The couplings this engine was designed to make safe were removed rather than wrapped: desktop_nominate_stable_candidate.yml and its +-URL bug were deleted (7a6bac1), the Rust cloud backend was replaced (#10686), and desktop_promote_prod.yml is now a 272-line pointer move that never invokes a backend deployment (desktop-updates.mdx: Stable is a protected distribution pointer). Candidate-first zero-traffic rollout with automatic traffic restore lives in gcp_backend.yml. Exposure shape and reverse gear are owned by omi-knowledge-base projects/staged-rollouts. The unbuilt durable state-record/lease sub-item can be re-filed on its own if needed.

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

    desktopenhancementmacOSmaintainerneeds-maintainer-reviewp1stabilityworkflow-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions