_VALID_ASSETS accepted both linux-x86_64.AppImage, the name
electron-builder gives the x64 AppImage and the one
scripts/releases/linux.py publishes feeds for, and a linux-x64.AppImage
alias nothing produces. Both normalize to the same (linux, x64) row, so
an archive holding both listed whichever name came last.
Drop the alias. The new test feeds both names and expects the produced
one in the row and in the version filter; it failed on the previous head
because the alias overwrote the real file.
Linux x86_64 and arm64 AppImages now build, pass native install-and-chat
smoke, unpack to a stable per-version `$XDG_DATA_HOME/hermes/bundles/`
payload path, and publish updater feeds on daily canaries (`#161336`)
and opt-in `--with linux` stable releases (`#161406`), but the builds
page renderer and documentation still hid them or described them as
unsmoked, unoffered artifacts:
- `scripts/releases/downloads_page.py`: accept real `linux-x86_64.AppImage`
and `linux-arm64.AppImage` filenames via `_VALID_ASSETS` (normalizing
`x86_64` to `x64` while rejecting invalid os/arch/ext combinations),
remove `_UNLISTED_OS = frozenset({"linux"})` so staged Linux AppImages
render in `Hermes Desktop` download tables, and update `_SMOKE_SCOPE`
to reflect diagnostic Linux AppImage smokes while preserving the
unsigned Store notice.
- `tests/scripts/test_render_builds_publication.py`: verify real
`linux-x86_64.AppImage` and `linux-arm64.AppImage` rows render in both
release bodies and R2 `index.html`, while YAML feeds and invalid
os/arch/ext pairs remain hidden.
- `apps/desktop/BUILDING.md`, `tests/install/README.md`, and
`website/docs/` (`platform-support`, `installation`, `updating`,
`desktop`, `shared-bundle-builds`, `stable-releases`): document the
Linux AppImage distro/glibc floors, first-launch payload extraction,
`AppImageUpdater` differential updates, measured canary sizes, and
current non-gating canary / opt-in `--with linux` stable status.
The put_object retry-sleep test needed a loopback server thread to
answer 503 inside a 0.5 s budget, so on a busy runner the PUT could
time out first and fail the test before it reached the retry. Raise the
503 from `put_object`'s own `fetcher` seam instead: no server, no
timing. On 0c5046ba26 it still records three 1 s sleeps and three PUTs.
`put_object` retries a retryable R2 status in its own loop with an
unconditional `time.sleep(1.0)`, so under `time_budget` it slept past a
deadline that `signed_request` had already declined to retry into, and
the next attempt then failed on the spent budget instead of the 503.
`_reconcile_linux` reaches it through `linux.publish_stable_record`.
Use `_retry_sleep(1.0)` like the other retry loops: outside a budget it
sleeps as before; inside one it re-raises the PUT's own error once the
time left cannot cover the sleep.
Test: a loopback endpoint answering 503 under a 0.5 s budget recorded
three 1 s sleeps and three PUTs on the previous head; now none and one,
and the error is the 503.
tests/AGENTS.md asks for wall-clock bounds of at least 2 s so a busy
runner does not fail a working test. The budget tests asserted under
1 s; they now assert under 5 s, which still fails a 60 s or 600 s
socket wait.
The 1 s bound was also what caught a retry sleeping past the budget
(1 s, then 2 s). The stalled `signed_request` case now records
`time.sleep` and asserts no retry slept and only one connection opened,
so that check no longer depends on runner speed: making `_retry_sleep`
ignore the budget fails it.
A socket timeout bounds one wait, not one read. `res.read(n)`, the
whole-body `read()` in `signed_request` and the status/header
`readline()` loop recv until they have their bytes, so a peer that sends
a byte every few milliseconds kept a single call going past the
`time_budget` deadline: the budget was only checked between 1 MiB
chunks, and `signed_request` and `read_public_receipt` never checked it
while reading.
Under an active budget, `_connection` now gives the connection a
response class whose socket reader sets each wait's timeout to what the
budget has left (`_effective_timeout`) and raises once it is spent. That
covers the status line, headers and every body read in all four
readers, so the per-loop `_clamp_socket_timeout` / `_check_budget` calls
go away and the chunk loops read as they did before. Connections opened
outside a budget keep the stock response class.
Sends are unchanged: each `sendall` is bounded by the timeout the
connection opened with, which the budget already clamps, and the
reconcilers only PUT small JSON bodies.
Tests: a loopback server that sends headers or a body one byte every
20 ms holds each of `signed_request`, `read_public_receipt`,
`download_public_object` and `verify_remote_artifact` for the whole
10 s trickle on the previous head (8 failed); all raise `TimeoutError`
at the 0.5 s budget now. A trickle that stops at 2.5 s under a 3 s
budget pins the per-wait clamp: without it the last wait runs the
connection's full 3 s.
Post-publication reconcilers (`_reconcile_store`, `_reconcile_linux`)
run after durable channels have already moved, inside `reconcile`'s
30-minute timeout. Previously they inherited `r2.py`'s 600-second
per-request socket timeout and unbounded retries, so a stalled R2
request could outlast the workflow timeout and fail the run after
publication. `_reconcile_store` also caught only `(StoreError,
ValueError, OSError)` and did not handle `r2.R2RequestError` or
`http.client.HTTPException` when reading the archived candidate
manifest.
Add a `ContextVar`-backed `r2.time_budget(total_seconds, *,
per_request_timeout=None)` context manager wired through
`signed_request`, `read_public_receipt`, `_download_url`, and
`_stream_and_hash` (clamping open socket reads and retry sleeps to the
remaining deadline, strictly tightening nested budgets). Wrap
`_reconcile_store` and `_reconcile_linux` in a 300 s budget with 60 s
per-request caps, and widen `_reconcile_store`'s advisory catch tuple
to log a structured Microsoft Store warning on R2/HTTP errors.
No test caught a mutant of three _arch_evidence_reasons clauses: the
invalid commit SHA, the invalid release tag, and ev.arch != arch.
admit_publication's other refusals hide them there. For record_evidence
these clauses are the only guard before it fetches the staged feeds.
The new parametrized test passes record_evidence one bad identity with
everything else valid. It asserts that exact single reason and zero R2
requests. Replacing each clause with pass fails its row, so no
mutant of the shared helper survives test_release_linux.py.
Found by a Sol review round on #161406.
_reconcile_linux runs after the release and its channels are durable,
and the Linux lane promises never to gate publication. Its except
clause listed the error types it expected, and review kept finding ones
it missed. A truncated R2 read raised http.client.HTTPException
(820a4262ab). A malformed live stable-linux.yml raises ruamel's
ParserError from parse_linux_feed. A handoff receipt with a non-string
sha256 raises TypeError in handoff.validate. Each of them failed
sequencer.main after the release was public.
The lane now catches Exception at its single call, with a BLE001
waiver that says why. It logs the traceback and warns with the
exception's type name, the same form sequencer.main uses for its own
::error::. An unexpected bug therefore still shows up in the job log
and as an annotation, but it no longer turns a finished publication
red. SystemExit and KeyboardInterrupt still propagate.
The new test serves a stable-linux.yml that is not valid YAML from the
loopback R2. On the previous head ParserError escaped _reconcile_linux.
Now it warns, the feed is unchanged and no PUT is made.
Found by a Sol review round on #161406.
When linux-evidence.json was missing, publish_stable_record returned
published=False. _reconcile_linux then logged a plain line, so a skipped
or failed recorder left the stable Linux feeds stale with no annotation,
although the PR promises a :⚠️: for missing receipts. A refusal
now warns the same way an R2 error does.
The warning goes through a new progress.warning, next to notice and
error, so it lands on stderr like the other annotations. The sequencer's
stdout stays the JSON step list that progress.py documents. The earlier
print put the R2-error warning on stdout, and the two tests that read it
now read stderr.
The new test runs _reconcile_linux against an empty loopback R2. On the
previous head it saw only the plain log line.
Reported by Greptile on #161406.
r2.signed_request retries an IncompleteRead and then re-raises it.
IncompleteRead is an http.client.HTTPException, not an OSError, so it
escaped _reconcile_linux's catch. The sequencer job then failed after
the release and its channels were already live, which breaks the Linux
lane's non-gating promise. The catch now includes HTTPException, the
same tuple channels.py already uses for R2 transfers.
The test has the loopback R2 fixture send a short body for
linux-evidence.json on every attempt. On the old head it raises
IncompleteRead out of _reconcile_linux.
Reported by Greptile on #161406.
_preflight_feed returned "noop" for an arch whose live feed already
matched the plan before it checked that arch's AppImage. A retry after a
partial publish (x64 written, arm64 PUT failed) therefore verified only
the arm64 AppImage and wrote the arm64 feed, even if the x64 AppImage the
live feed names had gone missing or corrupt since. That breaks the
all-or-nothing rule publish_admitted states: both AppImages are checked
before the first PUT.
The live-feed checks (downgrade, conflicting same version) still refuse
first, without a download. The AppImage size and SHA-512 check then runs
for every arch, whether its feed is already live or not. A rerun where
both feeds are already live now downloads both AppImages and writes
nothing, the same transfer cost as the first publish.
Test: test_retry_after_partial_publish_reverifies_the_already_live_arch_appimage
seeds a live x64 feed, corrupts the x64 AppImage and retries. It
expects a checksum refusal, no PUT and no arm64 feed. It fails on the
previous head (DID NOT RAISE: the arm64 feed was written) and passes now.
Found by the sol-loop review on #161336.
Greptile on #161336: load_feeds_from_dir had no caller, because
fetch_staged_feeds read both staged feeds itself, with a hand-rolled
copy of the receipt-bound transfer that handoff.fetch already does for
every other leg (read and validate the receipt, then GET each row and
check size and sha256), plus a read of r2.Response's private `_body`.
Keep the loader and drop the copy instead: publish_from_env now
downloads each arch's feed with handoff.fetch into a temporary
directory, one receipt per call with only that arch's feed name
included, and reads both with load_feeds_from_dir. Each feed can still
come only from its own arch's receipt, and a missing or tampered feed
still refuses before the first PUT. A transfer whose bytes disagree with
the receipt now gets the shared download's retries before it fails, and
the error reads "Artifact checksum mismatch".
New test: test_publish_from_env_takes_each_feed_only_from_its_own_arch_receipt
moves the x64 feed's receipt row into the arm64 receipt and expects a
refusal with no PUT. It passes on the previous head too (that code
looked the row up per receipt); it fails on a mutant that fetches both
arches in one handoff.fetch call, which is the shape this change has to
avoid.
Greptile on #161336: linux.py threaded an optional `fetcher` through
every R2 call and, when one was set, ran its own copies of
r2.verify_remote_artifact and r2.put_object (checksums, request
hashes, Cache-Control, error checks). Nothing passes a fetcher: the
workflow runs `python -m scripts.releases.linux publish` and the tests
drive the real transport against the loopback R2 fixture. The copies had
already drifted (the artifact check read `response.data`, which
r2.Response doesn't have), so the first caller would have hit an
AttributeError instead of a checksum verdict.
Remove the parameter and its branches. Artifact verification and the
conditional feed PUT now go only through r2.verify_remote_artifact and
r2.put_object, and _get_live_feed keeps only the 404 handling that
r2.signed_request can actually raise. No behaviour change on the real
path, so the existing loopback tests are the proof: the same 36 test ids
in tests/scripts/test_release_linux.py pass before and after.
Termux links its interpreter with RUNPATH $PREFIX/lib, so the launcher put
the payload's Python lib folder first on LD_LIBRARY_PATH. Every child
inherited that, and a Termux Python of the same minor then loaded Hermes's
libpython: `import array` failed in terminal commands, pip and venv.
Staging now rewrites the interpreter's RUNPATH to $ORIGIN/../lib ahead of
the Termux prefix, in place, and the launcher names neither libpython
folder. The value has no version in it, and a .deb whose interpreter cannot
take it fails the build instead of reaching a phone.
Fixes#158261
(cherry picked from commit 5af4d277dea7877b738da23dedba4dea3602f906)
Dropping the *.yml glob made the CI structural job (which validates the
whole plugin-catalog/ directory) silently skip a .yml entry, so it still
passed admission and never loaded at runtime — the #160206 symptom.
Directory mode now collects *.yml again so validate_file rejects it with
"catalog entry files must use the .yaml extension".
On APFS and NTFS the two colliding names are one file. The case-collision
fixtures assumed a write to one name leaves its sibling's bytes alone, so
on the macOS lane writing CRLF into the uppercase path also made the
lowercase entry dirty, and the verifier correctly refused it. The same
assumption broke the binary-CRLF and symlink steps in update-ui.test.mjs
on a Mac.
The CRLF cases now come from a real core.autocrlf=true checkout (what
installers through v2026.9.24 got from Git for Windows), with the
uppercase path holding the bytes of the sibling checked out last. On a
folding filesystem the checkout leaves that state by itself; on a
case-sensitive one the fixture copies the sibling's bytes. The binary and
symlink steps assert on the uppercase path's record instead of counting
dirty entries, since the sibling is dirty too where the names fold.
Verifier code is unchanged.
Historical release tags v2026.8.16.2, v2026.8.18, and v2026.8.31 contain two
distinct blobs whose paths differ only in case:
contributors/emails/agent@Agents-Mac-mini.local and
contributors/emails/agent@agents-Mac-mini.local.
On case-insensitive filesystems (macOS APFS and Windows NTFS), checking out
those immutable tags overwrites one file with the other and leaves the
uppercase entry modified (M). The historical updaters themselves handle this
state cleanly via autostash, whereas mutating the git index with
--assume-unchanged or --skip-worktree breaks both git merge --ff-only and
git reset --hard when HEAD deletes the colliding path.
Add a shared fail-closed verifier (tests/install/e2e-assets/case-collision.cjs)
that accepts a dirty entry only when core.ignorecase is true, the entry is an
unstaged worktree-only modification (1 .M N...) matching HEAD's index entry,
its path belongs to a HEAD case-collision group, and the on-disk bytes match a
colliding sibling's HEAD blob (exact or CRLF-normalized for non-binary blobs,
never following symlinks for regular files). Wire it into the POSIX marker
check (source-driver.sh), the Windows churn cleaner (source-driver.ps1 /
windows-e2e.ps1), and the Desktop update bridge guard (update-ui.cjs /
launch-from-spec.mjs).
windows-stale-processes.ps1 wrote stale-processes.json only after the settle
poll. If a later Get-CimInstance call threw, the error left the script before
the write, so the full record of the process it had already seen (untruncated
command line, CreationDate) was lost, and a process that exits before the
finally-block evidence collector runs cannot be read again (Greptile and Sol
on #161139).
Catch a failed re-read, keep the last records read, save the report with the
error as queryError, and then fail the check with that error. A failed first
read still throws as before: nothing was seen yet.
The new platforms("windows") test fails on the previous head (no
stale-processes.json) and passes here on Windows PowerShell 5.1.
In the rc.1-v0.23.6 Windows x64 update E2E leg (run 24066510747),
`tests/install/windows-bundled-e2e.ps1` threw a bare
`Old payload processes remain alive` immediately after the new package
relaunched, without waiting briefly for post-swap process teardown or
recording which process(es) under OLD's InstallLocation were still alive.
The `finally` evidence collector (`windows-update-evidence.ps1`) also saved
only `AppInstaller` processes, leaving the failing process's PID, PPID,
executable path, and command line absent from both the job log and uploaded
proof artifacts.
- Add `tests/install/e2e-assets/windows-stale-processes.ps1`: scans
`Win32_Process` under `$OldInstallLocation\`, polls up to `-SettleSeconds`
(default 15s) if any are initially alive, writes full process identity
(`ProcessId`, `ParentProcessId`, `Name`, `CreationDate`, `ExecutablePath`,
`CommandLine`) to `proof/stale-processes.json` whenever any stale process
was sighted, logs the initial/remaining records to stdout, and includes
the surviving process summary in the thrown error.
- Update `tests/install/e2e-assets/windows-update-evidence.ps1` to accept
optional `-OldInstallLocation` and record matching processes under OLD/NEW
package install roots or matching `$Identity`/`hermes` to `processes.json`
and stdout (recording `processes-error.txt` without aborting other
evidence on WMI failure).
- Wire both into `tests/install/windows-bundled-e2e.ps1` (initializing
`$old = $null` before `try` so `finally` is strict-mode safe on early
failures) and cover with `platforms("windows")` PowerShell 5.1 tests.
Three guards from #158714 could each be removed with every test still
passing: the Windows stager's refusal of a symlink named like the MSIX,
the macOS stager's check that each blockmap has its package beside it,
and release_channel's refusal of a commit tag, which keeps a commit
claim's manifest from reading as stable in publish and promote.
The trust-boundary test now plants a symlink in place of a package
(Windows and macOS) and an orphan Other-…-mac-arm64.dmg.blockmap, and a
new pipeline test asserts that publish and promote refuse a commit tag.
With each guard removed in turn, the old tests pass (55) and exactly one
new case fails; with the guards in place all 59 pass.
Found by @unsupportedpastels on #158714, whose patch this is.
Co-authored-by: unsupportedpastels <274530371+unsupportedpastels@users.noreply.github.com>
Address the non-blocking review nits on #160857 from @c2h5oh and @yoniebans:
- Block ruamel imports in tests/ci/test_protected_canary_publication.py's shared
fake python driver unless invoked through scripts.ci.python_packages
ruamel.yaml==... --, turning the existing darwin canary and candidate cases
into bare-Python regression guards.
- Move macOS channel-record bare-Python coverage out of
tests/scripts/test_macos_channel_artifact_record.py into
tests/ci/test_protected_canary_publication.py (reusing the canary fixture,
native_leg, and module-top imports per AGENTS.md).
- Discover macOS release_artifacts record steps structurally from
desktop-bundled-release.yml via desktop_release_roles so any future macOS
record step outside commit-claim stagers cannot slip past untested.
Refs #160857
Refs #159962
Commit 33522e6dee made scripts/bundles/release_artifacts.py::_verify_mac_feed_dmg
call scripts.releases.darwin.parse_mac_feed, which imports hermes_yaml (ruamel.yaml).
The macOS bundled build job runs on bare bootstrap Python (stdlib only), so
Stage macOS packages and feed inputs to R2 failed on Canary 95 and Canary 96
with ModuleNotFoundError: No module named 'ruamel'.
Invoke scripts.bundles.release_artifacts record --platform macos through
scripts.ci.python_packages ruamel.yaml==0.18.17 -- in both macOS staging steps
(matching stable-release.yml, canary-release.yml, and
stable-release-publication.yml), update the protected-canary test driver shim to
handle scripts.ci.python_packages, and add a workflow-step regression test that
blocks ruamel unless provisioned via scripts.ci.python_packages.
Refs #159962
The merge of main moved the autocrlf flags into _write_git_archive(), which
also archives scripts/whatsapp-bridge back in after scripts/ is excluded.
The eol test snapshotted without excludes, so it only ever exercised the
first pass.
The fixture now snapshots with INERT_SNAPSHOT_DIRS and commits an
unattributed text file under scripts/whatsapp-bridge. Its bytes must come
through unchanged. Mutants of scripts/bundles/payload.py:
- the runtime pass archived without the flags: the old test passes, the new
one fails;
- the flags removed from the helper: both fail;
- unmutated: both pass.
Found by the sol-loop self-review on #159146.
Conflict:
- scripts/bundles/payload.py: main (79c00f3aa2, 1b39ecabee) moved the git
archive call out of snapshot() into _write_git_archive(). That lets it
archive scripts/whatsapp-bridge back in after the exclude, and it adds a
timeout. This PR (fea697d62c) had added -c core.autocrlf=false
-c core.eol=lf to the old inline call, so that a Windows builder's
autocrlf doesn't rewrite the payload's bytes. Main's snapshot() body is
taken as is, and the PR's flags and comment move into _write_git_archive().
That also covers main's new runtime-tree archive, which ships to the same
payload.
Auto-merged without conflict: scripts/render-builds-table.py (the PR's
shutil.which("gh") lookup survives main's rewrite and still feeds both
gh calls), tests/ci/test_stable_release_graph.py,
tests/scripts/test_bundle_payload.py, tests/scripts/test_release_artifacts.py
and tests/scripts/test_render_builds_publication.py. Every line the PR added
in those files is present in the merge.
_verify_macos_dmg returned early when the root held neither a DMG nor a
*-mac.yml, so a tagged, channel or signedDmg commit-claim record whose
root carried only the update ZIP passed with no outer DMG check at all.
The workflow's own guards (the feed rename's test -s, the commit-claim
DMG count) keep that shape out of CI today, but the recorder is the gate
publish trusts, so it now fails closed on its own inputs: whenever the
outer check applies, exactly one *-mac-<arch>.dmg must be present.
The feed stays required only for tagged releases. Channel builds write
latest-mac.yml, but their staging step never stages or publishes a feed,
so requiring one would gate on a file nothing downstream reads; a feed
that is present is still checked.
The existing ZIP-only fixtures gain the DMG, blockmap and (tagged) feed a
real build produces. _write_mac_feed now streams its hashes, since the
Squirrel-limit fixture is a sparse 1 GiB ZIP.
44379fa174 put a uname shim first on PATH so that check_platform in
install.sh saw Linux on Windows. tests/AGENTS.md forbids faking the host.
With the shim, the plain-Linux check asserts a host fact the test supplied
itself, and the repository-stage test runs install.sh on a host where it
refuses to run.
Drop the shim. Mark the repository-stage test platforms("posix"), since
install.sh supports both Linux and macOS, and the plain-Linux platform
check platforms("linux"). On Windows both now skip; the install.ps1
repository-stage test in the same file covers that host.
The macOS lane now imports the repository-stage test. Its scenario,
replayed on a Darwin arm64 host under /bin/bash 3.2 with a throwaway
HOME, exits 0 and parks the local commit on a
refs/hermes-update-backups/diverged-main-* ref, as on Linux.
Reported by Greptile and the sol-loop review on #159146.
Address CI failure and validated review findings on outer macOS DMG
signing, notarization, recording, and smoke verification:
- Update tests/ci/test_protected_canary_publication.py's darwin transport
fixture to write a real gzipped .dmg.blockmap and parse_mac_feed-valid
canary-mac.yml matching the recorded ZIP and DMG bytes.
- Reuse the exact certificate identity and keychain selected for the .app
by recording them in apps/desktop/scripts/mac-sign.mjs (getAppSigningResult)
instead of re-querying security find-identity in notarize-dmg.mjs.
- Share one combined 300-minute notarization budget across afterSign and
notarize-dmg.mjs (with a 15-minute reserve for verification/metadata) so
DMG waiting cannot outlast the 330-minute CI step.
- Require .dmg.blockmap presence and validate tagged *-mac.yml feeds via
parse_mac_feed (exact ZIP + single DMG entries) in
scripts/bundles/release_artifacts.py, keeping the no-feed path explicit
for commit and channel builds.
- Align commit-claim outer DMG verification across release_artifacts.py
and tests/install/macos-bundle-smoke.sh via a sealed signedDmg: true
field in darwin bundled install-stamp.json: releases, canaries,
channels, and signedDmg commit claims enforce outer DMG verification,
while older pre-PR and legacy commit claims still verify the inner .app.
When the stable page already described a newer release, b1469d1641 left
it in place but still read it back through the public origin. If the
public copy was still catching up, the read-back failed after the feeds
and DMG alias had moved and before the head advanced, over a page this
promotion never wrote.
_check_stable_page_state now returns None for the page bytes in that
case. publish_page then neither writes nor reads back. A page this
promotion writes, or finds already in place, is still verified. In
test_stable_promotion_rejects_stale_order_for_dmg_and_page the
page-ahead case now serves a stale public page; it failed on 86ba6e6244
with "Channel read-back differs" and passes now.
`python -m scripts.releases.channel_releases stable` called
publish_release("stable-release") directly. That skipped advance_stable's
check of the candidate digest against the final release receipt and ran
outside the stable-release concurrency group. It reached the same stable
feeds, and with this PR the DMG alias and downloads page, that
ff616309d5 closed off in the release_artifacts CLI. No workflow, test or
doc uses that role; stable-release.yml calls only `channel_releases
canary`.
The CLI now refuses `stable` with the reason (exit 2) and publishes
canary as before. test_channel_releases_cli_publishes_canary_and_refuses_stable
did not raise on f4785e7bee and does now.
b1469d1641 left the stable downloads page alone whenever supersedes()
said the promoted tag could not replace it. supersedes() also says no
when the page at the stable key records a canary build, so that wrong
page was kept, with only a warning, while the stable head advanced.
The skip now applies only to a newer stable release, the renderer's
page-ahead case. A canary marker at the stable key fails closed before
any write. test_stable_promotion_refuses_a_canary_page_at_the_stable_key
did not raise on a906c2b033 and does now.
copy_source kept whatever ETag the source HEAD returned, and copy_object
sent x-amz-copy-source-if-match only when there was one. A HEAD without
an ETag therefore made the copy unconditional, and a same-size
replacement of the source would pass the destination's size check.
copy_source now refuses a source with no ETag. CopySource.etag is always
set, and copy_object always sends the condition. The no-ETag case in
test_copy_object_sends_signed_server_side_copy_and_verifies_destination
did not raise on b1469d1641 and does now.
The stable downloads page has a second writer on main: render-builds-table
in stable-release.yml's `complete` step renders a full-desktop release's
page before the ordered publication pass runs. If an older published
release's advance was still pending, that step put the page ahead of it.
The sequencer advances oldest first, so StableDownloads.prepare for the
older release then refused with "Refusing to move the stable downloads
page backward", on every rerun. Since the standalone CLI no longer
promotes stable, nothing could clear it.
Feed order is checked before promotion, so a page describing a newer
release can only be that renderer's. _check_stable_page_state now leaves
it as it is with a warning, as the renderer's own write_channel_page does,
and returns the bytes that should be live plus the write conditions (None:
no write). The older advance moves the feeds and the DMG alias, and the
public read-back checks the page that is actually live. The page is still
never moved backward.
In test_stable_promotion_rejects_stale_order_for_dmg_and_page, the
page-only-ahead case raised on 274bc33a78 and now promotes the older
release while leaving the newer page alone. stable-releases.md no longer
says the page changes only with promotion.
Sign, notarize, staple, and Gatekeeper-verify the outer macOS .dmg
container in an electron-builder artifactBuildCompleted hook while
keeping inner .app notarization (afterSign) intact for Squirrel.Mac .zip
updates.
- Reuse notarize.mjs auth resolution and 4h LOST_CONTACT / CloudKit
retry logic in apps/desktop/scripts/notarize-dmg.mjs, signing the
outer .dmg with Developer ID Application + --timestamp (which
dmg-builder's built-in dmg.sign omits) using the packager's active
codeSigningInfo keychain.
- Verify codesign, stapler validate (with LOST_CONTACT retries), and
spctl -a -vv -t open --context context:primary-signature, then rebuild
.dmg.blockmap and update event.updateInfo before artifactCreated fires
so PublishManager writes post-staple sha512/size to *-mac.yml.
- Enforce outer DMG codesign, team match, .dmg.blockmap size, and
*-mac.yml consistency in scripts/bundles/release_artifacts.py, and
verify outer DMG signature, stapler ticket, Gatekeeper policy, and
team match before mounting in tests/install/macos-bundle-smoke.sh.
StableDownloads.prepare HEADed the source DMG and compared its size, but
the 5 GiB single-copy limit was applied only inside copy_object, which
ran after finalize had moved the macOS feed. A DMG over the limit would
stop promotion with the feed already pointing at the new release.
copy_object also HEADed the source again and copied against that fresh
ETag rather than the object prepare had checked.
r2.copy_source now runs every source check once: the path, the
single-copy limit, existence and receipt size. It returns a CopySource
holding the key, size and ETag. prepare calls it before any write, and
copy_object takes the CopySource and copies on its ETag, so a source
that changed after the check fails with 412 instead of being copied.
With the limit below the staged DMG's size, the new stable promotion
test fails on c1494b2ff2 (feed PUTs were sent before the error) and
passes now.
When ff616309d5 moved the renderer harness off the refused CLI, the
admission test's fault loop kept only the renderer step. Its helper hashed
the bytes it had just read and called promote_stable_feeds directly, so no
test sent a legacy, smoke-less, failed, wrong-identity or tampered manifest
through the controller's own check.
The helper now promotes the way publish_release does: accepted_stable
against a digest pinned separately from the stored bytes, then
promote_stable_feeds. The fault loop sends every bad manifest through it,
checking the controller's message and that nothing was written, before
running the renderer step. With accepted_stable reduced to an unpinned,
unvalidated read, the ff616309d5 test passes and this one fails.
python -m scripts.bundles.release_artifacts promote checked the pinned
candidate digest but neither required the published release nor ran
inside the stable-release concurrency group. A manual replay could
therefore pass the stable DMG alias's order check and then overwrite a
newer alias that a concurrent controller promotion had just copied. R2's
CopyObject takes no destination If-Match, so the copy itself cannot be a
compare-and-swap. Promoting a staged draft needed no race at all.
The CLI now refuses a stable candidate, payload tag or attempt ref,
before it reads anything. Stable promotion runs only through the Stable
Release Publication sequencer (channel_releases.advance_stable ->
publish_release -> promote_stable_feeds), which already requires the
published release and serializes every stable writer. Canary candidates
still promote through the CLI. The renderer harness test now promotes
through promote_stable_feeds, as the sequencer does, instead of the CLI.
stable-releases.md says only the controller promotes stable, and that a
partial publication is repaired by running Stable Release Publication
again.
render-builds-table.py imported recorded_build only so three tests could
reach it through the script after it moved to downloads_page.py, and it
still imported smoke_rows, which nothing in the script uses. Both imports
are gone; test_render_builds_binding, test_render_builds_publication and
test_canary_page_history import recorded_build from downloads_page.
The read-back test failed at copy_object's signed R2 HEAD, so deleting
StableDownloads.publish_dmg's public-origin HEAD left every test green.
The new test lets R2 take the copy while the public origin serves another
size for the alias, and checks promotion stops before the App Installer
pointer and the page move. It fails with that HEAD removed.
The receipt-only rendering test seeded a Linux AppImage orphan, which the
shared table drops whatever it is given, so the assertion held even for a
page built from a bucket listing. A same-version Hermes Light MSIX would
render if listed: with a renderer that also lists the archive, the old
test passes and this one fails.
publish_release refused a stale release before the feed writes with its
own copy of the ordering rule, read from the live build's request.json.
ChannelPublisher._promote applies the real rule later: the digest-checked
live manifest, the native versions, and the allocation sequence. The copy
had no sequence check, so a newer release allocated before an older one
published (its retry keeps the lower sequence it was pinned to) passed the
early gate, moved the stable feeds, DMG alias and page, and was then
refused by the head update. That leaves the feeds on an archive the
retention pointer does not protect.
ChannelPublisher.require_protected_successor now runs the head update's
ordering check (sequence, then versions against the digest-verified live
manifest) without writing, and _promote calls the same helper, so the
rule lives in one place for both the canary and stable policies.