The attached-client page listed a hand-picked "Method catalog (selected)"
that included methods the shared gateway's /api/ws socket refuses
(session.title, session.usage, session.activate, session.compress,
session.branch, session.close, session.status). Nothing told a client
author that `x-canonical-methods` (53 names) is the set of methods with a
hermes-gateway-v1 wire model of their own, not the set the gateway serves
(it serves 114), or that some methods only reach an older handler.
`scripts/gen_serve_handler_ledger.py` already derives, per method, how
/api/ws answers it. It now also writes that split into the page between
markers, and its `--check` and test fail when the page is stale. The page
explains the authority-first dispatch, the older-handler rule, and what
`x-canonical-methods` means, and the live-session paragraph names the
methods to use on the shared gateway.
The video plugin already reaches tools.fal_common for its managed client,
queue wait and error helpers (all baselined); the direct-key client sits in
the same module so both FAL tools build it the same way.
Self-chat rejections logged the full chat/sender id of every other chat
on the owner's account, unconditionally; they now go through
redactWhatsAppId() like the debug events. libsignal's console.info
session dumps (private/root/base keys) are collapsed to their label by
the console wrapper, which now also covers console.info. bridge.log
rotates to one .1 generation above 5 MB when the adapter opens it at
spawn, and full/pre-update backups skip both generations.
Fixes#149860
update_cmd_force_stop now imports tools/process_registry.py (the left-behind
sweep) and gateway/host_topology.py (served homes), so a change to either can
break `hermes update` and must start e2e_upgrade (test_update_ci_routing).
`python -m hermes_cli.main update` from releases before update_cmd.py was split
out runs cmd_update/_cmd_update_impl as `__main__`, so in_historical_update()
did not see them and e.g. bc747001eec5's post-pull update_managed_uv() import
raised instead of handing off, leaving the update half-done. A `__main__` frame
now counts when its code was compiled from this checkout's hermes_cli/main.py;
the current tree's own entry points stay live code via the sentinel local.
The shim runtime tests discovered shims by parsing source (banned in tests).
The shim list is now data (tests/fixtures/retired_updater_shims.json, 63 shims,
generated from the former scan); scripts/ci/check_retired_shims_manifest.py runs
the AST scan as a repo-guards step and fails on drift or an empty scan.
The self-updater gate rejects any plugin script that both fetches from
GitHub and writes or renames files. rom-studio (#153798) trips it on
kit/kit.ts, which downloads the third-party poryscript 3.6.1 compiler
from its own release, checks a fixed sha256 and unpacks it into
kit/.cache. It never fetches or replaces rom-studio's own files, so the
pin stays the only update path (README rule 3).
Teknium ruled to allow it. A maintainer now lists such a file in
scripts/ci/catalog_self_updater_allowlist.json by repo, pinned sha, path
and the file's sha256: a re-pin, an edit to that file or a second
fetching file is gated again. The list lives under scripts/ci/, which an
entry PR may not touch (catalog_changed_entries.py), so a submitter
cannot add themselves. Rule 3 in both rule blocks names the exception.
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.
prune_staged_store kept every history row facts.json carries, so a cached
build store shipped superseded tool entries. No other checkout shares a
build store: drop all history before computing the keep set.
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.
adapter_forwarded.py is a sibling extracted from adapter.py, which already imports
agent.compression_marker.elide/ELISION_MARKER_MAX_LEN (baselined) for the unfurl budget.
The sibling reuses the same marker so forwards and unfurls elide identically; the
published plugin API has no truncation helper to use instead.
_rename_like() compared the sequence of quote characters on the line and the token line-up. A branch
that moved the quotes from the module name to another argument, use(tui_gateway, "callback"), kept
both, so the resolver renamed the bare name into hermes_agent.tui_gateway, an attribute lookup. Each
renamed token's quote parity must now match its lined-up base token; such a line stays a conflict.
--continue stops when tracked files have unstaged changes, which the import rewrite step would discard.
--push compares the branch with the remote default branch's full name, so release/stable is refused too.
just migrate-branch --continue and --abort reuse the interpreter the first run set up, so they start after commit A moved hermes_cli.
A resolved hunk renames only the token that lines up with the renamed one, on a line whose quotes are unchanged; anything else stops.
Commit A of a chunk may also modify hermes_agent/compat/moves.py, which just move-chunk amends into it.
Python scripts without a .py extension that the branch changed go to the import rewriter.
A conflict in a file the branch rewrote was resolved with `git checkout --ours` on the whole
file. That dropped every other hunk the import-rewrite merge brought: main's commits when main
was merged into the chunk between A and B, and hand fixes when commit C carried the trailer.
Now git merges every non-conflicting hunk, and a conflicting hunk is resolved only when one side
changed nothing but module names there (both sides read with moved names spelled the old way); a
line that side renamed keeps the rename, and a line the other side edited takes the same
whole-token rename when that is all the renaming side changed on it. Every other hunk stops with its file and line. The same
rule applies to the final merge of the target.
Commit B is no longer "the last commit with the trailer". Trailers may carry a role
(`Hermes-Move: NN-name move|codemod|fix`); without roles, A is the first trailer commit and B is
only A's direct child, so later trailer commits are hand fixes that arrive with the target.
Also:
- files the branch added only inside a new subdirectory of a package A moved whole are moved to
the new path (git's directory rename detection leaves them behind), then rewritten;
- the codemod gets only files that still exist (a branch that deletes a moved file no longer
wedges on --continue);
- docs lines the branch added are rewritten with scripts/move/rewrite_docs.py, and any non-Python
line the branch added that still names a moved module or path is listed and stops the run
unless --accept-flags;
- --push pushes HEAD to refs/heads/<branch> on the branch's own remote and refuses the remote's
default branch; a detached HEAD is refused up front.
scripts/move/migrate_branch.py finds the move chunks a branch is missing by
their Hermes-Move trailer and, for each in landing order, merges the commit
before the rename, merges the rename with directory rename detection, runs
scripts/move/rewrite_imports.py on the Python files the branch changed, and
merges the import rewrite keeping the branch version of those files. It then
merges the target. Any other conflict stops the run; --continue resumes and
--abort restores the branch. Merges only; the remote is touched only with
--push.
The config.yaml key gateway.platforms.<name>.enabled was rewritten to
hermes_agent.gateway.platforms.<name>.enabled. The config-path deny list
matches gateway.platforms. only when a real segment follows, and a name
token stops at a placeholder or a wildcard, so the bare gateway.platforms
was read as the package. A config path that is also a package, alone or
before a placeholder or wildcard, now stays as written and is counted as
flagged-config-or-module for a person to check.
The docs pass counted a `bare-dir` skip for every `cron/*`, `tools/*` or
`plugins/**` it saw, even in a chunk that does not move that folder, so the
skip counts in the build log were inflated. The check now runs only for a
folder the chunk moves. What the pass writes is unchanged.
Add a test that a whole-folder glob on a moved folder that is not ambiguous
(`tui_gateway/*`) is still rewritten, and that an unmoved `cron/*` counts no
skip.
A glob that takes every file of a folder whose name is also a HERMES_HOME dir or an MCP method family (cron/*, tools/*, plugins/**) is skipped like the bare folder; a file pattern such as cron/*.py still follows the move.
rewrite_docs.py imports the old-path file generator only when it checks a .py path, so a copy of scripts/move outside the checkout no longer exits or fails to import.
English that follows from/import in running prose ("from providers like X") and config keys named like a
moved package (plugins.enabled, providers.<id>.api_key) were rewritten to hermes_agent.* names.
- from M import ... / import M / -m M are rewritten only as code: in a code span, a code fence, a >>> line, or
an import statement that parses as Python and starts its line. A bare top-level word alone is never
rewritten. import M becomes from hermes_agent import M.
- A dotted name is rewritten when it names a moved module or package, or a moved module plus an attribute it
defines; a bare package that is also a config section (agent, plugins, providers, ...) needs the attribute.
- DEFAULT_CONFIG keys (shared reader in renames.py, found wherever hermes_cli moved to) and i18n keys
(locales/en.yaml, first argument of t()) are left alone.
- Files generate_shims.py wrote are skipped.
The windows-footguns check flagged three reads/writes in rewrite_docs without
the policy encoding. Reads now use utf-8-sig; a file that started with a BOM
gets it back via write_bytes so rewritten files keep their bytes.
`just move-chunk` stopped with "nothing to commit" when no tool changed a file (a moved leaf that nothing
imports), and left commit A as the head. The command now makes commit B without changes, so every chunk has
the same two commits and a second run has nothing left to do.
The package list in pyproject.toml keeps an old package name while a generated file lives under it. A
`copy` row was not counted, so a package kept only by copy rows would have lost its line. No row is in
that position today: both copy rows sit under hermes_cli, which by-path rows keep.
The import rewrite now splits a multi-name import statement in the order of its names, so each module still loads in the same order.
move_roots now deletes only __pycache__ folders at hermes_agent/<ROOT> and refuses when any other file is there.
An __import__ through a variable, a helper, an empty fromlist or five arguments keeps its old module name.
move_roots refuses a Windows ROOT that has a root but no drive (\outside).
The --from-commit help says commit A also holds the MOVES update.
The row sat directly under the old-updater test row, which the hermes_cli chunk deletes in its hand
fixes, so that pick conflicted on every rebuild. It is now the last row of EXCLUDED.
The docs pass rewrites paths in SKILL.md files, the inputs of website/scripts/generate-skill-docs.py, and
skips the generated pages. Nothing regenerated them, so the docs job failed from the first chunk that
touched a path a skill names. The chunk command and just move-generate now run that generator.
scripts/build/launcher_wrapper.py is the text of minted launchers. It imports hermes_bootstrap first: the
root file, which repairs a torn update and installs the old-name finder before hermes_agent is importable.
The rewrite turned it into hermes_agent.hermes_bootstrap; it is now an excluded site.
The pyproject rewrite kept an old path in update-startup-files only while a generated file lived there.
The root hermes_bootstrap.py stays hand-written, so its entry was replaced by the new path and updates
stopped syntax-checking the file every launcher imports first.
A packages.find row ("pkg", "pkg.*") of a moved package stays while
required_names.py gives it a generated old-path file, and goes otherwise:
hermes_agent.* already ships the new place.
Decision D47. The call-argument sink and the module:attr reading rewrote hook
events, session keys, config keys, i18n keys and message text. A string now
changes only in a sink (sinks.py): import functions and helpers whose
parameter reaches one, validated patch targets, sys.modules keys, logger
names, -m/-c argv pairs, commands given to a process, Python code given to an
interpreter. A name, loop or table that feeds a sink is followed, and
rewritten only when every use feeds a sink. Every other string that names a
moved module or path is flagged with a class of its own.
import a becomes from hermes_agent import a (ruff PLR0402), except where the
from-form changes behaviour: a try that tells a missing module apart, and a
function that removes modules from sys.modules, keep the module form with
noqa. __import__("pkg.mod").Attr gets fromlist. Moved modules under folders
without __init__.py resolve. Code split across literals and f-strings is
edited piece by piece (pieces.py). Path flags need a moved file or folder
after the top folder, so tools/list and hermes-agent/ are not paths.
The bot_desktop row anchored text that left the base in ecf7061700, so the
shipped module name was rewritten; it now anchors the base spelling. The
_launcher_script row covered the whole def, including a live import; it now
anchors the minted return statement (anchor_spans widens a return like a def).
print_runtime_command's --module default is persisted text. Two test sites
that exercise old top-level names on purpose get OLD_NAMES rows.
KEPT_NAMES names the reasons whose module names tests may mirror.
`import a` became `import hermes_agent.a`, which binds `hermes_agent` for the whole
function: an earlier `hermes_agent.x` read there raised UnboundLocalError (practice
chunk 04, tests/hermes_state/test_fts_layout_drift.py). It now becomes
`import hermes_agent.a as a` and its uses keep their spelling. A function-local
`import a.b` whose new root another read in that function needs is flagged.
A string passed to a call is rewritten when its whole value names a moved module,
`module.attr` or `module:attr` of a name the module defines (`where="batch_runner.AIAgent"`,
`_tools_mod("tui_gateway.checkpoints")`); a bare top-level name needs `(module, attr)`
evidence (`_lazy("hermes_state", "SessionDB")`); a dotted name that only starts with
one is flagged. `"-m", "<mod>"` pairs in call arguments and f-string target heads
(`f"pkg.mod.{name}"`) are rewritten. DEFAULT_CONFIG keys (`agent.reasoning_effort`,
also a module) never change.
pyproject.toml entry points and package-data keys follow their module; package lists
are flagged (the old directory may still hold a shim). The run ends by naming
`just move-generate`, which regenerates the files built from rewritten docstrings.
Exclusion rows were (path, first line, last line) of the pre-move file. The codemod runs after
commit A, when the file sits at its new path, so no row ever matched a moved file
(hermes_cli/_old_updater.py was rewritten on chunk 11), and in migrate-branch a branch's
inserted lines shifted the site out of its range. Rows are now (path, anchor, reason): the path
also matches the file's new path through this move and the compat MOVES table, and the anchor is
exact source text, widened to the whole def, class or assignment it starts. A row whose anchor is
gone is flagged instead of silently doing nothing. Rows regenerated against origin/main.
A UTF-8 BOM is kept on rewrite; a .py file that is not UTF-8 is skipped with an `undecodable`
flag instead of crashing the whole run. A moved module the working tree no longer has (a branch
deleted it) is left out of the plan instead of raising FileNotFoundError.
String literals were checked against every moved path with a freshly compiled regex each; with
853 paths on chunk 11 that overflowed re's cache and took 80% of the run. One precompiled pattern
now, and the plan goes to each worker once.