Skip to content

Check that Apple, Sigstore and the latest stable's updater still accept releases - #1337

Open
tolgaergin wants to merge 6 commits into
fix/sigstore-trust-refreshfrom
ci/release-trust-gates
Open

tolgaergin wants to merge 6 commits into
fix/sigstore-trust-refreshfrom
ci/release-trust-gates

Conversation

@tolgaergin

@tolgaergin tolgaergin commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An installed copy of LPM checks every update with code it can never change, against records that Apple and Sigstore keep changing. Nothing watched those records from the outside. Nothing checked that a new release is one that the updaters already in the field accept, either. #1329 removed the Apple calls from the clients and agreed to move those checks to the release side. This PR adds them.

Fix

  • scripts/ci/previous-stable-update-gate.sh:

    • CI only: the updater finds the account's home from the system, not from $HOME, and on macOS it updates only an app installed there. So the gate runs only in GitHub Actions. It sets the account's ~/.lpm aside and puts it back afterwards.
    • It installs the latest stable through the official installer.
    • It serves a release on loopback: the npm version document, the release-by-tag JSON with the attestation's time and commit, and the assets. Release builds of 0.88.0 already honour these endpoint overrides.
    • That stable then updates itself to the served release through its own lpm self-update, and the gate checks lpm --version.
    • On macOS it hides Xcode and the Command Line Tools once the latest stable no longer needs them; 0.88.0 still runs stapler.
    • It fails when the release isn't newer than the stable it updates from. Versions compare by SemVer precedence, using scripts/ci/semver-newer.py.
    • The developer-tools state lives under RUNNER_TEMP, and an always() step restores the tools.
  • release.yml: the gate runs in two places.

    • The standalone installer smoke job runs it on every candidate and nightly, on Linux x64 and arm64 and macOS arm64 and x64. That job's timeout goes from 15 to 30 minutes.
    • The promotion job runs it on the promotion-time signature, which is the one users receive. That job's timeout goes from 10 to 20 minutes.

    A release the latest stable's updater would refuse is never published.

  • New Release trust workflow, which runs daily, on PRs that touch it, and on dispatch:

    • Apple: Apple must still vouch for the current stable and nightly macOS apps. It runs codesign, stapler validate (with the existing retry wrapper) and Gatekeeper's spctl --assess. These see revoked tickets and certificates that offline clients can't.
    • Sigstore: the live TUF repository must still verify under the built-in TUF root and serve the built-in trust root. The failure message names the assets to replace.
    • Updater: the latest stable must update itself to the newest nightly, using its real publication time, on Linux x64 and arm64 and macOS arm64 and x64. Until the first nightly after a stable release, the stable before it updates to the new stable instead.
    • No silent passes: both macOS archives must be present, and the Sigstore job must run exactly one test.

Tests

  • Review round: the council found that the first version of the gate could never pass on macOS. Check that Apple, Sigstore and the latest stable's updater still accept releases #1337's own run on macos-15-intel failed with "macOS standalone updates require execution from /Users/runner/.lpm/…". That is fixed as described above, along with:

    • partial-hide cleanup;
    • vacuous passes;
    • synthesized publication times;
    • the SemVer comparison;
    • the port race;
    • a python3 that comes from the hidden tools.

    Declined: Sol's suggestion to run the gate with Sigstore refresh turned off. Once Sigstore rotates a key, that would block every release, because installed copies learn new keys by refreshing.

  • Gate against the real nightly, on Linux arm64 (OrbStack, Debian 12): after the rework, with GITHUB_ACTIONS=true and the real publishedAt, 0.88.0, installed by the official installer, updated itself through loopback to 0.89.0-nightly.20261124.284.bc3608e. A planted ~/.lpm came back intact. In an earlier run, one byte appended to SHA256SUMS.txt made 0.88.0 refuse the update, and the gate failed, saying installed copies would be stranded. Outside GitHub Actions the gate refuses to run.

  • Apple checks: run locally against the real 0.88.0 app; all three pass.

  • Sigstore check: the live test passes against Sigstore's repository today.

  • Lint: actionlint and shellcheck are clean for the new files. The one remaining release.yml warning is in an existing job.

Stacked on #1336.

🤖 Generated with Claude Code

@tolgaergin
tolgaergin added this pull request to stack #1338 November 25, 2026 11:54
@tolgaergin
tolgaergin force-pushed the ci/release-trust-gates branch from 70773ab to 8ab098e Compare November 25, 2026 12:43
tolgaergin and others added 6 commits November 25, 2026 13:36
…pt releases

Installed copies of LPM check each update with code they can never
change, against Apple and Sigstore records that keep changing. Nothing
watched those from the outside, and nothing checked that a new release
is one the updaters already in the field accept.

- scripts/ci/previous-stable-update-gate.sh installs the latest stable
  through the official installer into a throwaway home, serves a release
  on loopback, and has that stable update itself to it through its own
  `lpm self-update`. On macOS it hides Xcode and the Command Line Tools
  once the latest stable no longer needs them.
- The release workflow runs it on every candidate and nightly after the
  installer smoke test, so a release the latest stable's updater would
  refuse is never published.
- The new Release trust workflow runs daily: Apple must still vouch for
  the current stable and nightly macOS apps (stapler and Gatekeeper,
  which see revoked tickets and certificates that offline clients
  can't), Sigstore's live repository must still serve the trust root
  built into LPM, and the latest stable must update itself to the
  newest nightly on Linux x64 and arm64 and macOS arm64 and x64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and use real publication times

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The updater finds the account's home from the system, not $HOME, and on
macOS updates only an app in that home, so the gate failed on every Mac.
It now runs only in GitHub Actions, sets the account's ~/.lpm aside
beside itself, and puts it back afterwards. The developer tools state
lives under RUNNER_TEMP with an always() restore step, python3 must not
come from the tools it hides, the server binds its own port, and
versions compare by SemVer precedence through scripts/ci/semver-newer.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Promotion signs the release again, and users get that signature, not
the candidate's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es, and install the Sigstore job's build packages

The macOS run exited with no message. The server now writes the port it
bound, startup failures print the server's log, and an ERR trap names
the failing line. The Sigstore job installs pkg-config and libdbus-1-dev
like the other Linux builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On macos-15-intel the server never wrote its port. It now runs from a
script file with stdin closed, gets 30 seconds to start, and a failure
prints the python3 used, the server process and its log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tolgaergin
tolgaergin force-pushed the ci/release-trust-gates branch from f5d8979 to 6a2c546 Compare November 25, 2026 13:36

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant