Commit Graph

116 Commits

Author SHA1 Message Date
Teknium
fea3dd340f fix(pm): gc reclaims a deleted checkout's sole tool pins too
Review (kvnloo): drop_dead_history only looked at facts with a `previous`
list, so a tool only a deleted checkout pinned (no history) kept its entry
forever. gc now judges every tool row: one with no owners (pre-history)
or matching this checkout's own lock stays, otherwise a row lives while
any owning checkout's install state dir exists. A tool left with no live
row loses its fact.

A checkout that finds an entry another checkout recorded now claims it, so
that checkout's deletion cannot reclaim an entry still in use.
2026-11-13 16:09:55 -08:00
Teknium
24272e92ad fix(bundles): a staged payload store keeps no other install's tool pins
prune_staged_store kept every history row facts.json carries, so a cached
build store shipped superseded tool entries. No other checkout shares a
build store: drop all history before computing the keep set.
2026-11-13 16:09:55 -08:00
BearHuddleston
69a1ad5c08 fix(bundles): refuse a macOS update ZIP of 1 GiB or more
v0.22.0 ships Electron 40, whose Squirrel.Mac reads the whole update
ZIP into one NSData. From 1 GiB, CFData's growth asks Electron's
allocator for 2 GiB, which refuses, and the app dies with SIGTRAP
partway through the download (electron/electron#55089, fixed in
Electron 44.7). Measured with the real signed v0.22.0 app on macOS: a
1,070,000,000-byte ZIP downloads, a 1,080,000,000-byte one crashes it
at 1,076,887,552 bytes. rc.2-v0.23.2 shipped a 1,447,529,425-byte ZIP
and its macos-packaged-arm64 upgrade job crashed exactly this way.

Recording a macOS build now refuses a ZIP of 1,073,741,824 bytes or
more and prints the margin otherwise, so an oversized build fails in
its own job instead of in the upgrade gate or on users' Macs.
2026-11-13 10:17:50 -06:00
BearHuddleston
e9607bf4e9 perf(bundles): leave Chromium out of the macOS bundle; install it on first use
v0.22.0 on macOS cannot update in-app to a bundle whose update ZIP is
1 GiB or more: its Electron 40 Squirrel.Mac reads the whole ZIP into one
buffer and dies past 1 GiB (electron/electron#55089). The rc.2-v0.23.2
ZIP is 1,447,529,425 bytes, and its Chromium alone is 177 MB compressed.

Chromium is already an optional default: `install.sh --skip-browser`
declines it, and the browser tool installs PM's pinned build once per
process when none is found (browser_launcher._maybe_autoinstall_chromium,
under security.allow_lazy_installs). On a sealed payload that install
lands in the writable store (tests/pm/test_store_extensions.py).

The macOS payload now leaves it out, so the first browser use downloads
it (195 MB). Windows and Linux bundles still ship it.
2026-11-13 10:17:18 -06:00
BearHuddleston
96e4107167 perf(bundles): ship the payload uv cache's venv-identical files once, as links
Some checks failed
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
Skills Index Freshness Check / check-freshness (push) Has been cancelled
Skills Index Freshness Check / check-catalog-cors (push) Has been cancelled
Docs Search Monitor / probe (push) Has been cancelled
Build Skills Index / build-index (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
v0.22.0 on macOS cannot update in-app to any bundle whose update ZIP is
1 GiB or more. It ships Electron 40, whose Squirrel.Mac reads the whole
ZIP into one NSData; past 1 GiB CFData asks Electron's allocator for
2 GiB, which refuses, and the app dies with SIGTRAP (electron/electron
#55089, fixed in Electron 44.7). Measured with the real signed v0.22.0
app: a 1,070,000,000-byte ZIP downloads, a 1,080,000,000-byte one kills
it. The rc.2-v0.23.2 ZIP is 1,447,529,425 bytes.

Most of that is the payload uv cache shipping a second copy of the
venv: 31,771 of its archive-v0 files (297 MB compressed) are byte for
byte the venv's installed files.

Off Windows, staging now replaces each archive-v0 file the payload venv
holds byte for byte with a relative link to the venv copy. Files the
installer rewrote (RECORD) or placed elsewhere (.data) stay. The uv
seed recreates links that stay inside the cache, as before, and copies
the bytes of a link that leaves it, so the machine cache keeps no link
into a payload an update will replace. MSIX packages hold no links, so
Windows is unchanged.
2026-11-13 10:16:38 -06:00
BearHuddleston
58e0b85e91 fix(bundles): bake the interpreter's stdlib and every existing pyc as unchecked-hash
A sealed macOS bundle is user-writable, so any payload Python that runs without
a cache prefix rewrites stale bytecode inside the signed app. codesign then
reports "file modified", spctl rejects the app, and the next Squirrel.Mac
update waits on a Gatekeeper prompt. The shipped Nov 10 canary (da06acacc9),
inventoried on a real Mac, had:

- stdlib: 1,061 modules, 140 timestamp pycs (all stale: they record the
  2024-01-01 source mtime, the .py files carry the build time) and 921 with
  no pyc at all. bake_bytecode never compiled the interpreter's own library.
- venv site-packages: all 25,439 pycs timestamp-based and stale; pm-runtime:
  all 61. uv's --compile-bytecode writes timestamp pycs, and compileall
  without -f keeps a timestamp pyc whose mtime still matches, even in
  unchecked-hash mode, so the bake left them as they were. Packaging then
  moved the sources' mtimes.
- hermes-agent: unchecked-hash, as intended.

On that build, Desktop's ticket helper rewrote 94 stdlib pycs inside the app,
and a `python -I` import of the gateway (which ignores PYTHONPYCACHEPREFIX)
wrote 248 (103 stdlib, 145 venv).

The bake now also compiles the staged interpreter's library, found by
CPython's own landmark (os.py) beside the binary and refused when it lies
outside the payload, and forces every root (-f) so existing timestamp pycs
become unchecked-hash too. The same payload baked with this change on the Mac:
every module in all four roots unchecked-hash, nothing stale or missing, and
neither the ticket helper nor the `python -I` import wrote a file. The bake
took 25 s there; the stdlib grows by about 16 MiB. The prepared-payload
digests skip __pycache__, so they are unchanged.

Windows and Linux install trees are read-only, so their payloads never hit the
seal break. The Windows launcher reads these source-adjacent pycs (it sets no
cache prefix for a baked payload), so there the change only removes
recompiles.
2026-11-12 22:34:16 -06:00
BearHuddleston
3944af0ea3 fix(bundles): build the Webapp in source desktop bundles too
Some checks failed
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
Skills Index Freshness Check / check-freshness (push) Has been cancelled
Skills Index Freshness Check / check-catalog-cors (push) Has been cancelled
Docs Search Monitor / probe (push) Has been cancelled
`pnpm run dist:bundled` stages its payload through scripts/bundles/stage.py,
not the prepared desktop builder. Its automatic route compiled only the TUI
and dashboard, so a payload stamped `bundled` shipped no Webapp and
`hermes webapp` stopped at "This desktop app ships no Webapp renderer".

Install the Desktop workspace in the frontend snapshot, compile the Webapp
there and pass it to stage_native. The native staging child takes its
products as flags and only knew --tui/--web, so it also learns --webapp;
without that, handing it the Webapp exits 2 on an unrecognized argument.

The regression test runs stage.main through the real stage_native argv into
native.main and asserts the planted payload: red on the PR head (no
dist-webapp), red with stage.py alone changed (argparse exit 2).

Reported by @kvnloo on #154325, whose b294b532 changed stage.py the same way.

Co-authored-by: Kevin Rajan <7121943+kvnloo@users.noreply.github.com>
2026-11-12 14:16:57 -06:00
BearHuddleston
f3ad28864a fix(bundles): ship the prebuilt Webapp in every desktop bundle
Desktop bundles (MSIX, Store, DMG/ZIP) plant prebuilt TUI and dashboard
products into the agent payload, but not the Webapp renderer, and the
payload drops apps/ and scripts/, so nothing in the app can build one.

desktop.py now compiles the Webapp with scripts/build/webapp.mjs from the
checkout whose apps/desktop dependencies the bundle job already installed,
and hands it to finish_native beside tui and web. The assembler plants it
at hermes-agent/apps/desktop/dist-webapp, where the gateway serves it.

- webapp.mjs gets the --source/--out CLI its sibling builders have.
  Compiling in place tripped its own overlap guard: the workspace's path
  relative to the source is '', which protected the whole checkout.
- The prepared payload's source digest ignores dist-webapp, as it does
  tui_dist and web_dist. Windows assembles the bundled and then the Store
  variant from one preparation; without this the Store pass fails with
  "prepared bytes changed: hermes-agent".

The renderer adds about 45 MB in 1,083 files to the payload, about 18 MB
deflated. It built in 23 s on linux-arm64.
2026-11-12 14:16:57 -06:00
alt-glitch
3753f34101 fix(pm): desktop bundles do not ship just
scripts/bundles/native.py staged every non-internal lockfile package, so
pinning just put it in every desktop payload and on the shipped agent's
PATH. Bundle selection now skips DEVELOPER_TOOLS, like a user install.

Tests: a bundle never stages just while the lockfile pins it; on Termux
just is checked from its file and never run.
2026-11-09 16:34:06 +05:30
Maciej Lisiewski
7062229090 chore(js): switch the workspaces from npm to pnpm
pnpm 12.15.0 (native executable) installs every JS workspace from one
pnpm-lock.yaml, imported from package-lock.json with the same resolved
versions. website/, the WhatsApp bridge and the photon sidecar stay separate
npm projects.

Configuration moves from .npmrc and the root manifest into
pnpm-workspace.yaml: the 14-day minimumReleaseAge and its excludes,
overrides, allowBuilds (the old allowScripts set, with strictDepBuilds
failing any unlisted build script), engineStrict, sideEffectsCache: false
(in-place rebuilds must not write into the store) and
verifyDepsBeforeRun: false (a `pnpm run` never installs).

The pnpm version is pinned in pm/lock.json and in root devEngines.
pmOnFail: ignore keeps that pin out of pnpm-lock.yaml: a leading pin
document makes osv-scanner read zero packages. scripts/build/node-deps.mjs
enforces the exact version instead, and every lock reader refuses a
multi-document lock. A root preinstall refuses `npm install`; devEngines
onFail is warn so npx (MCP servers, the tsc linter) keeps working inside
the checkout.

User-machine installs run --frozen-lockfile --trust-lockfile (release age is
checked when locking, in CI, not per user). node-deps removes npm-era
node_modules trees before the first pnpm install. Nix builds the store with
fetchPnpmDeps and a hash file that CI checks.
2026-11-06 04:08:24 +01:00
Maciej Lisiewski
79c1648300 refactor(release): define the desktop targets once
scripts/releases/desktop_targets.py holds the (electron platform, arch)
triple and derives the manifest spelling and the native handoff legs from it.
channel_artifacts, channel_publish, channel_releases, stable and the builds
table read it instead of five hand-written copies, and NATIVE_LEGS has one
definition instead of two.

read_native_receipts always reads every native leg, so its legs parameter
and _leg_targets go. A claim with includeMacosIntel: true now says why it is
refused. Tests iterate the targets directly instead of skipping a 2x2 case.
2026-11-03 23:54:59 +01:00
Maciej Lisiewski
06192b894c ci(release): stop building and publishing macOS Intel desktop bundles
Remove the darwin-x64 build, receipt and smoke jobs from Desktop Bundled
Release and the candidates/transitions/packaged-x64 jobs from Stable Release,
with the release scripts that required them: the macos-intel lane, the
darwin-x64 job group, the x64 macOS target in candidate/channel manifests and
the two-leg macOS feed merge. The macOS updater feed is arm64-only.

Pre-lanes claims still read: the published ones all carry
includeMacosIntel:false; a claim with true is now refused.
2026-11-03 20:58:05 +01:00
Bear Huddleston
2dbeda872f Merge pull request #148193 from NousResearch/fix/pm-uv-cache-keep-symlinks
fix(bundles): keep uv's wheel links from the payload cache to the machine cache
2026-11-02 21:51:10 -06:00
BearHuddleston
cd5cfcd192 fix(bundles): refuse a macOS update ZIP with entries lacking owner write
Squirrel.Mac's ShipIt runs removexattr on every enumerated item of a
downloaded update before swapping it in, and aborts the whole install on
any errno except ENOATTR. A read-only file or directory the caller owns
returns EACCES, so one such entry wedges every macOS update (#138659).

record --platform macos already opens the update ZIP in every release
path that publishes a macOS feed (stable candidate, bundled canary,
channel build). It now refuses the ZIP when any entry with a Unix mode,
other than a symlink, lacks owner write, naming the count and the first
three paths. Entries without a Unix mode are skipped.

The check is the one @unsupportedpastels suggested in review of #148192;
@vadimcomanescu proposed a build check like it in #138659.

Refs #138659
2026-11-03 02:52:07 +00:00
BearHuddleston
22c7561a72 docs(bundles): state the baked-pyc guarantee for default imports only
The comments said writes to the baked pycs "still cannot land" and that
the macOS signature "never observes a pyc change". That holds for
default imports, which is all the launcher does. It does not hold in
general: with unchecked-hash pycs baked read-only (0444), a stale source
and Python 3.14.9, `--check-hash-based-pycs always` replaced the pyc (new
inode, mode 664), and `-O` wrote new opt-1 pycs beside it. CPython
replaces a pyc through its writable __pycache__ directory, so the
read-only bit never blocked either.

Say what actually keeps default imports off the pycs (unchecked-hash and
the asserted coverage), and note that 0o644 also stops a baked tree from
blocking the next prepare's rmtree on Windows (#137717).

Reported in review by @unsupportedpastels.
2026-11-03 01:17:31 +00:00
BearHuddleston
7dc7e648ce docs(bundles): scope the uv wheel-link note to macOS and Linux
The shared-bundle-builds note and the stage_uv_cache docstring read as if
uv's wheel entries were symlinks on every target. On Windows uv writes
pointer files. The docstring's layout also covered only the pypi family;
URL, git and named-index entries carry an extra hash directory.

Reported in review by @unsupportedpastels.
2026-11-03 01:16:49 +00:00
BearHuddleston
b8e6687e63 fix(bundles): ship uv's wheel links as links in the payload cache
stage_uv_cache copied the build cache with shutil.copytree's default
symlinks=False. uv stores each cached wheel as a relative link into
archive-v0/, so the copy stored every unpacked wheel a second time and
the seed then merged those directories into the machine cache. On the
published v0.22.0 macOS ZIP that is 30,859 files under
uv-cache/wheels-v6 (278 MB compressed, 901 MB installed), and uv fails
with "Is a directory (os error 21)" when it publishes one of those
wheels again (#141891). Windows is unaffected: uv writes pointer files
there.

Keep the links. The signing walkers already skip symlinks, so each
binary is still signed once at its archive-v0 path. Also correct the
shared-bundle-builds doc and the staging comment: built wheel ZIPs ship.
2026-11-02 23:12:45 +00:00
liuhao1024
6e8a0deb82 fix(bundles): bake pycs owner-writable so Squirrel.Mac updates install
ShipIt strips the quarantine attribute off every file in the .app and
aborts the whole update with EACCES on any read-only one, so a payload
whose baked pyc files were sealed 0444 (f6713f2762) could never pass
a macOS update: three attempts, "Couldn't remove quarantine attribute",
then "Too many attempts to install, aborting update" and the old app
relaunches on the old version. Bake them 0644 instead: unchecked-hash
pycs are never rewritten and asserted coverage means no cache-miss
write can target them, so the read-only bit only ever blocked the
updater.

(cherry picked from commit fa34f089cb6e05bc86c03320eaf0d5e136b96f7d)
2026-11-02 23:12:44 +00:00
Teknium
debdab9fec fix(desktop): drop python-docx's unzipped template from the Windows payload so MakeAppx can pack it
The signed Windows MSIX build fails every run since the [documents] extra
(b357ebbfc4) put python-docx into the bundled payload: its wheel carries
docx/templates/default-docx-template/[Content_Types].xml, and MakeAppx
refuses that package-reserved name anywhere in the layout with 0x8007007b
"The filename, directory name, or volume label syntax is incorrect".

The directory is the unzipped source of templates/default.docx; python-docx
only ever opens the .docx, so dropping the tree from the win32 venv and the
shipped uv-cache keeps Document() working. Any other reserved-name file now
fails payload staging with its path instead of failing the pack anonymously.
2026-11-02 02:02:44 -08:00
Teknium
a4072ce7e6 fix(desktop): the short uv cache junction creates its parent
Review follow-up: short_alias now creates the junction's parent directory,
so preparation never depends on the caller having made the work dir first
(the existing prepare_tools test failed on both Windows lanes with WinError 3).
That test now checks the invariant the Windows path keeps: UV_CACHE_DIR
reaches the cache directory, through the short work-local junction on Windows.
2026-10-22 17:47:42 -07:00
Teknium
1aaf75e6f2 fix(desktop): build Windows sdists under a short uv cache path
With a cold desktop-inputs cache, Windows desktop preparation builds sdists
that have no cp314 Windows wheel (obstore on win32-x64, dependency-injector on
win32-arm64). uv builds each one in
<cache>\python\runtime\<toolchain id>\sdists-v10\pypi\<pkg>\<ver>\<id>\src,
about 200 characters below the deep .cache\desktop-inputs root, so MSVC
link.exe outputs passed MAX_PATH and the build failed with LNK1104.

On Windows, prepare_tools now hands uv a short job-local junction
(<work>\uv) that points at the same transported cache directory. uv keeps the
spelling it is given, so builds run under the short path while the bytes are
still restored and saved by the desktop-inputs cache. The native toolchain id
is read through the junction, and prepare_native keeps the absolute spelling
instead of resolving the junction back to the long path.

CARGO_TARGET_DIR is also owned by the preparation environment and points at
<work>\cargo, so Rust sdists link under the work root on every target even
if a tool resolves the junction.
2026-10-22 17:47:42 -07:00
ethernet
fa6a127ed6 perf(release): stage candidates from metadata; verify package bytes at publish
candidate-manifest spent ~4 of its 5.2 min downloading 8.7 GB (stable run
38491090442: both MSIX bundles, including the 4.3 GB Store bundle) only to
re-hash them, and each stage-receipt job re-downloaded its group's ZIPs and
bundle (60-256 s). The same bytes are hashed by the build job that uploaded
them, bound by digest in its handoff receipt, and downloaded and digest-
checked again by release_artifacts.publish (materialize) before anything
goes live.

Candidate staging and receipts now download only the metadata JSONs; package
rows still carry the receipt digests. The one check that read package
contents, the universal bundle identity against its per-arch rows, moves to
publish, after materialize has verified the bytes. A Store-only claim has no
metadata to fetch, so candidate-manifest reads its receipts alone.
2026-10-20 15:50:30 -04:00
ethernet
84b1f05313 fix(desktop): read VCToolsVersion BOM-tolerantly; match vswhere as a path
Windows CI on #141651:
- footguns lint: Microsoft.VCToolsVersion.default.txt is read with
  'utf-8', which keeps a BOM in the version string. Use 'utf-8-sig'
  (and write a BOM in the test fixture, as Visual Studio does).
- Windows-only test: locate_command joins the known dir with mixed
  separators (".../Installer\vswhere.exe"), so the stub's string
  comparison never matched, vswhere looked absent, and both calls fell
  back to a random partition. Compare as paths.
2026-10-20 15:50:30 -04:00
ethernet
ec64d1440e refactor(desktop): find vswhere through hermes_platform
Review (#141651): _msvc_identity hand-wrote the vswhere.exe install path,
which is the known-path table the hermes_platform rule keeps in one place.
Add visual_studio_installer_dirs() to resolver/known_dirs.py and locate
vswhere with locate_command (PATH first, then the installer directory).

Return None explicitly when vswhere reports no installations, before selecting
the newest instance.

Warn on stderr with the reason whenever MSVC identity detection returns None:
missing vswhere, no matching installations, or a failed probe/version read.
2026-10-20 15:50:30 -04:00
ethernet
5d8bf6eaf0 chore(desktop): time each native payload staging phase
prepare showed 79-197 s of silence between the repo snapshot and the
pm-runtime venv (snapshot extract, pinned tool preparation, the copy +
re-digest of every tool into the payload store, store pruning). Name each
phase with its duration, and each copied tool, so the next run says which.
2026-10-19 12:30:43 -04:00
ethernet
e97ce2a457 fix(desktop): Windows native wheels and vcpkg OpenSSL reuse the restored cache
Two caches were restored every run and then never read.

uv's native-wheel partition (native_cache_path) needs a toolchain identity
to be stable. win32-x64 never runs VsDevCmd, so VCToolsVersion is unset and
the identity fell back to a random uuid: every run compiled cryptography,
obstore, davey and friends from source into a fresh partition (all 6
sampled x64 runs had a new partition). Identify MSVC the way rustc's cc
crate finds it, through vswhere and the default VCToolsVersion file.

vcpkg's default binary cache lives under LOCALAPPDATA, which the desktop
preparation moves into the job-local home, so OpenSSL rebuilt every arm64
run ("Restored 0 package(s)", ~3 min). Point VCPKG_DEFAULT_BINARY_CACHE at
native/vcpkg-archives, inside the transported native domain.
2026-10-19 12:30:42 -04:00
ethernet
f9d8a74035 feat(release): split the Microsoft Store bundle into its own windows-store lane
`windows` used to build the signed MSIX, the universal bundle and the Store
bundle together, so skipping the signed pipeline meant skipping the Store too.
Now `windows` is the signed pipeline and `windows-store` the unsigned Store
bundle; both default on and the shared per-arch builds only make what the
lanes ask for.

- lanes: new `windows-store` lane and derived `windows-build` (either lane),
  which gates the shared candidates-win32-* jobs and handoffs.
- desktop-bundled-release: `skip-signed` builds only the Store variant and
  needs no Azure login, signing, metadata, smoke or receipt; `skip-store`
  builds and submits no Store bundle (replaces the old `store` input).
- manifest: a Store-only release has no package rows, only the Store bundle
  file; assemble() now takes the claim's lanes and checks each Windows bundle
  against its lane.
- claims record `lanesRevision: 2`. A lanes claim without it was cut when
  `windows` also meant the Store bundle (rc.2-v0.22.1), so it reads as
  windows + windows-store.
- release_artifacts: drop the unused `assemble` CLI command, which could not
  name the lanes.
2026-10-14 14:39:03 -04:00
ethernet
36a8ee18cd feat(release): choose what a stable release builds and tests with lanes
The skip and opt-in flags (--skip-bundles, --skip-tests, --include-macos-intel,
--include-termux) were four booleans in the claim, and every consumer
re-derived what they meant. A release is now a set of lanes, defined once in
scripts/releases/lanes.py: five build lanes (docker, windows, macos-arm64,
macos-intel, termux) and ten test lanes (ci, nix, docker-tests, pm-bundle,
windows-live, install-e2e, bootstrap-version, termux-checks, smoke, upgrade).
The default is every lane except macos-intel and termux.

  release.py release --only windows,docker      # the Store bundle + image, untested
  release.py release --with macos-intel --without install-e2e

- The claim records `lanes`. A claim cut before lanes existed still parses:
  skipBundles/skipTests/include* translate to the lane set that gated the
  same jobs, because the sequencer reads every claim tag ever cut.
- `admit` emits `lanes` and `jobs` (a run flag per lane-controlled job). Each
  job's `if` reads its own `jobs` entry and the gates derive their expected
  skips from the same table, so the workflow and the gates cannot drift.
  tests/ci/test_stable_release_graph.py evaluates every `if` against 37 lane
  sets.
- A release may build any subset: the candidate manifest carries exactly the
  claim's targets, and the final tag records null for the docker digest or the
  manifest digest when the claim built neither.
- The protected desktop channel, feeds, APT index and upgrade baseline move
  only when the claim built windows and macos-arm64. A partial set is staged,
  verified and (with windows) submitted to the Store, and leaves the channels
  on the previous release. A release that moves no channel is finished once
  public.
- publish-bundles passes `store` so a claim without windows submits nothing
  to the Microsoft Store.

Not exercised end to end: no real release was cut with a partial set.
2026-10-14 11:03:26 -04:00
ethernet
667e6639af feat(release): dispatch Stable Release from the default branch
Stable ran on its claim tag, so its Actions caches lived in a scope no
later claim could read. Every attempt rebuilt wheels and re-signed every
Windows payload file. Canary already runs from the default branch with the
tag as an input. Stable now does the same.

- `check_claim` reads the commit from the claim tag. It requires the
  default-branch dispatch of stable-release.yml instead of GITHUB_REF and
  GITHUB_SHA.
- The protected publisher accepts stable-release.yml on the default branch.
- `release.py` and the release entrypoint dispatch on the default branch.
- Runs are matched to a claim by their run name. Every run now has the same
  head branch. Runs that started on the tag still match.
- `release_artifacts` reads RELEASE_COMMIT before GITHUB_SHA. The publish
  and Store jobs now set it to the admitted commit.
2026-10-13 21:22:30 -04:00
alt-glitch
303b70f75b chore(release): retire HERMES_GUEST_ONBOARDING from bundles, build tooling and the updater
The Microsoft Store variant forced HERMES_GUEST_ONBOARDING=1 into its bundle env,
and commit/channel builds could bake it with --bundle-env. Nothing reads it now.

- scripts/bundles/desktop_inputs.py: the Store bundle env is just the request's.
- bundle_env.py / bundle-env.mjs: the key is no longer allowed for new builds.
- channel-protocol.ts: the key moves to RETIRED_BUNDLE_ENV_KEYS, so preview
  manifests already published with it still decode (the HERMES_SKIP_INTRO
  precedent).
- BUILDING.md example uses HERMES_PREVIEW_FULL_CONNECTORS.
- Build tests use another allowed key as their sample; both validators reject the
  retired key and the decoder drops it.
- msix-virtualization.test.mjs: every generated MSIX manifest (store, release,
  canary, channel) keeps filesystem and registry write virtualisation disabled,
  and the builder config declares unvirtualizedResources. The machine marker and
  the shared %LOCALAPPDATA%\hermes root depend on that.
2026-10-14 00:32:21 +05:30
ethernet
4b050f6731 fix(release): stable advance trusts receipts instead of downloading ~33 GB
The 0.21.7 publication pass downloaded every package twice (~13 GB of
native handoffs, then all 20.5 GB of candidate files including the Store
packages the feeds never reference) to recompute digests the receipts
already bind, then died in the macOS feed merge:

  ModuleNotFoundError: No module named 'ruamel'

- The sequencer steps run under python_packages with ruamel.yaml (the
  node toolchain has no project deps), as the canary finalize already does.
- Stable advance fetches only metadata-*.json and the per-arch *-mac.yml
  legs. assemble(local_bytes=False) binds each artifact by its receipt
  sha256 and takes the macOS sha512s from the receipt-bound feed legs,
  cross-checked against receipt sizes.
- promote() materializes only non-package files (feed legs, APT indexes).
- finalize(verify_bytes=False) checks remote sizes with HEAD instead of
  streaming the zip/dmg back down.

Canary (no accepted candidate) keeps the full download path unchanged.
2026-10-12 02:18:43 -04:00
ethernet
bfa4f5098c feat(release): the stable sequencer narrates what it is doing
A publication run sat silent for 8+ minutes while it downloaded ~20 GB,
with no way to tell which phase it was in or why a claim was held.

scripts/releases/progress.py logs to stderr (stdout stays the JSON steps)
with GitHub ::group::/::notice::/::error:: markers:

- every git/gh/docker command the sequencer runs, with its time and result
- discovery counts, and each claim's state with the reason (run attempt
  and conclusion, draft location, abandon marker, receipt/release match)
- the plan: why each version advances, is skipped, or is held
- each step as a timed group: publish (receipt digests) and advance
- the channel advance's phases, plus per-file progress for the handoff
  fetch and candidate materialize downloads (the slow part)
- the head before and after, and a top-level ::error:: on failure
2026-10-12 02:13:17 -04:00
Teknium
0d3b11c21c ci(release): refuse Intel-less retirement targets and define opt-in platforms once
- Retiring a preview channel now requires the stable head to carry every
  package the preview ships. An Intel preview could otherwise be pinned to an
  arm64-only stable head it has no package in, and its client would fail to
  resolve the retirement for good.
- The docs and release.py's next-steps text said Intel Macs stay on the last
  Intel release's feed. They do not: promote rewrites the one shared macOS
  stable feed with the arm64 leg, so Intel Macs get no update until a release
  opts Intel back in. Only the Termux APT channel stays on its previous release.
- New scripts/releases/optional_platforms.py holds the claim flag, jobs,
  handoff, target and smoke of each opt-in platform; stable.py, channel
  releases, release artifacts and the entrypoint read from it. stable.py is
  back under 1,000 lines. No behavior change.
- Test: a macOS Intel receipt against a baseline without Intel plans no
  upgrade arm (baseline=none); against a baseline with Intel it plans one.
2026-10-11 11:38:33 -07:00
Teknium
5f9b77cce0 ci(release): stop building macOS Intel and Termux in stable releases by default
Stable releases no longer build the macOS Intel (darwin-x64) desktop bundle
or the Termux APT package unless the release is cut with an opt-in flag.
Intel macOS is not supported on main, and its macos-15-intel bundle leg
takes 76-88 minutes, which is most of the release's wall time.

    python scripts/release.py release --commit SHA --include-macos-intel
    python scripts/release.py release --commit SHA --include-termux

The flags are written into the signed claim as includeMacosIntel and
includeTermux, like skipBundles/skipTests. admit emits them, and the
candidates-darwin-x64, transitions-darwin-x64 and macos-packaged-x64 jobs
(Intel) and candidates-termux and termux-checks (Termux) run only when
their flag is on. The gate requires those jobs to report skipped when the
flag is off; the skip flags keep their meaning.

Claims cut before these keys existed (every rc.* tag so far) have neither
key. validate_claim treats a missing key as false and still refuses a
non-boolean value or any unknown key, so sequencer discover/reconcile keep
working over the historical tags.

Without the opt-in platforms the candidate manifest, receipts, mac feed,
protected R2 head, APT promotion and downloads table all work with those
rows absent: the macOS feed carries the arm64 leg alone, the APT indexes
are left on the previous Termux release, and the unbuilt smoke is recorded
as skipped (a passed smoke for an unbuilt target is refused). A release
that opts Intel back in after one that left it out has no Intel baseline,
so its Intel upgrade arm is skipped like a first release.

Preview channels, canary and the PM bundle artifacts are unchanged.
2026-10-11 11:38:33 -07:00
Teknium
efd17a70b5 fix(release): staging checks each metadata row's commit and tag, not stamp-only fields
rc.10-v0.21.7's "Stage verified stable candidate artifacts" job failed with

  ValueError: Built package provenance does not match the release

assemble() ran stamp_matches() on each metadata row. stamp_matches() is the
check for an install-stamp.json and requires baseVersion, but a metadata row
is what record() writes (platform, arch, tag, commit, identity, version, ...)
and never carries baseVersion. So every bundled stable release failed here
once all packages were built. record() already verified each package's own
stamp (including baseVersion) when it wrote the row.

The row check is now what the row actually contains: commit and tag. The
staged-candidate fixture wrote a baseVersion into its rows, which is how the
mismatch stayed hidden; it now writes exactly the keys record() does. With
the corrected fixture, main's code fails 8 tests with the production error.
2026-10-11 02:56:13 -07:00
Maciej Lisiewski
0006a5e229 ci: fix PLW1509, PLW1510, PLW2101 linter errors 2026-10-10 15:20:13 +02:00
Maciej Lisiewski
9eab688b42 ci: ruff UP017 fixes 2026-10-09 17:34:36 +02:00
ethernet
8ac5c74432 Harder linter fixes (#135281)
* ci: fix B004 linter rule

* ci: prefix unused variables with underscore (RUF059)

* ci: don't cast int to int

* ci: remove unnecessary if/else where both blocks yield same result

* ci: RUF024

* ci: fix RUF017, RUF018, RUF022

* ci: RUF013, RUF015

* ci: RUF007

* ci: RUF009

* ci: address code review
2026-10-08 18:56:50 -04:00
ethernet
aac3440bac fix(desktop): build-bundle cleans under the lock, restores the shell, never signs
Review findings on the local build scripts:

- Cleanup ran before desktop.py took the checkout lock, so a second run deleted
  the outputs of a build that was still going. desktop.py gains --clean, which
  removes this checkout's outputs after build_lock is held. Both scripts pass it
  instead of deleting files themselves.
- build-bundle.ps1 left RELEASE_CLAIM_* and HERMES_PAYLOAD_* in the caller's
  session. It now saves those variables and restores them in the finally block.
- The scripts said "unsigned" but inherited signing credentials. The ps1 removes
  AZURE_* for the build. The sh removes CSC_* and APPLE_* and sets
  CSC_IDENTITY_AUTO_DISCOVERY=false, the switch the desktop rebuild command uses.
  The wording now says what is ignored.
- The Store bundle step needs the claim timestamp, and the script deletes the
  claim. The ps1 prints it as HERMES_RELEASE_EPOCH, and BUILDING.md documents it.
2026-10-08 18:02:26 -04:00
Maciej Lisiewski
74f1f17a7e ci: fix RUF017, RUF018, RUF022 2026-10-08 19:54:07 +02:00
Maciej Lisiewski
aa2d120cba ci: prefix unused variables with underscore (RUF059) 2026-10-08 19:22:03 +02:00
Maciej Lisiewski
d76cce4f11 ci: apply all automatic linter fixes available 2026-10-08 17:22:54 +02:00
Yuan Li
b16c598c5d fix(bundle): seed shipped venv state 2026-10-07 06:58:03 +05:30
ethernet
77534ab6d8 chore(desktop): store bundle env 2026-10-07 03:27:07 +05:30
ethernet
68718cf6d3 fix(release): record macOS channel artifacts without a release tag
Select the expected archive and embedded app version from the admitted
channel request, or the release tag for tagged builds. Channel builds
have no tag, so indexing it crashed before macOS packages could stage.
Keep filename, identity and provenance validation intact.

Regression coverage reproduces the crash on both architectures and checks
that wrong filenames, embedded versions and commits remain rejected.
2026-10-06 11:04:35 -04:00
ethernet
36c70d31c7 fix(bundle): show progress while verifying the prepared payload 2026-10-06 11:04:35 -04:00
ethernet
be0eaab563 fix(scripts): portable bash shebang for set_dmg_volume_icon.sh 2026-10-02 10:33:44 -04:00
ethernet
0217a2a324 feat(icons): custom drive artwork as the volume icon of both installer DMGs
The desktop DMG's volume icon defaulted to the packager's icns, which is
actool's 256px fallback whenever mac.icon is the Icon Composer package, and
dmgbuild's badge option can only paste onto the stock removable-drive icon.
Ship our own drive-with-the-girl artwork instead: assets/dmg-volume.png
(hand-made, one artwork since volume icons have no appearance variants) is
emitted as apps/desktop/packaging/dmg-volume.icns, beside the DMG background
so the `files` whitelist keeps it out of the app bundle, and dmg.icon points
at it.

Tauri always uses the app icns as the volume icon and offers no override, so
the bootstrap workflow runs scripts/bundles/set_dmg_volume_icon.sh on the
built DMG before signing (the same .VolumeIcon.icns + custom-icon flag
dmgbuild sets), and the verify step checks the icon is on the mounted image.
Verified on macOS 26.6.2: both DMGs render the identical volume icon.
2026-10-02 10:33:44 -04:00
Siddharth Balyan
86f54bfdaa Flavored desktop builds no longer stamp themselves dirty (#129540)
* fix(bundles): write the build stamp before flavored icons land

A flavored build (commit, canary, preview channel) copies its icons over the
committed apps/desktop/assets before packaging. write-build-stamp ran after
that copy, so its git check saw modified tracked files and stamped the
bundle dirty, and the Windows smoke refused it (stamp.dirty: true != false),
which keeps a channel from promoting the build. Stamp first, in both the CI
driver (scripts/bundles/desktop.py) and the source build (build.mjs). The
stamp reads no artwork, so its content is unchanged.

* test(bundles): pin the build stamp ahead of the flavored icon copy

buildSourceDesktop copies flavored icons over committed files in
apps/desktop/assets. write-build-stamp asks git whether tracked files
changed, so it has to run while the committed bytes are still there. The
test records what the stamp step sees through the injectable run seam.
It fails on the old order (sees the flavored icon) and passes on the new one.
2026-10-01 01:30:18 +05:30
ethernet8023
4bc38bceec fix(desktop): hand the admitted checkout back after flavored icon staging
electron-builder resolves every piece of packaging artwork from the workspace
— the app icon, the icon.ico extraResource, the MSIX logo set before-build
stages into build/appx, and the exe identity stamp — so a flavored canary or
commit build copies its rendered icon set over apps/desktop/assets before
packaging.

Those files stopped being gitignored in 4b7229d612, which turned a write that
was invisible into 15 dirty paths. The source custody check then refuses the
checkout twice: inside the same build, at the check that used to sit after the
copy, and on every later build from the first check on a now permanently dirty
tree.

Hold the render at the workspace path for the packaging window only and
restore the admitted files afterwards, whether packaging finished or failed.
The final custody check now asserts the build handed the checkout back.
2026-09-29 12:29:47 -04:00