The Interactions API answers HTTP 400 ("Request contains an invalid
argument") when a model turn that calls tools does not open with a
thought step. A turn written by another provider has no signature to
replay, so a conversation switched to Gemini 3+ mid-session failed on
its first request.
Such a turn now opens with the placeholder signature Google accepts in
place of a real one, the same one the generateContent path already
sends. Turns that open with their own signature and text-only turns are
unchanged.
A catalog entry whose repository was deleted, or whose pinned commit was
force-pushed away, can't be installed any more: `hermes plugins install` clones
the repo and checks out the pin, and both fail. Nothing noticed until a user
hit it.
scripts/ci/catalog_dead_repos.py looks up every entry (GitHub in GraphQL batches
of 50, with REST confirming each miss so a renamed or transferred repo is never
taken for deleted; other hosts via git ls-remote). Any unclear answer, or more
than 25 dead at once, aborts with nothing delisted, because that shape is an
outage, not a week of deletions. The weekly workflow deletes the dead entry
files on bot/catalog-dead-repos and opens one PR for review; nothing
auto-merges. It delists (deletes the file) and never touches removed.yaml,
which is the security blocklist.
First run, on today's catalog: 8 of 2,087 entries are dead (7 deleted repos,
1 force-pushed pin). Their files are deleted in a separate commit.
A step that raised was logged and skipped, then migrate_config stamped the
latest version, so the step never ran again (v21 on a nested list in
plugins.disabled: plugins stayed off for good). Boot could not keep partial
progress either: any stamp below latest counted as a failed migration and
restored the backups.
- run_migrations stops at the first failing step and returns it; the
stamp moves only to the step before it. Later steps wait, so a one-time
step never runs twice over a value the user set in between. An
unversioned file that fails stays unversioned.
- Boot keeps the steps that succeeded, records the failing step, and
retries it on every start of the same revision (one warning per start,
also kept for the next visible turn). Docker does the same.
- hermes doctor says why the version is behind, and --fix reports a pass
that stopped instead of "migrated".
- A config stamped by a newer build runs no step, keeps unknown keys, and
refuses whole-file saves; key-level writes (config set) still save.
- The remote backend migrates in memory and never writes back, so it
keeps running the whole ladder.
- disable_suspicious_mcp_servers moves to config_migrations (size cap).
tests/ci/test_update_ci_routing.py requires every module an update entry point
imports to start its suite; _relaunch_bare now imports strip_supervisor_markers.
`hermes update` respawns each profile gateway through a detached restart
watcher that hands its own env to the gateway it starts. For a named
profile the watcher inherited the updater's os.environ, which already
holds the updater's profile .env. A profile with no TELEGRAM_BOT_TOKEN of
its own (an API-only profile) then started the root bot and took its
polling lock, and the default gateway's Telegram failed with "token
already in use".
The watcher env now follows the rule update_cmd_posix_pause._replay_env
already uses for the same respawn: the launcher's own named profile keeps
the launcher's env (an exported token may be its only credential); any
other home gets that home's own secrets via served_profile_child_env and
none of the launcher's. The host path is unchanged.
The env choice moves into hermes_cli/gateway_restart_env.py
(hermes_cli/gateway.py is over its line cap).
Fixes#135792.
Catalog reviews ask plugin authors to refuse credential paths with
agent.file_safety.get_read_block_error / raise_if_read_blocked and to read
YAML with hermes_yaml (core ships no PyYAML). `hermes plugins validate`
then warned on exactly those imports as "private core imports", so an
author who followed the review got a warning for doing so.
- plugin_api.json lists the four file_safety checks and
hermes_yaml.safe_load/safe_dump; public-api.md regenerated.
- plugins/index.md gains a short section with the table and an example.
- boundary_lint baseline drops the 7 bundled-plugin crossings that are now
public (no other line changes).
- Test: the guide's example validates clean, while a whole-module
`import agent.file_safety` still warns. Red on main.
.gitattributes asks git to store text with LF, but only a client that
honours it does: a GitHub web upload or an API commit lands bytes as sent.
plugin-catalog/board-insights.yaml arrived that way. Every fresh checkout
then showed it as modified, and the icon check (which needs a clean tree)
failed on every catalog PR until #154171 rewrote it.
- scripts/ci/check_line_endings.py reads `git ls-files --eol` and fails on
any index blob that is crlf/mixed, except -text (binary) and eol=crlf
(*.ps1) paths. `--fix` rewrites offenders with LF and stages them.
- Runs as a Repository guards step and as `scripts/check --only
line-endings` (so the pre-push hook catches it locally too).
- `* text=auto` catch-all in .gitattributes, so text files outside the
listed extensions are normalized at check-in too (renormalizing the
whole tree with it changes nothing but the file below).
- Fixes the one remaining offender:
contributors/emails/uperLu@users.noreply.github.com.
Co-authored-by: lancelotsh51sh <283335493+lancelotsh51sh@users.noreply.github.com>
bridge.js now refuses to serve without HERMES_WHATSAPP_BRIDGE_TOKEN, so the passkey
test (added on main) exited 1 before reaching the passkey path. The port-release
harness modelled a refused connect as a bare OSError; a refused connect is
ConnectionRefusedError/ClientConnectorError, and any other failure is now an
unproven holder that is never killed by port.
Builds on @fangliquanflq's #83432 (cherry-picked first commit; the remaining
eight commits were re-applied by hand because the adapter has since been
refactored into _probe_bridge_health / _reuse_running_bridge / _bridge_req /
_standalone_send). Port prompted by qwibitai/nanoclaw#4013, which closed the
same class (an unauthenticated loopback webhook) on their Discord bridge.
Why: the bridge binds 127.0.0.1 and checks the Host header, but loopback does
not identify the caller — any local process could GET /messages (read every
inbound) or POST /send (send as the user), and a process that bound the port
first and mirrored /health with the derivable scriptHash was adopted as the
bridge (#83395, #80096).
What:
- bridge.js: every route except GET /auth-proof requires
`Authorization: Bearer <HERMES_WHATSAPP_BRIDGE_TOKEN>` (constant-time);
/auth-proof answers HMAC(token, challenge); express.json() runs only after
the gate; the bridge exits when spawned without a token; bridge_auth.js is
folded into scriptHash so stale auth code is never adopted.
- adapter: per-session secret at platforms/whatsapp/session/.bridge-token
(0600, created once under a cross-process lock), passed to the spawned
bridge via env; _probe_bridge_health is challenge-first so an impostor
never sees the bearer and is replaced; the long-lived aiohttp session
carries the bearer as a default header, so every send/edit/media/typing/
read/poll call is authenticated with no per-call-site change.
- _standalone_send (cron / `hermes send` out of process): READS the persisted
token, never mints one (a bridge spawned without it would not know it) and
reports "No WhatsApp bridge token" until the gateway has started once;
pinned to 127.0.0.1 like the bridge's bind.
- docs: whatsapp.md "Bridge API authentication" + env-var reference row.
Live repro (real bridge.js + real impostor HTTP server, real aiohttp):
origin/main: anon GET /messages 200, wrong bearer /health 200,
impostor accepted by probe = true
this branch: anon GET /messages 401, anon POST /send 401, wrong bearer 401,
adapter probe real bridge ok=true / wrong token ok=false,
impostor accepted = false, impostor saw bearer = false,
impostor requests = [/auth-proof] only
Tests: 2 impostor invariants + adopted-with-bearer in test_whatsapp_stale_bridge
(red on origin/main adapter, green here); token lock + proof binding in
test_whatsapp_bridge_auth; standalone harness answers the challenge.
As root, tar restores the owner recorded in the archive, and astral's uv
release tarballs record uid 1001. A root install.sh / setup-hermes.sh
run therefore staged the uv binary root executes owned by whichever local
account holds uid 1001. Extract with -o (no-same-owner; the only spelling
busybox tar without long options accepts).
The Node tarball path the issue names now goes through pm.store's tarfile
data filter, which already drops archived owners.
Fixes#81525
read_file fetches document bytes through the file backend (a `base64 <
path` subprocess) and extract_document_bytes runs _extract_sqlite on a
private temp copy, so the extractor never opens a live database. The
guarded header read cost more than it protected: it held _live_lock
across the open (a FIFO named *.db would stall every tracked open/close)
and folded missing-file, directory and permission errors into one
message. Restore tools/read_extract.py and drop its tests.
Also name DEFAULT_DB_PATH, _default_db_path() and session_db.db_path
among HX015's documented misses.
has_live_connection() and offline_file_access() decide when raw byte I/O
on a live database is safe (closing any raw fd cancels the process's
POSIX locks on the file; #100519). They only see connections opened
through connect_tracked, and several in-process readers used a bare
sqlite3.connect. The read_file SQLite extractor also open()/close()d the
file to check its magic bytes, which cancels the gateway writer's locks
when the agent reads its own state.db.
Route those opens through connect_tracked with tracking_path (same
URIs, timeouts and flags): gateway readiness, the lifecycle ledger's
integrity and journal-mode reads, the API server response store, the
spillover reference scan, install state, doctor, the repair damage
check, shared metrics, the worktree liveness reads cron's sweep runs in
the gateway, backup verification, the restore destination and epoch
reads, the downgrade guard, approvals suggest (whose hand-built URI also
skipped percent-encoding) and the journal-mode switch. The read_file
magic check goes through read_header_bytes_preopen. Offline opens
(snapshots, staging copies, the stdlib-only backup copier) take a
documented HX015 waiver.
Add HX015, "untracked sqlite3.connect on state.db", an advisory
heuristic rule until a replay shows it can block.
Fixes#149276
A Scope now says who owns the agent and what the activity may do on it, and a TurnScope says
which claim the turn runs under:
- Scope gains keyword-only owner (Principal for a personal agent, Group for a shared one) and
role ("owner" | "manager" | "member"). A personal agent is used only by its owner, so its only
role is "owner"; a group agent's roles are "manager" and "member". can_administer is true for
owners and managers. A hosted scope must name both; a local scope defaults to the local person
as owner with role "owner", so every local caller is unchanged.
- TurnScope gains fence: Fence(epoch, generation), the owner epoch and runtime generation the
admission claim stamped. bind_turn(session, turn, fence) requires it; claim_fence(row) reads it
off a claimed session_admissions row. The authority's turn path, the owner-side cron run and
the managed worker bind the real fence.
- Inside a hosted scope a bind must keep tenant, agent, actor, owner and role; changing any of
them raises ScopeSwitchRefused.
- bind_profile_scope / scope_for_profile drop the unused turn= tuple: a turn is marked only with
bind_turn, which has the fence.
Tests that executed a never-claimed admission row now claim it first, as the drain does
(tests/gateway/session_claims.py); hand-built cron rows carry the claim's columns.
The rule text promised migration when a function is next edited; the ratchet compares lines, so an
edit around an old call never required it. Say what it does, and pin it with a test.
Round-2 review findings:
- A raw terminal mapping could still replace the bound profile's policy with
another profile's. Raw policies now go through bind_terminal_policy(policy,
profile_home=...): inside a bound scope only the bound agent's own policy is
accepted. The four callers pass the session's owning profile.
- A partial bind (home_override=False) inherited the home override from an
earlier change, so resetting that change took it away. A bind now copies the
pieces it keeps, so it is whole on its own.
- bind_state switched directly between hosted agents and tenants. Inside a
hosted scope only a bind of the same tenant and agent is allowed.
- Setters whose tokens are discarded grew the state chain without bound. Changes
that can no longer be reset fold together on the next push.
- A cross-profile install_profile_terminal_scope dropped its env_overlay.
- HX016 flagged a bare 'from . import set_secret_scope', whose module it cannot
know.
- The TUI heap-trim ordering test observes the whole-profile release.
Review found three ways around the guards in the first commit: set_terminal_scope
was unguarded (four production callers), set_secret_scope(None) cleared secrets
alone so get_secret fell back to the launch profile, and a stale or out-of-order
reset token moved one piece back while the others stayed. Guards around three
separate context variables leave every unguarded path able to split them.
The four pieces are now one immutable ScopeState in one context variable. Every
setter is a change to that value; a reset removes its own change and replays the
later ones, dropping those made inside a scope the result no longer has, so any
reset sequence lands on a state whole binds produce. Leaving a hosted agent by
any reset other than the bind that entered it refuses.
- set_terminal_scope narrows a bound local scope's own policy; clearing it, or
setting it in a hosted scope, refuses. set_secret_scope(None) inside a scope
refuses.
- bind_profile_scope and bind_state refuse a local bind inside a hosted scope.
- The TUI turn holds one token instead of four; housekeeping still runs under
the session's whole profile scope and the release resets it at once.
- HX016 sees relative imports and no longer flags a local object named like a
setter's module.
- The historical updater reads the override through get_hermes_home_override
when hermes_constants no longer exposes the raw context variable.
Profile state lived in three independent globals (home override, secret
scope, terminal policy) that every entry point set separately, so they could
describe different profiles. 85 call sites set them by hand.
hermes_scope.Scope(tenant, agent, actor) is now the single value, in one
contextvar; actor is Principal(id) or System(reason), and TurnScope adds
session and turn. agent/runtime_scope.py is the one module that turns a scope
into profile state: bind_profile_scope binds and restores all of it together.
The process's own home keeps its launch semantics; any other home is hydrated
from that profile's sources and stamped as routed.
The legacy setters keep their signatures. Inside a bound scope, a call naming
another profile moves the whole scope (local) or raises ScopeSwitchRefused
(hosted). Gateway turns, cron, the TUI, model switch, kanban spawn and the
managed worker bind once at entry. HX016 blocks new direct setter calls;
existing ones migrate when their function is next edited.
* fix(ci): the supply-chain scan judges a moved file by what changed in it
The supply-chain pattern scan failed on a pull request that moves hermes_cli/_launchers.py to hermes_agent/hermes_cli/_launchers.py and leaves a small forwarding file at the old path. Git showed the old path as modified and the new path as an added file, so all 1,177 unchanged lines counted as added. Line 334, which builds a Windows launcher with exec and base64.b64decode and has been on main for a long time, was then reported as a critical finding.
The scan now runs git diff with --find-copies -l0. Git pairs the new file with its old path and shows only the lines that changed as added. -l0 removes git's file limit: on a diff of about 5,000 files git otherwise skips copy detection and also drops rename detection.
Copy detection alone would also hide a payload-shaped line that a pull request copies into a new file while the original file keeps it. The scan therefore still judges every line of a copied file that its source file still contains after the pull request. A line is treated as moved only when it left its old place.
It still reports a payload line added anywhere: new lines in a moved file, a new file, a copy of an existing file with a line inserted, and a copied line whose source still has it. Renamed files without a forwarding file were already judged by their changed lines and are unchanged. On the 5,230-file move range the scan takes about 8 seconds instead of 1.3.
* fix(ci): the supply-chain scan judges a moved line by whether the diff also removes it
The scan paired a moved file with its old path through git's copy detection and then re-read both files. That missed a payload line when one file was copied to two new paths, and it split lines at characters git does not treat as line ends.
The scan now diffs without rename detection and leaves out an added line only when the same diff removes a line with the same text, once per removed line. A second copy of a moved file and a copy whose source keeps the line are judged.
The copy detection, the name-status parser and the cat-file reader are removed, so the scan no longer needs git 2.38.
* fix(ci): the supply-chain scan treats a line as moved only between files of the same name
An added line was left out whenever the diff removed the same text anywhere, so a payload-shaped line deleted from a test fixture and added to another module produced no finding.
The removed line must now come from a file with the same file name, which is what a move to a new folder keeps. Text taken from a file of another name is judged.
- agent.verbose: the example config seeded it, but verbosity comes from
--verbose / display.tool_progress (de5a88bd97 dropped the read).
- display.copy_shortcut: default added in 645a2f482d with no reader; the
Ctrl+Shift+C binding never consulted it.
- slack.reply_prefix: the Slack docs promised a prefix on every message, but
only the WhatsApp adapters read reply_prefix.
Part of #126448
Image URLs in an agent reply are downloaded by Slack / Telegram / Feishu /
Mattermost / Weixin before upload, and those paths read the whole body into
memory with no cap, so a streamed unbounded body could OOM the gateway.
They now stream through the same capped reader the inbound path uses and
take the adapter's existing fallback when the cap is exceeded.
Rebased onto current main (adapters moved under plugins/platforms/, the
SSRF redirect guard went public as ssrf_redirect_guard). The capped reader
is made public too (read_httpx_body_with_limit) so the plugins do not add
new private-core imports; the Teams baseline entry for the old private
name is dropped.
Fixes#122667
Google's Interactions API is now the recommended Gemini interface and where
new Gemini capabilities launch. The gemini plugin now
supplies its own client (ProviderProfile.create_client), which sends each
call to Interactions or to generateContent per model:
- providers.gemini.gemini_api / providers.gemini.models.<m>.gemini_api:
interactions | generate_content | auto (default). auto keeps
generateContent except for INTERACTIONS_MODELS (empty for now, so
default behavior is unchanged). Only the AI Studio host has Interactions,
so Vertex express and proxy bases stay on generateContent.
- Stateless (store: false): the full history goes as typed steps, so
compaction, branching and model switches behave as on generateContent.
Thought signatures ride extra_content.google.thought_signature (the
existing slot) and replay as thought steps.
- Streaming (step.start/delta/stop, arguments_delta, thought summaries and
signatures), usage (thoughts folded into completion tokens), status to
finish_reason, in-band errors mapped to HTTP-equivalent codes.
- Long decode continues requires_continuation hops with
previous_interaction_id + continuation_token, which needs a stored
interaction, so only those requests set store: true.
- A long-decode stream that drops resumes from its last mid-stream
checkpoint token (same request, continued), as the generateContent path
does. Output past the checkpoint voids it: resuming would repeat that
output, so the turn is retried instead. The dropped hop is counted up to
its checkpoint.
One core line: gemini_api joins the known providers.<name> keys, so setting
it no longer logs "unknown config keys ignored". Otherwise core is
untouched: the generateContent path is the existing GeminiNativeClient,
and the plugin rebuilds the same keepalive client and provider TLS settings
the core gives it.
config_mutation_lock.py duplicated web_server._CONFIG_MUTATION_LOCK (965a548788). The lock now lives
in web_server_profiles beside _SKILLS_PROFILE_LOCK; web_server re-exports it for the routers' LateState
lookups and profile_provision imports it with the scope helpers it already uses.
Comment pass: narration, move history and section banners removed from the
added code; long docstrings trimmed to their contract. The two now-identical create_profile name
checks in check_profile_create_entry.py merge into one branch, and _mirror_voice_sections runs
through _try (logged) instead of its own silent catch-all.
`hermes profile create`, `POST /api/profiles` and the Desktop/TUI
`profiles.create` RPC each called `create_profile()` and then ran their own
post-create steps (skills, alias, credentials, model, MCP servers, skill
selection). The same "new profile" therefore came out different
depending on where it was started, and a fix to one surface missed the
other two.
Add `hermes_cli/profile_provision.py` with
`provision_profile(ProfileCreateRequest) -> ProvisionResult`. Every surface
now builds a request and renders the result. `create_profile()` keeps the
folder work (validate, copy, strip channels, stage, publish, notify);
`provision_profile` runs every later step in one fixed order. A failing
later step never undoes the create: it is a warning in the result, as the
dashboard and RPC already treated it.
- The dashboard's model / MCP / skill-selection writers and the RPC's
launch-credential mirroring moved into the module; the routers import
them. Every config read-modify-write during create now holds the
dashboard's `_CONFIG_MUTATION_LOCK` (MCP servers, voice sections,
endpoint seed and base_url restore were unlocked on main).
- Plugins get no step here: since main's 6933155eaf the core create calls
the selected memory provider's on_profile_created hook, so every surface
already gets the provider's per-profile files.
- `scripts/check_profile_create_entry.py` (scripts/check, lint.yml) scans
every production Python file and fails on any use of `create_profile`
outside its definition and the new module: calls, imports, aliases, the
function passed as a value, getattr by name, and files that do not parse.
Behaviour is unchanged on purpose: each surface passes the options it used
before (only the RPC mirrors launch credentials). Two small differences,
both on failure paths: a failing post-create step in the CLI prints a
warning instead of a traceback, and the RPC writes SOUL.md during the core
create (as the dashboard already did), so a failed write fails the create
instead of returning soul_written=false.
A cancelled gate could pass on a live run of another PR that shares its head
SHA. Fork runs carry an empty pull_requests list, so the PR cannot be matched
without refusing every fork duplicate; require the twin's head_branch and
head_repository.id to match instead (both duplicates of one push share them).
Also soften the README: the last run to start never passes by delegation,
and a run cancelled while still pending never runs its gate.
Suggested by Greptile; narrowing from @BearHuddleston's review.
Catch AttributeError in the superseding-run lookup so a JSON list page keeps
the gate failing with its job report instead of a traceback.
Suggested by @BearHuddleston's review.
Order superseding runs by (run_started_at, id) so the later entrant to the
concurrency group, which is the one that cancels, carries the verdict. Let
attempt 2 delegate only when attempt 1 concluded action_required (a fork
run held for approval). Adds tests for a pending twin and the client-side
workflow/SHA/event check.
Patch from @BearHuddleston's review.
A cancelled run's gate may now pass only when a strictly newer run (higher id) of the same workflow, event and head SHA is live or succeeded, and only on the run's first attempt. Delegation is acyclic, so two cancelled duplicates can no longer vouch for each other and the newest cancelled run always fails.
ludeeus/action-shellcheck (00cae500) also selects *.bash, *.ksh, *.zsh,
*.shlib and the shell rc/profile names. The local selector took only *.sh
plus shebang files, so a future docker/foo.bash would be checked in CI and
skipped locally. Both selections give the same 8 files under docker/ today.
On native Windows print() ends in CRLF and $(...) strips only the LF, so
HERMES_PYTHON kept a trailing CR and generate-icons.mjs could not spawn it.
The path is now printed without a newline.
Locally the script left the interpreter to generate-icons.mjs, which takes
HERMES_PYTHON, else `python` on PATH. In an unactivated shell that is the
PM toolchain Python, and the renderer runs it isolated (-I), so Pillow and
resvg-py are missing. Outside Actions the script now selects the checkout's
runtime venv (pm.environments.project_python) through scripts/hermes-python.
On a runner it still uses setup-pm's HERMES_PYTHON unchanged.
Honcho left core on 2026-10-01 (7e53b3ef82) and ships from plastic-labs/honcho, but core kept
four places that know its file layout: profile create and rename edited Honcho's host blocks,
`hermes update` called the plugin's `sync_honcho_profiles_quiet()`, and the dashboard config
panel had a Honcho-only storage kind that imported the plugin's private `client` and `oauth`
modules (including its lock internals).
Replace them with seams any memory provider can use:
- MemoryProvider.on_profile_created / on_profile_renamed: called for the provider the profile's
config selects, with that profile's home and its own .env secrets bound, from create_profile
(CLI, dashboard, Desktop/TUI) and rename_profile. A failing hook, or an unreadable config, is
logged and never fails the create or rename.
- STORAGE_PROVIDER for config_schema.py, with read_config_fields / write_config_fields on the
provider: the provider owns its file layout; core keeps coercion, the memory.provider switch,
the 400 on a refused write, and saves secrets to .env only after the provider accepted them.
Delete: hermes_cli/profiles_honcho.py, the CLI create's Honcho step, the update-time sync,
STORAGE_HONCHO_HOST_BLOCK and the host-block reader/writer, the empty `honcho: {}` config
root and its template block, HONCHO_API_KEY in _ENV_CONFIG_KEYS (the *_API_KEY rule covers
it), the dead check_config_yaml_readers exemption, and "honcho" as a hardcoded reserved
profile/subcommand name (alias collision now checks installed memory-provider names).
_record_profile_rename moves to profile_identity.py (profiles.py line budget).
Kept: honcho in the left-core migration (moves existing users onto the catalog plugin), its
env-var metadata, and comments that use it as an example.
Until the Honcho plugin implements these methods (catalog pin 7dd3702 does not), its dashboard
panel is empty, --clone creates no host block for the new profile and rename does not re-key
it; `hermes honcho sync` still creates missing host blocks by hand.
The pinned hadolint digest moves from the workflow into the script, which CI calls as
`lint_docker.sh hadolint`. Locally the script also runs shellcheck on the files
ludeeus/action-shellcheck selects under docker/. Editing the script alone now starts the
docker_meta lane that runs it, without building an image.
The repo-guards step scripts publish through RUNNER_TEMP, GITHUB_OUTPUT and
GITHUB_STEP_SUMMARY, and the supply-chain scan reads the PR's base and head, so run
locally they died on a KeyError. scripts/ci/local_step.sh gives each step throwaway
runner files and the merge base with origin/main as the PR base. It fails a step on a
non-zero exit or found=true, runs every step, and runs them on the bootstrap Python, as
the pre-setup-pm steps run. CI is unchanged.
The repo-guards icon step moves into scripts/ci/check_icons.sh, and CI now calls it
through `just check-icons` (setup-pm already precedes the step). On a runner the script
keeps the old whole-tree check, so it still catches files an earlier step left behind.
Anywhere else it diffs against a scratch-index snapshot, so uncommitted work is not
reported as icon drift and the real index is untouched.
The checkout lock, the child supervision and the heartbeat, watcher and
relay programs embedded as strings move out of node-deps.mjs:
node-deps-lock.mjs owns who may touch the trees, and the three programs are
real .mjs files (node-deps-heartbeat/-watcher/-relay.mjs) that lint and
navigation can see. node-deps.mjs keeps recovery, install and commit.
No behaviour change; the watcher's empty catches now say why.
The new files ship wherever node-deps.mjs did: the Dockerfile's
dependency layer, nix/webapp.nix, the webapp freshness inputs, the desktop
input-cache key, and the source-build test fixture.
The lockfile, projects and receipt key were read before lockCheckout,
which can wait 10 minutes. A run that waited out an update compared the
new trees with the old files: it reused a stale receipt or rejected a good
install. They are now read and validated after the lock is taken.
The relay started pnpm first and the watcher after it, with no error
handler: a watcher spawn failure (a process or descriptor limit) exited the
relay while pnpm went on writing the trees the failed run then restored.
The relay now starts pnpm only once the watcher has spawned, and hands it
the pid on stdin; a watcher that cannot start fails the run before
anything touches the trees.
node-deps had no SIGINT/SIGHUP listener, so a Ctrl-C or closed terminal
during pnpm killed it before the restore and the release: the next run
waited out the 30 s stale limit on a dead owner. The run now outlives the
job signals while its child runs (the child gets them too and exits), and
the CLI exits with the child's 128 + n so Ctrl-C still reports 130.
SIGTERM is left out: one aimed at node-deps alone still kills it and the
relay passes it on.
A takeover rename that kept failing (EPERM/EBUSY/EACCES) skipped both the
deadline check and the sleep, so the wait spun past its limit. A failed
rename now waits like a live owner.