Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(ci): attest native installers and smoke every published release (#438)
Ruben Lütke2cabbd884fcc
diff --git a/.github/workflows/desktop-installers.yml b/.github/workflows/desktop-installers.ymlindex b1ebe54174..b364a767f6 100644--- a/.github/workflows/desktop-installers.yml+++ b/.github/workflows/desktop-installers.yml@@ -420,6 +420,11 @@ jobs:# The ONLY job that may write to the repository, and only to attach the# assets it just verified.contents: write+ # Build provenance for the native installers (tag runs only, see the+ # attestation step): an OIDC identity for Sigstore plus the attestation+ # store. Users check it with `gh attestation verify`.+ id-token: write+ attestations: writesteps:- name: Checkoutuses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2@@ -493,6 +498,18 @@ jobs:if-no-files-found: errorretention-days: 14+ # SLSA build provenance for every native installer the manifest lists+ # (.exe, both .dmg, .AppImage, .deb), signed with this workflow's OIDC+ # identity and stored in GitHub's attestation store. It runs before the+ # upload so a release can never carry installers without provenance, and+ # it attests the final (signed) bytes that the OS jobs uploaded.+ # Verify a download: gh attestation verify <file> -R PersonalJarvis/PersonalJarvis+ - name: Attest build provenance for the native installers+ if: github.ref_type == 'tag'+ uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2+ with:+ subject-checksums: installers/installers-SHA256SUMS.txt+- name: Upload verified installer assets without replacing published filesif: github.ref_type == 'tag'env:diff --git a/.github/workflows/installer-smoke.yml b/.github/workflows/installer-smoke.ymlindex 32a1bec5a2..01cfd0b680 100644--- a/.github/workflows/installer-smoke.yml+++ b/.github/workflows/installer-smoke.yml@@ -133,7 +133,7 @@ jobs:echo "run-fresh=false" >> "$GITHUB_OUTPUT"echo "fresh-install smoke SKIPPED."fi- if echo "$changed" | grep -qE '^(install/install-verify\.(sh|ps1)|install/TRUST_ROOT\.md|install/install\.(sh|ps1)|install/installer\.py|\.github/workflows/sign-installer\.yml|\.github/workflows/installer-smoke\.yml)$'; then+ if echo "$changed" | grep -qE '^(install/install-verify\.(sh|ps1)|install/TRUST_ROOT\.md|install/install\.(sh|ps1)|install/installer\.py|\.github/workflows/sign-installer\.yml|\.github/workflows/installer-smoke\.yml|\.github/workflows/release-wrapper-smoke\.yml)$'; thenecho "run-verify=true" >> "$GITHUB_OUTPUT"echo "verify-release smoke RUNS."else@@ -338,101 +338,17 @@ jobs:exit $RC# Continuous proof that the verifying installer wrapper still works end-to-end- # against the latest signed release: resolve the tag, confirm the signed- # assets are attached, then run the RELEASED install-verify.sh (not the- # in-repo copy — that is the actual wire format a user runs) in- # --dry-run --no-wizard --no-launch mode. Skips gracefully when no signed- # release exists yet, which is the state on a bootstrapping commit.+ # against the latest signed release (or the dispatched `tag`). The steps live+ # in release-wrapper-smoke.yml, which release-smoke.yml also runs on every+ # OS after each release - one implementation, two schedules. It skips+ # gracefully when no published release exists yet.verify-release:name: verify signed release wrapperneeds: changesif: needs.changes.outputs.run-verify == 'true'- runs-on: ubuntu-latest- timeout-minutes: 10-- steps:- - name: Checkout (just for install-verify.sh reference)- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2- with:- fetch-depth: 1- persist-credentials: false-- - name: Resolve target tag- id: tag- env:- GH_TOKEN: ${{ github.token }}- INPUT_TAG_RAW: ${{ inputs.tag }}- run: |- set -euo pipefail- INPUT_TAG="$INPUT_TAG_RAW"- if [ -n "$INPUT_TAG" ]; then- echo "tag=$INPUT_TAG" >> "$GITHUB_OUTPUT"- echo "Using manually-provided tag: $INPUT_TAG"- exit 0- fi- # Resolve the latest published release. The /latest API- # returns 404 if there are no releases yet — we treat that- # as a "skip" condition, not a failure.- HTTP=$(curl -s -o /tmp/resp.json -w "%{http_code}" \- -H "Authorization: Bearer $GH_TOKEN" \- -H "Accept: application/vnd.github+json" \- -H "X-GitHub-Api-Version: 2022-11-28" \- "https://api.github.com/repos/${{ github.repository }}/releases/latest")- if [ "$HTTP" = "404" ]; then- echo "tag=" >> "$GITHUB_OUTPUT"- echo "No releases yet — smoke will skip gracefully."- exit 0- fi- if [ "$HTTP" != "200" ]; then- echo "::error::unexpected HTTP $HTTP from GitHub API"- cat /tmp/resp.json- exit 1- fi- TAG=$(python3 -c "import json; print(json.load(open('/tmp/resp.json'))['tag_name'])")- echo "tag=$TAG" >> "$GITHUB_OUTPUT"- echo "Latest release tag: $TAG"-- - name: Skip when no signed release exists- if: steps.tag.outputs.tag == ''- run: |- echo "::notice::No signed release exists yet; smoke test is a no-op."- echo "This is expected on the bootstrapping commit that adds the signing workflow."- echo "Once the first v*.*.* tag is pushed and signed, this smoke will run for real."-- - name: Confirm signed assets exist on the release- if: steps.tag.outputs.tag != ''- run: |- set -euo pipefail- TAG="${{ steps.tag.outputs.tag }}"- REL_BASE="https://github.com/${{ github.repository }}/releases/download/${TAG}"- for f in install-verify.sh install.sh install.sh.sig install.sh.pem install.sh.bundle; do- if ! curl -fsSL -I -o /dev/null "${REL_BASE}/${f}"; then- echo "::error::missing asset on release $TAG: ${f}"- echo "Did the sign-installer.yml workflow run to completion?"- exit 1- fi- done- echo "All signed assets present on release $TAG."-- - name: Run install-verify.sh end-to-end (dry-run, no-wizard, no-launch)- if: steps.tag.outputs.tag != ''- env:- JARVIS_INSTALL_TAG: ${{ steps.tag.outputs.tag }}- JARVIS_INSTALL_DIR: /tmp/jarvis-smoke-install- # This job verifies the latest published release even weeks later.- # Its signature chain still runs; only the 24-hour recency policy is- # waived for this historical artifact in CI.- JARVIS_INSTALL_ALLOW_STALE: "1"- run: |- set -euo pipefail- REL_BASE="https://github.com/${{ github.repository }}/releases/download/${JARVIS_INSTALL_TAG}"- # Download the released install-verify.sh (NOT the in-repo copy)- # — this is the actual wire-format the user runs.- curl -fsSL "${REL_BASE}/install-verify.sh" -o /tmp/install-verify.sh- chmod +x /tmp/install-verify.sh- echo "----- install-verify.sh first 20 lines -----"- head -20 /tmp/install-verify.sh- echo "--------------------------------------------"- # The verifier honours JARVIS_INSTALL_TAG (set above) so we exercise- # the exact release we resolved.- bash /tmp/install-verify.sh --dry-run --no-wizard --no-launch+ permissions:+ contents: read+ uses: ./.github/workflows/release-wrapper-smoke.yml+ with:+ tag: ${{ inputs.tag }}+ platforms: '["ubuntu-latest"]'\ No newline at end of filediff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.ymlindex f5a19187ff..28360bf300 100644--- a/.github/workflows/release-cut.yml+++ b/.github/workflows/release-cut.yml@@ -15,6 +15,7 @@# personal-jarvis-src.tar.gz asset the install scripts fall back to. The# in-app updater follows releases/latest, so this is the step that reaches# users.+# 6. runs release-smoke.yml against the published release (read-only).## Tags pushed with GITHUB_TOKEN fire no `push: tags` event, which is why step 4# dispatches explicitly; workflow_dispatch is the documented exception.@@ -205,3 +206,19 @@ jobs:python scripts/ci/release_assets.py finalize--repo "$GITHUB_REPOSITORY" --tag "v$V"--sha "$(git rev-parse HEAD)" --wait-minutes 150++ # Read-only proof that what users now download installs: assets, checksums,+ # build provenance and the signed wrapper on Linux, Windows and macOS. Called+ # from here because a release published with GITHUB_TOKEN fires no `release`+ # event. A red smoke means the release is already public: follow the+ # rollback runbook in docs/ci-pipeline.md.+ smoke:+ name: smoke published release+ needs: [cut, publish]+ permissions:+ contents: read+ attestations: read+ uses: ./.github/workflows/release-smoke.yml+ with:+ tag: v${{ needs.cut.outputs.version }}+ require_attestation: truediff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.ymlnew file mode 100644index 0000000000..98cb382cd8--- /dev/null+++ b/.github/workflows/release-smoke.yml@@ -0,0 +1,190 @@+# Release smoke - does the release users can download today actually verify+# and install? Read-only: it never edits, uploads to or re-publishes a release.+#+# For one PUBLISHED release it proves, on Linux, Windows and macOS:+# 1. the complete asset set, both signed manifests and the source checksum+# match GitHub's server-side digests (release_assets.py verify - the same+# rules finalization applied to the draft),+# 2. the native installers a user of that OS downloads match+# installers-SHA256SUMS.txt byte for byte, and carry a valid build+# provenance attestation from desktop-installers.yml on that tag,+# 3. the released install-verify.sh / install-verify.ps1 verifies every+# signature axis and hands off to the installer in dry-run / no-launch+# mode (release-wrapper-smoke.yml, shared with installer-smoke.yml).+#+# Triggers:+# * release-cut.yml calls it after it publishes (its `smoke` job). That is+# the normal path: a release published with GITHUB_TOKEN fires no+# `release` event, so the trigger below never sees release-cut releases.+# * `release: published` covers a release a maintainer publishes by hand.+# * workflow_dispatch re-checks any published tag, e.g. before a rollback.+#+# Releases built before provenance existed have no attestation; that is a+# notice unless `require_attestation` is set (release-cut sets it).++name: Release smoke++on:+ release:+ types: [published]+ workflow_dispatch:+ inputs:+ tag:+ description: "Published release tag (vX.Y.Z); empty = latest"+ required: false+ default: ""+ require_attestation:+ description: "Fail when an installer has no build provenance attestation"+ type: boolean+ default: false+ workflow_call:+ inputs:+ tag:+ type: string+ required: true+ require_attestation:+ type: boolean+ default: true++permissions:+ contents: read++jobs:+ assets:+ name: published assets and manifests+ runs-on: ubuntu-latest+ timeout-minutes: 10+ outputs:+ tag: ${{ steps.tag.outputs.tag }}+ steps:+ - name: Checkout+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2+ with:+ persist-credentials: false++ - name: Set up Python+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0+ with:+ python-version: "3.11"++ - name: Resolve the release tag+ id: tag+ env:+ GH_TOKEN: ${{ github.token }}+ INPUT_TAG: ${{ inputs.tag || github.event.release.tag_name }}+ REPO: ${{ github.repository }}+ run: |+ set -euo pipefail+ tag="$INPUT_TAG"+ if [ -z "$tag" ]; then+ tag="$(gh api "repos/$REPO/releases/latest" --jq .tag_name)"+ fi+ [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::Not a release tag: $tag"; exit 1; }+ echo "tag=$tag" >> "$GITHUB_OUTPUT"+ echo "Release under test: $tag"++ - name: Verify the published asset set against GitHub's digests+ env:+ GH_TOKEN: ${{ github.token }}+ TAG: ${{ steps.tag.outputs.tag }}+ run: python scripts/ci/release_assets.py verify --repo "$GITHUB_REPOSITORY" --tag "$TAG"++ installers:+ needs: assets+ strategy:+ fail-fast: false+ matrix:+ include:+ - os: ubuntu-latest+ platform: linux+ - os: windows-latest+ platform: windows+ - os: macos-latest+ platform: macos+ # No explicit `name:` - an unevaluated matrix value renders raw in the+ # check list whenever the job is skipped (see the dragdrop job in ci.yml).+ runs-on: ${{ matrix.os }}+ timeout-minutes: 30+ permissions:+ contents: read+ # `gh attestation verify` reads the repository's attestation store.+ attestations: read+ env:+ GH_TOKEN: ${{ github.token }}+ TAG: ${{ needs.assets.outputs.tag }}+ REQUIRE_ATTESTATION: ${{ inputs.require_attestation && '--require-attestation' || '' }}+ steps:+ - name: Checkout+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2+ with:+ persist-credentials: false++ - name: Set up Python+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0+ with:+ python-version: "3.11"++ - name: Download installers, check checksums and build provenance+ shell: bash+ run: >-+ python scripts/ci/release_assets.py verify+ --repo "$GITHUB_REPOSITORY" --tag "$TAG"+ --platform "${{ matrix.platform }}"+ --directory "$RUNNER_TEMP/installers"+ $REQUIRE_ATTESTATION++ # The checksum proves the bytes; these prove the container opens the way+ # the OS will open it. Signatures are reported, not required, while the+ # publisher certificates are optional (see desktop-installers.yml).+ - name: Inspect the Linux packages+ if: matrix.platform == 'linux'+ shell: bash+ run: |+ set -euo pipefail+ cd "$RUNNER_TEMP/installers"+ for deb in personal-jarvis_*_amd64.deb; do+ [ -e "$deb" ] || continue+ dpkg-deb --info "$deb" > /dev/null+ echo "$deb: package metadata OK"+ done+ # An AppImage is an executable ELF runtime with the squashfs appended.+ python - <<'PYEOF'+ import sys+ with open("PersonalJarvis-Linux-x86_64.AppImage", "rb") as stream:+ if stream.read(4) != b"\x7fELF":+ sys.exit("::error::PersonalJarvis-Linux-x86_64.AppImage is not an ELF executable")+ print("PersonalJarvis-Linux-x86_64.AppImage: ELF runtime OK")+ PYEOF++ - name: Inspect the Windows installer signature+ if: matrix.platform == 'windows'+ shell: pwsh+ run: |+ $installer = Join-Path $env:RUNNER_TEMP 'installers\PersonalJarvis-Setup-x64.exe'+ $signature = Get-AuthenticodeSignature -FilePath $installer+ Write-Host "Authenticode: $($signature.Status) $($signature.SignerCertificate.Subject)"+ if ($signature.Status -ne 'Valid') {+ Write-Host "::notice::PersonalJarvis-Setup-x64.exe Authenticode status: $($signature.Status)"+ }++ - name: Inspect the macOS disk images+ if: matrix.platform == 'macos'+ shell: bash+ run: |+ set -euo pipefail+ cd "$RUNNER_TEMP/installers"+ for dmg in PersonalJarvis-macOS-arm64.dmg PersonalJarvis-macOS-x64.dmg; do+ hdiutil verify "$dmg"+ if ! spctl --assess --type open --context context:primary-signature -v "$dmg" 2>&1; then+ echo "::notice::$dmg is not accepted by Gatekeeper (unsigned or not notarized)"+ fi+ done++ wrapper:+ needs: assets+ permissions:+ contents: read+ uses: ./.github/workflows/release-wrapper-smoke.yml+ with:+ tag: ${{ needs.assets.outputs.tag }}+ platforms: '["ubuntu-latest","windows-latest","macos-latest"]'diff --git a/.github/workflows/release-wrapper-smoke.yml b/.github/workflows/release-wrapper-smoke.ymlnew file mode 100644index 0000000000..fdb1dceccf--- /dev/null+++ b/.github/workflows/release-wrapper-smoke.yml@@ -0,0 +1,112 @@+# Signed release wrapper smoke - runs the RELEASED install-verify.sh /+# install-verify.ps1 (not the in-repo copy: that is the wire format a user+# actually runs) against one published release in dry-run / no-wizard /+# no-launch mode. Every signature axis is verified for real; only the install+# itself is a dry run, and nothing is launched.+#+# One implementation, two callers:+# * installer-smoke.yml `verify-release` (Linux only, on installer changes),+# * release-smoke.yml (Linux, Windows and macOS, after every release).+#+# An empty `tag` means "the latest published release". When there is none+# (a bootstrapping fork) the smoke is a clearly reported no-op.++name: Release wrapper smoke++on:+ workflow_call:+ inputs:+ tag:+ description: "Published release tag (vX.Y.Z); empty = latest"+ type: string+ default: ""+ platforms:+ description: "JSON list of runner labels"+ type: string+ default: '["ubuntu-latest"]'++permissions:+ contents: read++jobs:+ resolve:+ name: resolve release tag+ runs-on: ubuntu-latest+ timeout-minutes: 5+ outputs:+ tag: ${{ steps.tag.outputs.tag }}+ steps:+ - name: Resolve target tag+ id: tag+ env:+ GH_TOKEN: ${{ github.token }}+ INPUT_TAG: ${{ inputs.tag }}+ REPO: ${{ github.repository }}+ run: |+ set -euo pipefail+ if [ -n "$INPUT_TAG" ]; then+ [[ "$INPUT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::Not a release tag: $INPUT_TAG"; exit 1; }+ echo "tag=$INPUT_TAG" >> "$GITHUB_OUTPUT"+ echo "Using the requested tag: $INPUT_TAG"+ exit 0+ fi+ # Authenticated on purpose: the anonymous API limit is per runner IP+ # and shared with every other job on that host (an earlier version of+ # this step failed on "API rate limit exceeded for <ip>").+ if ! tag="$(gh api "repos/$REPO/releases/latest" --jq .tag_name 2> "$RUNNER_TEMP/latest.err")"; then+ if grep -q "HTTP 404" "$RUNNER_TEMP/latest.err"; then+ echo "tag=" >> "$GITHUB_OUTPUT"+ echo "::notice::No published release yet; the wrapper smoke is a no-op."+ exit 0+ fi+ cat "$RUNNER_TEMP/latest.err"+ exit 1+ fi+ echo "tag=$tag" >> "$GITHUB_OUTPUT"+ echo "Latest published release: $tag"++ # No explicit `name:` - an unevaluated ${{ matrix.os }} renders raw in the+ # check list whenever the job is skipped (see the dragdrop job in ci.yml).+ verify:+ needs: resolve+ if: needs.resolve.outputs.tag != ''+ strategy:+ fail-fast: false+ matrix:+ os: ${{ fromJSON(inputs.platforms) }}+ runs-on: ${{ matrix.os }}+ timeout-minutes: 30+ env:+ JARVIS_INSTALL_TAG: ${{ needs.resolve.outputs.tag }}+ REL_BASE: https://github.com/${{ github.repository }}/releases/download/${{ needs.resolve.outputs.tag }}+ # A smoke may verify a release days after publication. The whole+ # signature chain still runs; only the 24-hour Rekor recency policy is+ # waived for this historical artifact in CI.+ JARVIS_INSTALL_ALLOW_STALE: "1"+ steps:+ - name: Run the released install-verify.sh (dry-run, no-wizard, no-launch)+ if: runner.os != 'Windows'+ shell: bash+ run: |+ set -euo pipefail+ export JARVIS_INSTALL_DIR="$RUNNER_TEMP/jarvis-smoke-install"+ curl -fsSL --retry 3 "$REL_BASE/install-verify.sh" -o "$RUNNER_TEMP/install-verify.sh"+ echo "----- install-verify.sh first 20 lines -----"+ head -20 "$RUNNER_TEMP/install-verify.sh"+ echo "--------------------------------------------"+ # The verifier honours JARVIS_INSTALL_TAG, so it checks exactly this+ # release and hands the authenticated install.sh the same flags.+ bash "$RUNNER_TEMP/install-verify.sh" --dry-run --no-wizard --no-launch++ - name: Run the released install-verify.ps1 (dry-run, no-wizard, no-launch)+ if: runner.os == 'Windows'+ shell: pwsh+ run: |+ $ErrorActionPreference = 'Stop'+ $env:JARVIS_INSTALL_DIR = Join-Path $env:RUNNER_TEMP 'jarvis-smoke-install'+ $verifier = Join-Path $env:RUNNER_TEMP 'install-verify.ps1'+ Invoke-WebRequest -Uri "$env:REL_BASE/install-verify.ps1" -OutFile $verifier -UseBasicParsing+ Get-Content $verifier -TotalCount 20+ # Windows PowerShell 5.1 is what the documented one-liner runs.+ & powershell -NoProfile -ExecutionPolicy Bypass -File $verifier --dry-run --no-wizard --no-launch+ exit $LASTEXITCODEdiff --git a/docs/ci-pipeline.md b/docs/ci-pipeline.mdindex e78d407e73..7f8e94b960 100644--- a/docs/ci-pipeline.md+++ b/docs/ci-pipeline.md@@ -188,7 +188,11 @@ A release happens **only** when the maintainer asks for one.verifies required assets and GitHub's stored digests against both checksummanifests, checks the signed payload commit, uploads the source archive andits checksum, and verifies those uploads before publishing. The release-cut- publisher and `release-finalize.yml` share a per-tag lock. Finalization can+ `publish` job is the normal finalizer. `release-finalize.yml` shares its+ per-tag lock but only fires on its own (`workflow_run`) when a person or the+ integration token started the publishers: publisher runs dispatched with+ `GITHUB_TOKEN` raise no `workflow_run` event, so with the default token it+ stays a manual retry path. Finalization canalso be retried manually from main with an existing draft tag. Producersnever edit release visibility or replace existing asset names. Before anupload, the complete staged set must match any files already present;@@ -199,6 +203,70 @@ A release happens **only** when the maintainer asks for one.Re-run failed jobs with their original build artifacts to recover a partialupload; a full rebuild with different bytes requires an explicit decision.The in-app updater follows `releases/latest`; draft releases remain hidden.+* **Build provenance.** On a tag, `desktop-installers.yml` attests every+ native installer listed in `installers-SHA256SUMS.txt` (`.exe`, both+ `.dmg`, `.AppImage`, `.deb`) with `actions/attest-build-provenance` before+ the upload. Anyone can check a download:++ ```bash+ gh attestation verify PersonalJarvis-Setup-x64.exe -R PersonalJarvis/PersonalJarvis+ ```++ Releases up to and including v2.9.0 predate this and have no attestation.+* **`release-smoke.yml`** (read-only) checks a published release the way a+ user meets it: the complete asset set and all manifests against GitHub's+ stored digests, each OS's installers downloaded and matched against+ `installers-SHA256SUMS.txt` plus their attestation, a container check+ (`dpkg-deb`, ELF header, `hdiutil verify`; Authenticode and Gatekeeper are+ reported, not required), and the released `install-verify.sh` /+ `install-verify.ps1` in dry-run, no-launch mode on Linux, Windows and+ macOS (`release-wrapper-smoke.yml`, which `installer-smoke.yml` also runs on+ Linux). Release cut calls it after publishing and requires attestations; a+ release published with `GITHUB_TOKEN` fires no `release` event. Re-check any+ tag with `gh workflow run release-smoke.yml -f tag=vX.Y.Z`.++### When a release is bad: roll forward++PyPI versions and published release assets are immutable, so there is no+"undo". A rollback is a new, higher patch release. What the updater does+decides the order of steps:++* Every install path follows GitHub's **Latest** release+ (`releases/latest`): the native installers' updater, the one-line+ installer's managed checkout, and the website download buttons+ (`releases/latest/download/<name>`). A running app caches the answer for+ 30 minutes.+* An update is offered only when Latest is **strictly newer** than the running+ version (`_is_newer` in `jarvis/ui/web/update_routes.py`). Nothing ever+ downgrades. A user already on the bad version leaves it only when a newer+ version is published.+* A native update downloads the installer from that same release and refuses+ it unless it matches that release's `installers-SHA256SUMS.txt`+ (`jarvis/core/installer_update.py`).++Steps:++1. **Confirm.** Reproduce the problem and run+ `gh workflow run release-smoke.yml -f tag=vX.Y.Z` to see whether the+ artifacts themselves are broken.+2. **Stop the spread (optional, minutes).**+ `gh release edit vX.Y.Z -R PersonalJarvis/PersonalJarvis --prerelease`+ takes the release out of Latest, so Latest falls back to the previous+ release. New downloads and apps on older versions stop receiving the bad+ one (running apps within their 30-minute cache). Users already on it are+ not downgraded. Check the result with+ `gh api repos/PersonalJarvis/PersonalJarvis/releases/latest --jq .tag_name`.+3. **Fix forward.** Land the revert or fix on main through a normal PR, then+ cut a patch: `gh workflow run release-cut.yml -f bump=patch`. The new+ version is newer than both the bad and the previous release, becomes+ Latest, reaches every install path, and is smoke-tested by the cut.+4. **PyPI (optional).** A maintainer may *yank* the bad version on pypi.org.+ pip then skips it unless someone pins that exact version. Never delete it:+ the number can never be reused anyway.+5. **Leave the evidence.** Do not delete the bad release, its assets or its+ tag, and never re-tag. Installs pinned with `JARVIS_INSTALL_TAG`, the+ signed manifests and the attestations all point at them. Add a short note+ to the release body instead.PyPI publishing retains a separate OIDC-only job and can run only after tagadmission. Manual branch runs build packages without publishing or signing.diff --git a/scripts/ci/release_assets.py b/scripts/ci/release_assets.pyindex 980dc39866..7de3cebe7a 100644--- a/scripts/ci/release_assets.py+++ b/scripts/ci/release_assets.py@@ -60,6 +60,13 @@ REQUIRED_ASSETS = ()DESKTOP_ASSETS = INSTALLERS | {"installers-SHA256SUMS.txt"}SIGNING_ASSETS = REQUIRED_ASSETS - DESKTOP_ASSETS+PLATFORM_INSTALLERS = {+ "linux": {"PersonalJarvis-Linux-x86_64.AppImage"},+ "windows": {"PersonalJarvis-Setup-x64.exe"},+ "macos": {"PersonalJarvis-macOS-arm64.dmg", "PersonalJarvis-macOS-x64.dmg"},+}+DEB_PATTERN = re.compile(r"personal-jarvis_[0-9.]+_amd64\.deb")+DESKTOP_WORKFLOW = ".github/workflows/desktop-installers.yml"def release_info(repo: str, tag: str) -> dict:@@ -244,6 +251,22 @@ def dispatch_missing_publishers(repo: str, tag: str, sha: str) -> None:run_command(["gh", "workflow", "run", workflow, "--repo", repo, "--ref", tag])+def parse_manifest(text: str) -> tuple[dict[str, str], list[str]]:+ """Read ``sha256sum`` output into ``{name: hex digest}`` plus format errors."""+ digests: dict[str, str] = {}+ errors = []+ for line in text.splitlines():+ match = re.fullmatch(r"([0-9a-f]{64}) ([A-Za-z0-9_.-]+)", line)+ if not match:+ errors.append("invalid checksum record")+ continue+ digest, name = match.groups()+ if name in digests:+ errors.append(f"duplicate checksum: {name}")+ digests[name] = digest+ return digests, errors++def asset_errors(assets: list[dict], manifests: dict[str, str]) -> list[str]:"""Validate required nonempty assets and manifests against GitHub's stored digest."""by_name = {asset["name"]: asset for asset in assets}@@ -258,19 +281,12 @@ def asset_errors(assets: list[dict], manifests: dict[str, str]) -> list[str]:("installers-SHA256SUMS.txt", INSTALLERS),("checksums.txt", SIGNED - {"payload-commit.txt"}),):- seen = set()- for line in manifests.get(manifest, "").splitlines():- match = re.fullmatch(r"([0-9a-f]{64}) ([A-Za-z0-9_.-]+)", line)- if not match:- errors.append(f"invalid checksum record in {manifest}")- continue- digest, name = match.groups()- if name in seen:- errors.append(f"duplicate checksum: {name}")- seen.add(name)+ digests, problems = parse_manifest(manifests.get(manifest, ""))+ errors.extend(f"{problem} in {manifest}" for problem in problems)+ for name, digest in digests.items():if by_name.get(name, {}).get("digest") != f"sha256:{digest}":errors.append(f"release asset checksum mismatch: {name}")- if required - seen:+ if required - digests.keys():errors.append(f"incomplete manifest: {manifest}")return errors@@ -380,15 +396,147 @@ def finalize(repo: str, tag: str, sha: str, wait_minutes: int) -> int:return 0+def _download(repo: str, tag: str, name: str, folder: Path) -> Path:+ run_command(+ ["gh", "release", "download", tag, "--repo", repo, "--pattern", name, "--dir", str(folder)]+ )+ return folder / name+++def published_errors(repo: str, tag: str) -> list[str]:+ """Re-check a PUBLISHED release the way finalization checked its draft.++ Runs after publication, so it proves what users can download today: the+ complete asset set, both signed manifests and the source checksum, all+ against GitHub's server-side digests. It never writes to the release.+ """+ info = release_info(repo, tag)+ if info.get("tagName") != tag or info.get("isDraft"):+ return [f"{tag} is not a published release"]+ assets = api_pages(f"repos/{repo}/releases/{info['databaseId']}/assets?per_page=100", "")+ with tempfile.TemporaryDirectory(prefix="jarvis-release-smoke-") as raw:+ folder = Path(raw)+ manifests = {+ name: _download(repo, tag, name, folder).read_text(encoding="utf-8")+ for name in ("checksums.txt", "installers-SHA256SUMS.txt", "source-SHA256SUMS.txt")+ }+ errors = asset_errors(assets, manifests)+ by_name = {asset["name"]: asset for asset in assets}+ source, problems = parse_manifest(manifests["source-SHA256SUMS.txt"])+ errors.extend(f"{problem} in source-SHA256SUMS.txt" for problem in problems)+ archive = "personal-jarvis-src.tar.gz"+ if archive not in source:+ errors.append("incomplete manifest: source-SHA256SUMS.txt")+ elif by_name.get(archive, {}).get("digest") != f"sha256:{source[archive]}":+ errors.append(f"release asset checksum mismatch: {archive}")+ return errors+++def platform_installers(platform: str, manifest: dict[str, str]) -> list[str]:+ """The installer files a user on ``platform`` downloads from this release."""+ names = sorted(PLATFORM_INSTALLERS[platform])+ if platform == "linux":+ names += sorted(name for name in manifest if DEB_PATTERN.fullmatch(name))+ return names+++def attestation_state(repo: str, tag: str, path: Path, digest: str) -> str:+ """``verified``, ``absent`` or ``failed`` for one downloaded installer.++ Only the tag build of desktop-installers.yml may vouch for a native+ installer, so the verification pins both the signing workflow and the ref.+ """+ endpoint = f"repos/{repo}/attestations/sha256:{digest}"+ lookup = run_command(["gh", "api", endpoint, "--jq", ".attestations | length"], check=False)+ if lookup.returncode != 0:+ if "HTTP 404" in lookup.stderr:+ return "absent"+ print(f"::error::attestation lookup failed for {path.name}: {lookup.stderr.strip()}")+ return "failed"+ if lookup.stdout.strip() in {"", "0"}:+ return "absent"+ verify = run_command(+ [+ "gh",+ "attestation",+ "verify",+ str(path),+ "--repo",+ repo,+ "--signer-workflow",+ f"{repo}/{DESKTOP_WORKFLOW}",+ "--source-ref",+ f"refs/tags/{tag}",+ "--deny-self-hosted-runners",+ ],+ check=False,+ )+ if verify.returncode != 0:+ print(verify.stdout + verify.stderr)+ return "failed"+ return "verified"+++def platform_errors(+ repo: str, tag: str, platform: str, folder: Path, *, require_attestation: bool+) -> list[str]:+ """Download this platform's installers and prove them like a careful user would."""+ folder.mkdir(parents=True, exist_ok=True)+ manifest, errors = parse_manifest(+ _download(repo, tag, "installers-SHA256SUMS.txt", folder).read_text(encoding="utf-8")+ )+ for name in platform_installers(platform, manifest):+ if name not in manifest:+ errors.append(f"installers-SHA256SUMS.txt does not list {name}")+ continue+ path = _download(repo, tag, name, folder)+ with path.open("rb") as stream:+ digest = hashlib.file_digest(stream, "sha256").hexdigest()+ if digest != manifest[name]:+ errors.append(f"downloaded {name} does not match installers-SHA256SUMS.txt")+ continue+ state = attestation_state(repo, tag, path, digest)+ if state == "failed" or (state == "absent" and require_attestation):+ errors.append(f"build provenance attestation {state}: {name}")+ elif state == "absent":+ print(f"::notice::{name} has no build provenance attestation (older build)")+ print(f"[release] {name}: checksum OK, attestation {state}")+ return errors+++def verify(repo: str, tag: str, platform: str | None, folder: Path | None, attest: bool) -> int:+ errors = published_errors(repo, tag)+ if platform:+ directory = folder or Path(tempfile.mkdtemp(prefix="jarvis-release-smoke-"))+ errors += platform_errors(repo, tag, platform, directory, require_attestation=attest)+ for error in errors:+ print(f"::error::{error}")+ if errors:+ return 1+ scope = f" and {platform} installers" if platform else ""+ print(f"[release] {tag}: published assets{scope} verified")+ return 0++def main(argv: list[str] | None = None) -> int:parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument("command", choices=("prepare", "upload", "dispatch", "finalize"))+ parser.add_argument("command", choices=("prepare", "upload", "dispatch", "finalize", "verify"))parser.add_argument("--repo", required=True)parser.add_argument("--tag", required=True)parser.add_argument("--sha")parser.add_argument("--wait-minutes", type=int, default=0)parser.add_argument("--directory", type=Path)parser.add_argument("--profile", choices=("desktop", "signing"))+ parser.add_argument(+ "--platform",+ choices=sorted(PLATFORM_INSTALLERS),+ help="verify: also download and check this platform's installers",+ )+ parser.add_argument(+ "--require-attestation",+ action="store_true",+ help="verify: a downloaded installer without build provenance fails",+ )args = parser.parse_args(argv)if not re.fullmatch(r"v\d+\.\d+\.\d+", args.tag):parser.error("a stable vX.Y.Z tag is required")@@ -401,6 +549,11 @@ def main(argv: list[str] | None = None) -> int:if args.command == "upload":upload_draft_files(args.repo, args.tag, staged_assets(args.directory, args.profile))return 0+ if args.command == "verify":+ # Read-only and tag-free: a smoke runner needs no git history.+ return verify(+ args.repo, args.tag, args.platform, args.directory, args.require_attestation+ )sha = run_command(["git", "rev-parse", f"refs/tags/{args.tag}^{{commit}}"]).stdout.strip()if args.sha and sha != args.sha:raise ValueError("release tag moved away from the publisher's commit")@@ -411,6 +564,8 @@ def main(argv: list[str] | None = None) -> int:return finalize(args.repo, args.tag, sha, args.wait_minutes)except (subprocess.SubprocessError, OSError, ValueError, KeyError, TypeError) as exc:print(f"::error::Release verification failed: {type(exc).__name__}: {exc}")+ if detail := (getattr(exc, "stderr", None) or "").strip():+ print(detail)return 1diff --git a/tests/unit/ci/test_release_smoke.py b/tests/unit/ci/test_release_smoke.pynew file mode 100644index 0000000000..eae2f9da46--- /dev/null+++ b/tests/unit/ci/test_release_smoke.py@@ -0,0 +1,184 @@+"""Post-release smoke: published assets, installer checksums and build provenance."""++from __future__ import annotations++import hashlib+import subprocess+from pathlib import Path++import pytest+import yaml++from scripts.ci import release_assets++ROOT = Path(__file__).resolve().parents[3]+REPO = "example/project"+TAG = "v1.2.3"+++def workflows() -> dict[str, dict]:+ return {+ p.name: yaml.safe_load(p.read_text(encoding="utf-8"))+ for p in (ROOT / ".github/workflows").glob("*.yml")+ }+++class FakePublishedRelease:+ """In-memory published release; any write command fails the test."""++ def __init__(self, *, attested=0, attestation_ok=True, draft=False):+ self.payloads = {+ "PersonalJarvis-Linux-x86_64.AppImage": b"appimage",+ "personal-jarvis_1.2.3_amd64.deb": b"deb",+ "PersonalJarvis-Setup-x64.exe": b"exe",+ }+ self.manifest = "".join(+ f"{hashlib.sha256(data).hexdigest()} {name}\n"+ for name, data in sorted(self.payloads.items())+ )+ self.attested = attested+ self.attestation_ok = attestation_ok+ self.draft = draft+ self.commands = []++ def command(self, args, **kwargs):+ self.commands.append(args)+ if args[:3] == ["gh", "release", "download"]:+ name = args[args.index("--pattern") + 1]+ folder = Path(args[args.index("--dir") + 1])+ if name == "installers-SHA256SUMS.txt":+ (folder / name).write_text(self.manifest, encoding="utf-8")+ else:+ (folder / name).write_bytes(self.payloads[name])+ return subprocess.CompletedProcess(args, 0, "", "")+ if args[:2] == ["gh", "api"] and "/attestations/sha256:" in args[2]:+ if not self.attested:+ return subprocess.CompletedProcess(args, 1, "", "gh: Not Found (HTTP 404)")+ return subprocess.CompletedProcess(args, 0, f"{self.attested}\n", "")+ if args[:3] == ["gh", "attestation", "verify"]:+ assert args[args.index("--source-ref") + 1] == f"refs/tags/{TAG}"+ assert args[args.index("--signer-workflow") + 1] == (+ f"{REPO}/.github/workflows/desktop-installers.yml"+ )+ return subprocess.CompletedProcess(args, 0 if self.attestation_ok else 1, "", "")+ raise AssertionError(f"unexpected external command: {args}")++ def install(self, monkeypatch):+ monkeypatch.setattr(release_assets, "run_command", self.command)+ monkeypatch.setattr(+ release_assets,+ "release_info",+ lambda *a: {"databaseId": 1, "tagName": TAG, "isDraft": self.draft},+ )+++def test_linux_smoke_checks_appimage_and_deb_against_provenance(monkeypatch, tmp_path):+ fake = FakePublishedRelease(attested=1)+ fake.install(monkeypatch)+ errors = release_assets.platform_errors(REPO, TAG, "linux", tmp_path, require_attestation=True)+ assert errors == []+ verified = [c[3] for c in fake.commands if c[:3] == ["gh", "attestation", "verify"]]+ assert sorted(Path(p).name for p in verified) == [+ "PersonalJarvis-Linux-x86_64.AppImage",+ "personal-jarvis_1.2.3_amd64.deb",+ ]+++ "defect,require,expected",+ [+ ("tampered", False, "does not match"),+ ("unattested", True, "attestation absent"),+ ("forged", False, "attestation failed"),+ ],+)+def test_installer_smoke_fails_closed(monkeypatch, tmp_path, defect, require, expected):+ fake = FakePublishedRelease(+ attested=0 if defect == "unattested" else 1,+ attestation_ok=defect != "forged",+ )+ if defect == "tampered":+ fake.payloads["PersonalJarvis-Setup-x64.exe"] = b"tampered"+ fake.install(monkeypatch)+ errors = release_assets.platform_errors(+ REPO, TAG, "windows", tmp_path, require_attestation=require+ )+ assert any(expected in error for error in errors), errors+++def test_older_unattested_builds_pass_unless_provenance_is_required(monkeypatch, tmp_path):+ fake = FakePublishedRelease()+ fake.install(monkeypatch)+ errors = release_assets.platform_errors(+ REPO, TAG, "windows", tmp_path, require_attestation=False+ )+ assert errors == []+++def test_smoke_refuses_a_draft_without_touching_it(monkeypatch):+ fake = FakePublishedRelease(draft=True)+ fake.install(monkeypatch)+ assert release_assets.published_errors(REPO, TAG) == [f"{TAG} is not a published release"]+ assert fake.commands == []+++def test_source_archive_digest_is_part_of_the_published_check(monkeypatch):+ digest = "b" * 64+ assets = [+ {"name": name, "size": 1, "state": "uploaded", "digest": f"sha256:{digest}"}+ for name in release_assets.REQUIRED_ASSETS | {"personal-jarvis-src.tar.gz"}+ ]+ manifests = {+ "installers-SHA256SUMS.txt": "".join(+ f"{digest} {n}\n" for n in sorted(release_assets.INSTALLERS)+ ),+ "checksums.txt": "".join(+ f"{digest} {n}\n" for n in sorted(release_assets.SIGNED - {"payload-commit.txt"})+ ),+ "source-SHA256SUMS.txt": f"{'c' * 64} personal-jarvis-src.tar.gz\n",+ }++ def command(args, **kwargs):+ assert args[:3] == ["gh", "release", "download"]+ name = args[args.index("--pattern") + 1]+ (Path(args[args.index("--dir") + 1]) / name).write_text(manifests[name], encoding="utf-8")+ return subprocess.CompletedProcess(args, 0, "", "")++ monkeypatch.setattr(release_assets, "run_command", command)+ monkeypatch.setattr(release_assets, "api_pages", lambda *a: assets)+ monkeypatch.setattr(+ release_assets, "release_info", lambda *a: {"databaseId": 1, "tagName": TAG}+ )+ assert release_assets.published_errors(REPO, TAG) == [+ "release asset checksum mismatch: personal-jarvis-src.tar.gz"+ ]+ manifests["source-SHA256SUMS.txt"] = f"{digest} personal-jarvis-src.tar.gz\n"+ assert release_assets.published_errors(REPO, TAG) == []+++def test_native_installers_are_attested_on_tags_before_upload():+ job = workflows()["desktop-installers.yml"]["jobs"]["release"]+ assert job["permissions"]["id-token"] == "write"+ assert job["permissions"]["attestations"] == "write"+ steps = job["steps"]+ attest = next(i for i, s in enumerate(steps) if "attest-build-provenance@" in s.get("uses", ""))+ upload = next(i for i, s in enumerate(steps) if "release_assets.py upload" in s.get("run", ""))+ assert steps[attest]["if"] == "github.ref_type == 'tag'"+ assert steps[attest]["with"]["subject-checksums"] == "installers/installers-SHA256SUMS.txt"+ assert attest < upload+++def test_release_smoke_is_read_only_and_follows_every_cut():+ definitions = workflows()+ for name in ("release-smoke.yml", "release-wrapper-smoke.yml"):+ workflow = definitions[name]+ assert workflow["permissions"] == {"contents": "read"}+ for job in workflow["jobs"].values():+ assert set(job.get("permissions", {}).values()) <= {"read"}+ smoke = definitions["release-cut.yml"]["jobs"]["smoke"]+ assert smoke["uses"] == "./.github/workflows/release-smoke.yml"+ assert "publish" in smoke["needs"]+ assert set(smoke["permissions"].values()) == {"read"}+ assert smoke["with"]["require_attestation"] is True+ wrapper = definitions["installer-smoke.yml"]["jobs"]["verify-release"]+ assert wrapper["uses"] == "./.github/workflows/release-wrapper-smoke.yml"