2952 Commits

Author SHA1 Message Date
Teknium
0f8bbed1ed fix(config): drop browser.extension_control (default and v52 migration)
Nothing reads the key since browser-extension control was removed; the existing v52 step (a
legacy-key step, so unstamped configs get it too) now strips it from user config.
2026-10-23 01:42:29 -07:00
Teknium
1ac18d2b12 refactor(pm): drop the agent-browser package; Chromium is a default package in its own right
- pm: AgentBrowser class + lock entry gone; Chromium default=True and its env
  exports only PLAYWRIGHT_BROWSERS_PATH (Playwright launches without an
  executable path still need it). A recorded or passed --without agent-browser
  maps to chromium (pm.defaults.RETIRED_DEFAULTS), and pm gc forgets the stale
  agent-browser fact so its store entry is reclaimed.
- install.sh --skip-browser/--no-playwright and install.ps1 -SkipBrowser pass
  --without chromium; undo hint is hermes pm install chromium.
- Docker bakes /etc/hermes/chromium-executable-path; stage2-hook validates it
  and exports nothing; the sandbox-desktop image drops the agent-browser npm
  install and keeps its Playwright Chromium.
2026-10-23 01:41:25 -07: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
c073ce29c1 fix(tests): keep the Nix shell's PYTHONPATH through run_tests.sh's env -i
The devShell's HERMES_PYTHON is the lock's interpreter, which finds pytest and
the uv2nix venv only through PYTHONPATH. env -i dropped it, so every file failed
with 'No module named pytest'. Only the unactivated HERMES_PYTHON branch keeps it;
the activated test environment stays hermetic.
2026-10-22 17:25:38 -04:00
ethernet
75a8d6fcf4 fix(deps): update uv to 0.13.5 2026-10-22 17:25:38 -04:00
ethernet
8c3734f1d7 fix(desktop): fresh Windows hosts can unpack Electron 40.10.3+ without the VC++ redist
From 40.10.3 on, every Electron line unpacks its binary with
@electron-internal/extract-zip, an MSVC-built binding that imports
VCRUNTIME140.dll. A Windows host that never installed the VC++
Redistributable has no copy, so install.js dies with ERR_DLOPEN_FAILED.
This is the failure that made bb8280b7537 roll Electron back to 40.10.2.

Our Python ships vcruntime140.dll. source_build_env() passes its path to
the Node builders as HERMES_VC_RUNTIME, and electron-runtime.mjs copies it
beside the extractor's binding right before it runs install.js. Node
loads bindings with LOAD_WITH_ALTERED_SEARCH_PATH (libuv uv_dlopen), so
Windows finds that copy first. This is the same app-local copy
fdea3e92e01 ships beside ARM64 rg.exe.

Clean Windows Sandbox (ARM64, no redist), Node 26.7.0, electron 44.9.3:
- before: install.js exits 1, "Cannot find native binding", ERR_DLOPEN_FAILED
- after: install.js exits 0, dist/electron.exe --version prints v44.9.3
2026-10-22 16:17:57 -04:00
ahrazzle
a9376424e5 fix(desktop): prepare the locked Electron runtime explicitly before use
Electron 42 dropped the postinstall that unpacked its binary into
node_modules/electron/dist. The binary now appears on the first
require('electron'), so parallel vitest workers race to unpack it
("Text file busy" in #128267's CI), and `hermes desktop --source` finds
no path.txt to launch.

electron-runtime.mjs runs Electron's own install.js once: after npm ci
for the desktop workspace, and in CI before the parallel checks. It first
checks the installed package against the desktop pin and the lockfile,
and does nothing when the runtime is already in place. On the current
40.10.2 pin, whose postinstall still unpacks the binary, it is a no-op.

Salvaged from #137648 (the runtime-preparation subset only).
2026-10-22 16:17:57 -04:00
Maciej Lisiewski
41dfcf2c1b
Merge pull request #142831 from NousResearch/deps/pillow-13.0.0
fix(deps): bump Pillow 12.3.0 → 13.0.0 (critical, GHSA-8g5g-8vmr-9782)
2026-10-22 17:56:19 +02:00
ethernet
0153a9e460 refactor(ci): simplify cache report state and rendering
Use one escaped HTML fragment for the report and review comment instead
of maintaining separate Markdown and HTML table builders. GitHub's
renderer preserves the same table text and all 39 real job/step links.

Remove the obsolete phase-generic accounting helper, redundant attempt
list and save-evidence flag, and unused collected-job counter. Append
main's saved column in one place.

Use urllib's unredirected Authorization header instead of a custom
redirect handler. The real HTTP redirect test still proves that only
the API request receives the token. Exercise PM formatting directly,
while retaining the actual stdlib-only CLI invocation test.

Verification: 696 CI tests pass, one native skip, and all 12 checks pass.
Saved real-log parser records and rendered values remain unchanged.
2026-10-22 11:55:58 -04:00
ethernet
4f53b89a47 ci: summarize cache hits with main-aware job details
put cache hits/attempts and restored/missed archive bytes above an expander.
show hit and miss job/step links in both Markdown and HTML. off main,
compare hits with main's latest measured archive and hide write figures;
on main, show saved bytes without self-comparison.

retain unknown outcomes and sizes instead of treating them as misses or
zero. miss-byte totals use main archive references off main, and newly
saved archive sizes on main. preserve the real run mode and step numbers
in the snapshot so artifact-only rendering keeps the same behavior.
2026-10-22 11:55:58 -04:00
ethernet
19ed6e147c ci: compare cache archive transfers in the review comment
Collect ordinary actions/cache job logs alongside the existing timing
snapshot and retain per-invocation restore/write receipts and archive bytes.
Compare each cache with main and show saved-minus-restored archive changes
in the review comment, Actions summary and complete HTML report.

Count successful writes only after their save receipt; transfer progress
supplies a size once, never a sum. Preserve unknown sizes, failed or missing
logs, lookup-only results and exact-hit save skips. Match content-keyed
writes to their restored paths, without inspecting cache contents or using
the GitHub inventory as a proxy for a runner provider's cache store.
2026-10-22 11:55:58 -04:00
ethernet
f3ea0290e2 ci: show PM cache restore results and write policy
Print a compact tools/uv/npm summary from setup-pm, including the selected
restore outcome, exact-hit output, cache path, ref scope and save policy.
Keep actual archive sizes and upload results in the native cache logs.
Do not scan cache trees or add logging wrappers to non-PM cache actions.
2026-10-22 11:55:58 -04:00
Maciej Lisiewski
2b31d12ade fix(pm): apply lock overrides to requirements builds; read pip check uncoloured
Requirements builds (Termux deb assembly and wheelhouse gate, PM runtime
wheelhouse install) install the lock's export with uv pip install, which
re-resolves and rejects the overridden graph. Pass the lock: its manifest
overrides become --overrides and the closing check accepts them.

FORCE_COLOR/CLICOLOR_FORCE made uv pip check emit ANSI the report parser
cannot read, failing every install with an expected override mismatch.
2026-10-22 17:36:39 +02:00
Teknium
99cc712bf3 fix(update): a damaged .git no longer strands paused gateways
When a checkout's .git exists but git rejects it (empty HEAD, a gitdir:
file pointing nowhere), every `hermes update` failed at the fetch with a
generic "Failed to fetch updates" and, on Windows, left the paused
gateways stopped with "the next `hermes` command restarts them". No
later command could: the whole-tree gate held the set while HEAD was
unreadable, so bots stayed down until someone repaired the checkout by
hand.

- tree gate: a set whose every pause already found HEAD unreadable and
  that never bound a tree move resumes. The gateways were serving that
  exact tree and no update step wrote it. A recorded move, or a HEAD
  that was readable at the pause, still holds the set.
- fetch failure: "not a git repository" now says the checkout's git data
  is damaged and prints the installer one-liner that repairs it.
- install.sh: a dangling `.git` file is moved aside and re-cloned like a
  commit-less one, matching install.ps1 (Test-Path already matched it);
  both installers' warning names a damaged .git, not only an
  interrupted clone.
2026-10-21 16:57:37 -07:00
yoniebans
3e6589fc34 ci: run the upgrade suite when hermes_state_fts.py changes
The hermes update search-index notice now reads the stored FTS layout through hermes_state_fts.fts_layout_drift, so the module is on the update path.
2026-10-21 04:14:08 -07:00
ethernet
c4c42bc72e
Merge pull request #141741 from NousResearch/ci/pr-restore-only-pm-caches
ci: pull requests restore main's PM caches instead of saving their own
2026-10-20 18:00:40 -04:00
ethernet
d6d77c3649
Merge pull request #141725 from NousResearch/feat/store-auto-publish
feat(release): Store certifies before the gate; publication switches it live
2026-10-20 17:43:36 -04:00
ethernet
01af57a06c
Merge pull request #141716 from NousResearch/perf/release-metadata-only-receipts
perf(release): stage candidates from metadata; verify package bytes at publish
2026-10-20 17:31:33 -04:00
ethernet
ee8f05a48a
Merge pull request #141651 from NousResearch/fix/desktop-prepare-caches
fix(desktop): Windows prepare reuses its restored wheel, vcpkg and npm caches
2026-10-20 16:03:44 -04:00
ethernet
13cb8cca17
ci: pull requests restore the uv and npm caches without saving their own
save-python-cache and save-node-cache now default to false on
pull_request events, like save-tools-cache. Their restore-only steps
read the exact keys the saving steps write on main, so a PR gets main's
uv and npm caches and leaves nothing PR-scoped behind.

Restore-only used to mean an explicit-save flow: run- and job-scoped
keys meant for save-pm-cache or a caller's actions/cache/save to write
later. Nothing calls save-pm-cache, and the last caller restoring from
the npm explicit-save key moved to its own cache, so the flow and its
outputs are deleted.
2026-10-20 15:50:30 -04:00
ethernet
4148f6d1f3
feat(release): Store certifies before the gate; publication switches it live
stable-store commits the Store submission held (targetPublishMode Manual)
instead of leaving an uncommitted draft, so certification runs before the
release gate and a run whose stable-publish fails still shows customers
nothing. The publication pass then PUTs the held submission with
Immediate and commits it again, so it goes live without a Partner Center
click.

Microsoft documents no call that releases a held submission and does not
say whether update accepts a committed one (409 is documented only as
"the current state of the app"). A 409 from the switch leaves the
submission held and prints the Publish now instruction; the release
stays green. The first real release shows which answer the API gives.

Reconcile receipt-bound Store work independently of channel advancement, including
already-current published releases, so an interruption cannot strand a held
submission. Record each upload's claim in certification notes and replace a held
Manual predecessor only after its exact remote abandon marker matches the claim
commit. Unknown owners and publishing submissions remain protected.
2026-10-20 15:50:30 -04: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
550e2a891f
feat(release): publication commits the Store draft with auto-publish on
The Store build used to be committed at green with targetPublishMode
Manual, and the publication pass could only print "click Publish now":
the submission API has no call that releases a held submission (update
and commit return 409 once it is committed). Every stable release needed a
person in Partner Center.

stable-store now uploads the verified bundle as an uncommitted draft
(msstore publish --noCommit) and stops. The publication pass, which runs
only when the release really goes out, reads the receipt-bound candidate
manifest, checks the pending draft carries that release's Store bundle,
sets targetPublishMode Immediate and commits it. Certification starts
then, and the build goes live when it passes.

- A draft from a newer green run is left for its own release; a committed
  or live submission is a no-op, so reruns are safe.
- submit refuses to replace a committed submission still on its way live
  (an earlier release); msstore publish would delete it.
- complete's Reconcile step now receives the MS_STORE_* credentials; it had
  none, so the success path silently skipped the Store.
- A failed or unreadable Store step stays a warning: the release publishes.
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
Maciej Lisiewski
ba78364593 fix: update tag selection to work without local refs 2026-10-20 20:36:30 +02:00
kshitijk4poor
9ca23c6840 fix(cli): run every /cron form on the gateway that owns the cron store
Symptom: in a classic `hermes chat` session on the shared gateway, /cron
add|edit|pause|resume|run|remove still ran main's handler in the CLI
process, which called the cronjob tool there and wrote the profile's
cron/jobs.json from the client. Under strace, every write to jobs.json
came from the `chat --cli` process and none from the gateway.

Root cause: the one-gateway runtime (#106742) made the gateway the
owner of the profile's runtime state and of the ticker that fires cron
jobs. It left CLICommandsMixin._cron_* in the client, and the
gateway's slash.exec refused /cron for every local session except TUI
reads (2efe028116). That left the cron store with two writers.

Change:
- Move main's /cron handler (overview, list and every write) into
  hermes_cli/cli_cron_lines.py as line builders (cron_command_lines),
  with no other behaviour change. The CLI prints them when it has no
  gateway session. The unused CLICommandsMixin._cron_list goes; its
  test and eval read cron_list_lines directly.
- On the gateway, /cron is an owner command
  (gateway/session_cron_commands.py). Bare /cron and `list` are reads
  for every local session; that includes Desktop- and ACP-created
  sessions, which main refused with unsupported_command. Every other
  form is an admission-fenced control. An unclosed quote is refused as
  invalid_params before pre_command fires. `/cron list -a` keeps the
  list-all alias that the TUI read path accepted.
- A /cron write runs only when it arrives on a connection that is not
  attached to the session: the classic CLI's own command socket
  (GatewayConnection.call_until), which waits with no deadline. A
  connection attached to the session keeps main's unsupported_command.
  That is how Ink, Desktop and ACP send /cron: on their main
  connection, which the gateway answers one request at a time and
  which waits with a deadline, while a /cron run lasts as long as its
  job. The gate is on the requesting connection, not on the surface
  that created the session, so a classic CLI that resumed a TUI-made
  session still writes (as on main), and Ink on a CLI-made session is
  still refused.
- The classic CLI sends /cron to slash.exec
  (gateway_setting_commands.GATEWAY_SETTINGS) with no deadline, on a
  socket of its own (gateway_plugin_commands.call_unbounded, now shared
  with plugin commands; its Ctrl+C handle is renamed
  _gateway_command_wait). Ctrl+C prints the stopped line and
  propagates.
- Regenerate the parity table. test_pre_command_in_gateway pinned the
  old refusal of every classic CLI /cron; it now pins that the accepted
  /cron forms fire pre_command once and a refused one (an unclosed
  quote) fires nothing.

Why: the design contract allows one writer per owned store, and
clients only read and submit. The gateway already serves this
profile's cron store to its ticker and to Desktop (cron.manage). Now
the classic CLI's writes go through the same process.

Refs #134889 (T1)
Refs #139158
2026-10-20 13:08:24 +05:30
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
58801c565b
perf(ci): stop transporting node_modules in the desktop dependency snapshot
node-deps runs npm ci on every prepare (the receipt never matched across
runs in any sampled job), and npm ci deletes node_modules first. The
restored trees were GBs of tar/untar for nothing; npm's content cache
(npm/_cacache) is what lets npm ci skip downloads. The workspace path
validation only existed to guard those paths, so it goes too.
2026-10-19 12:30:42 -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
Teknium
71b45e13aa docs(gateway): the parity note for /save names Desktop's client-side write
The generator's /save note still said the export file is written on the gateway host; Desktop with
a current gateway saves session.export text through its own dialog. Fix the note in
scripts/gen_gateway_command_parity.py and regenerate the table.
2026-10-18 20:50:00 -07:00
kshitijk4poor
3752497cc4 refactor(update): one deferral core, shared reason prefix, per-line Desktop hint; review folds
Folds the final-head review and /simplify-code pass on #141070:

- update_serve_obligations: defer_manual_serve and defer_unit_serve share
  _defer_identified (pid/create-time guard, dead-pid discharge, reminder
  write) instead of two copies; a unit row's failed-write warning says
  "unit restart reminder", not "manual".
- update_cmd_fleet: a positive _is_serve_or_dashboard_unit name gate,
  composed into _is_hermes_gateway_unit; _is_serve_unit uses it rather
  than "gateway gate minus SIGUSR1 support". _SERVE_SKIP_REASON names
  hermes-dashboard* units too.
- update_cmd_fleet_verify: SERVE_ONLY_REASON_PREFIX and the gateway
  sentence are module constants, so the producer and the Desktop
  predicate share one spelling; the test now feeds the producer's own
  reasons to both scripts.
- Desktop hand-offs (posix.sh, windows.ps1): drop the gateway hint only
  when EVERY gateway_restart line is serve/dashboard-only, so a serve-only
  line next to a raw restart-phase error keeps it; case-sensitive in
  PowerShell (-cmatch) like grep.
- main_dashboard._format_restart_commands replaces three copies of the
  backticked " or " join.
- Docstrings: already_restarted_units covers declined and failed units.
2026-10-19 02:48:18 +05:30
kshitijk4poor
3c23e52ae3 fix(desktop-update): add the gateway hint only when the follow-up blames gateways
posix.sh and windows.ps1 appended "Run hermes gateway restart" whenever
the gateway_restart step was owed. Since this PR, that step can be owed
for a serve/dashboard unit alone (a system hermes-dashboard the updater had
no root for), and the hint then sends the user to a command that never
touches that unit. Both hand-offs now drop the hint only when the owed
reason is serve/dashboard-only: it starts with "serve/dashboard" and does
not mention `hermes gateway restart`. Every other gateway_restart reason
keeps the hint, including the raw exception text update_finish owes when
the restart phase itself crashes and reasons from older CLIs. A
dashboard-only owed restart points to the update log, which names the
unit's own command. The step id and owed-step parsing are unchanged.

Fixes #141071
Refs #141021
2026-10-19 02:48:18 +05:30
Teknium
e6f57427c1
Merge pull request #140701 from NousResearch/fix/pkg9-windows-live
test(windows): live Windows proof for W3 and W4, plus a Windows packaging fix
2026-10-17 12:16:10 -07:00
Teknium
91e27b6c09 fix(desktop-build): npm run builder -- --win --x64 can stage its per-target native deps
`npm run builder` with an arch flag stages native deps into
apps/desktop/build/native-deps-<platform>-<arch>
(scripts/run-electron-builder.mjs). The product guard in
scripts/build/frontend-common.mjs accepted only apps/desktop/build/native-deps
as a generated destination in the tree, so every source build with an
explicit arch died before staging:

  Error: Output must be outside source or in a supported generated
  destination: ...\apps\desktop\build\native-deps-win32-x64

Seen on blacksmith-32vcpu-windows-2025 packaging the Desktop for the W3
attach lane (run 39053936919, `npm run builder -- --dir --publish never
--win --x64`). The guard now also accepts exactly
native-deps-(darwin|linux|win32)-(x64|arm64) under apps/desktop/build.
A nested path below one, or another platform/arch, is still refused.

Red -> green: run-electron-builder.test.mjs "source multiarch ..." now
asserts each per-target --out it hands stage-native-deps.mjs passes
productOutput (red on main: "Output must be outside source ..." for
native-deps-darwin-x64). product-builders.test.mjs gains the accepted and
refused per-target names (10 passed).

Refs #134889 (W3)
Refs #140337
2026-10-17 11:33:15 -07:00
Teknium
d2c6ca2300 test(desktop): E2E guard for turn state after a lost connection
apps/desktop/e2e/core/reconnect-turn-state.spec.ts, real Electron + real
gateway, only the LLM scripted:

1. primary socket blocked mid-turn (loopback proxy that resets and refuses);
   the turn finishes on the gateway while disconnected; after the redial the
   reply renders exactly once (transcript oracle) and no Stop/spinner stays.
2. socket drop while a held turn runs, then a Control+Enter follow-up right
   after the redial: both turns run in order, oracle holds, nothing spins.
3. gateway SIGKILL mid-turn: supervisor brings a new owner up, recovery
   fences the turn `unknown`; the lost-turn card + Discard are on screen
   with "1 Queued — paused"; a follow-up is queued ("2 Queued — paused")
   and does not run ahead; Discard lets it run; oracle holds.

The classifier now routes the queue panel to the core lane, since the
lost-turn card lives there.

Refs #134889 (NF2)
Refs #140337
2026-10-17 11:33:13 -07:00
Teknium
861a0299ed refactor(gateway): no re-export shims for the split status/base helpers; the lock split is one-way
The round-1 health offset moved safe_url_for_log and the scoped-lock
release pair into siblings but re-exported them from gateway.status /
gateway.platforms.base, and status_scoped_locks read gateway.status
privates at call time while gateway.status re-exported the sibling's
privates (_unusable_lock_dir, _warned_unusable_lock_dirs). AGENTS.md:
no re-export shims for internal moves.

- gateway/status_lock_dir.py: the unusable-lock-dir report
  (ScopedLockDirUnusable + public unusable_lock_dir / _recovered /
  reset / reported). gateway.status imports it; it imports nothing back.
- gateway/status_scoped_locks.py: only the release pair, reading
  gateway.status at call time; gateway.status no longer imports it.
- Every importer points at the real home: base.py, run_bootstrap.py,
  the Feishu and Slack adapters, and the tests that patch them
  (gateway.status_scoped_locks.release_*). safe_url_for_log comes from
  gateway.platforms.base_log_safety; base.py imports it only for its
  own use.
- classify_changes: status_lock_dir.py rides with gateway/status.py on
  the e2e_upgrade lane.

code_health: 0 blocking (status.py stays under its main value).

Review finding by @unsupportedpastels on #140490 (minor 4) and by
@alt-glitch on #140490 (suggestion 4)
Refs #134889 (W2)
Refs #140337
2026-10-17 08:03:53 -07:00
Teknium
11380ac90a ci(routing): route hermes_dir_acl.py to the e2e_upgrade suite
hermes_cli/update_cmd_maint.py and update_host_obligation.py import the new
root module, so the update path runs it; list it beside its root siblings
(hermes_bootstrap.py, hermes_constants.py) in the update owners.

Refs #134889 (W8)
Refs #140337
2026-10-17 08:03:52 -07:00
Teknium
7fb93521a6 refactor(acp): one route table serves editor commands and documents them
The parity generator kept its own ACP_ROUTES list beside the membership
checks in run_command, so an ACP route could change while the documented
cell (and its drift check) stayed the same. acp_adapter/gateway_commands.py
now holds ROUTES (command -> documented cell, handler): run_command
dispatches through it, anything else is the owner's slash.exec, and the
generator reads the same table. The rendered parity doc is unchanged.

Review finding on #140190 (Greptile)
Refs #134889 (ACP-17)
Refs #140138
2026-10-16 21:13:47 -07:00
Teknium
69f80031de fix(acp): registry commands the editor path does not serve get a named reply, not Internal error
On the gateway ACP path every registered Hermes command outside the adapter's
small allowlist (/title /yolo /retry /undo /skills /clear /bg ...) raised
GatewayClientError('unsupported_command'), which the ACP SDK turned into a
JSON-RPC -32603 "Internal error" for the whole prompt, while /help said
unrecognized commands go to the model.

Map them the way the classic transport client (gateway_chat_commands.py) does:
/title <name> is session.mutate rename, /undo [N] and /retry the rewind
mutation, /clear the reset, and every other registry command goes to the
owner's slash.exec, which runs what it serves for a local session (/yolo,
/skills, bare /title, /plan's turn...) and refuses the rest. That refusal
(and /branch's pointer to session/fork) is the command's reply with
stop_reason end_turn, using the shared "not available on the shared gateway
yet" wording. The parity table's ACP column now reads those routes.

Red on main: tests/acp_adapter/test_gateway_registry_commands.py (real
acp_adapter.entry stdio process + real gateway.run daemon) failed with
{'code': -32603, 'message': 'Internal error', 'data': {'details': 'unsupported_command'}}
on /title.

Refs #134889 (ACP-17)
Refs #140138
2026-10-16 21:13:14 -07:00
Teknium
620f3b3b45 feat(plugin-catalog): add a Nous-granted verified tier
Verified entries come from the company that makes what the plugin integrates,
confirmed by the Nous team. Only maintainers set official/verified (CODEOWNERS
review; no CI check inspects the value). Tier order everywhere: official,
verified, community. Desktop's installed-plugin pill now reads the same
catalogInstall.tier map as the install card, dropping the duplicate
skills.plugins.tierOfficial/tierCommunity keys.
2026-10-16 14:31:11 -07:00
unsupportedpastels
b65e078cdc fix(install): keep "git is required" on macOS when git is not on PATH
stage_prerequisites sent every Mac whose git_runs failed into
install_macos_git, and git_runs is also false when git is missing from
PATH. So a Mac with no git got the Command Line Tools message instead of
"git is required", contradicting the "no git on PATH: unchanged" row and
failing test_real_install_sh_ladder_leaves_only_closed_tokens on macOS.
Gate the macOS path on git being on PATH.

That ladder test was gated with a bare skipif, so the macOS lane never
imported it; give it platforms("posix") per tests/AGENTS.md.

Also from review:
- Check the developer tools' git before Homebrew, so a git that fails
  with the tools present (unaccepted Xcode license, broken ~/.gitconfig)
  reports git's own error instead of running brew install git first.
- Log why xcode-select --install failed (e.g. no GUI session over SSH)
  before the wait, instead of discarding its output.
- Parametrize the dialog-then-continue and fail-fast cases.
2026-10-16 09:05:04 -04:00
unsupportedpastels
e6bfe7a5f1 fix(install): treat macOS developer tools as present only when they hold git
A macOS upgrade can leave /Library/Developer/CommandLineTools behind with its contents gone; xcode-select -p still names it, so the folder-exists check skipped the install dialog for the most common broken-git Mac. Require $dev/usr/bin/git instead, which both the CLT folder and Xcode's Contents/Developer hold.

When xcode-select --install refuses over such a leftover folder, no dialog opens: fail at once with the reinstall remedy instead of waiting 15 minutes.
2026-10-16 09:05:04 -04:00
unsupportedpastels
9b3d61732a fix(install): report git errors when macOS developer tools are already present; wait under Hermes-Setup
When xcode-select -p names an existing developer directory (e.g. Xcode installed, license never accepted), no install dialog will open: skip the dialog and the wait and fail with git's own error instead of waiting 15 minutes and suggesting the wrong fix.

Hermes-Setup drives stages with --non-interactive --json; it has no stage timeout, a Cancel button, and streams log lines as progress, so wait for the Command Line Tools there too. Only a plain headless --non-interactive run fails fast.

Run Homebrew with HOMEBREW_NO_AUTO_UPDATE=1 (auto-update runs the broken git and can take minutes) through run_logged instead of discarding its output.
2026-10-16 09:05:04 -04:00
unsupportedpastels
5aaedc178b fix(install): install git on macOS again when /usr/bin/git is the CLT stub
Restore the pre-pm installer's macOS git path that the pm bootstrap rewrite dropped: try Homebrew first, else open Apple's Command Line Tools dialog and wait up to 15 minutes for git to run, then continue the install in the same run.

Without a terminal (--non-interactive, Hermes-Setup) the installer still opens the dialog but fails right away with the remedy instead of hanging.
2026-10-16 09:05:04 -04:00
unsupportedpastels
ca9b5f04fd fix(install): stop at prerequisites when macOS git is the CLT stub
macOS ships /usr/bin/git as a stub until Apple's Command Line Tools are installed. It passes 'command -v git', so the installer reported prerequisites ok and then died at the clone with 'git clone failed; no checkout published: ... see man xcode-select'.

Check that git actually runs. On macOS, open the CLT installer and fail with the remedy; elsewhere, fail with git's own error. Both keep the git_missing failure class.

Regressed in 3d12e86ef1, which replaced attempt_install_git() (CLT install + git --version check) with a PATH-only check.
2026-10-16 09:05:04 -04:00
Teknium
275b15fc35 ci: catalog-only PRs run the catalog tests instead of the full suite
A PR that changes only plugin-catalog entry YAML (plus contributor email
maps) ran all 23k Python tests on Linux, macOS and Windows, ~25 min, and
unrelated core flakes kept blocking one-file catalog additions.

The classifier now has a `catalog` lane. A diff made only of catalog entry
data turns `python` off and `catalog` on; ci.yaml then runs
catalog-tests.yml (every test file that reads the catalog or the email
maps, discovered by scripts/ci/catalog_test_files.py), plus the contributor
check. The lane is required by all-checks-pass whenever detect selects it.
plugin-catalog/README.md keeps the full suite (a docs-page test mirrors
it), and any non-catalog file in the diff brings the suite back. The
structural and pinned-source admission gates in plugin-catalog-ci.yml are
unchanged.
2026-10-16 04:37:07 -07:00
Mikhail Tarasov
c1f19acb7f fix(tui): ship runtime Python helpers with the built product
(cherry picked from commit 699555cebc116c50d8fab0d7d0e0dc604840bca6)
2026-10-16 01:54:58 -07:00
Teknium
6d63140782 fix(install): a rerun moves a checkout only forward onto the release
Review (unsupportedpastels) on #139311: a rerun over a main checkout moved
it to v0.22.2, which was cut on release/0.22.1 and diverged from main, so
the move crossed the gateway runtime cutover backwards without the downgrade
guard `hermes update` runs before the same move (update_downgrade_guard
refuses when a state.db holds session_admissions rows). The linear test
history could not show it: there, "does not contain the release" always
meant "behind it".

A rerun now moves only when the release descends from HEAD. A checkout that
contains it, has diverged from it, or cannot tell (shallow) stays, and
`hermes update` decides that move with its guard; an explicit
--channel stable is saved and left to `hermes update` the same way. The
stable-default tests gain the release-branch shape (v0.22.2's): a rerun
from main's tip keeps HEAD, a rerun from before the fork still moves.
2026-10-15 12:09:14 -07:00