Commit Graph

3565 Commits

Author SHA1 Message Date
BearHuddleston
c455207039 perf(bundles): pack Windows uv-cache into deterministic uv-cache.hpkg
Collapse ~33,191 loose Windows uv-cache files (~26.3% of the MSIX entry count) into a single deterministic ZIP_STORED archive (uv-cache.hpkg) during Windows native payload staging.

Using the non-excluded .hpkg extension lets MakeAppx DEFLATE-compress 64 KiB blocks natively (preserving MSIX size and block-level delta updates) while cutting ~33k HTTP Range requests and Defender file-open scans on remote and local MSIX installs. POSIX payloads keep loose symlinked uv-cache/ directories unchanged.

Update pm/packages.py to read both uv-cache.hpkg and loose uv-cache/ directories, preserving selective scope='sdists' seeding (.seeded-sdists), selective-to-full upgrade (.seeded), atomic interruption-safe extraction with retry, path-traversal rejection, and expanded 4 KiB-block uv_cache_seed_bytes() accounting. Update scripts/bundles/native_prepared.py to stream file digests and validate uv-cache.hpkg on win32 targets.
2026-11-30 04:52:06 -08:00
BearHuddleston
98fbfdeadf test(bundles): run the stage-msixbundle tests where CI finds them
scripts/stage-msixbundle.test.mjs was a node:test file outside every JS
test root (tests-js vitest includes only tests-js/**, apps/desktop only
its own scripts/), so CI never ran it. It moves to
tests-js/stage-msixbundle.test.mjs under vitest.

The happy-path test now pins the order of every tool call per bundle:
makeappx at the feed version (/bv), then sign, then verify. The old test
only listed the verify calls, so dropping /bv or verifying before signing
passed it; both now fail. The plan snapshot test duplicated the output
assertions and goes, with the plan's kind field, which only it read.
2026-11-30 04:51:52 -08:00
BearHuddleston
5371041c12 fix(bundles): keep the need-both-per-arch diagnostic stage-msixbundle had
The staging rewrite changed the missing-input error from "need both
per-arch msix to bundle" to "missing per-arch msix to bundle". The native
Windows test apps/desktop/scripts/commit-bundles.windows.test.mjs still
matches /need both per-arch/ in the CLI's stderr, so its missing-input
case failed even though the CLI refused correctly.

The thrown error keeps the old prefix and still lists the missing files.
The Node test now asserts the same text the native test reads.
2026-11-30 04:51:52 -08:00
BearHuddleston
9eb12a38d9 fix(bundles): stop promising in-app updates on per-arch .msixbundle rows
The downloads-page label for the single-arch bundles said "manual; in-app
updates". That is false on every page that renders it. Those pages list
tag and commit builds, which carry no channelBuild in their install stamp,
and a bundle opened directly registers no App Installer source. With no
updates.desktop_feed_base_url configured, the app-installer checker
reports "No App Installer update source is registered" and apply() falls
back to the manual-install message.

The label now reads "manual install and updates": a direct install is
updated by opening the next release's bundle, which upgrades it in place.
The downloads-page test asserts the Windows rows say "manual" and never
"in-app".
2026-11-30 04:51:52 -08:00
BearHuddleston
532c521a51 feat(bundles): emit signed single-arch Windows .msixbundle downloads
Emit and sign single-architecture Windows .msixbundle packages (-win-x64.msixbundle and -win-arm64.msixbundle) alongside the existing universal -win.msixbundle in scripts/stage-msixbundle.mjs, and update all release consumers atomically.

Windows rejects in-place upgrades from an installed .msixbundle to a bare .msix, while downloading a single-arch .msixbundle via one HTTP GET cuts clean installs and in-place upgrades from 63–99 minutes down to ~5–6 minutes (verified on Win11 x64 and ARM64).

Key changes:
- scripts/stage-msixbundle.mjs: stage each bundle from an isolated hardlinked/copied directory (removing staging dirs immediately to preserve runner disk), sign all 3 with Azure Trusted Signing, and verify /pa on each.
- scripts/bundles/release_artifacts.py: add select_windows_bundles() and validate_windows_arch_bundle(); accept either historical universal-only receipts (v0.22.0/rc.2) or complete 3-bundle sets (universal + x64 + arm64), failing loudly on incomplete sets.
- scripts/releases/stable.py, scripts/bundles/channel_artifacts.py, scripts/releases/channel_publish.py: select universal vs per-arch bundles explicitly via select_windows_bundles() and validate per-arch manifests when local bytes are present.
- scripts/releases/downloads_page.py: prefer signed per-arch .msixbundle (labeled manual install; uses in-app updates) over bare .msix when present, while keeping .appinstaller primary for OS-managed feeds.
2026-11-30 04:51:52 -08:00
BearHuddleston
6ca636880d perf(bundles): exclude CI-only contributors directory from sealed snapshots
Add contributors to INERT_SNAPSHOT_DIRS in scripts/bundles/payload.py so repository-root contributor attribution files (3,256 tiny files totaling ~0.1 MiB, read only by CI attribution scripts) no longer ship inside macOS, Linux, and Windows desktop payloads.
2026-11-30 04:51:42 -08:00
alt-glitch
7947e7aad4 refactor(bot-desktop): the idle check names its module from the import
runtime.py passed the literal "tools.bot_desktop.idle_watch" to the
launcher's idle command. It now passes next_check_in.__module__, the
module it imports two lines above, so the name follows the file when the
package moves. The value is the same today.

The row in scripts/move/exclusions.py that told the move rewrite to keep
that literal is removed with it.
2026-11-30 18:11:57 +05:30
alt-glitch
fc9bfa05f4 fix(code-health): HX018 stops allowing pm, and utils/AGENTS.md matches the code
pm imports hermes_cli.config inside functions, so a utils helper could
reach config through it with no waiver. No utils module imports pm, so the
allowlist entry goes.

utils/AGENTS.md: the product test names its one standing exception (the
atomic writers call hermes_constants.mkdir_under_hermes_home so a write
never resurrects a deleted profile), the owner table gives
hermes_cli/config_backend.py its real path, and the submodule-import rule
is scoped to new callers. The utils/__init__.py docstring says the same.
tests/AGENTS.md no longer lists utils among the modules whose tests sit
directly in tests/.

The rule's tests now cover a root-level product module, `not in
sys.modules`, and a relative import inside utils.
2026-11-30 18:07:16 +05:30
alt-glitch
26287b320a feat(code-health): HX018 keeps utils/ free of product code
utils is meant to be importable from every package without pulling the
product in, and nothing enforced that. HX018 is a blocking code-health rule
over utils/: it flags an import of a first-party module at any depth,
importlib.import_module or __import__ of a literal name, and a sys.modules
get, subscript or `in` lookup of one. Allowed: other utils modules,
hermes_constants, hermes_platform, hermes_yaml and pm.

First-party names come from the judged tree's tracked files (NAME.py or
NAME/__init__.py at the root), so there is no list to keep in sync.

The two hermes_cli.config imports in utils/files.py, the config writer's
round-trip YAML path, carry `# health: allow HX018 -- why`. They are the
whole exception list.

utils/AGENTS.md states what belongs in utils and what the rule allows. The
root routing table gets no row: root plus gateway/AGENTS.md is 11 characters
under the chain cap.
2026-11-30 18:07:16 +05:30
alt-glitch
42866787a1 refactor(speech): speech files move from tools/ to a new speech/ package
Text-to-speech engines, transcription, voice mode and wake word register no
tool, so 28 files leave tools/ for a root package with four sub-packages:
speech/synthesis, speech/transcription, speech/voice and speech/wake_word.
tools/tts_tool.py, which registers text_to_speech, stays, and so does
tools/tts_elevenlabs_voices.py, which builds part of that tool's schema. Each
__init__.py is a docstring only.

File names keep their stem and drop the prefix the folder makes redundant.
transcription_tools becomes transcription/transcriber, transcription_common
becomes transcription/settings, wake_word becomes wake_word/listener, and
tts_tool_openai becomes synthesis/openai_compatible: neutts_synth.py runs by
file path from that folder, where an openai.py would shadow the openai package.
The NeuTTS samples and the bundled wake-word model move with the code that
reads them through __file__.

Function bodies are unchanged and every import stays where it was. Logger
names follow the modules: a moved module logs under its speech.* path, and a
literal that named a moved module names its new path. speech joins the tools
log component, so `hermes logs --component tools` shows the same lines. The
seven synthesis files that share the logger of tools/tts_tool.py keep it.

tools.tts_streaming keeps a generated file at its old path. Every release from
v0.21.6 to v0.23.5 imports it inside the CLI and TUI turn, outside any try, and
an idle process has not loaded it yet, so a process that outlives `hermes
update` would fail its first turn. No other moved name gets a file.

speech joins pyproject's packages.find, FIRST_PARTY_MODULE_ROOTS, the plugin
isolation audit, the known logger roots of `hermes debug share`, six check
scripts, the P33 profile-scope pattern, the subprocess env guard test, the
packaging test and three fixtures that copy a source tree. Tests whose subject
is a moved module move to tests/speech/ with the fixtures only they use.

Pinned catalog plugins import these moved modules by the old name, so each has a key in
hermes_agent/compat/moves.py and the plugin guide lists it with the release
that may remove it (no earlier than v0.27.0):
  tools.transcription_cloud
  tools.transcription_tools
  tools.tts_text_normalize
  tools.tts_tool_providers
  tools.voice_live
  tools.voice_mode
  tools.voice_mode_transcript
2026-11-30 16:59:14 +05:30
alt-glitch
55866ee0fb refactor(browser): browser sessions, launcher and supervisor move from tools/ to browser/
tools/ holds model tools. These 15 files register none: they launch and
track Chromium, hold the per-task browser sessions and run the CDP
supervisor the browser tools call. They move to a new root package:

  tools/browser_session*.py          -> browser/session*.py
  tools/browser_launcher{,_holders}  -> browser/launcher{,_holders}.py
  tools/browser_lightpanda.py        -> browser/lightpanda.py
  tools/browser_supervisor*.py       -> browser/supervisor*.py
  tools/browser_real_profile_logins  -> browser/real_profile_logins.py
  tools/bot_desktop/browser.py       -> browser/desktop_profile.py

browser/__init__.py is a docstring only. tools/browser_tool.py and every
tool file stay. 38 tests and one helper move to tests/browser/; its
conftest.py imports the autouse fixtures of tests/tools/conftest.py they
ran under.

Old-path files, each a MOVES key, a REQUIRED_NAMES row and a file
written by scripts/move/generate_shims.py:
- tools.browser_supervisor and tools.browser_supervisor_capture are on
  the published plugin API (hermes_cli/data/plugin_api.json), so a
  plugin's import gives the same module object.
- tools.browser_session and tools.browser_session_cloud are imported
  inside functions on every turn by a process started on v0.22.7 to
  v0.23.5 (the per-turn browser cleanup), which keeps running its old
  code after an update swaps the checkout.

Function bodies are unchanged and every import stays where it was.
Loggers follow their modules: every moved file keeps
getLogger(__name__), and the two literal supervisor loggers name
browser.supervisor. browser joins the tools entry of
hermes_logging.COMPONENT_PREFIXES, so `hermes logs --component tools`
shows the same lines. browser also joins packages.find,
FIRST_PARTY_MODULE_ROOTS, _KNOWN_LOGGER_ROOTS, the plugin isolation
audit, six check scripts, the P33 profile-scope pattern, the gateway's
stop-path preload list and the test fixtures that list root packages.

The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py; split imports, imports inside child-process code
strings, boundary-lint baseline keys, two resolution-allowlist rows and
docs globs were fixed by hand.

Pinned catalog plugins import these moved modules by the old name, so each has a key in
hermes_agent/compat/moves.py and the plugin guide lists it with the release
that may remove it (no earlier than v0.27.0):
  tools.browser_session_cdp
  tools.browser_session_lifecycle
2026-11-30 16:47:24 +05:30
alt-glitch
a56fdb508f fix(code-health): a from-import of a moved module matches with any local name
The alias was dropped from the head's line only when it equalled the old
module name, so `from tools import helper as helper` stopped matching
itself after a move, and `from pkg import (helper)` was not read at all.

Both sides now drop the local name of a from-import that names a moved
module, and the pattern accepts an opening parenthesis.
2026-11-30 16:21:50 +05:30
alt-glitch
2f7efad8c1 fix(code-health): an import that follows a renamed module is not a new import
The ratchet reads a line that names a moved module as the base's line
only when the module has a key in hermes_agent/compat/moves.py. Most
moved modules get no key, so under tools/ every function-level import
of one failed PLC0415 as new, in files the move did not otherwise touch.

module_moves adds the Python files the diff renames to the MOVES table
before lines are compared. module_renames also reads `from pkg import
module`, with the alias a move adds to keep the old local name.
2026-11-30 16:21:50 +05:30
alt-glitch
177cf64315 fix(code-health): packaged-imports skips only imports a guard really protects
- An import in a function defined under try/except ImportError is checked: the function runs when called, after the handler is gone.
- A try whose ImportError handler re-raises is not a guard, since the missing module still fails the import.
- Tests pin what stays checked: the handler, else, finally, a broader except, a plain if.

Co-authored-by: BearHuddleston <BearHuddleston@users.noreply.github.com>
2026-11-30 15:28:01 +05:30
alt-glitch
db0568795e fix(code-health): tool-discovery and packaged-imports judge what discovery and the wheel do
tool-discovery now flags a registration in tools/registry.py or tools/__init__.py, which discovery never imports; both read one skip set in tools/registry.py.
packaged-imports no longer flags an import inside try/except ImportError or if TYPE_CHECKING, which cannot fail an installed wheel.
packaged-imports now flags a regular package under an unshipped namespace directory.
The FILE_LINES fix text no longer forbids flat siblings an area AGENTS.md prescribes, and is shorter.

CONTRIBUTING.md states the same flat-sibling exception as root AGENTS.md.
2026-11-30 15:28:01 +05:30
alt-glitch
f2c36b5002 feat(code-health): a new import inside a function under tools/ fails the ratchet
ruff's PLC0415 joins the ratchet's pattern rules, scoped to tools/. The 2,716
function-level imports already there are existing debt and keep passing where
they sit; a new one fails unless it carries
'# health: allow PLC0415 -- <why>' (an optional extra or a measured startup
cost). The fix text names the cause: a cycle that forced the import is fixed
by moving the shared names down.
2026-11-30 15:18:23 +05:30
Jan-Stefan Janetzky
de5f8e90d6 fix(pm): admit plugin and extra changes against a Nix package's environment
On a Nix package every `hermes plugins enable|disable`, plugin install,
plugin update and `hermes pm install` died in the venv stamp: PM looked
for uv.lock beside the wheel-installed modules (#140765). Shipping the
lockfile does not help, because the sync then builds a dependency
generation from a source tree the package does not carry.

A Nix package's environment is its store closure, so the sync no longer
builds there. On a `distribution: nix` install it checks what a plugin
change brings in, and what extras were asked for, against the
distributions the application can already import, publishes the change
when they are satisfied, and refuses by package name otherwise, pointing
at extraPythonPackages and extraDependencyGroups. The sync records no
dependency state and downloads nothing.

- pm/nix_admission.py: the check. The application's sys.path reaches
  every PM child through runtime_environment(), so the worker and
  `hermes pm ...` judge the same environment.
- A plugin that was already enabled is not re-judged by an unrelated
  change, so one enabled by hand cannot block enabling or disabling
  another, or itself.
- `hermes pm install` without --extra no longer asks a Nix package for
  [all]: the package variant chose its extras.
- Only the executing tree resolves through the package's stamp; a Nix
  install asked to sync another checkout reads that checkout's.

Fixes #140765

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-30 15:08:02 +05:30
alt-glitch
cb4c3f9aa9 fix(compat): tools.send_message_tool and tools.send_message_targets import again
Both modules moved to gateway/outbound/ before v0.23.2. Nine pinned
catalog plugins import tools.send_message_tool by its old name, and one
of them also imports tools.send_message_targets. On v0.23.2 through
v0.23.5 five of those plugins fail to load and four lose a feature.

Two keys in hermes_agent/compat/moves.py map the old module names to the
modules that hold the code now. No file returns to tools/.

The plugin guide lists both names with the release that may remove them
(no earlier than v0.27.0). The moves.py docstring said a key is never
removed; that holds for a key a supported release reaches, and the
docstring now says so.

The boundary lint names a keyed module by its first name, so the one
baseline row for gateway.outbound.send is renamed; no count changes.
2026-11-30 14:47:25 +05:30
alt-glitch
775a797e2a refactor(tools): move the MCP client files into the package tools/mcp/
The 27 flat tools/mcp_*.py client files and tools/osv_check.py become
modules of tools/mcp/, each without its mcp_tool_ or mcp_ prefix.
tools/mcp_tool.py becomes tools/mcp/client.py, because discovery imports
any tools/<pkg>/tool.py. tools/mcp_tool_agent.py stays. tools/mcp/__init__.py
is a docstring only, so importing one module loads what the flat file loaded.

Their 118 tests move to tests/tools/mcp/ under the same names. Imports,
string patch targets, sys.modules keys and doc paths follow the move.
Three old module names keep a generated file at the old path, because a
process that started on a supported release and outlives the update
imports them lazily: tools.mcp_tool_discovery and tools.mcp_oauth when an
editor's ACP server opens its next session, tools.mcp_elicitation_form on
its next tool call. The other 25 names stop importing.

Logger names follow the modules. The eight files that use
getLogger(__name__) log under tools.mcp.<module>, and the literal name the
split modules share is tools.mcp.client. Every name stays under tools.

The "mcp_tool.py" entry in the discovery skip set is removed: discovery
scans only tools/*.py and tools/*/tool.py, so no file of tools/mcp/ is a
candidate. The same tools register before and after.
2026-11-30 14:45:36 +05:30
BearHuddleston
d70b5c1487 fix(releases): list only the AppImage names the Linux build produces
_VALID_ASSETS accepted both linux-x86_64.AppImage, the name
electron-builder gives the x64 AppImage and the one
scripts/releases/linux.py publishes feeds for, and a linux-x64.AppImage
alias nothing produces. Both normalize to the same (linux, x64) row, so
an archive holding both listed whichever name came last.

Drop the alias. The new test feeds both names and expects the produced
one in the row and in the version filter; it failed on the previous head
because the alias overwrote the real file.
2026-11-29 14:13:27 -06:00
BearHuddleston
8e9aaf056c docs(releases): list Linux AppImages in builds tables and document bundle support
Linux x86_64 and arm64 AppImages now build, pass native install-and-chat
smoke, unpack to a stable per-version `$XDG_DATA_HOME/hermes/bundles/`
payload path, and publish updater feeds on daily canaries (`#161336`)
and opt-in `--with linux` stable releases (`#161406`), but the builds
page renderer and documentation still hid them or described them as
unsmoked, unoffered artifacts:

- `scripts/releases/downloads_page.py`: accept real `linux-x86_64.AppImage`
  and `linux-arm64.AppImage` filenames via `_VALID_ASSETS` (normalizing
  `x86_64` to `x64` while rejecting invalid os/arch/ext combinations),
  remove `_UNLISTED_OS = frozenset({"linux"})` so staged Linux AppImages
  render in `Hermes Desktop` download tables, and update `_SMOKE_SCOPE`
  to reflect diagnostic Linux AppImage smokes while preserving the
  unsigned Store notice.
- `tests/scripts/test_render_builds_publication.py`: verify real
  `linux-x86_64.AppImage` and `linux-arm64.AppImage` rows render in both
  release bodies and R2 `index.html`, while YAML feeds and invalid
  os/arch/ext pairs remain hidden.
- `apps/desktop/BUILDING.md`, `tests/install/README.md`, and
  `website/docs/` (`platform-support`, `installation`, `updating`,
  `desktop`, `shared-bundle-builds`, `stable-releases`): document the
  Linux AppImage distro/glibc floors, first-launch payload extraction,
  `AppImageUpdater` differential updates, measured canary sizes, and
  current non-gating canary / opt-in `--with linux` stable status.
2026-11-29 14:13:27 -06:00
BearHuddleston
07c9d399da docs(releases): say what time_budget bounds by the deadline
The docstring promised a bound on total wall time. Reads end by the
deadline, and the retries in `signed_request`, the downloads and
`put_object` skip a sleep the time left cannot cover; `copy_object`'s
retry, which no budgeted caller reaches, still sleeps. Connecting (per
address tried), the TLS handshake (CPython's `do_handshake` takes one
deadline from the socket timeout) and each send run with the timeout
the connection opened with, which is at most the per-request cap and
the time left at open. So each of those steps is bounded but can still
run that long past the deadline. Say so, so a caller sizes the
per-request cap knowing it is also the possible overrun.
2026-11-29 13:06:26 -06:00
BearHuddleston
7e5f505087 fix(releases): let the time budget skip put_object's retry sleep
`put_object` retries a retryable R2 status in its own loop with an
unconditional `time.sleep(1.0)`, so under `time_budget` it slept past a
deadline that `signed_request` had already declined to retry into, and
the next attempt then failed on the spent budget instead of the 503.
`_reconcile_linux` reaches it through `linux.publish_stable_record`.

Use `_retry_sleep(1.0)` like the other retry loops: outside a budget it
sleeps as before; inside one it re-raises the PUT's own error once the
time left cannot cover the sleep.

Test: a loopback endpoint answering 503 under a 0.5 s budget recorded
three 1 s sleeps and three PUTs on the previous head; now none and one,
and the error is the 503.
2026-11-29 13:06:26 -06:00
BearHuddleston
594add2fc0 fix(releases): hold trickled R2 responses to the time budget
A socket timeout bounds one wait, not one read. `res.read(n)`, the
whole-body `read()` in `signed_request` and the status/header
`readline()` loop recv until they have their bytes, so a peer that sends
a byte every few milliseconds kept a single call going past the
`time_budget` deadline: the budget was only checked between 1 MiB
chunks, and `signed_request` and `read_public_receipt` never checked it
while reading.

Under an active budget, `_connection` now gives the connection a
response class whose socket reader sets each wait's timeout to what the
budget has left (`_effective_timeout`) and raises once it is spent. That
covers the status line, headers and every body read in all four
readers, so the per-loop `_clamp_socket_timeout` / `_check_budget` calls
go away and the chunk loops read as they did before. Connections opened
outside a budget keep the stock response class.

Sends are unchanged: each `sendall` is bounded by the timeout the
connection opened with, which the budget already clamps, and the
reconcilers only PUT small JSON bodies.

Tests: a loopback server that sends headers or a body one byte every
20 ms holds each of `signed_request`, `read_public_receipt`,
`download_public_object` and `verify_remote_artifact` for the whole
10 s trickle on the previous head (8 failed); all raise `TimeoutError`
at the 0.5 s budget now. A trickle that stops at 2.5 s under a 3 s
budget pins the per-wait clamp: without it the last wait runs the
connection's full 3 s.
2026-11-29 13:06:26 -06:00
BearHuddleston
3562efb348 fix(releases): bound R2 time inside post-publication reconcilers
Post-publication reconcilers (`_reconcile_store`, `_reconcile_linux`)
run after durable channels have already moved, inside `reconcile`'s
30-minute timeout. Previously they inherited `r2.py`'s 600-second
per-request socket timeout and unbounded retries, so a stalled R2
request could outlast the workflow timeout and fail the run after
publication. `_reconcile_store` also caught only `(StoreError,
ValueError, OSError)` and did not handle `r2.R2RequestError` or
`http.client.HTTPException` when reading the archived candidate
manifest.

Add a `ContextVar`-backed `r2.time_budget(total_seconds, *,
per_request_timeout=None)` context manager wired through
`signed_request`, `read_public_receipt`, `_download_url`, and
`_stream_and_hash` (clamping open socket reads and retry sleeps to the
remaining deadline, strictly tightening nested budgets). Wrap
`_reconcile_store` and `_reconcile_linux` in a 300 s budget with 60 s
per-request caps, and widen `_reconcile_store`'s advisory catch tuple
to log a structured Microsoft Store warning on R2/HTTP errors.
2026-11-29 13:06:26 -06:00
Teknium
a3d5f87f01 fix(slash): retired names stay commands on input; discovery offers only what runs
Retiring a name in the registry turned it into chat at the adapter boundaries: Slack `/hermes topup`
became the plain text `topup`, and Slack `!topup` / Matrix `!commands 2` were never rewritten, so the
model read them. Every adapter normalizer now asks one rule, hermes_cli.commands.is_command_on_input
(registry names and aliases, plugin commands, RETIRED_COMMANDS keys), and slack_subcommand_map (the
native and relayed `/hermes` input map) carries the retired names, so the gateway answers the rename
notice. Menus still list only the registry. The Matrix guide recommends `!help`.

Desktop's /hatch fallback for older backends runs only when the session's loaded catalog lists
/hatch; an unloaded catalog sends the command to the backend. On the shared gateway Ink offers only
the /pet arguments it runs itself (no `hatch`). Restricted /help drops the usage-hint parts a folded
form owns from its parent's line unless the caller holds that folded grant.
2026-11-29 03:22:20 -08:00
Teknium
f2b19fd37c refactor(slash): retire the folded command names
The folds Teknium approved are on main (/verbose focus, /statusbar battery|indicator,
/status's egress block, /model --runtime, /pet hatch, /goal add, /help <page>,
/billing topup|upgrade, TUI /verbose details|density), but the old names still ran.
They are now retired with RETIRED_COMMANDS: typing /focus, /battery, /indicator,
/egress, /codex-runtime, /hatch, /generate-pet, /subgoal, /commands, /topup,
/subscription or /upgrade (either _ or - spelling) runs nothing on the CLI, gateway,
TUI and Desktop and answers "`/old` is now `/new`.". The TUI answers its own /details,
/detail and /density the same way (slash.retired), since they never existed elsewhere.

The old names leave help, menus, completion, the Telegram menu priority, the Slack
/hermes-only set, the Desktop registry and description keys, and the docs tables (the
Renamed commands table lists each). Handlers only the old names reached are removed;
the umbrella commands still call the shared handlers.

Slash access: the folded forms check their own user_allowed_commands keys (goal-add,
model-runtime, status-egress, help-pages) instead of the retired names, and an
operator list that still names subgoal, codex-runtime, egress, commands or topup
grants what replaced it, so no existing config loses or gains access.
2026-11-29 03:22:20 -08:00
BearHuddleston
9d23ed3542 fix(releases): let no Linux feed failure fail the stable sequencer
_reconcile_linux runs after the release and its channels are durable,
and the Linux lane promises never to gate publication. Its except
clause listed the error types it expected, and review kept finding ones
it missed. A truncated R2 read raised http.client.HTTPException
(820a4262ab). A malformed live stable-linux.yml raises ruamel's
ParserError from parse_linux_feed. A handoff receipt with a non-string
sha256 raises TypeError in handoff.validate. Each of them failed
sequencer.main after the release was public.

The lane now catches Exception at its single call, with a BLE001
waiver that says why. It logs the traceback and warns with the
exception's type name, the same form sequencer.main uses for its own
::error::. An unexpected bug therefore still shows up in the job log
and as an annotation, but it no longer turns a finished publication
red. SystemExit and KeyboardInterrupt still propagate.

The new test serves a stable-linux.yml that is not valid YAML from the
loopback R2. On the previous head ParserError escaped _reconcile_linux.
Now it warns, the feed is unchanged and no PUT is made.

Found by a Sol review round on #161406.
2026-11-29 01:31:39 -06:00
BearHuddleston
e3164075e9 refactor(releases): share the Linux identity and smoke checks with admission
record_evidence's _arch_evidence_reasons was a copy of the commit, tag
and per-arch smoke checks in admit_publication. A rule change would have
needed the same edit in both places. admit_publication now starts from
the helper and adds only its ChannelAuthority checks, and the helper
moves above it.

The only observable change is reason order: authority refusals now come
after the evidence refusals. Nothing reads that order. The 92 tests in
test_release_linux.py and test_release_sequencer.py pass on the previous
head and on this one. Dropping the helper call from admit_publication
fails 9 of them.

Reported by Greptile on #161406.
2026-11-29 01:31:39 -06:00
BearHuddleston
bcc8a32444 fix(releases): warn when a published Linux release has no smoke receipt
When linux-evidence.json was missing, publish_stable_record returned
published=False. _reconcile_linux then logged a plain line, so a skipped
or failed recorder left the stable Linux feeds stale with no annotation,
although the PR promises a :⚠️: for missing receipts. A refusal
now warns the same way an R2 error does.

The warning goes through a new progress.warning, next to notice and
error, so it lands on stderr like the other annotations. The sequencer's
stdout stays the JSON step list that progress.py documents. The earlier
print put the R2-error warning on stdout, and the two tests that read it
now read stderr.

The new test runs _reconcile_linux against an empty loopback R2. On the
previous head it saw only the plain log line.

Reported by Greptile on #161406.
2026-11-29 01:31:39 -06:00
BearHuddleston
3d2acfa982 fix(releases): keep a truncated R2 read from failing the stable sequencer
r2.signed_request retries an IncompleteRead and then re-raises it.
IncompleteRead is an http.client.HTTPException, not an OSError, so it
escaped _reconcile_linux's catch. The sequencer job then failed after
the release and its channels were already live, which breaks the Linux
lane's non-gating promise. The catch now includes HTTPException, the
same tuple channels.py already uses for R2 transfers.

The test has the loopback R2 fixture send a short body for
linux-evidence.json on every attempt. On the old head it raises
IncompleteRead out of _reconcile_linux.

Reported by Greptile on #161406.
2026-11-29 01:31:39 -06:00
BearHuddleston
a41f3b77aa ci(releases): reconcile opt-in Linux AppImage stable updater feeds 2026-11-29 01:31:39 -06:00
BearHuddleston
1df8bf5c5b fix(releases): verify both Linux AppImages before a retry writes either feed
_preflight_feed returned "noop" for an arch whose live feed already
matched the plan before it checked that arch's AppImage. A retry after a
partial publish (x64 written, arm64 PUT failed) therefore verified only
the arm64 AppImage and wrote the arm64 feed, even if the x64 AppImage the
live feed names had gone missing or corrupt since. That breaks the
all-or-nothing rule publish_admitted states: both AppImages are checked
before the first PUT.

The live-feed checks (downgrade, conflicting same version) still refuse
first, without a download. The AppImage size and SHA-512 check then runs
for every arch, whether its feed is already live or not. A rerun where
both feeds are already live now downloads both AppImages and writes
nothing, the same transfer cost as the first publish.

Test: test_retry_after_partial_publish_reverifies_the_already_live_arch_appimage
seeds a live x64 feed, corrupts the x64 AppImage and retries. It
expects a checksum refusal, no PUT and no arm64 feed. It fails on the
previous head (DID NOT RAISE: the arm64 feed was written) and passes now.
Found by the sol-loop review on #161336.
2026-11-29 00:19:46 -06:00
BearHuddleston
61cb3898fd refactor(releases): fetch staged Linux feeds through handoff.fetch
Greptile on #161336: load_feeds_from_dir had no caller, because
fetch_staged_feeds read both staged feeds itself, with a hand-rolled
copy of the receipt-bound transfer that handoff.fetch already does for
every other leg (read and validate the receipt, then GET each row and
check size and sha256), plus a read of r2.Response's private `_body`.

Keep the loader and drop the copy instead: publish_from_env now
downloads each arch's feed with handoff.fetch into a temporary
directory, one receipt per call with only that arch's feed name
included, and reads both with load_feeds_from_dir. Each feed can still
come only from its own arch's receipt, and a missing or tampered feed
still refuses before the first PUT. A transfer whose bytes disagree with
the receipt now gets the shared download's retries before it fails, and
the error reads "Artifact checksum mismatch".

New test: test_publish_from_env_takes_each_feed_only_from_its_own_arch_receipt
moves the x64 feed's receipt row into the arm64 receipt and expects a
refusal with no PUT. It passes on the previous head too (that code
looked the row up per receipt); it fails on a mutant that fetches both
arches in one handoff.fetch call, which is the shape this change has to
avoid.
2026-11-29 00:19:46 -06:00
BearHuddleston
0d523559c9 refactor(releases): drop the Linux publisher's unused fetcher copies of the R2 helpers
Greptile on #161336: linux.py threaded an optional `fetcher` through
every R2 call and, when one was set, ran its own copies of
r2.verify_remote_artifact and r2.put_object (checksums, request
hashes, Cache-Control, error checks). Nothing passes a fetcher: the
workflow runs `python -m scripts.releases.linux publish` and the tests
drive the real transport against the loopback R2 fixture. The copies had
already drifted (the artifact check read `response.data`, which
r2.Response doesn't have), so the first caller would have hit an
AttributeError instead of a checksum verdict.

Remove the parameter and its branches. Artifact verification and the
conditional feed PUT now go only through r2.verify_remote_artifact and
r2.put_object, and _get_live_feed keeps only the 404 handling that
r2.signed_request can actually raise. No behaviour change on the real
path, so the existing loopback tests are the proof: the same 36 test ids
in tests/scripts/test_release_linux.py pass before and after.
2026-11-29 00:19:46 -06:00
BearHuddleston
a7d0f2a301 ci(releases): wire diagnostic Linux AppImage updater feed publication 2026-11-29 00:19:46 -06:00
BearHuddleston
ce7373edc5 feat(releases): add Linux AppImage feed planner, admission gate, and R2 prune protection 2026-11-29 00:19:46 -06:00
Erosika
4927b5b277 fix(termux): stage the bionic Python to load its own libpython
Termux links its interpreter with RUNPATH $PREFIX/lib, so the launcher put
the payload's Python lib folder first on LD_LIBRARY_PATH. Every child
inherited that, and a Termux Python of the same minor then loaded Hermes's
libpython: `import array` failed in terminal commands, pip and venv.

Staging now rewrites the interpreter's RUNPATH to $ORIGIN/../lib ahead of
the Termux prefix, in place, and the launcher names neither libpython
folder. The value has no version in it, and a .deb whose interpreter cannot
take it fails the build instead of reaching a phone.

Fixes #158261

(cherry picked from commit 5af4d277dea7877b738da23dedba4dea3602f906)
2026-11-28 23:42:32 -06:00
Teknium
853e51b4f6 feat(catalog): default: ">=X" makes a plugin a default from Hermes X on
A plugin replacing a platform that released cores still bundle cannot use
`default: true`: v0.23.4 and v0.23.5 read it and install the plugin in every
home (it stands down there; each install still costs a clone and, before the
base-deps change, a dependency generation per home). A `requires_hermes`
floor avoids that but gates every install, so it also refuses the move of an
existing Weixin/QQ setup on main and canary builds that dropped the platform
but still report 0.23.5.

`default` now also takes a version spec. Cores before this read only
`default: true`, so they skip such an entry; cores with it make it a default
when the running version satisfies the spec (judged like requires_hermes, an
unknown version passes), while `requires_hermes` keeps the plugin's real
floor for every other install. The validator accepts the spec form and the
catalog CI's default-plugin venv-rebuild lint covers it.
2026-11-28 20:59:22 -08:00
Teknium
f1c9031a61 refactor(slash): /resume is the one session picker; /sessions, /session, /switch retire
Bare /resume lists sessions on every surface (CLI table, TUI switcher overlay,
Desktop picker, messaging listing); /resume <number|name|id> switches. The
messaging /sessions forms move under /resume: all, full, search|find <q>; a
listing number resumes that row (with the same all/full words), the current
session is listed unnumbered, rows rank by lineage activity. /resume --all and
--cross-room keep working.

/sessions, /session and /switch answer "`/x` is now `/resume`." via
RETIRED_COMMANDS. The TUI submits a typed retired name as-is instead of
accepting the first fuzzy completion, so its notice shows.

Depends on #161271 (RETIRED_COMMANDS).
2026-11-28 20:48:40 -08:00
Teknium
a30074a733 fix(tui): offer only commands that run, keep typed registry names on Enter
- Client checks move from TypeScript-parsing pytest to vitest. A generated dump of the
  owner's verdicts (apps/shared/src/slash-exec-verdicts.json,
  scripts/dump_slash_exec_verdicts.py) is the owner truth. The Python test checks only the
  catalog's slash_exec against command_verdict and that the dump is fresh.
- Ink: a handler that forwards its bare form to slash.exec (`forwardsBare`, bare /pet) no
  longer earns the local exemption. A vitest runs every offered registry command and asserts
  none is refused.
- Ink: Enter keeps a fully typed registry name instead of accepting the completer's top row
  (/platform no longer becomes /platforms); tested through the real composer and submit.
2026-11-28 19:42:51 -08:00
Teknium
050c423499 fix(ci): no '::' survives in a capped entry's printed report
Review (Greptile P2 4729422888): indentation alone was not the guard for
plugin-controlled report text; every '::' is now broken up as well, so no
part of a printed check or warning can be parsed as a workflow command.
2026-11-28 16:51:56 -08:00
Teknium
49dc8004ca fix(ci): a capped entry's validate report and warnings reach the log
Review (Greptile P2 4729395304): the --json run kept only the failed check
names, so a capped pin's caution scan findings and private-import/Desktop
warnings never reached the reviewer. Each check and warning is printed, one
indented line each so plugin-controlled text cannot start a workflow command.
2026-11-28 16:51:56 -08:00
Teknium
c843f4c930 fix(ci): a capped entry still runs every admission check that does not load it
Review (Greptile P1 4729331907): skipping hermes plugins validate outright
for a pin capped below this core also skipped its file-based checks
(manifest, loadable entrypoint, install scanner, core overrides, private
imports, Desktop SDK use), and none of the other gates replaces them. For a
capped entry the gate now runs validate --json --install-deps and refuses
the entry when any check other than the capability probe (the one that
imports the pin on this core) fails, or when no report can be read.
2026-11-28 16:51:56 -08:00
Teknium
1af980732d fix(ci): pinned-source gate skips loading an entry capped below this core
`pinned-source-validate` ran `hermes plugins validate` for every changed
entry on the PR's own Hermes, even when the entry's own requires_hermes
excludes that Hermes. An entry can legitimately be capped below main: its
pin imports core modules a newer release dropped, and only the older Hermes
it names will ever install it. hermes-tag is the case: its pin imports
plugins.platforms.dingtalk, which left core with #159638. Loading that pin
on main can only fail.

The gate now reads requires_hermes through the isolated field reader. A
malformed value is refused the same way the structural validator refuses
it. When the spec excludes the running core (as an install by catalog name
compares it), the load step is skipped, with a ::notice and the reason on
the PASS line. Clone, reachability, confinement, self-updater, attestation
and payload gates still run on the pin, because older Hermes installs it.
2026-11-28 16:51:56 -08:00
Teknium
cad3ea20c7 feat(feishu): Feishu / Lark leaves core for the feishu Hermes Labs plugin
The Feishu / Lark gateway platform and its feishu_doc / feishu_drive document-comment tools move to
NousResearch/hermes-labs-plugins (`feishu/`, history kept): built by Nous Research, not supported.

- Removed: plugins/platforms/feishu/**, tools/feishu_{doc_tool,drive_tool,lark}.py, the adapter's tests,
  Platform.FEISHU, the hermes_cli/platforms.py row, toolsets feishu_doc / feishu_drive / hermes-feishu
  and the hermes-gateway include, platform.feishu.* locale strings in every locale, env/config-key list
  entries, the dashboard env fallback rows, the cron home-target / webhook deliver / startup allowlist /
  /update allowlist / messaging order rows, the ACP kind-map tool names.
- Name-keyed core tables become PlatformEntry traits the plugin sets: binds_port_fn (port binding only in
  webhook mode, was PORT_BINDING_CONDITIONAL_MODES), listen_port (dashboard topology readout),
  thread_reply_anchor (reply-in-thread anchors for replies, progress and interim sends), opus_voice
  (auto-TTS .ogg). gateway.platform_registry.registered_trait reads them.
- Migration: LEFT_CORE row `feishu` built with platform_in_use: env FEISHU_APP_ID + FEISHU_APP_SECRET
  (core's EnvCred row) or a platforms.feishu block carrying app_id (core's is_connected), or the
  feishu_doc / feishu_drive / hermes-feishu toolset selected elsewhere; plugins.disabled
  platforms/feishu / feishu-platform is not use. secret_env/private_env keep the child-process strip set
  identical to main (9 FEISHU_* names); legacy_toolsets keep a disabled hermes-feishu / hermes-gateway
  disabling the tools; off_platforms derived.
- Telemetry: feishu_* tools and feishu_doc / feishu_drive / hermes-feishu toolsets are retired names.
- Docs: messaging/feishu.md (+ zh-Hans) is a short "moved to the Labs plugin" page; tool/toolset
  references and the messaging index mark it as a plugin.
2026-11-28 15:59:41 -08:00
BearHuddleston
21ae8b62c7 fix(ci): forward CLOUDFLARE_R2_PUBLIC_URL into linux x64 build container 2026-11-28 17:46:44 -06:00
BearHuddleston
4e812017de feat(ci): add diagnostic Linux AppImage install-and-chat bundle smoke 2026-11-28 17:45:54 -06:00
Teknium
449a353522 refactor: move QQ Bot out of core into the qqbot Hermes Labs plugin
The bundled QQ Bot platform (plugins/platforms/qqbot) leaves core for the
`qqbot` plugin in NousResearch/hermes-labs-plugins. Its platform name, every
QQ_*/QQBOT_* env var, the platforms.qqbot keys and QQBOT_HOME_CHANNEL stay
the same; the plugin's PlatformEntry carries the env bridge, authz env names,
cron home env and the default allow_update_command.

Removed from core: the plugin dir and its tests (they moved to the plugin),
Platform.QQBOT (Platform("qqbot") resolves once the plugin registers), the
hermes-qqbot bundle and its hermes-gateway include, the platforms.py,
tools_config, dump, setup home-channel and web messaging rows, the QQ_*
OPTIONAL_ENV_VARS / _EXTRA_ENV_KEYS entries, the webhook deliver and startup
allowlist entries, /update's built-in list entry, the shipped
platform_toolsets row, the compat required-name rows for the deleted folder
and the qqbot boundary-baseline lines. Tests that exercised the deleted
adapter drop only those cases.

Kept: the shared own-policy helpers (comments only), cron's home-target order
and the QQ_HOME_CHANNEL legacy alias, doctor's rename warning, the QQ_ env
prefix alias for profile channel ownership, the session_rules route enum,
desktop/TUI source lists. hermes-qqbot stays a valid retired telemetry
toolset value for rows older releases saved.
2026-11-28 15:31:26 -08:00
Teknium
b4f52550a4 refactor(left-core): split left_core_migration.py into a package by job
hermes_cli/left_core_migration.py (1951 lines) was at the 2,000-line file cap with two approved
platform moves (QQ Bot, Feishu) still to add rows to it. Per the root AGENTS.md rule, the topic
becomes a folder: the facade (__init__.py) names each module's job and re-exports the public
surface in __all__; the code moves unchanged into homes, platform_use, feature_use, provider_use,
rows, hints, locks, notices and migrate. Topic modules import one another, never the facade.

Pure move: every top-level def/assign is AST-identical to the original except that hints and
migrate read the table as table.LEFT_CORE (rows imported as table), so one patch of
rows.LEFT_CORE reaches every reader. Private-name importers (default_plugins, catalog_platforms,
catalog_platform_listing) import from the owning module; tests patch where a name is looked up
(migrate._install_into, migrate._attempted, rows.LEFT_CORE, ...). The module path
hermes_cli.left_core_migration keeps working (it is the facade), so running updaters that import
migrate_all_homes from it are unaffected.
2026-11-28 14:59:59 -08:00