Commit Graph

896 Commits

Author SHA1 Message Date
alt-glitch
ec6827c388 fix(code-health): the packaged-imports scan is a guard, and it sees submodule imports
The scan that flags a package the wheel would drop read production
source from a test, which tests/AGENTS.md bans. It is now
scripts/check_packaged_imports.py, registered as `packaged-imports` in
scripts/check with its own lint.yml step, beside `tool-discovery`; the
hook fixture copies it like every guard. It uses only the standard
library: tomllib for the include patterns, the find_packages walk done
over `git ls-files` (a package is reachable only through parent
packages), and ast for imports.

`from acp_adapter import server` and `from . import server` now count
`acp_adapter.server` as imported, not only `acp_adapter`, so a submodule
turned into a folder is caught whichever form imports it.

tests/scripts/test_check_packaged_imports.py covers a root module turned
into a folder, both from-import forms, and a clean tree, on temporary
repos. On the real tree the guard passes, and fails with `toolsets` or
`acp_adapter.server` when either module becomes a folder.
2026-11-16 11:52:44 +05:30
alt-glitch
72564e4b7f fix(code-health): check tool discovery in scripts/check, not in a test
The repo-wide check that every module registering a tool at import is one
discovery imports parsed production source from a test, which
tests/AGENTS.md bans. It is now the `tool-discovery` guard
(scripts/check_tool_discovery.py), run by `scripts/check` and its lint.yml
step, using discovery's own `_module_registers_tools` and
`_tool_module_candidates`.
2026-11-16 11:52:44 +05:30
alt-glitch
b7f657fc5e chore(lint): keep ruff.toml as the only ruff config
Ruff reads ruff.toml and ignores [tool.ruff] in pyproject.toml when both
exist, so the pyproject block was never applied: PLW1514
(unspecified-encoding), which that block called too load-bearing to keep
off and lint.yml said the blocking step enforces, was not enforced. Its
ASYNC baseline list was stale for the same reason: ruff.toml already
selects those rules with no baseline and the tree passes.

- ruff.toml selects PLW1514 and turns on preview only for preview rules
  it names (explicit-preview-rules). That also activates PLE0304,
  PLR1708, RUF063, RUF068 and FURB192, which were selected but skipped
  with a "preview is not enabled" warning.
- PLW1514 stays off for tests/, skills/, optional-skills/ and plugins/,
  carried over from the pyproject block.
- [tool.ruff*] leaves pyproject.toml; ruff.pre-commit.toml (a copy of
  ruff.toml that differed by one comma) is deleted, and `just ruff`
  (the lefthook pre-commit step) uses ruff.toml.
- lint.yml's comments name ruff.toml.
2026-11-15 14:02:40 +05:30
Maciej Lisiewski
b624d30ec0 Merge pull request #155405 from NousResearch/sec3/128930-history-check-pr-head
fix(ci): judge the unrelated-histories gate on the PR head, not the merge ref
2026-11-15 01:31:00 +01:00
Maciej Lisiewski
00c53467ef Merge pull request #155389 from NousResearch/sec3/108382-ci-input-hardening
ci: pin wheel, pass install-e2e inputs via env, keep skills-index probe output single-line
2026-11-15 01:30:15 +01:00
Maciej Lisiewski
5c2daadc29 fix(ci): judge the unrelated-histories gate on the PR head, not the merge ref
A pull_request checkout is refs/pull/N/merge, whose first parent is main's
tip, so merge-base origin/main HEAD always succeeded and the gate could never
reject. The step now gets github.event.pull_request.head.sha, fails closed
when that commit cannot be resolved, and also rejects a head whose root
commits are not all already in main (a main-descended branch that merged an
unrelated history).

Fixes #128930

Co-authored-by: beardthelion <56458543+beardthelion@users.noreply.github.com>
2026-11-14 13:24:09 +01:00
Teknium
78f8c9a625 fix(update): module-mode old updaters still hand off; shim tests use a manifest
`python -m hermes_cli.main update` from releases before update_cmd.py was split
out runs cmd_update/_cmd_update_impl as `__main__`, so in_historical_update()
did not see them and e.g. bc747001eec5's post-pull update_managed_uv() import
raised instead of handing off, leaving the update half-done. A `__main__` frame
now counts when its code was compiled from this checkout's hermes_cli/main.py;
the current tree's own entry points stay live code via the sentinel local.

The shim runtime tests discovered shims by parsing source (banned in tests).
The shim list is now data (tests/fixtures/retired_updater_shims.json, 63 shims,
generated from the former scan); scripts/ci/check_retired_shims_manifest.py runs
the AST scan as a repo-guards step and fails on drift or an empty scan.
2026-11-14 01:03:00 -08:00
Maciej Lisiewski
6193da37fa fix(ci): pass skills-index probe outputs to the report step via env
The "Report status" step interpolated steps.probe.outputs.detail and
summary (built from the remote index's generated_at and source keys)
straight into the bash run: script, so quotes or $(...) in those values
would execute on the runner. Pass them through env: like the issue step.

Refs #108382
2026-11-14 05:26:27 +01:00
Adolanium
326a756578 ci: pass install e2e inputs through the environment
Quoting ${{ inputs.setup-exe-url }} still lets the Actions runner
splice the value into the script before PowerShell parses it. A quote
or backtick in the input can break out of that string. The four
product steps now take every script input from env, the same way the
bundled leg already passes the manifest url.
2026-11-14 05:26:27 +01:00
Adolanium
a1e37d77fa ci: pin wheel in build requires
build-system.requires pinned setuptools exactly but left wheel
unconstrained, so every PEP 517 isolated build floats to the newest
PyPI wheel release. Pin wheel==0.48.0 to match the setuptools policy.
2026-11-14 05:26:27 +01:00
0xDevNinja
29a2e4f24a chore(ci): pass VERCEL_DEPLOY_HOOK via env, not inline expression
Direct ${{ secrets.VERCEL_DEPLOY_HOOK }} interpolation inside a shell
run: block embeds the secret in the rendered command line. GitHub's
secret masking covers the value, but the indirection via an env: mapping
is the documented hardening pattern and avoids any chance of the URL
surfacing through set -x, error traces, or a custom shell wrapper.

Fixes #23631

Salvaged from #23664.
2026-11-13 17:28:52 -08:00
Siddharth Balyan
d312b4989e Merge pull request #151880 from NousResearch/sid/migrate-branch-tool
feat(move): just migrate-branch carries a branch across module moves
2026-11-14 05:37:07 +05:30
BearHuddleston
18a716589a ci(install-e2e): run the macOS packaged-bundle upgrade on Blacksmith
The macos-packaged-arm64 upgrade arm timed out in rc.4-v0.23.2 (129 s
and 149 s) with v0.22.0's "macOS update verification timed out.". The
installed app gives Squirrel.Mac 120 s from checkForUpdates to
update-downloaded. On the 3-core M1 macos-15 runner, unpacking and
verifying the update takes longer than that. An M4 Mac mini takes
38-45 s.

Timed with the real signed v0.22.0 app updating to the rc.4-v0.23.2
ZIP, three runs per runner (run 43513361469, from a throwaway branch):

  macos-15 (M1 VM, 3 vCPU)                112.3 s, 121.6 s, 125.6 s
  blacksmith-6vcpu-macos-15 (M5 Max VM)    46.5 s,  39.7 s,  35.9 s
  blacksmith-12vcpu-macos-15 (M5 Max VM)   32.9 s,  29.6 s,  29.2 s

The job moves to blacksmith-12vcpu-macos-15, the size this file's
Hermes-Setup.dmg leg already uses. It also switches to Blacksmith's
checkout, like the repo's other Blacksmith jobs. 4bc546d567 kept the
job on macos-15 only because a branch run cannot exercise it: it needs
signed bundle manifests.
2026-11-13 16:24:02 -06:00
alt-glitch
d5489336a2 ci: keep the WAL check and the MCP catalog owner working after the move
The three SQLite WAL checks import hermes_state_wal in a bare interpreter, where nothing serves
old module names, so they would fail once the module moves; they install the compat finder first.
CODEOWNERS also names the catalog at its moved path.
2026-11-13 20:47:04 +00:00
alt-glitch
7d090e2c0e fix(ci): sparse-check out the compat package the change classifier imports
The detect job checks out only the classifier and its action, so the classifier's
hermes_agent.compat import fails and every later job is skipped. Check out the package too, and
pin the sparse list against the classifier's imports in a test.
2026-11-13 20:47:04 +00:00
Maciej Lisiewski
ebca7335c9 docs(debug): /debug descriptions, tips and issue templates describe the summary
Slash-command descriptions (all locales), tip t346, slash-commands docs and
the bug/setup issue templates still said the public paste carries logs.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-13 20:20:47 +01:00
alt-glitch
fb6cd1d8d2 fix(ci): quote the outcome literal in the shim check step 2026-11-13 18:45:32 +00:00
alt-glitch
da72db50e4 feat(compat): generate shims at old module paths for releases that update across a move
Release-channel updaters (v0.21.6 on) keep old code loaded across the checkout swap. After it
they run some files by path and lazily import modules under packages they loaded before the swap,
which Python looks up on the old package's __path__ without asking the compat finder. Each such
name needs a file at its old path once its module moves.

- hermes_agent/compat/required_names.py: the 120 old names supported releases reach, with kind
  (package, module, by-path, exists), built once from the per-release shim audit.
- scripts/move/generate_shims.py: for each name whose module is moved in MOVES, writes a shim
  that installs the finder and becomes the moved module (or runs it as __main__ when run by path
  or with -m). Lists the shims as linguist-generated in .gitattributes. --check fails on drift and
  on stray files in a moved folder.
- The check runs in scripts/check (just check), lint.yml and the lefthook pre-commit hook.
  install_root_lint skips the shims: they are entry points for runs by path.

With MOVES empty the generator writes nothing.
2026-11-13 18:45:32 +00: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
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
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
IAvecilla
77e16d5f0f fix(ci): a green release's sandbox run can no longer be cancelled while it waits 2026-11-11 08:52:37 -05:00
IAvecilla
fc94b6197c fix(ci): apply sandbox image review nits 2026-11-11 08:52:37 -05:00
IAvecilla
fed7d68cba fix(ci): the sandbox image is rebuilt after every stable release and weekly 2026-11-11 08:52:37 -05:00
kshitijk4poor
463044ae93 refactor(profiles): reuse the dashboard's config mutation lock; drop slop comments
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.
2026-11-10 14:09:08 +05:30
kshitijk4poor
96d816a10f refactor(profiles): one entry point for profile create
`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.
2026-11-10 14:09:08 +05:30
Teknium
d9a4196f59 ci(js): refresh the apt index before installing Electron's packages
The JS & TS checks job ran apt-get install with no apt-get update. Runners on
the current Blacksmith ubuntu-2404 image (rootfs ubuntu24-full-x64-081926)
ship without a populated package list, so the step dies with
"Package 'zsh' has no installation candidate" / "Unable to locate package
libnotify4" before any check runs. Every merge to main since ~02:50Z is red
on it (8f6cfd10, e782db3f, PR heads too); a rerun hits the same image.
Every other apt step in .github already updates first.
2026-11-09 23:56:51 -05: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
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
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
38d4cbdf93 Merge pull request #152151 from NousResearch/just-ci-local
ci: more CI checks run locally as just recipes
2026-11-09 22:28:33 +01:00
Siddharth Balyan
86b9622f01 Merge pull request #152000 from NousResearch/sid/just-ci-leftovers
ci: the remaining workflow copies of recipe commands call the recipes
2026-11-10 02:24:14 +05:30
Teknium
fc86fb39a1 fix(ci): desktop Pre-build setup survives a slow R2 day (30 -> 60 min)
v0.23.1 rc.1: `Archive every pinned input` (scripts.ci.archive_inputs,
which re-downloads every pinned input from R2 to verify its sha256)
took ~3 min per Windows chain on the green v0.23.0 attempt. On rc.1 it
took 28 min on win32-x64 and was cancelled at the 30-minute job cap on
win32-arm64. Single files stalled 5-8 min each (chromium@linux-arm64,
llamacpp-cuda@win32-arm64), so the cap fired with the work still moving.
The input list itself barely grew (180 -> 194 files: pnpm and just pins).

60 minutes matches the standalone archive job this step replaced. An
attempt runs its claim commit's workflows, so this helps the next rc,
not rc.1.
2026-11-09 11:24:44 -08:00
Maciej Lisiewski
f6e574a57f ci(js): the WhatsApp bridge install and tests run through just 2026-11-09 19:43:47 +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
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
Teknium
cacad9510e ci: side-branch dispatch cancel covers branches only; README matches
Review follow-up: the dispatch clause matched any non-main ref, so a
non-release tag dispatch also cancelled its predecessor. It now requires
refs/heads/ (tag case added to the test; red on the previous head).
_gha_expr models startsWith/endsWith (case-insensitive, per the Actions
docs). .github/workflows/README.md concurrency section now describes
side-branch dispatches, and notes GitHub may still replace a pending run
in a non-cancelling group.
2026-11-09 10:14:14 -08:00
Teknium
339989f8db ci: a re-dispatch on a side branch replaces its stale run
ci.yaml keyed manual dispatches on the branch ref with cancel-in-progress
off, so a second `gh workflow run ci.yaml --ref fix/x` sat `pending`
behind the first until that one finished every slow leg (e2e-upgrade
shards, Windows install/update E2E). A release-blocker debug lane lost
~30 min waiting on runs whose answer it had already read.

cancel-in-progress now also covers workflow_dispatch on any ref but
main, the same way a new push to a PR supersedes the previous run.
Unchanged: pushes to main, a dispatch on main, and stable-release
workflow_call runs (their group is run_id and inputs.release
short-circuits the expression).

tests/ci/test_ci_concurrency_cancel.py evaluates the real block for each
start mode; the side-branch dispatch case is red on the old expression.
The commit-threading guard gets an allowlist row for the github.ref use,
which never chooses the commit under test.
2026-11-09 10:14:14 -08:00
alt-glitch
e0d13d10fb ci: the remaining workflow copies of recipe commands call the recipes
Nine workflow steps still ran the exact command of an existing recipe:
the tests-js install in the install-e2e workflows (5), the Electron
runtime preparation and the full JS install in js-tests and the Windows
desktop attach E2E (2 each). They now call just js-install-tests,
just electron-runtime and just js-install.

A new desktop-build recipe replaces the `pnpm run build` steps of the
desktop E2E workflows. The contributing guides and the PR template name
just test, just test-all and just check.

`set windows-shell` is dropped: the manual marks it deprecated, and its
value was identical to `set shell`, which applies on Windows when no
Windows setting exists. Checked on a Windows host with just 1.59.0: both
forms run the same bash.
2026-11-09 20:18:44 +05:30
alt-glitch
06234d5c51 ci(termux): termux-verify stages its payload and runs its contracts through just
`just termux-payload <payload> <package>...` calls the new
scripts/termux/stage_payload.sh, which runs termux_pkg_build.sh for each
package in order, then stage_runtime_libs.py: the same four commands the
"Stage the pinned bionic runtimes" step ran (build_cpython.sh and
build_uv.sh are one-line wrappers over termux_pkg_build.sh with the
package name as the subdir). The archive_inputs step before it stays a
separate step: it needs R2 credentials and is not a developer command.

The native linker contracts step runs `just test -j 2 <files>`, which is
scripts/run_tests.sh --require-paths with the same arguments.
desktop-bundled-release.yml stages the same payload in separate steps and
is unchanged.
2026-11-09 19:16:36 +05:30
alt-glitch
9b4e66d5f7 ci(desktop): the desktop E2E and bundle smoke installs run just recipes
Two new recipes, one line each:

- `just electron-runtime`: node scripts/build/electron-runtime.mjs --source .
- `just js-install-tests`: the tests-js-only, production, no-scripts pnpm
  install the bundle smoke drives its chat with.

e2e-desktop.yml and e2e-desktop-core.yml call `just js-install` and
`just electron-runtime`; e2e-desktop-update.yml calls `just js-install`.
desktop-bundle-smoke.yml calls `just js-install-tests` on both its macOS
and Windows legs (they share one step list), each after setup-pm with
toolchain all, which installs just. js-tests.yml,
windows-desktop-attach-e2e.yml and the install-e2e-*-run.yml workflows
still spell the same commands out.
2026-11-09 19:16:36 +05:30
alt-glitch
47fb16ee68 ci(docs): docs-site-checks and deploy-site run the docs recipes
New recipes, each one line over the script CI already ran:

- `just docs-generate`: extract-skills.py, then generate-skill-docs.py.
- `just docs-check-generated`: the "committed skill docs match the
  generator" block, moved verbatim into scripts/ci/check_generated_skill_docs.sh
  (same `git add -N`, same diff paths, same ::error:: line and exit 1).
- `just docs-check-links`, `just docs-lint-diagrams`.
- `just docs-check`: generate, then the three checks, in CI's order.

docs-site-checks.yml calls docs-install, docs-generate, the three checks
and docs-build. deploy-site.yml calls docs-generate and docs-install; its
generate-skill-docs.py step moves up beside extract-skills.py because it
reads neither the plugin stars nor the plugin catalog the steps between
them write. Its full bilingual `npm run build`, staging and Pages deploy
steps stay inline. Python recipes run through scripts/hermes-python, which
uses the interpreter setup-pm exports as HERMES_PYTHON, as python3 did.
2026-11-09 19:16:36 +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
Maciej Lisiewski
c3bcfcc5bd test(e2e-upgrade): start a merge release from its second parent; fail on CI with no release
upgrade_base() took N-1 from `git tag --merged HEAD~1`, a first-parent
walk. A release cut as a merge loses its predecessor that way: at
v0.22.2 (first parent the release/0.22.1 tip, second parent the
published v0.22.1) it picked v0.22.0. release_tags(before=True) now
takes `--merged HEAD --no-contains HEAD` and keeps the depth-1 guard on
HEAD~1. On main both pick v0.23.0.

With no release reachable the suites skipped. On CI, where the job
fetches full history and tags, that means a broken checkout reported
green, so it now raises there.

The resolver test lives in tests/ci so PR CI runs it; the e2e-upgrade
lane runs only on release and dispatch runs.

Part of #150040
2026-11-08 23:46:06 +01:00