Skip to content

refactor(release): beta break-glass as a relaxed precondition, not a parallel subsystem - #10091

Merged
Git-on-my-level merged 15 commits into
BasedHardware:mainfrom
Git-on-my-level:feat/release-evidence-override-10082
Jul 20, 2026
Merged

Git-on-my-level merged 15 commits into
BasedHardware:mainfrom
Git-on-my-level:feat/release-evidence-override-10082

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #10082

Adds a break-glass path for promoting a signed macOS candidate to beta when the qualification gate itself is broken — the case we actually hit.

Scope changed after review, twice:

  1. The first pass built this as a parallel subsystem with an approval ceremony. It is now a relaxed precondition on the existing promotion path.
  2. An audit of every deploy surface found the same footgun on two more. Those now have hatches too.

Every gated surface now has a hatch

The audit found the posture was bimodal and arbitrary: one surface welded shut with no hatch, twenty with no gate at all, and which was which bore no relation to blast radius.

Surface Before Now
Desktop candidate (desktop_auto_release) Swift source gate; force_release explicitly did not bypass it release_mode=break_glass
Desktop beta fail-closed qualification, no hatch desktop_emergency_promote_beta
Desktop stable already had break_glass_confirm unchanged
Backend prod (gcp_backend) required a successful eligibility run on the exact SHA, zero bypass inputs skip_eligibility_proof + break_glass_confirm + reason

Two of these could block a hotfix with no recovery at all:

  • Backend prod: a flaky or red check permanently poisons that SHA — rerunning doesn't make the original run succeed, so the only recovery was landing another commit on main and waiting for a full green run. That's a bigger blast radius than the beta gate that cost a day.
  • Desktop candidate: plan-desktop-release.py checked the source gate before the force_release branch, so a flaky Desktop Swift Build & Tests blocked candidate creation outright, and everything downstream with it.

Hatches relax evidence requirements only. The backend hatch moves the ancestry-of-main check outside the break-glass branch so it is always enforced — unreviewed code still cannot reach production. Each hatch opens a tracking issue; repeated use means the gate is the defect.

AGENTS.md now carries one table of every hatch. Not knowing a hatch exists is the same outage as not having one.

Untouched: gcp_backend_auto_dev is workflow_run-only and manual gcp_backend is already its fallback. The 20 ungated gcp_* services need gates decided first — separately, not here.

The design

Emergency promotion is ordinary promotion with the T2 qualification gate relaxed. It is not a separate mutation path.

  • _build_channel_pointer, _build_beta_rollback_pointer, and _build_emergency_macos_beta_pointer collapse into one _build_pointer driven by a TRANSITIONS policy table. It is the single pointer-mutation authority; the three transitions differ only in which preconditions they declare.
  • The three emergency endpoints become emergency: true on the existing POST /v2/desktop/channels/promote. Beta-only, and requires a compare-and-swap on both current release id and generation, so it cannot silently clobber a concurrent normal promotion.
  • The resulting pointer carries emergency: true. The audit record lives on the pointer rather than in a parallel collection that can diverge from it.
  • Normal promotion is unchanged and still fail-closed.

Why the ceremony was removed

Removed: two-approver comment parsing, the four-hour expiry window, incident binding, behavioral-evidence fetch, responder notification, the one-hour monitor, the operation-id reconciliation protocol, and the recovery job that existed to repair state the subsystem itself created.

This codebase is mostly agent-driven, and ceremony is not a control against an automated actor. An agent fills in a rationale, an incident id, and an approval comment as readily as a human — faster, and correctly. Those fields imposed real cost on a small team mid-incident while filtering nothing. Eight of this branch's original commits were fixes to that machinery rather than to release behavior, which is the clearest signal it cost more than the risk it insured.

What remains are the guards a machine can actually check: tag-to-SHA binding, artifact digests recomputed from the published assets, and the pointer CAS.

The workflow now reads the live pointer itself rather than requiring an operator to paste release id and generation mid-incident.

The escape hatch is a signal, not a solution

Every run opens a qualification-gate-failure issue recording tag, SHA, operator, reason, and run URL. If those accumulate, the qualification gate is the defect and this hatch is masking it. Fix the gate, then close the issue.

Also in this PR

Deletes release_blessing.py and check-python-backend-blessing.py plus their tests (502 lines). The latter is referenced only by its own test — no workflow, no Makefile, no checks-manifest.yaml entry — and run_checks.py resolves checks by explicit id without globbing, so nothing could execute it.

The qualification reliability amendment keeps every break-glass workflow unchanged while making its automatic evidence boundary fail closed: fault qualification waits for the bridge's live signed-in, onboarded, non-restoring owner snapshot (not only the UI's appState: main), and release preflight validates the fetched publication timestamp plus signed ZIP, DMG, and signed-smoke assets with SHA-256 digests.

Product invariants affected

  • INV-AUTH-1

Verification

  • cd backend && python3 -m pytest tests/unit/test_desktop_update_channels.py tests/unit/test_desktop_updates.py tests/unit/test_desktop_release_scripts.py → 133 passed
  • New TestEmergencyBetaPromotionRules covers: promotes an unqualified build and marks the pointer emergency; normal promotion still rejects that same build; stale release-id and stale generation CAS both rejected; roll-forward only; never reaches stable.
  • python3 .github/scripts/check-release-process-guards.py → passes
  • python3 .github/scripts/test_desktop_qualification_dispatch.py → passes
  • python3 .github/scripts/check-desktop-release-terminology.py → passes
  • python3 backend/scripts/check_route_policy_baseline.py → 0 baseline additions, 0 new missing entries after removing the three routes
  • Workflow validated as YAML (466 → 179 lines, one job, 8 steps)
  • python3 .github/scripts/test_plan_desktop_release.py → passes, including two new cases: break_glass releases over a blocked source check, and does not set the bypass flag when the check passes. The existing assertion that force_release still blocks is unchanged.
  • python3 .github/scripts/test_check_backend_deploy_source_admission.py → 23 pass, including 3 new break-glass contract tests (confirm string + reason required; ancestry enforced outside the branch; bypass recorded as an issue). These read workflow source, so they are static tripwires, not behavioral coverage — Actions cannot be driven from a unit test.
  • bash desktop/macos/tests/test-omi-ctl-wait-ready.sh → rejects signed-out, restoring, owner-not-ready, and stale snapshots; accepts only the live authenticated owner-ready bridge snapshot.
  • python3 desktop/macos/scripts/release-keyvalue.py self-test → validates passing release JSON and rejects missing/malformed publication timestamps, missing signed-smoke assets, and missing artifact digests.
  • bash desktop/macos/tests/test-fault-suite-launch-env.sh && bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh → passes; confirms the fault harness invokes the strengthened readiness command and qualification bootstrap contracts remain intact.
  • ENCRYPTION_SECRET=*** backend/.venv/bin/python -m pytest backend/tests/unit/test_desktop_release_scripts.py backend/tests/unit/test_desktop_update_channels.py → 43 passed; covers qualified qualification-claim retries re-dispatching beta promotion without rerunning the runner.
  • actionlint .github/workflows/desktop_qualify_beta.yml → passes.
  • make preflight with this PR body → 36 deterministic checks passed.
  • python3 .github/scripts/check_backend_deploy_source_admission.py → passes. Note it validates structural wiring, not bypass semantics — hence the added contract tests.
  • check_agents_md_lean.py → within budget

Limitations

  • No hatch has been fired against real infrastructure. These change production deploy controls — beta promotion, backend prod deploy, desktop candidate creation. They need a real incident or a deliberate dry run before they are trusted.
  • gcp_backend.yml is prod backend deploy. Per AGENTS.md that is a wide-blast-radius surface needing explicit sign-off; this is not auto-mergeable.
  • Full backend pytest selection could not run in this worktree (no project-local Python environment; restricted network blocks the documented 3.11 bootstrap). The three affected files were run directly.

Failure class

Failure-Class: FC-split-mutation-authority

The original defect and this rewrite share a cause: pointer-mutation authority was split across parallel implementations. Consolidating to a single _build_pointer removes the class rather than adding another observer of it.

Follow-ups (not in this PR)

Deliberately excluded to keep this reviewable:

  • 22 gcp_* deploy workflows, 3,766 lines, zero workflow_call — the job scaffold is copy-pasted ~20×. A reusable workflow targets ~1,200 lines and removes the drift risk of hardening one deploy path and missing the others.
  • ~1,300 lines implementing the same scan → count → compare-to-JSON-baseline ratchet five separate times, across 8 baseline formats. One runner plus a rule table targets ~300.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67542a0d89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Git-on-my-level Git-on-my-level changed the title feat(release): make qualification and emergency beta promotion recoverable refactor(release): beta break-glass as a relaxed precondition, not a parallel subsystem Jul 20, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Maintainer direction: retain the PR’s broad break-glass bypasses. Follow-up work should add the incident-derived macOS qualification/auth-readiness and evidence/audit improvements without removing the existing desktop candidate, Beta promotion, Stable promotion, or backend deployment hatches.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Clarification from maintainer: the separate emergency promotion workflows are intentional. Retain broad, flexible candidate/Beta/Stable/backend break-glass avenues rather than folding them into one ordinary promotion path. Continue adding the incident-derived M1 fault authenticated-readiness, qualification-controller reliability, and evidence/audit improvements; do not remove the existing hatch mechanisms.

@Git-on-my-level
Git-on-my-level force-pushed the feat/release-evidence-override-10082 branch from a7e76b8 to ac112d8 Compare July 20, 2026 07:57
Git-on-my-level and others added 14 commits July 20, 2026 18:34
Failure-Class: FC-split-mutation-authority
Failure-Class: FC-split-mutation-authority
Failure-Class: FC-split-mutation-authority
Failure-Class: FC-split-mutation-authority
Failure-Class: FC-split-mutation-authority
`check-python-backend-blessing.py` is referenced only by its own test: it
appears in no workflow, no Makefile target, and no entry in
`.github/checks-manifest.yaml`. `run_checks.py` resolves checks from that
manifest by explicit id and never globs the scripts directory, so nothing
can execute it. `release_blessing.py` is imported only by that dead script.

Verification:
- `grep -rn` for both module names across the repo: only the deleted files
  and their own tests referenced them.
- `grep -in blessing .github/checks-manifest.yaml`: no matches.
- `python3 .github/scripts/check-release-process-guards.py` passes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The break-glass path was a parallel subsystem: its own pointer builder,
Firestore transaction, audit collection, side-effect claim collection,
reconciliation verifier, three admin endpoints, and a second workflow job
to recover state the subsystem itself created. Eight of this branch's
commits were fixes to that machinery rather than to release behavior.

Emergency promotion is ordinary promotion with the T2 qualification gate
relaxed. Model it that way:

- Collapse `_build_channel_pointer`, `_build_beta_rollback_pointer`, and
  `_build_emergency_macos_beta_pointer` into one `_build_pointer` driven by
  a `TRANSITIONS` policy table. It is now the single pointer-mutation
  authority; the three transitions differ only in declared preconditions.
- Replace the emergency endpoints with `emergency: true` on the existing
  `POST /v2/desktop/channels/promote`. The bypass is beta-only and requires
  a compare-and-swap on both current release id and generation, so it
  cannot silently clobber a concurrent normal promotion. The resulting
  pointer carries `emergency: true` — the audit record lives on the pointer
  rather than in a collection that can diverge from it.
- Drop the approval ceremony entirely: two-approver comment parsing, the
  four-hour expiry, incident binding, behavioral-evidence fetch, responder
  notification, and the one-hour monitor. Ceremony is not a control against
  an automated actor, which fills in rationale and approval fields as
  readily as a human. The guards that remain are the ones a machine checks:
  tag-to-SHA binding, recomputed artifact digests, and the CAS.
- The workflow reads the live pointer itself instead of requiring an
  operator to paste release id and generation mid-incident.
- Every run opens a `qualification-gate-failure` issue. A bypass firing
  more than rarely means the qualification gate is the defect.

Normal promotion is unchanged and still fail-closed.

Net: -2,820 / +355. The workflow is 466 -> 179 lines;
`desktop_update_channels.py` is 942 -> 437 (main was 413, so the whole
emergency capability now costs +24 lines instead of +530).

Verification:
- `python3 -m pytest tests/unit/test_desktop_update_channels.py
  tests/unit/test_desktop_updates.py tests/unit/test_desktop_release_scripts.py`
  -> 133 passed. New `TestEmergencyBetaPromotionRules` covers: promotes an
  unqualified build and marks the pointer, normal promotion still rejects
  that same build, stale release-id and stale generation CAS both rejected,
  roll-forward only, and never reaches stable.
- `python3 .github/scripts/check-release-process-guards.py` passes.
- `python3 .github/scripts/test_desktop_qualification_dispatch.py` passes.
- `python3 .github/scripts/check-desktop-release-terminology.py` passes.
- `python3 backend/scripts/check_route_policy_baseline.py`: 0 baseline
  additions, 0 new missing entries after removing the three routes.
- Workflow parses as YAML; `actionlint` is not installed locally, so it has
  not been linted — CI must confirm.

Not exercised: the live promotion path itself. This changes a production
release control and I have not run it against the real backend.

Failure-Class: FC-split-mutation-authority

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Audited all deploy surfaces. The posture was bimodal and arbitrary: one
surface welded shut with no hatch, twenty with no gate at all, and which
was which bore no relation to blast radius.

Two surfaces could block a hotfix with no recovery:

1. `gcp_backend.yml` (prod backend) required a *successful* Release
   Eligibility push-run on the exact SHA, with zero bypass inputs. A flaky
   or red check poisons that SHA permanently -- a rerun does not make the
   original run succeed -- so the only recovery was landing another commit
   on main and waiting for a full green run.
2. `plan-desktop-release.py` checked the Swift source gate *before* the
   `force_release` branch, so `force_release` did not bypass it (as
   documented). A flaky `Desktop Swift Build & Tests` blocked candidate
   creation outright, and every downstream stage with it.

Both now have hatches following the pattern validated for beta:

- `gcp_backend.yml`: `skip_eligibility_proof=true` +
  `break_glass_confirm=deploy-without-proof` + a required
  `break_glass_reason`. Ancestry-of-main is moved *outside* the branch and
  always enforced, so unreviewed code still cannot reach production. Opens
  a `release-gate-failure` issue.
- `desktop_auto_release.yml`: new `release_mode=break_glass`, the only mode
  that may cut a candidate over a red source check. Emits
  `source_gate_bypassed`. `force_release` semantics are unchanged.

Surfaces deliberately untouched: `gcp_backend_auto_dev.yml` is
workflow_run-only, and manual `gcp_backend.yml` is already its fallback.
Desktop stable already had `break_glass_confirm`. The 20 ungated `gcp_*`
services need gates decided first -- tracked separately, not added here.

AGENTS.md now carries one table of every hatch. Not knowing a hatch exists
is the same outage as not having one.

Verification:
- `python3 .github/scripts/test_plan_desktop_release.py` -> passes,
  including two new cases: break_glass releases over a blocked source
  check, and does not set the bypass flag when the check passes. The
  existing assertion that force_release still blocks is unchanged.
- `python3 .github/scripts/test_check_backend_deploy_source_admission.py`
  -> 23 tests pass, including 3 new break-glass contract tests (confirm
  string + reason required; ancestry enforced outside the branch; bypass
  recorded as an issue). These read workflow source, so they are static
  tripwires, not behavioral coverage -- GitHub Actions cannot be driven
  from a unit test.
- `python3 .github/scripts/check_backend_deploy_source_admission.py` passes
  (note: it validates structural wiring, not bypass semantics -- hence the
  added contract tests).
- `check-release-process-guards.py`, `check_agents_md_lean.py`,
  `check-desktop-release-terminology.py`, `test_desktop_qualification_dispatch.py`
  all pass. Backend unit tests: 133 passed.
- All three workflows parse as YAML.

Not exercised: no hatch has been fired against real infrastructure. These
change production deploy controls and need a real incident or a deliberate
dry run before they are trusted.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
The pre-push gate caught this: adding `issues: write` to
`firestore_readiness` violated `validate-backend-runtime-env.py`, which
requires that job's permissions to be exactly actions:read/contents:read.
That guard is correct -- the readiness job is a least-privilege
release-proof boundary and must not carry write scopes.

Move the issue-recording step into its own `record_break_glass` job that
depends on the readiness job's `break_glass` output and holds the
issues:write scope by itself. The readiness boundary is restored unchanged.

Verification:
- `python3 backend/scripts/validate-backend-runtime-env.py --env dev
  --check-workflows` and `--env prod` both pass (this is the check that
  blocked the push).
- `check_backend_deploy_source_admission.py`,
  `test_check_backend_deploy_source_admission.py` (23),
  `test_plan_desktop_release.py`, `check-release-process-guards.py`,
  `check_agents_md_lean.py` all pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…needed

CI failure: `tests/unit/test_strict_firestore_transaction.py
::test_unsupported_operations_fail_loudly[create]`.

An earlier commit on this branch taught the StrictFirestore fixture to
support `transaction.create`, because the emergency-promotion audit
subsystem created audit and side-effect-claim documents inside its
transaction. It did not update the test asserting `create` is unsupported,
so the fixture and its contract test disagreed. The test raised
`RuntimeError('row already exists')` where it expected
`UnsupportedFirestoreOperationError`.

Deleting that subsystem removed the only reason for the capability. No
remaining consumer of the fixture (`test_candidate_lifecycle`,
`test_memory_ledger`, `test_repair_memory_state_head`) calls
`transaction.create`, so the fixture is reverted to main's version rather
than the test being relaxed. The fixture is now unchanged from main, and
this branch no longer touches it at all.

Verification:
- `BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh` over the 7 affected files
  (the authoritative runner CI uses, not bare pytest) -> exit 0, all files
  pass, including the previously failing
  `test_strict_firestore_transaction.py`.
- `git diff main...HEAD -- backend/tests/unit/fixtures/` is now empty.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Provide the fault bundle a hermetic Firebase Auth emulator profile and wait
for authenticated bridge readiness. Make qualification release preflight and
worktree/tag handling deterministic without changing emergency workflows.

Tests: bash desktop/macos/tests/test-fault-suite-launch-env.sh
Tests: bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh

Failure-Class: none
Require wait-ready to parse the bridge snapshot and reject signed-out, restoring, incomplete-owner, and stale states. Validate candidate publication and immutable signed release assets before qualification.

Failure-Class: none
@Git-on-my-level
Git-on-my-level force-pushed the feat/release-evidence-override-10082 branch from 2b6142b to 0265e8c Compare July 20, 2026 11:35
A qualified desktop beta claim now exposes a should_promote output so a retry can re-dispatch the protected beta promotion without rerunning the expensive qualification stack.

Verification:
- ENCRYPTION_SECRET=*** backend/.venv/bin/python -m pytest backend/tests/unit/test_desktop_release_scripts.py backend/tests/unit/test_desktop_update_channels.py
- actionlint .github/workflows/desktop_qualify_beta.yml
- git diff --check

Failure-Class: FC-split-mutation-authority
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor follow-up for the trusted review threads:

Thread Status
PRRT_kwDOLkKqys6SKBWh / discussion_r3612318511 Fixed. Qualified dispatch retries now expose should_promote=true, and desktop_qualify_beta.yml re-dispatches protected beta promotion without rerunning qualification.
PRRT_kwDOLkKqys6SKBWj / discussion_r3612318514 Resolved by the simplified design already in this PR: emergency side effects were removed from the pointer/readiness boundary, so there is no abandoned side-effect claim to recover.

Verification run locally before push:

  • python3 .github/scripts/test_desktop_qualification_dispatch.py
  • ENCRYPTION_SECRET=*** backend/.venv/bin/python -m pytest backend/tests/unit/test_desktop_release_scripts.py backend/tests/unit/test_desktop_update_channels.py → 43 passed
  • actionlint .github/workflows/desktop_qualify_beta.yml
  • git diff --check
  • Manual pre-push gate against origin/main with this PR body → passed 36 manifest checks plus bounded repo hooks; rerun with env -u VIRTUAL_ENV so backend typecheck used backend/.venv instead of the Hermes Python.

I resolved both review threads after pushing a250055478f26ba83d6ef79cbf241576a6315bf8 and re-scanned trusted bot threads; none remain unresolved at this head.

@Git-on-my-level
Git-on-my-level merged commit 323a3be into BasedHardware:main Jul 20, 2026
30 of 33 checks passed
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
…parallel subsystem (BasedHardware#10091)

## Summary

Closes BasedHardware#10082

Adds a break-glass path for promoting a signed macOS candidate to beta
when the qualification gate itself is broken — the case we actually hit.

**Scope changed after review**, twice:

1. The first pass built this as a parallel subsystem with an approval
ceremony. It is now a relaxed precondition on the existing promotion
path.
2. An audit of every deploy surface found the same footgun on two more.
Those now have hatches too.

## Every gated surface now has a hatch

The audit found the posture was bimodal and arbitrary: one surface
welded shut with no hatch, twenty with no gate at all, and which was
which bore no relation to blast radius.

| Surface | Before | Now |
|---|---|---|
| Desktop candidate (`desktop_auto_release`) | Swift source gate;
`force_release` explicitly did **not** bypass it |
`release_mode=break_glass` |
| Desktop beta | fail-closed qualification, no hatch |
`desktop_emergency_promote_beta` |
| Desktop stable | already had `break_glass_confirm` | unchanged |
| **Backend prod** (`gcp_backend`) | required a *successful* eligibility
run on the exact SHA, **zero bypass inputs** | `skip_eligibility_proof`
+ `break_glass_confirm` + reason |

Two of these could block a hotfix with no recovery at all:

- **Backend prod**: a flaky or red check *permanently poisons that SHA*
— rerunning doesn't make the original run succeed, so the only recovery
was landing another commit on `main` and waiting for a full green run.
That's a bigger blast radius than the beta gate that cost a day.
- **Desktop candidate**: `plan-desktop-release.py` checked the source
gate *before* the `force_release` branch, so a flaky `Desktop Swift
Build & Tests` blocked candidate creation outright, and everything
downstream with it.

**Hatches relax evidence requirements only.** The backend hatch moves
the ancestry-of-`main` check *outside* the break-glass branch so it is
always enforced — unreviewed code still cannot reach production. Each
hatch opens a tracking issue; repeated use means the gate is the defect.

`AGENTS.md` now carries one table of every hatch. Not knowing a hatch
exists is the same outage as not having one.

Untouched: `gcp_backend_auto_dev` is `workflow_run`-only and manual
`gcp_backend` is already its fallback. The 20 ungated `gcp_*` services
need gates decided first — separately, not here.

## The design

Emergency promotion is ordinary promotion with the T2 qualification gate
relaxed. It is not a separate mutation path.

- `_build_channel_pointer`, `_build_beta_rollback_pointer`, and
`_build_emergency_macos_beta_pointer` collapse into one `_build_pointer`
driven by a `TRANSITIONS` policy table. It is the single
pointer-mutation authority; the three transitions differ only in which
preconditions they declare.
- The three emergency endpoints become `emergency: true` on the existing
`POST /v2/desktop/channels/promote`. Beta-only, and requires a
compare-and-swap on both current release id and generation, so it cannot
silently clobber a concurrent normal promotion.
- The resulting pointer carries `emergency: true`. The audit record
lives on the pointer rather than in a parallel collection that can
diverge from it.
- Normal promotion is unchanged and still fail-closed.

## Why the ceremony was removed

Removed: two-approver comment parsing, the four-hour expiry window,
incident binding, behavioral-evidence fetch, responder notification, the
one-hour monitor, the operation-id reconciliation protocol, and the
recovery job that existed to repair state the subsystem itself created.

This codebase is mostly agent-driven, and **ceremony is not a control
against an automated actor.** An agent fills in a rationale, an incident
id, and an approval comment as readily as a human — faster, and
correctly. Those fields imposed real cost on a small team mid-incident
while filtering nothing. Eight of this branch's original commits were
fixes to that machinery rather than to release behavior, which is the
clearest signal it cost more than the risk it insured.

What remains are the guards a machine can actually check: tag-to-SHA
binding, artifact digests recomputed from the published assets, and the
pointer CAS.

The workflow now reads the live pointer itself rather than requiring an
operator to paste release id and generation mid-incident.

## The escape hatch is a signal, not a solution

Every run opens a `qualification-gate-failure` issue recording tag, SHA,
operator, reason, and run URL. If those accumulate, the qualification
gate is the defect and this hatch is masking it. Fix the gate, then
close the issue.

## Also in this PR

Deletes `release_blessing.py` and `check-python-backend-blessing.py`
plus their tests (502 lines). The latter is referenced only by its own
test — no workflow, no Makefile, no `checks-manifest.yaml` entry — and
`run_checks.py` resolves checks by explicit id without globbing, so
nothing could execute it.

The qualification reliability amendment keeps every break-glass workflow
unchanged while making its automatic evidence boundary fail closed:
fault qualification waits for the bridge's live signed-in, onboarded,
non-restoring owner snapshot (not only the UI's `appState: main`), and
release preflight validates the fetched publication timestamp plus
signed ZIP, DMG, and signed-smoke assets with SHA-256 digests.

## Product invariants affected

- INV-AUTH-1

## Verification

- `cd backend && python3 -m pytest
tests/unit/test_desktop_update_channels.py
tests/unit/test_desktop_updates.py
tests/unit/test_desktop_release_scripts.py` → **133 passed**
- New `TestEmergencyBetaPromotionRules` covers: promotes an unqualified
build and marks the pointer `emergency`; normal promotion still rejects
that same build; stale release-id and stale generation CAS both
rejected; roll-forward only; never reaches stable.
- `python3 .github/scripts/check-release-process-guards.py` → passes
- `python3 .github/scripts/test_desktop_qualification_dispatch.py` →
passes
- `python3 .github/scripts/check-desktop-release-terminology.py` →
passes
- `python3 backend/scripts/check_route_policy_baseline.py` → 0 baseline
additions, 0 new missing entries after removing the three routes
- Workflow validated as YAML (466 → 179 lines, one job, 8 steps)
- `python3 .github/scripts/test_plan_desktop_release.py` → passes,
including two new cases: `break_glass` releases over a blocked source
check, and does not set the bypass flag when the check passes. The
existing assertion that `force_release` still blocks is unchanged.
- `python3
.github/scripts/test_check_backend_deploy_source_admission.py` → 23
pass, including 3 new break-glass contract tests (confirm string +
reason required; ancestry enforced outside the branch; bypass recorded
as an issue). These read workflow source, so they are **static
tripwires, not behavioral coverage** — Actions cannot be driven from a
unit test.
- `bash desktop/macos/tests/test-omi-ctl-wait-ready.sh` → rejects
signed-out, restoring, owner-not-ready, and stale snapshots; accepts
only the live authenticated owner-ready bridge snapshot.
- `python3 desktop/macos/scripts/release-keyvalue.py self-test` →
validates passing release JSON and rejects missing/malformed publication
timestamps, missing signed-smoke assets, and missing artifact digests.
- `bash desktop/macos/tests/test-fault-suite-launch-env.sh && bash
desktop/macos/tests/test-qualify-desktop-beta-contract.sh` → passes;
confirms the fault harness invokes the strengthened readiness command
and qualification bootstrap contracts remain intact.
- `ENCRYPTION_SECRET=*** backend/.venv/bin/python -m pytest
backend/tests/unit/test_desktop_release_scripts.py
backend/tests/unit/test_desktop_update_channels.py` → 43 passed; covers
qualified qualification-claim retries re-dispatching beta promotion
without rerunning the runner.
- `actionlint .github/workflows/desktop_qualify_beta.yml` → passes.
- `make preflight` with this PR body → 36 deterministic checks passed.
- `python3 .github/scripts/check_backend_deploy_source_admission.py` →
passes. Note it validates structural wiring, not bypass semantics —
hence the added contract tests.
- `check_agents_md_lean.py` → within budget

## Limitations

- **No hatch has been fired against real infrastructure.** These change
production deploy controls — beta promotion, backend prod deploy,
desktop candidate creation. They need a real incident or a deliberate
dry run before they are trusted.
- **`gcp_backend.yml` is prod backend deploy.** Per `AGENTS.md` that is
a wide-blast-radius surface needing explicit sign-off; this is not
auto-mergeable.
- Full backend pytest selection could not run in this worktree (no
project-local Python environment; restricted network blocks the
documented 3.11 bootstrap). The three affected files were run directly.

## Failure class

Failure-Class: FC-split-mutation-authority

The original defect and this rewrite share a cause: pointer-mutation
authority was split across parallel implementations. Consolidating to a
single `_build_pointer` removes the class rather than adding another
observer of it.

## Follow-ups (not in this PR)

Deliberately excluded to keep this reviewable:

- 22 `gcp_*` deploy workflows, 3,766 lines, zero `workflow_call` — the
job scaffold is copy-pasted ~20×. A reusable workflow targets ~1,200
lines and removes the drift risk of hardening one deploy path and
missing the others.
- ~1,300 lines implementing the same scan → count →
compare-to-JSON-baseline ratchet five separate times, across 8 baseline
formats. One runner plus a rule table targets ~300.
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.

release: separate qualification evidence from promotion permission (make override expressible, on the record)

1 participant