Commit Graph

268 Commits

Author SHA1 Message Date
alt-glitch
4a2c1d1e9b fix(ci): start the upgrade suite when the module-rename finder or its table changes 2026-11-13 18:45:32 +00:00
Maciej Lisiewski
547739e466 Merge pull request #154471 from NousResearch/sec/126942-sandbox-artifact-integrity
fix(sandbox): verify the cua-driver tarball before extracting it
2026-11-13 17:17:57 +01:00
Teknium
513f8bfbfd ci: route default_plugins.py to the upgrade lane (the update tail imports it) 2026-11-13 02:36:06 -08:00
Maciej Lisiewski
5b7b470cc3 fix(ci): catch streamed downloads hidden by comments, blank lines or absolute paths
BuildKit drops comment lines and blank lines inside a RUN continuation, and a
top-level comment ending in a backslash does not continue; the guard joined
lines naively, so 'curl u \\ / # c / | tar' and '# c \\ / RUN curl u | sh' slipped
through. '| /bin/tar' and '| /usr/bin/sh' were missed by the matcher too.
2026-11-12 19:57:31 +01:00
Maciej Lisiewski
c321b8f406 fix(sandbox): verify the cua-driver tarball before extracting it
docker/sandbox-desktop.Dockerfile streamed the cua-driver release asset
straight into tar, so whatever the server returned became a root-owned
binary on PATH in the published default terminal sandbox. Fetch to a
file and sha256sum -c it against committed per-arch digests first, the
way the root Dockerfile already handles SQLite and s6-overlay.

Add scripts/ci/check_dockerfile_downloads.py (repo-guards step and
`scripts/check --only dockerfile-downloads`) so no tracked Dockerfile
can pipe a download into an extractor or interpreter again.

Fixes #126942

Co-authored-by: Yuan Li <dskwelmcy@163.com>
2026-11-12 19:55:14 +01:00
Teknium
d92c31ae65 feat(catalog): weekly check delists entries whose repo or pin is gone
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.
2026-11-12 02:21:17 -08:00
Teknium
9a735ca353 ci: run the cwd-restart Telegram E2E in the messaging-gated job
It probes for the real python-telegram-bot, which only the e2e job installs
(tests/ci/test_messaging_gated_selection.py).
2026-11-12 00:32:41 -08:00
Teknium
d5cf6deff4 ci: route gateway_runtime_start to the update suites now that the pause replay imports it
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.
2026-11-11 23:20:47 -08:00
Teknium
a2620368c0 ci: run the paused-/new Telegram E2E in the messaging-gated job
It probes for the real python-telegram-bot, which only the e2e job installs
(tests/ci/test_messaging_gated_selection.py).
2026-11-11 23:09:40 -08:00
Teknium
753ea6bb16 fix(update): a sibling profile's gateway restarts with its own credentials, not the updater's
`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.
2026-11-11 22:40:06 -08:00
Teknium
9dc7e6a524 fix(ci): reject text files stored with CRLF line endings
.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>
2026-11-11 18:50:11 -08:00
Siddharth Balyan
3bcd071226 fix(ci): the supply-chain scan no longer counts a moved line as new (#153398)
* 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.
2026-11-11 18:10:04 +05:30
Teknium
1fef533064 docs(config): drop documented keys nothing reads (agent.verbose, display.copy_shortcut, slack.reply_prefix)
- 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
2026-11-10 15:32:44 -08:00
unsupportedpastels
bf4d330db0 fix(ci): only delegate to a twin from the same head branch and repository
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.
2026-11-09 22:16:54 -05:00
unsupportedpastels
d85c6f3974 fix(ci): fail closed with the report when a runs page is not an object
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.
2026-11-09 22:16:54 -05:00
unsupportedpastels
6d84737945 fix(ci): delegate from approved fork duplicates by run start order
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.
2026-11-09 22:16:54 -05:00
unsupportedpastels
3105eb1f6a fix(ci): page through event-filtered runs when looking for a superseding twin 2026-11-09 22:16:54 -05:00
unsupportedpastels
3bdbc97063 fix(ci): only let a cancelled duplicate run delegate forward to a newer twin
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.
2026-11-09 22:16:54 -05:00
unsupportedpastels
8c891f2d51 fix(ci): pass the gate of a cancelled duplicate PR run when its twin is live 2026-11-09 22:16:54 -05:00
Maciej Lisiewski
4e9ae2136b Merge pull request #151577 from NousResearch/fix/node-deps-fetch-before-delete
fix(build): keep the previous node_modules until the pnpm install succeeds
2026-11-09 22:32:14 +01:00
Maciej Lisiewski
e60ab54588 fix(dev): just lint-docker selects every file CI's shellcheck action does
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.
2026-11-09 20:37:26 +01:00
Maciej Lisiewski
49a851b0ec fix(dev): just check-icons drops the CR Windows Python prints
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.
2026-11-09 20:37:25 +01:00
Maciej Lisiewski
407ab834f1 fix(dev): just check-icons renders on the checkout's runtime environment
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.
2026-11-09 20:10:55 +01:00
Maciej Lisiewski
f4bbeab788 ci(guards): hadolint runs from scripts/ci/lint_docker.sh, which just lint-docker also runs
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.
2026-11-09 19:43:47 +01:00
Maciej Lisiewski
fa23d69165 feat(dev): just check-repo-guards and check-uv-lock run the guard scripts outside Actions
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.
2026-11-09 19:43:46 +01:00
Maciej Lisiewski
a11cecb2d8 ci(guards): check-icons runs the icon freshness step locally and in CI
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.
2026-11-09 19:43:46 +01:00
Maciej Lisiewski
6750c484c3 refactor(build): move the node-deps lock and its programs into modules
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.
2026-11-09 19:13:41 +01:00
teknium1
8719a66ef8 ci: limit the ajv declaration separator to ':' (drop '=>')
BearHuddleston: '(?::|=>)' also matched an arrow function returning ajv's id
(const f = $id => '<ajv id>'; fetch(new URL('/evil', f()))), stripping the id
and letting a fetch-base self-updater pass. No JS object declaration uses '=>',
so restrict the separator to ':'. Add arrow_fn_base and other_url_declared as
red cases (the latter pins that only ajv's exact id -- not any
raw.githubusercontent URL in a $id -- is exempt).
2026-11-09 08:36:59 -08:00
teknium1
267ab847fd ci: read the candidate file as utf-8-sig (BOM-tolerant)
The new _file_fetches_github read tripped the windows-footguns gate: a plugin
file BOM'd by Windows tooling must still be read, so use utf-8-sig.
2026-11-09 08:36:59 -08:00
teknium1
aa711165dd ci: exempt the ajv meta-schema by declaration in Python, not a grep lookbehind
Two review findings on the regex approach:
- Greptile: the fixed `$id: "` / `$ref: "` lookbehinds rejected harmless ajv
  bundles with quoted keys ("$id":) or minified spacing ($id:"...") -- the very
  false rejection this change removes.
- BearHuddleston: the lookahead left a `.../data.json/../../evil` traversal (Node
  normalizes it to a real GitHub path) and a real fetch sharing a minified line
  with the inert id.

Replace the overloaded grep pattern with a plain grep -E first cut plus a Python
refinement (_file_fetches_github): strip the inert ajv $id/$ref DECLARATION in
any quoting/spacing, then a real raw.githubusercontent / release URL remaining is
a true fetch. "#" is the only id terminator, so a traversal out of data.json is a
different, non-exempt URL; the literal reused as a fetch base is not a declaration
and stays flagged. Tests parametrize four legit declaration forms and four
adversarial forms (two traversals, beside-id, fetch-base).
2026-11-09 08:36:59 -08:00
teknium1
ae6a219527 ci: pin the ajv exemption to the schema-declaration prefix
Greptile (P1): exempting the ajv meta-schema URL by value let the same literal
be abused as an executable fetch base --
`new URL('/evil/repo/main/plugin.js', ajvUrl); fetch(u)...writeFileSync(__filename, body)`
-- whose only raw.githubusercontent occurrence is the exempt id, so the fetch
scan skipped the file and the write scan never saw it.

Pin the exemption to the `$id: "`/`$ref: "` schema-declaration prefix with
fixed-length negative lookbehinds, so the URL is inert only where ajv declares
its meta-schema. The executable-base form, a sibling refs path, and a traversal
all still trip the gate. Adds the new-URL-base exploit as an invariant test.
2026-11-09 08:36:59 -08:00
teknium1
a81232342b fix(ci): the catalog self-updater gate ignores ajv's bundled meta-schema URL
A plugin that bundles ajv ships ajv's draft-06 meta-schema, whose $id/$ref is
the literal string "https://raw.githubusercontent.com/ajv-validator/ajv/master/
lib/refs/data.json#". ajv matches that identifier by value against its own
in-memory schema; it never drives a network request. But the self-updater gate's
fetch pattern matched raw.githubusercontent.com anywhere, so any such bundle that
also wrote a data file (both halves in one minified file) was rejected as a
self-updater (e.g. subnano's server/cli.js).

Exempt only that exact inert id, pinned up to its "#" fragment terminator via a
negative lookahead (needs grep -P), so a real fetch under any other
raw.githubusercontent path -- or a traversal like .../lib/refs/../../payload.js --
still trips the gate. Two invariant tests cover the exemption and the traversal.
2026-11-09 08:36:59 -08:00
alt-glitch
4ba6e7ef8a fix(ci): an attested file still goes through the self-updater gate
_check_attested removes each verified file from the clone so the payload scan
ignores it, and it ran before _check_self_updater. A plugin could list a JS
updater under attested_binaries: once its provenance checked out the file was
gone, the self-updater grep never saw it, and users still got it from the
pin. Provenance shows where a file came from, not what it does, so the
self-updater gate now runs before anything is removed.
2026-11-09 19:07:47 +05:30
alt-glitch
e82a44fcc6 fix(ci): the plugin catalog gate verifies attested binaries
README rule 17 lets a catalog entry ship a native binary listed under
attested_binaries, if `gh attestation verify` proves the plugin repo built it
at the pinned commit. The old inline step fed its parser as
`python3 -I - "$entry" <<PYEOF </dev/null`; the later </dev/null replaced the
heredoc, so the parser ran an empty program, the list always came back empty
and `gh attestation verify` never ran. #151877 moved the step into
scripts/ci/ and kept that dead branch out, so behaviour stayed the same.

The field reader now returns the attested paths beside the clone source and
rejects any that is not a plain relative path. The gate verifies each one
against the entry's repo at the pinned sha, then removes it so the payload
scan ignores it, and any other binary still fails. No catalog entry declares
attested_binaries today, so nothing admitted now changes.
2026-11-09 18:56:58 +05:30
Siddharth Balyan
d478c8ffc6 Merge pull request #151877 from NousResearch/sid/just-ci-scripts
ci: repo-guards, plugin-catalog and skills-index steps run scripts instead of inline bash
2026-11-09 18:53:07 +05:30
alt-glitch
c042454317 fix(ci): catalog fields cross as JSON; a uv.lock timeout keeps its report
The catalog field reader printed shell assignments and the gate parsed them
back with shlex, a shell layer between two Python programs. It now prints
one JSON object, and the gate rejects the entry unless it gets exactly
REPO, SHA, SUBDIR and BAD as strings.

verify_uv_lock.py let TimeoutExpired escape after 600 s, so the job lost the
attempt's log and published no review status. A timed-out attempt now prints
its partial log, reports "uv.lock check timed out" and stops: retrying three
more 600 s attempts would outlive the job.
2026-11-09 18:32:10 +05:30
alt-glitch
d8ed14f2da ci: a justfile or hermes-python change runs every lane
Workflows now run their commands as just recipes, so the justfile and the
wrapper its Python recipes use are CI configuration living outside
.github/. The change classifier only failed open on .github/, so a PR
that broke a recipe skipped the jobs that run it and failed after merge.
Both files now count as CI configuration.
2026-11-09 18:05:31 +05:30
alt-glitch
42288e127b ci(guards): repository guard steps run scripts under scripts/ci
repo-guards.yml carried twelve inline run blocks of 17 to 79 lines: bash
programs with embedded JSON, heredoc Python and a retry loop. Each moves
into a stdlib Python script that CI and a developer can run alike; the
workflow keeps every step name, id and if: unchanged, and the longest
run block is now one line.

- check_infographic_images.py: Reject committed PR-infographic images
- check_common_ancestor.py: Reject PRs with no common ancestor on main
- check_contributor_emails.py: Check for unmapped contributor emails
- pr_diff_report.py prompt-surface|lockfile: the two advisory diff
  summaries (merge base, $GITHUB_OUTPUT changed=, step summary)
- scan_supply_chain.py patterns|dependency-bounds: the supply-chain
  scan and the unbounded PyPI dependency check
- verify_uv_lock.py: Verify uv.lock is up-to-date (5/15/45s retry on
  registry failures only)
- review_status.py emit <check> | merge <artifact> ENV...: the four
  near-identical "Emit review_status (...)" blocks and the supply-chain
  merge, as one table of findings

${{ }} values the old blocks interpolated into bash (base_ref, PR base
and head SHAs, the lockfile-diff flag) now reach the scripts through
step env only.

An equivalence harness ran every old block and its replacement on the
same fixture repos (Linux, bash -e, GNU grep): 39 cases, identical exit
code, stdout, stderr, $GITHUB_OUTPUT, step summary and review-status
files. The one deliberate text change: the supply-chain how_to_fix now
points at scripts/ci/scan_supply_chain.py, where the pattern lives.
tests/ci/test_repo_guard_checks.py covers each guard as its step runs it.
2026-11-09 16:42:47 +05:30
alt-glitch
bec4baa051 ci(catalog): plugin-catalog gate steps call scripts instead of inline bash
The two long run: blocks of plugin-catalog-ci.yml move into scripts/ci/,
so the admission gate can be read, tested and run outside a workflow:

- "Find changed catalog entries" (41 lines) ->
  scripts/ci/catalog_changed_entries.py: the merge-commit check, the
  AMRT entry list without removed.yaml, the data-only rule for entry PRs,
  and the files<<__EOF__ block in $GITHUB_OUTPUT.
- "Clone each entry at its pinned sha and validate" (235 lines) ->
  scripts/ci/catalog_validate_pinned_entries.py, with the entry-field
  parser that the step fed to `python3 -I -` on a heredoc now in
  scripts/ci/catalog_entry_fields.py (still run with -I, still evaled
  as shlex-quoted assignments, still reset to "parser failed" when it
  dies).

Both steps run `python3 -I "$GITHUB_WORKSPACE/scripts/ci/<script>"`;
env, error lines, PASS/FAIL lines and exit codes are unchanged. The
attested_binaries block is not carried over: its parser ran with
`<<'PYEOF' </dev/null`, so the later redirect gave python an empty
program, ATTESTED was always empty and no `gh attestation verify` ever
ran. Dropping it keeps today's behaviour (a declared binary still fails
the payload scan).

test_plugin_catalog_ci_confinement.py still runs the workflow step text
(now the script call); every case passes against both the old and the
new workflow. test_catalog_pinned_confinement.py adds a POSIX test of
the confinement rule and the entry-field rejections, since the step
test is Linux-only.
2026-11-09 16:42:47 +05:30
alt-glitch
f5ef9cef05 ci(skills-index): probe and watchdog steps run scripts under scripts/ci
The freshness workflow carried a 64-line inline Python judge and two
near-identical bash blocks that open or comment on a watchdog issue.

- `Probe live index`: the heredoc judge moves to
  scripts/ci/skills_index_probe.py (same floors, 26 h limit, 1500 total,
  same output lines on stdout, exit 0 for every verdict). curl stays
  inline in the step.
- Both "Open issue" steps call scripts/ci/skills_index_watchdog_issue.py
  with `skills-index` or `plugin-catalog-cors`. One table holds the two
  title prefixes, titles and bodies; the find/comment/create logic is
  written once. GH_TOKEN, STATUS and DETAIL stay in the step env and the
  repository comes from GITHUB_REPOSITORY instead of `${{ }}` in the script.
  The prefix filter that used `--jq startswith` is now done in Python.

Tests judge saved index fixtures and drive the watchdog against a stub
gh, with no network.
2026-11-09 16:42:47 +05:30
alt-glitch
722bb88ece ci: lint, tests and js-tests run their commands through just
setup-pm installs the just pm/lock.json pins (python, node and all
toolchains) and forwards just-version and just-path. Three workflows then call
recipes instead of spelling the command out:

- lint.yml: each guard step runs `just check --only <name>`, so the guard list
  lives once, in scripts/check. Adding a guard there and forgetting lint.yml
  no longer leaves CI running a different set. The ratchet step is
  `just check --only health --base HEAD^1`.
- tests.yml: the sliced full-suite step is `just test-all`.
- js-tests.yml: the parallel workspace checks are `just check-js-ci`.

Python recipes run through scripts/hermes-python: on a runner it uses the
interpreter setup-pm exported as HERMES_PYTHON (as run_tests.sh does), so a
recipe never re-runs setup in CI. Elsewhere it goes through run-in-hermes-env.
2026-11-09 16:34:49 +05:30
alt-glitch
2ae6b5feb1 fix(pm): CI does not install just until a workflow calls it
No workflow runs a just recipe yet, so installing just in every setup-pm
job only added a download, and one with no mirror copy until the pin lands
on main. setup-pm goes back to main. The workflow change that first calls a
recipe adds just to CI with it.

scripts/tool_store_pins.py decides whether run_tests.sh may share the
account tool store. It checked the tools cmd_install provisions but not the
developer tools, so a store with a missing or broken just was shared and the
test-environment install could then rewrite it. It now walks them too.
2026-11-09 15:04:28 +05:30
alt-glitch
0f2ee4d80f fix(pm): request just only where pm/lock.json pins it
Setup asked for just by name: `pm install --test-environment` and every
setup-pm toolchain. A lockfile without a just pin (an older branch, a test
fixture repo) then stopped setup with "just: not in the lockfile", and
archive_inputs refused it as an unknown pinned package.

Both paths now take the developer tools from the lockfile they read, so a
lockfile without just installs without it. The repository lock pins just,
so developers and CI still get it.
2026-11-09 14:22:25 +05:30
alt-glitch
0b9f980a69 feat(pm): provision a pinned just for developers and CI, never for users
Add a `just` binary package (casey/just 1.59.0, musl on Linux, the static
aarch64 musl build on Termux like ripgrep) and pin all nine targets in
pm/lock.json. Digests come from GitHub's release API, as llama.cpp's do.
They match upstream SHA256SUMS.

The package is optional, so `source_install_packages` keeps it out of
every user install. `pm.testenv.DEVELOPER_TOOLS` names it, and
`pm install --test-environment` (what activation runs) installs it with
the default closure. activation_environment then puts it on the activated
PATH. setup-pm installs it in every toolchain, so every CI job can call
`just`.

Windows ARM64 just.exe imports no vcruntime140.dll (PE imports checked),
so it needs none of ripgrep's VC runtime staging.
2026-11-09 13:36:49 +05:30
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
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