Commit Graph

3120 Commits

Author SHA1 Message Date
Teknium
471537ae3a refactor(telegram): the standalone sender lives in the plugin
The out-of-process Telegram sender (_send_telegram and its bot, retry, text, media,
album and format helpers) moves from tools/send_message_senders.py into
plugins/platforms/telegram/standalone.py, registered as the PlatformEntry
standalone_sender_fn (the Signal pattern). _send_to_platform reaches it through
_plugin_standalone_sender and passes notify; core no longer imports the Telegram
plugin, and the plugin no longer imports tools.send_message_tool._send_telegram.
Small local copies of the caption split and the result/redaction helpers keep the
plugin on its published API. boundary_lint --update: only removals vs origin/main.
2026-11-08 20:53:58 -08:00
Teknium
486601c4fa fix(telegram): standalone sends keep formatting, honour rich_messages and the notifications mode
The standalone sender (hermes send, the send_message tool, standalone cron delivery) now
makes the gateway adapter's outbound decisions:

- rich_messages: true -> the adapter's own sendRichMessage gates and routing
  (telegram_outbound.send_rich_standalone over the standalone Bot), so tables, task lists,
  <details> and $$ math render natively; a transient rich failure is not resent as legacy.
- A rejected Bot API HTML chunk (an unsupported tag next to supported ones) retries as
  MarkdownV2 before plain text, so its Markdown still renders.
- display.platforms.telegram.notifications applies to every standalone text/media send;
  _send_to_platform(notify=) rings regardless, and cron's standalone lane passes
  cron.delivery.notify so briefs ring in both lanes (#92929).
- Invisible-only text (zero-width, BOM, soft hyphen, bidi marks) is never delivered, in
  both the adapter's send() and the standalone sender.

The notifications resolver moves from adapter.py into telegram_outbound.py and reads the
active profile's config.yaml through load_config_readonly(): it passed the GatewayConfig
dataclass to cfg_get, which only walks dicts, so the config.yaml key was always ignored
(regressed in 5600105478).

Fixes #74004, fixes #124413, fixes #145606, fixes #60848, fixes #131924, fixes #144895

Co-authored-by: Dean Chen <862469039@qq.com>
Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
Co-authored-by: Lavya Tandel <160998697+LavyaTandel@users.noreply.github.com>
2026-11-08 20:53:58 -08:00
Teknium
d1c4f6969a fix(telegram): standalone sends use the gateway's Bot API URL, timeouts and fallback IPs
hermes send, the send_message tool and standalone cron delivery built a bare
telegram.Bot: api.telegram.org only (platforms.telegram.extra.base_url ignored),
PTB's 5s/1s defaults and 20s media write timeout (HERMES_TELEGRAM_HTTP_* ignored),
no TelegramFallbackTransport. _telegram_bot now takes the platform extra and
builds the same request shape as the adapter's _build_ptb_requests: base_url /
base_file_url, the adapter's timeouts incl. media_write_timeout=60, proxy
(TELEGRAM_PROXY or extra.proxy_url), else the fallback-IP transport over the
configured or seed IPs (no DoH on a one-shot send).

The retry classifier also retries a connect or pool timeout (the request never
left, the adapter's _looks_like_connect_timeout / _looks_like_pool_timeout),
while every other timeout stays final.

Live probe (real `hermes send` -> stand-in Bot API via extra.base_url):
  main: {"error": "Telegram send failed: Unauthorized"} (went to api.telegram.org)
  head: success, one sendMessage on the stand-in, message visible.

Fixes #51223, fixes #62936, fixes #20915, fixes #47229, fixes #145412
Salvages #145428 (@locker95), #119934 (@OsmanSujoy), #125409 (@linfeng961)

Co-authored-by: Dean Chen <862469039@qq.com>
Co-authored-by: Osman Gani <32834772+OsmanSujoy@users.noreply.github.com>
Co-authored-by: linfeng961 <133505766+linfeng961@users.noreply.github.com>
2026-11-08 20:53:58 -08:00
Maciej Lisiewski
922b09eb84 test(runner): forward the e2e-upgrade install and origin knobs through env -i
run_tests.sh forwarded HERMES_E2E_UPGRADE_BASE and HERMES_E2E_N1_REF
but dropped the suite's other knobs: HERMES_E2E_INSTALL_REF (installs a
patched commit to prove a leg red), HERMES_E2E_GIT_OBJECTS (an extra
object store for the smart-HTTP origin) and HERMES_E2E_KEEP_ROOT. Set
through the runner, they were ignored without a message. None is a
credential.

Part of #150040
2026-11-08 23:46:06 +01:00
kshitijk4poor
acdc8f1ba6 test(whatsapp): pin the QR-era handoff key for a request after the first prologue
The existing handoff test supersedes only while the first attempt is still
signing, so consuming the key on use again would pass it. This sends two
requests, each signed at once, and checks both prologues carry an HMAC under
the QR secret. Follow-up from BearHuddleston's review of #150938.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-08 23:28:22 +05:30
kshitijk4poor
48c7a09fd8 fix(whatsapp): keep a paired gateway alive on a passkey request during login
Baileys awaits prekey upload and passive IQs between CB:success and 'open', so
connectionState is still 'disconnected' when a passkey_prologue_request can
arrive; the guard now also accepts registered creds (creds.me.id).

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-08 15:52:48 +05:30
kshitijk4poor
122b31f2b4 fix(whatsapp): end pairing on Ctrl+C at the code prompt and keep the QR-era handoff key
readline's question() rejects Ctrl+C with its own AbortError while the attempt's
signal is untouched; passkey_socket.js dropped it as a supersede, so the bridge
kept running with no prompt. Only this attempt's aborted signal now counts as a
supersede; any other AbortError becomes an ordinary failure (exit 1).

A superseding passkey_prologue_request re-derived the handoff HMAC key from the
ADV secret the first request had already rotated in, which the phone never saw.
The key is now derived once per flow and kept for its five-minute window.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-08 15:52:48 +05:30
kshitijk4poor
2221725409 test(whatsapp): require the connected bridge to be alive after its warning
runUntil returned a null status both when the test killed a live bridge after
the warning and when the 15 s guard killed a bridge that never printed it, so
removing the warning, or exiting 78 right after it, still passed. It now
reports alive only when the warning appeared and the bridge was still running
300 ms later; both mutations and dropping the connected-session guard turn
the test red.

The adapter's constant-agreement test regex-read bridge.js, which
tests/AGENTS.md rules out. The bridge test already observes the real exit
status 78 in gateway mode; the adapter test pins its constant to that value
and both sides name each other.
2026-11-08 15:52:48 +05:30
kshitijk4poor
6b4669a261 fix(whatsapp): treat a superseded passkey attempt's failure as a cancellation
Clearing the current attempt when a newer prologue request arrives closes the
browser, and Playwright then rejects the interrupted page.goto or launch with
a plain Error (net::ERR_ABORTED, "Target closed") rather than an AbortError.
executePrologue rethrew it unchanged, so passkey_socket.js reported a
passkeyError and the bridge exited 1 instead of running the replacement
attempt. The same held for a code question or companion_nonce query that
failed after its attempt was superseded.

Both stages now rethrow the attempt's abort reason when its own signal was
already aborted; the prologue reads the signal before its own cleanup aborts
it, so a genuine failure still surfaces. The encryption key is passed to
sendPairingRequest instead of riding on the session object.

The dashboard text for passkey_required drops the EXECUTABLE placeholder and
literal backticks the page would have shown as-is.

Tests: a superseded attempt whose signer rejects with a plain error, and a
code question that rejects with a plain error after supersede, emit no
passkeyError and the replacement prologue goes out; the stale-answer test's
stub now ignores its signal so only the flow's own abort check stops the
send; the owner-confirmation test waits until the owner is asked. Rethrowing
the raw error in either stage, or dropping the post-confirmation abort
check, turns a test red.
2026-11-08 15:52:48 +05:30
kshitijk4poor
331c15a992 test(whatsapp): pin exit-code agreement and drop the 4 s alive wait
The connected-session case proved the bridge stayed alive by letting
spawnSync hit a 4 s timeout, a fixed cost and a flake risk on slow runners.
It now waits for the bridge's own "ignoring it" warning and kills it; the
guarded exit would run in the same tick as the request, before that
warning, so a null status still proves the bridge survived (removing the
guard turns it red).

The adapter test asserted PASSKEY_REQUIRED_EXIT == 78 by hand. A separate
test now reads the constant out of bridge.js and compares it with the
adapter's, and the retry test parametrizes on the constant.
2026-11-08 15:52:48 +05:30
kshitijk4poor
fc60ebb7e6 fix(whatsapp): bind passkey code confirmation to its own attempt
The code reached the terminal prompt through a synthetic connection.update
event, and the prompt then called back into the flow's
confirmVerificationCode with a socket-lifetime abort controller. A newer
prologue request aborted the old attempt but left its question open, so a
late "y" sealed and sent the newer attempt's pairing request without the
owner having seen that code. A second request also queued behind the
current browser prompt for up to its 600 s bound.

The flow now awaits an injected confirmCode(code, signal) itself and sends
the pairing request only for the attempt that derived the code; signal is
that attempt's own controller, so a newer prologue (which now clears the
current session at once) or a socket close cancels the question. That
removes the event round trip, the returned confirmation wrapper and the
bridge's second controller.

Also removed from the adapted flow: the emitPrologueSent hook, the
pairingHandoffProof argument and getVerificationCode, none of which had a
caller; the proof now comes only from the stashed handoff key. The bridge
prints the passkey failure's name and message instead of one generic line.

Tests: a superseding request cancels the pending question and a late
answer sends nothing; the handoff-window cases assert whether confirmCode
runs. Removing the supersede clear, or forcing or skipping the prompt,
each turns a test red.
2026-11-08 15:52:48 +05:30
kshitijk4poor
700ae4ead8 test(whatsapp): pin passkey confirmation through the server prologue path
The existing confirmation tests call executePrologue directly, which skips
the ADV-derived handoff key a server prologue request stashes first. Through
CB:notification (the path production takes) a fresh session always carries
that key, so the pairing request goes out without the code prompt unless
signing outlasts the five-minute handoff window. Pin both outcomes through
attachPasskeyFlow and say so in PASSKEY.md, with the gateway's new
already-connected behaviour.

PASSKEY-LICENSE: the cited commit c3d846d carries "Copyright (c) 2025"
(2026 is only on current master), and the notice now states the Hermes
modification (owner confirmation when no trusted handoff applies).
2026-11-08 15:52:48 +05:30
kshitijk4poor
e89b47ac8b fix(whatsapp): keep a connected gateway alive on a late passkey request
Before passkey support, Baileys rc13 acked and ignored passkey_prologue_request.
With it, any such notification made a signer-less bridge exit 78, which the
adapter parks as non-retryable, so a request reaching an already open
gateway session would stop a working gateway until a manual re-pair.
Exit only when the session has not connected yet (or in pair-only mode),
and log and ignore it otherwise.

Also name the exit status (PASSKEY_REQUIRED_EXIT) on both sides, and emit
the dashboard-readable {event: error, error: passkey_required} under
--pair-json instead of a passkey_required event no watcher handles. The
passkey_failed / passkey_confirmation_failed emits and the PAIR_JSON guard
in confirmPasskey are dropped: loadPasskeySigner rejects --pair-json, so
those paths only run in an interactive terminal.

Tests: bridge.passkey.test.mjs drives the real bridge entry point; a
stubbed socket that opens before the request stays alive, and pair-json
emits the error event. Both new assertions fail with the guard / emit
removed.
2026-11-08 15:52:48 +05:30
helix4u
618b0d6bbe fix(whatsapp): stop passkey retry loops and tighten pairing setup 2026-11-08 15:52:48 +05:30
helix4u
58ebcf3007 fix(whatsapp): use official Baileys and isolate setup regression test 2026-11-08 15:52:48 +05:30
helix4u
d37547bf73 fix(whatsapp): package pinned passkey runtime and refresh stale dependencies 2026-11-08 15:52:48 +05:30
helix4u
9929bc74e7 fix(whatsapp): wire local passkey signer and validate pairing completion
Co-authored-by: vinikjkkj <viniwarrior4@gmail.com>
2026-11-08 15:52:48 +05:30
kshitijk4poor
171038d4bc feat(code-health): HX014 ratchet against private API-error predicates
The aux, compressor and turn paths each grew "is this a <kind> error?"
helpers that read an exception's status_code or grep its text; every
copy drifted from classify_api_error until the previous commit moved
the aux decisions onto the shared classifier. HX014 keeps new copies
out.

What it flags: a def or lambda with an exception parameter (exc/err/
error/e/ex/exception, *_err/*_error/*_exc, or an *Exception/*Error
annotation; a ClassifiedError parameter is not one) whose own body reads
<param>.status_code (also via getattr or .response) or probes the
exception's text (`in str(exc)`, a local bound to that text,
startswith/endswith, re.search/match/fullmatch, _contains_any). Scope:
agent/auxiliary*.py, agent/context_compressor*.py, agent/turn_*.py,
tests excluded.

Like the other HX rules it ratchets base vs head, so existing hits are
grandfathered. Waiver: `# health: allow HX014 -- <why>`.

Tests: tests/scripts/test_code_health_error_predicate_rule.py covers
flagged and passing shapes, scope and the base-vs-head verdict.

Part of the Code Health plan.
2026-11-08 13:18:54 +05:30
Teknium
11b2b4414f fix(catalog): payload scan treats JSON-LD and Turtle archive members as source
The rule-17 archive scan refused a data corpus tarball because one member
was a .jsonld context (siblings: 34k .json files, two .ttl files). Those are
plain-text RDF serialisations, as reviewable as the .json and .xml already on
the source list, so dike's pinned corpus failed pinned-source-validate for a
reason that is not a payload.
2026-11-07 19:06:07 -08:00
alt-glitch
658f942e3d fix(paths): the lint counts import-time sys.path edits in classes, match cases and inverted guards
Class bodies and match cases run at import, and the import branch of
an 'if __name__ != "__main__"' guard is the body, not the else. Removals
(remove, pop, clear, del) change the search path too.
2026-11-07 01:17:21 -05:00
alt-glitch
d010f5c93c ci(paths): baseline the install-root climb main added in left_core_migration 2026-11-07 01:17:21 -05:00
alt-glitch
f733de8041 refactor(paths): fifteen install-root definitions call the one owner
hermes_cli.config.get_project_root, uninstall.get_project_root, the
PROJECT_ROOT constants of status, cron, gateway, setup, tools_config and
web_server, code_skew and runtime_downgrade_exit _PROJECT_ROOT,
runtime_cwd._PACKAGE_ROOT, shared_metrics_catalog._REPO_ROOT,
desktop_update_verify.checkout_root and host_supervisor._repo_root now
return hermes_cli._startup_fast.project_root_str() instead of their own
__file__ arithmetic. Names, values and test seams are unchanged.

Still separate, on purpose: pm.paths (Docker's tool stage ships pm without
hermes_cli._startup_fast), hermes_constants and hermes_bootstrap (they load
before any package), main.py's script-mode bootstrap, the recovery closure
and stub-tree modules (_early_recovery, update_lock, update_pause_record,
venv_sync: tests and recovery load them as lone files), the lexical
linux_desktop_entry root and self_repo_guard's .git probe. The lint baseline
drops by the 15 sites.
2026-11-07 01:17:21 -05:00
alt-glitch
0e17aedc6d ci(paths): ratchet new __file__ install-root climbs and import-time sys.path edits
scripts/install_root_lint.py scans the shipped packages and root modules. It
counts __file__ path expressions that climb as many directories as the file
is deep (.parent, .parents[n], os.path.dirname, os.path.join with pardir),
and sys.path edits that run at import. Today's 106 climbs and 13 import-time
edits are the baseline; a file whose count rises fails, and the message names
hermes_cli._startup_fast.project_root_str() as the call to make instead.
Wired into scripts/check (install-root) and the lint workflow.
2026-11-07 01:17:21 -05:00
Teknium
0acc079a01 refactor: move the Yuanbao optional skill out of core with the platform
The skill drives the yb_* tools, which now ship in the yuanbao Labs plugin; the plugin carries
the skill (ctx.register_skill). Regenerated the skill pages, catalogs and sidebar with
website/scripts/generate-skill-docs.py, dropped yb_* from the ACP TOOL_KIND_MAP as the Home
Assistant move did for ha_*, and the boundary baseline's stale Yuanbao entries
(scripts/boundary_lint.py --update).
2026-11-06 20:39:14 -08:00
alt-glitch
b58dbb1985 test(upgrade): start from real releases; the next release moves a file
The upgrade suites chose their start version with a tag pattern that
matches only calendar-version tags, so after releases moved to v0.x
every run started from v2026.9.24, five releases behind. Three copies
of that resolver and a fourth tag scan are replaced by one:
upgrade_base() picks the newest release before HEAD, a ref, or the
newest release of a named updater generation (by-path, handoff,
pre-handoff), from HERMES_E2E_UPGRADE_BASE. scripts/run_tests.sh now
forwards that variable and its older name HERMES_E2E_N1_REF.

The handoff suite's synthetic next release only added a file. It now
also moves a module the gateway imports at boot and rewrites the
importer, so the relaunched gateway serves a turn only if the update
applied the move.
2026-11-06 23:23:32 -05:00
alt-glitch
5f2bd7588b fix(ci): public-surface judges a moved file by the kind it had before the move
A source module moved under tests/ was skipped, and a test file moved
out of tests/ was compared as source. The base path now decides which
comparison applies. The cap and src/ canaries no longer follow the
values they check.
2026-11-06 23:02:54 -05:00
alt-glitch
81b30fede9 fix(ci): public-surface reads NUL-separated paths and judges a rename by either side
A renamed file whose path git quotes (non-ASCII) was dropped by the
.py suffix test, and a move out of the source roots was skipped because
only the new path was classified.
2026-11-06 23:02:54 -05:00
alt-glitch
e8d908b1c9 fix(ci): guards fail instead of passing when they cannot see a change
Three guards could report success while they checked nothing:

- The public-surface check listed only modified files, so a moved
  file (git reports a rename) was never compared. It now pairs each
  renamed file with its old path, and treats src/hermes_agent/ as
  source.
- The change classifier read file names from the compare API, which
  stops at 300 files without saying so and drops the old path of a
  rename. A list at the cap now runs every lane, and a rename counts
  under both of its paths.
- Tree guards skipped a scan root that did not exist. The config
  reader and writer checks, the subprocess stdin check and two guard
  tests now fail when a root they scan is missing.
2026-11-06 23:02:54 -05:00
alt-glitch
ee376ff9f0 chore: delete the unused SWE runner and dataset compression scripts
mini_swe_runner.py and scripts/sample_and_compress.py have no importer
and no launcher. Each is reachable only as `python <file>` from a
checkout, and neither command appears in website/docs, docs/, skills/,
README, CONTRIBUTING or any AGENTS.md file.

Evidence (git grep over the whole tree, excluding the files themselves):
- mini_swe_runner: tests/test_mini_swe_runner.py (deleted here) and one
  docstring line in trajectory_compressor.py (removed here).
- sample_and_compress: no reference.
- No Dockerfile, nix/, flake.nix, setup.py, pyproject [project.scripts],
  .github/ or apps/ui-tui/web reference to either name.
- Neither appears in tests/compat/old_updater_surface.json or in the
  plugin API (hermes_cli/data/plugin_api.json).
- No release tag from v2026.8.13 to v2026.9.24 imports either module
  from outside the files themselves.
2026-11-06 23:02:03 -05:00
alt-glitch
940dc11d9b fix(update): a failed dropped-file listing retries; prune stays inside the checkout
When git could not list the files dropped since the recorded commit, the
prune returned 0 and the caller stamped the new fingerprint, so no later
sweep looked at that commit again and the old folder stayed. It now
raises, the launch sweep keeps the old fingerprint and the update
completion records the bytecode_sweep follow-up. A recorded commit that
no longer exists in the repository still counts as nothing to prune.

A folder reached through a symlinked parent is skipped, so an empty
folder outside the checkout is never removed.

main_web_build.py joins the update-path routing, since the update
completion now imports it.
2026-11-06 23:01:26 -05:00
Maciej Lisiewski
f429994946 fix(ci): key the desktop preparation packages whole, check the Node graph in vitest
The Python import probe parsed production source, which tests may not do.
Key scripts/bundles/*.py, scripts/build/*.py and apps/desktop/scripts/*.py
by glob, as pm/*.py already is, so a new module or late import there needs
no list edit; shared modules outside them stay listed. The Python test now
reads only sys.modules after importing the entry points, and a new test
proves a module added to a globbed package changes the key.

The Node graph check moves to tests-js, where JS-only PRs run it; it calls
desktop_build_cache.py's CLI for the key, and classify_changes routes an
edit of that owner to the JS lane too.
2026-11-07 03:10:04 +01:00
Maciej Lisiewski
1a2720e968 fix(ci): key the desktop input cache on the Python modules preparation imports
The previous change keyed the Node half of the preparation graph only.
desktop_prepare.py and the helpers it calls also import, mostly inside
functions, scripts/bundles/{desktop,payload,bytecode,msix_names}.py,
scripts/releases/{versioning,semver,bundle_env,commit_build}.py,
scripts/termux/deb_version.py, and hermes_cli/hermes_constants/
hermes_platform modules. Key those too.

A new test imports the Python entry points in a subprocess, follows the
late imports of the functions that can run (only the names each importer
takes, so setup_toolchain's archive-inputs subcommand stays out), fails
on a broken repo import, and requires an edit to every repo module that
loads to change the key. The Node probe now converts URLs with
fileURLToPath. Both probes miss dynamic import() in functions that do
not run at import time and PowerShell dot-sourcing; those stay listed
by hand.
2026-11-07 02:44:23 +01:00
Maciej Lisiewski
880cfbde6e fix(ci): key the desktop input cache on every module preparation loads
The desktop dependency-cache digest listed node-deps.mjs and
electron-runtime.mjs but not the modules they import (pnpm-lock.mjs,
frontend-common.mjs, python.mjs, apps/desktop/scripts/utils.mjs,
macos-sysroot.mjs), the Python helpers desktop_build_cache.py and
native_prepared.py import (scripts/ci/pnpm_lock.py, scripts/build/inputs.py),
or scripts/build/windows-deps.ps1, the provider pm/native_build.py runs. An
edit to any of them reused a cache keyed on the old code.

The test resolves the module graph of the preparation programs with Node's
resolve hook and requires an edit to each module to change the key.
2026-11-07 02:44:23 +01:00
unsupportedpastels
7d608e9647 feat(gateway): the control socket answers which gateway serves a profile
A local client that dials the gateway itself had to spawn `hermes gateway
attach --json` (a Python start) for every connect, because only Python
could work out the endpoint, and it is subtle when a multiplexer serves the
profile. The gateway now answers that lookup itself with a new control verb,
`resolve-profile`, and the local control socket is documented as a public
client contract.

- gateway/control_resolve.py: `resolve-profile {home}` returns the verdict
  `discover_gateway_endpoint` gives for that home (state, reason_code,
  detail, endpoint plus ws_url/ws_protocol/ticket prefix), `attachable`,
  `update_fenced` (the set `ensure` checks), `control` (self/host/null),
  the CLI's failure `message`, and `install_code_sha` (read without
  touching the gateway's cached boot identity). Built from the existing
  discovery helpers; a strict envelope; no credential in the reply.
- gateway/control_socket.py: `resolve_handler` (None by default, so a bare
  server keeps the unknown-verb answer) and one dispatch branch.
- gateway/run_bootstrap.py: install the handler over the `identify`
  descriptor.
- hermes_cli/gateway_runtime.py: the missing-owner verdict moves into
  `_missing_owner_verdict` so discovery and the verb share it.
- apps/shared/src/node/control-socket.vectors.json: request/reply vectors
  for `session-ticket` (its current behavior), `resolve-profile` and the
  legacy unknown-verb answer; tests/gateway/test_control_socket_vectors.py
  runs them. tests/gateway/test_control_resolve.py proves parity with
  discovery over real sockets.
- scripts/ci/classify_changes.py: a vectors-only edit runs the Python lane.
- gateway-internals.md: verbs, envelope, errors, rendezvous (POSIX, macOS
  launchd, Windows), security model.

Existing verbs, replies, error strings and `supported_verbs` are unchanged.

Refs #141982
2026-11-06 20:23:34 -05:00
unsupportedpastels
be3d288fa0 fix(gateway): plugin RPC is a detectable contract member and session events work hosted
A client could not tell "no such plugin method" from "this server has no
plugin RPC": runtime.describe advertised nothing, and plugin.* was in no
contract or ledger. Under plugins.isolation: host the module-level
emit_plugin_session_event returned False and sent nothing, and an
in-process ctx.emit_to_session from a plugin's own thread on a multiplexed
gateway looked the session up in the launch profile.

- runtime.describe lists plugin-rpc-v1.
- tui_gateway/contracts gains CANONICAL_NAMESPACES (canonical_namespace):
  plugin.{plugin_id}.{name} with open params, rendered as
  CanonicalRpcNamespaces in the TS contract and x-canonical-namespaces in
  OpenRPC; the serve handler ledger gets one row for it.
- The plugin host forwards emit_plugin_session_event to the gateway process
  (host->parent request session_event), looked up in the host's profile.
- ctx.emit_to_session binds the plugin manager's home before the lookup.

Refs #142005, #141982
2026-11-06 20:22:20 -05:00
Maciej Lisiewski
2d70da667f docs(desktop): reword the get-windows degrade comment for a regular dependency 2026-11-07 01:43:58 +01:00
Maciej Lisiewski
3d9dfffb9c docs(desktop): describe get-windows as the build now installs it
The win32 binding comes from the node-pre-gyp run in stage-native-deps, not
a dependency install script, and a skipped optional install is no longer how
get-windows goes missing. The compiler README now says an absent staged copy
is a degraded build.
2026-11-07 01:43:58 +01:00
Ronald Reis
f59eab9f3c fix(desktop): build without get-windows when pnpm skips it
pnpm >= 11.6 infers `os: [win32]` for optional dependencies whose name
contains "windows" (pnpm/pnpm#17774), so the filtered install that
node-deps.mjs runs drops get-windows on macOS. stage-native-deps already
treats that as a degraded tree and ships without read_window_below, but
validateNativeTree in scripts/build/desktop.mjs still required
get-windows/main on darwin, so every macOS `hermes update` failed with
"Prepared get-windows is missing its macOS helper" and re-owed the
desktop build.

Only refuse a staged get-windows that lacks its macOS helper; an absent
package is the documented degraded build.

Refs #149861

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a9f644c1c3c85b7e8e6808de2cd643fb27e8637f)
2026-11-07 01:43:36 +01:00
Maciej Lisiewski
728aa2ff0a Merge pull request #150117 from NousResearch/refactor/pm-one-npmrc-reader
fix(pm): one npmrc reader and file rule for the registry lookup and the build bridge
2026-11-07 01:32:01 +01:00
Maciej Lisiewski
81b1cfd0f1 fix(ci): route pm/index_config.py to the desktop update lane
source_build now imports pm.index_config for its npmrc bridge, so
test_update_ci_routing requires the module in the desktop-build
dependency list.
2026-11-07 01:00:03 +01:00
Maciej Lisiewski
c338036bf6 fix(pm): name a missing pnpm pin; keep npm's cache query out of the checkout
node-deps.mjs failed with a raw ENOENT/TypeError when pm/lock.json was
missing or pinned no pnpm; it now names the file and the field.
setup_toolchain.py keeps running `npm config get cache` outside the
checkout: a project package.json or .npmrc in cwd can change or fail it,
not only warn. The alignment test whose pnpm assertion went with
devEngines duplicated PM's lock validation and is gone with its type.
2026-11-07 00:45:52 +01:00
Maciej Lisiewski
7eee902ae0 refactor(pm): keep the pnpm pin only in pm/lock.json
The pnpm version lived in pm/lock.json and in root devEngines, kept equal
by a sync writer on every pnpm re-pin. node-deps.mjs, the only reader of
devEngines, now reads pm/lock.json. That drops root devEngines, the sync
writer and its test, and setup_toolchain's workaround for the
EBADDEVENGINES warning npm printed on every command in the checkout.
2026-11-07 00:45:52 +01:00
Maciej Lisiewski
6740235436 fix(ci): end a pnpm lock section at any top-level key
pnpm round-trips root keys it does not define (Bit's bit: block) and
sorts them between packages and snapshots, so the fixed key list made
such locks unreadable. Comments, conflict markers and tabs still raise.
2026-11-06 22:11:51 +01:00
Maciej Lisiewski
2001291ee9 docs(ci): describe what the lockfile diff counts and compares
The printed count now includes project and edge rows, and the
repo-guards comment still said the script only set-diffs
{package: version} maps.
2026-11-06 22:11:51 +01:00
Maciej Lisiewski
a357a562be fix(ci): report pnpm aliases, new edges and projects as one row
- An npm: alias (my-ms: ms@2.1.3, string-width-cjs: string-width@4.2.3)
  was checked against its alias name, which is not a packages key, so a
  move between locked versions was dropped. Check the real package.
- An edge added to or removed from a package on both sides (a
  packageExtensions dependency) was not compared. Report it.
- Diff the direct dependencies only of projects present on both sides;
  a project that appears or disappears is one "project <path>" row, not
  a row per dependency (a rename went from 240 rows to 2).
- An entry of an unexpected shape raises ValueError rather than
  AttributeError, KeyError or TypeError.
2026-11-06 22:11:51 +01:00
Maciej Lisiewski
9d4df4b7b3 fix(ci): end a pnpm lock section only at a known top-level key
section() and section_keys() stopped at any column-0 line, so a stray
comment, a merge-conflict marker or a tab-indented field inside importers
truncated the section and the diff reported every later project as
removed. Only a pnpm lockfile top-level key or the end of the file now
ends a section; any other unindented line raises.
2026-11-06 22:11:51 +01:00
Maciej Lisiewski
542626ed76 fix(ci): report pnpm dependencies moving between locked versions
The lockfile diff reduced pnpm-lock.yaml to its packages keys, so a
project or package repinned to a version already in the lock (hermes-ink
semver 7.8.5 -> 7.7.4) reported no change. Also diff each importer's
direct dependencies and the snapshot dependency edges, shown only when
the package rows cannot explain the move, so a bump stays one row.
2026-11-06 22:11:51 +01:00
unsupportedpastels
e36d4e5735 fix(boundary): key each accepted crossing by its importing file
Core keys left out the importing file and module keys lumped every file
of a module together, so two PRs adding the same target from different
files both ran --update to the same count, merged cleanly, and left main
one above the baseline.

Key every baseline entry as `<importing file> <target>` (repo-relative
path, line dropped). Additions in different files are now different
JSON lines. A file importing one target twice still counts 2 under one
key. Moving an import to another file now reads as a swap and needs
--update.

Totals are unchanged (830 / 29) across 789 + 21 keys.

Known limit: two PRs adding the same target in the same file still
merge to a count one above the baseline; CI on the merged head
catches it.
2026-11-06 13:39:00 -05:00
unsupportedpastels
c0dc75013f fix(boundary): record each accepted crossing so parallel accepts merge green
The baseline held one count per direction, so two PRs that each accepted
a different new import with --update made the same edit (830 -> 831),
merged cleanly, and left main at 832 against a baseline of 831.

Key the baseline per crossing instead: `<module dir> <target>` for a
module's import, the target alone for core's. Two accepted imports are
now two different JSON lines, moving an import between files of one
module (or between core files) keeps its key, and a swap (one removed,
another added) still fails. --check names the new crossing and says how
to accept an intended one.

Totals are unchanged (830 / 29) across 776 + 16 keys.

Also cover dashboard-manifest modules, relative imports and the core-side
TYPE_CHECKING skip in a tmp-tree test.
2026-11-06 13:39:00 -05:00
unsupportedpastels
92677e0244 fix(boundary): count each module a grouped core import names
A core import line naming several modules (`import plugins.web.exa,
plugins.web.firecrawl`, `from plugins.web import exa, firecrawl`) was
counted once. Collapse spellings per alias instead, so each distinct
module counts. Counts on this tree are unchanged (830 / 29).

Also state the ratchet precisely: CI fails when a direction's total
rises above the committed baseline; reductions stick only after
`--update`.
2026-11-06 13:39:00 -05:00