vision = [] is anchored on Pillow, which is core: every generation holds
it, and carrying it from the committed environment changed only the
stamp, rebuilding a healthy environment on its next sync (Greptile
review on #155730).
Past the pre-PM migration, every sync's baseline was the recorded selection alone. A ledger
narrower than its committed environment (an SDK restored by hand after an update dropped it,
or a ledger an interrupted migration wrote short) lost python-telegram-bot and the rest on the
next rebuild while the update reported success (#96180). The sync now carries, like the
pre-PM carry, every non-umbrella extra the committed generation's site-packages holds and the
ledger lacks; declined, gated-off and already-covered extras are not carried.
2.53.0.3 predates three Git for Windows security releases: 2.56.0.3
(eMudhra CA compromise, Git LFS CVE-2026-105803), 2.56.0.4 (bundled
brotli 1.2.1, CVE-2026-111497, reachable via libcurl's br encoding) and
2.56.1 (git CVE-2026-111760 recursive-clone RCE and five others).
2.56.1 was published 2026-11-10, past the release-age window; its first
build ships as PortableGit-2.56.1-*, which the salvaged fetch_url fix
resolves.
2.56 moved the x64 MSYS2 prefix from mingw64/ to ucrt64/, so the
trampoline self-heal git-core candidates, the non-login bash coreutils
PATH dirs and the desktop bundle-arch PortableGit exemption now also
cover ucrt64 (mingw64 kept for existing installs).
Fixes#148835
Git for Windows publishes the first build of a tag without the revision
in the artifact name (PortableGit-2.56.0-64-bit.7z.exe, not
PortableGit-2.56.0.1-64-bit.7z.exe), while the release directory keeps
it (v2.56.0.windows.1/). fetch_url always spliced in .{build}, so every
pin of a .windows.1 release 404'd.
Fixes#127044
The same sweep dropped every other root data dir read beside the
project root: skills/ and optional-skills/ (tools/skills_sync.py),
plugin-catalog/ (hermes_cli/plugin_catalog.py) and optional-mcps/
(hermes_cli/mcp_catalog.py). A live PM environment on this host has
none of the five. Name them all in one set swept once.
Covers the intent of #128820 by @Wenfengcheng.
agent.i18n resolves locales/ beside the running code, and a PM-built
environment runs from the workspace snapshot, which only copied
setuptools package roots. locales/ never travelled, so every t() call
returned its raw key (Telegram /model picker, gateway.busy.ack).
Name locales in the existing one-pass directory sweep so it is copied
exactly once whatever packages.find.include says.
Fixes#152630Fixes#128799
_refresh_found_env reloaded the facts object it was handed. Callers pass the
per-checkout view _installed_location returns, so the reload replaced that view's
packages with the shared file, and writable_copy returned whatever another
checkout selected last: a sealed install pinned to node 1.0 ran node 2.0 on the
first call after the store's selection moved (review repro wc_probe.py).
Read a fresh Facts(path) for the claim instead and leave the caller's view alone.
Same class as Greptile "Concurrent installs miss an owner": on a sealed
Windows payload, writable_copy returned an existing copy another checkout
made without recording this checkout as an owner, so that checkout's
upgrade let gc delete the copy this one runs on. A realizing lookup now
goes through _refresh_found_env, which claims the row (#149497).
Greptile "Fallback chooses another checkout's tool": with
allow_outdated=True a broken selected entry let the loop return the next
usable history row, another checkout's older pin. The exact-pin search
still covers every row; only the selected row may be the outdated
fallback.
Greptile "Concurrent installs miss an owner": B waits on the install lock
while A installs the pin both lock; B's _install then hits A's entry with
the selection and env unchanged, so nothing was recorded and B never
joined the row's owners. A's later upgrade dropped the row and gc deleted
B's still-pinned tool. _refresh_recorded_env now re-records whenever this
checkout is missing from the row's owners, the one rule both the install
cache hit and ensure's found-entry refresh go through (#149497).
Review of #154832: after A, B, then A prepared one build store, A's third
prepare hit its pin in the history row and returned without re-recording,
so the selected row stayed B's. Build admission (verified_tools) refused
A's lock ("tool source failed verification") and prune_staged_store kept
only B's entry, deleting A's.
_install's cache-hit path now re-records the hit row when it is not the
selection, at the one seam every caller shares.
Review of #154832: gc judged a pin owner alive only by its installs/<key>
dir, but a checkout that only ever ran ensure (a sealed or resident
runtime commits no dependency state) recorded ownership without one, so
another checkout's `pm gc` deleted a tool it was still running on.
Every pin record now leaves the owner's state record
(installs/<key>/inputs/.project-root), the same durable marker the orphan
sweep already uses to prove a checkout deleted, so a claimed pin is only
released once that sweep removes the dir.
A lock that pins no artifacts for a target (source fixtures, a custom
python) is matched by version, as Facts.installed already does; the
live-pin check demanded an artifact identity and reclaimed the selected
python (test_source_python_pin_update_survives_real_gc on macOS CI).
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.
gc only released dead history rows, so the checkout that recorded a tool
last kept its entry selected (and on disk) after it was deleted. A dead
selection now yields to the first live pin in its history; a selection
with no owners (written before per-install history) stays.
Also correct tool_store_pins.py: facts.json now keeps other checkouts' pins
as history, so the remaining reason not to share the account store is that
provisioning other pins writes into it under a concurrent run.
The shared-pin history kept every entry a tool was ever recorded at: each
upgrade moved the old row into `previous` and nothing removed it, so
`hermes pm gc` could never reclaim an old uv/python/chromium entry again.
Each history row now names the checkouts that pin it (their install key).
Re-recording moves this checkout's claim, so its own upgrade leaves no
history behind; a row nobody claims (a legacy one included) is dropped as
before. gc releases the claims of checkouts whose install state dir is
gone, after the orphan-state sweep runs in the same pass.
An explicit outdated read again returns the store's selected row first,
never an older pin another install keeps.
Regression for 100yenadmin's shared-store report (#149497): if
multiple stores contain outdated facts, keep the first store's
published fallback while allowing an exact current pin in any store.
Keep prior verified tool facts addressable by pinned identity while retaining
legacy selected-fact consumers and GC roots. Add a regression for alternating
installs on one HERMES_HOME.
Reported by 100yenadmin (NousResearch/hermes-agent#149497).
With NPM_CONFIG_USERCONFIG=$HERMES_HOME/npmrc and npm_config_userconfig=<other>,
user_npmrc took the first twin in dict order, so the twin filter dropped the
user's non-empty lowercase choice. Probed with npm 12.2.2 and pnpm 12.15.0:
pnpm reads only the lowercase name (empty as unset), npm the last non-empty
twin in environ order, so the installers already split. user_npmrc now prefers
a non-empty lowercase value (as pnpm and the desktop's configuredUpdateHosts
do), and source_build_env collapses any twins into one NPM_CONFIG_USERCONFIG
naming that file, so the bridge, PM's downloads and both installers agree.
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.
core_lock_upgrades compared core's lock with the seed alone, so a plugin
holding a core transitive below core's pin (allowed within core's ranges)
was -P'd onto core's pin on every later rebuild, evicted, re-admitted by
the bisect retry and evicted again; `hermes pm install` raised
ResolutionConflict. Each fresh generation now records the core uv.lock it
was built from (core-uv.lock beside the resolved lock); a pin moves only
when core's lock moved past that record too. Generations built before this
keep the seed-only comparison.
`uv lock -P` unpins a name in every fork, so a core bump to a fork the
installing interpreter never selects floated the host's fork to the newest
index release. Forks whose resolution-markers do not hold for the
installing python are skipped.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Keep opaque OR clauses stable when uv groups them in host-narrowed
resolution markers. Preserve the affected core pin without incorrectly
comparing against an unrelated higher-version Python fork.
Regression for c2h5oh's PR #154165, issues #91424 and #91931.
A generation solves only its host, so each seed fork's resolution marker is
core's marker with the host terms ANDed on. The raw-tuple lookup missed it,
fell back to every seeded version of the name, and a bump to the lower
Python fork stayed on the old pin. Match a seed fork that holds every
top-level conjunct of core's marker.
A generation with plugin members is seeded from the previous generation's
lock, and uv keeps every seeded pin that still resolves, so a transitive
core's uv.lock bumped (a security release) never reached a plugin-enabled
install. The lock step now passes `-P name==<core version>` for each index
package core's lock holds above every seeded pin; plugin-only pins and
plugin-vs-plugin choices keep the incumbent. A plugin that cannot take the
new pin fails the resolve and the update's existing eviction disables it.
Member-less, repair and replay builds stay frozen and unchanged.
Fixes#91424Fixes#91931
A sha256-less pin for an installable package is currently accepted by
Lockfile.artifacts(), then crashes _install() at artifact["sha256"].
Only termux-docker's docker:// digest is a legitimate no-archive pin.
Add focused malformed-pin regressions while retaining that exception.
Follow-up to NousResearch/hermes-agent#154529 by c2h5oh.
Follow-up to the sha256 check: the lock's version and target also build
store entry names (`<name>-<version>-<target>`) that _remove_entry rmtrees
and publish renames, and the url basename names the scratch download, so
each is now refused unless it is a single path component. The lock-level
check no longer rejects sha256-less registry-digest rows (termux-docker's
docker:// pin), which never touch the store.
The downloader's plain-http loopback allowance was a string prefix test
that `http://127.0.0.1:@evil.com/` passed; it now parses the URL and
requires an http loopback hostname with no userinfo.
Fixes#138359
A lock.json artifact sha256 flows unchecked into `fetch-<sha>` entry
names; Store.fetch_many and _remove_downloads then rmtree whatever that
name resolves to, so a hand-edited or hostile lock row can point the
cleanup outside the store root (#138359, item 1).
- Lockfile.artifacts() now validates every pin row (dict, non-empty url,
64-hex lowercase sha256) and raises ValueError off-shape — fail-closed
at the source every install path reads.
- pm/store.py gains fetch_entry_name() which enforces the same shape and
is used for every fetch-entry construction/publish/return, so no future
caller can bypass the lock-level check.
- pm/install.py _remove_downloads builds entry names through the same
helper.
Scope note: items 2 (facts.json env injection) and 3 (downloader
loopback prefix test) from the issue are separate root causes and are
intentionally left out to keep this PR focused.
#150419 pinned pnpm's android-arm64 executable so `hermes dashboard` can
fetch it on Termux, and dropped pnpm's linux-arm64-bionic gap to do so.
That also made pnpm a required tool there: drift() requires every
non-optional package the target can install, and the .deb records only
python, node, uv, npm, ffmpeg and ripgrep. Every installed .deb printed
"install out of sync (pnpm: not installed or outdated)", and the .deb's
install validation (`pm.check()` in validate_installed.py) has failed the
termux-deb job of every nightly since Nov 8, which blocks publish-canary.
The Termux docs already say the first `hermes dashboard` downloads pnpm:
the .deb ships a prebuilt TUI, and the dashboard's web build needs the
network for its dependencies anyway. A package can now name targets where
it is installed on demand (`on_demand`, like `gaps`), and pnpm names
linux-arm64-bionic. drift(), `hermes pm doctor` and a bare install's roots
read Package.is_optional(target), so all three agree on what bionic needs.
Tests: an assembled .deb payload passes pm.check() on bionic; pm doctor
reports pnpm as optional there; a bare install selects pnpm on linux-x64
but not on bionic. Each fails on the base.
npm 12.0.2 bundles brace-expansion 5.0.7, ip-address 10.2.0, tar 7.5.19
and undici 6.27.0, all with fixed releases. 12.2.2 (published 2026-11-04,
past the release-age window) bundles 5.0.12, 10.7.5, 7.5.22 and 6.29.1.
The pinned npm sits ahead of node's bundled copy on PATH, so this is the
npm every pm-run npm command uses. No node release yet bundles an npm with
these fixes (26.13.1 still ships npm 11.20.0), so the node pin stays.
Refs #143061
The packaged browser was Chrome 145.0.7632.6. Playwright 1.64 looks up
chromium-1248, and linux-arm64 now downloads the same Chrome build
instead of Playwright's older mirror.
Moves all five engine backends from b11671 to b12144.
b12144 is the last upstream release whose notes and archives both name CUDA
toolkit 13.4 (b12167 carries 13.4 archives under notes that list 13.5 files).
Releases from b12170 on are built with 13.5, which raises the driver
requirement for every GPU that compiles its kernels at load, so the pin stops
here until Hermes can tell whether the CUDA build runs on the machine.
LFM3 models load on this build; b11671 stops with "unknown model
architecture: 'lfm3'".
Upstream moved its CUDA 13 release builds from toolkit 13.4 to 13.5 at b12170
(ggml-org/llama.cpp 3ed7284f2). LlamaCppCuda hardcoded cuda-13.4 in its archive
names, so a pin for any tag from b12170 on asked for archives that do not
exist. The package now picks the toolkit from the version: 13.4 through
b12167, 13.5 from b12170.
The class docstring records what a 13.5 pin has to deal with: a GPU the build
carries no native code for (Turing, A100, Hopper, GB200/GB300) compiles its
kernels at load and needs a driver at least as new as the toolkit.
Main added `from pm.environment import PM_BUILT_KEY` in pm/extras.py after this branch was cut. With the pm/** TID251 ignore removed, it needs the same per-line noqa as the other PM-private imports in pm/.
Remove the pm/** TID251 ignore (per-line noqa for pm-private imports) so future old-name bans reach pm/. Route six __file__-derived bundled plugins paths through get_bundled_plugins_dir().
On win32-arm64, Python.stage deletes the x64 vcruntime140_1.dll that
python-build-standalone ships beside ARM64 python.exe. The tree was
extracted and hoisted moments earlier, so a Windows antivirus or indexer
scan can still hold the file; the delete is then refused for a moment
([WinError 32], EACCES) and the single-shot unlink failed the install.
Run it through retry_held, as #153075 did for the same DLL in
_unpack_vc_runtime, so both ARM64 CRT drops ride out the hold. A hold
that never clears still raises PermissionError.
Suggested by @kshitijk4poor in his review of #153075.
_unpack_vc_runtime writes each CRT DLL from the redist payload and
deletes the ARM64 payload's x64 vcruntime140_1.dll right after writing
it. A Windows scanner opens that file as soon as it is closed, so the
single unlink can be refused with [WinError 32] and fail the llama.cpp
or whisper.cpp install on Windows ARM64. Retry it like the other
fresh-tree mutations in PM.
pnpm unpacks with its own hoist (flatten = False): it moves
package\pnpm.exe, or the launcher's package\dist, out of a tree
extracted moments earlier and deletes the rest. Each of those ran once,
so a Windows scanner still holding the fresh files failed the install
with [WinError 32] (a file) or [WinError 5] (a directory) under
tools\.staging-*\. pnpm is a required tool, so `hermes update` then
left the source updated and the dependencies incomplete, and every
retry re-extracted and hit the same hold.
Route the three mutations through retry_held, the helper #133484 gave
flatten_single_dir for the same hold (#131884). pnpm's own hoist came
later with the npm-to-pnpm switch (#149746) and never got it. A hold
that outlasts retry_held's budget still fails the install.
StagedPlugin.publish dropped inherit_parent_acl's result. When Windows
refused the reset, the plugin still published with the tempfile staging
folder's protected DACL, which a non-elevated Hermes may be unable to
read, and nothing said so. The explicit grant it replaced had logged the
icacls remedy.
A refusal on Windows now prints a warning on the worker's stderr, which
reaches the user, with the `icacls "<plugin>" /reset /t` repair, and
records it in the sync receipt, the pattern carried_extras and
plugin_eviction use. The reset stays best effort and the publication
still commits.
The previous commit, Casey's inherit_parent_acl from #142284, resets the
published root to inherit plugins/'s entries, and Windows propagates that
down the tree in-process. plugins/ already grants the user, so this covers
the elevated install this PR was opened for. On Windows 11 (build 26200), a
UAC-elevated install read back with a limited token failed with WinError 5
on the base; with the reset the tree is fully inherited (SYSTEM,
Administrators, the user) and discovery finds the plugin. It also covers
what the explicit grant never did: a normal install whose __pycache__ an
elevated gateway writes later, and the sandbox groups plugins/ grants.
The elevation-gated grant_user_access on top only added a redundant ACE and
an icacls launch per elevated publication, so it goes, with its tests.
kvnloo's ordering stays: the permission fix runs before the install
metadata commits, because recovery keeps a committed tree.
test_publication_acl_order.py pins that on every host, adapted from his
test_worker_grants_acl_before_cli_returns.
Co-authored-by: Casey <caseyrussell1976@gmail.com>
Co-authored-by: Kevin Rajan <7121943+kvnloo@users.noreply.github.com>
Python >= 3.13 gives tempfile folders a protected DACL on Windows (SYSTEM,
Administrators, OWNER RIGHTS), and plugin install/update stage in one, so the
published plugin dropped every entry plugins/ grants (the user, Users, the
sandbox groups). A gateway run as a Windows service is elevated, so its
__pycache__ there was owned by Administrators and the same user's non-elevated
hermes could neither read nor delete it.
StagedPlugin.publish now calls pm.filesystem.inherit_parent_acl on the
published root after the os.replace: an empty, unprotected DACL that Windows
propagates down the tree. Explicit entries are kept; best effort, no-op off
Windows.
[BearHuddleston: adapted to #152234, whose worker already granted the user at the same point; kept that grant below this call so this commit stays this change alone. The next commit drops it.]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 80ad13f6e5edce0301b0ade12ca347c6401ce515)
StagedPlugin.publish runs in PM's worker, whose runtime environment
(pm/pyproject.toml) has no pywin32. grant_tree_user_access therefore
took the icacls fallback for every entry: a whoami and an icacls
process per file, while holding the plugin metadata lock, so a plugin
with a node_modules tree launched thousands of processes on install.
grant_user_access(target, repair_children=True) does the right thing on
both writers. The icacls fallback first walks the whole subtree and
refuses one holding a link, then writes the root's inheritable ACE,
which propagates to the tree: one whoami and one icacls. The pywin32
write does not propagate, so it still grants each entry. Its own
warnings carry the remedy.
The fixture's fake pywin32 writer now returns True like the real one
when it wrote, so children are owed on that path.
The previous commit moved the elevated grant from publish_plugin into
StagedPlugin.publish, but the fixture still replaced sync_venv with a
bare shutil.move, so nothing granted on that path and the elevated
publish_plugin test failed. The fake sync_venv now runs the real
StagedPlugin.publish (without the dependency build), so both
publish_plugin tests exercise the move that grants. Also drops the
extra blank line before StagedPlugin and adds the missing one before
the new test.