Commit Graph

28 Commits

Author SHA1 Message Date
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
alt-glitch
101d061571 fix(move): migrate-branch resumes mid-move and keeps the branch's own text in resolved hunks
just migrate-branch --continue and --abort reuse the interpreter the first run set up, so they start after commit A moved hermes_cli.
A resolved hunk renames only the token that lines up with the renamed one, on a line whose quotes are unchanged; anything else stops.
2026-11-13 20:47:06 +00:00
alt-glitch
285cc20598 feat(move): just migrate-branch carries a branch across module moves
scripts/move/migrate_branch.py finds the move chunks a branch is missing by
their Hermes-Move trailer and, for each in landing order, merges the commit
before the rename, merges the rename with directory rename detection, runs
scripts/move/rewrite_imports.py on the Python files the branch changed, and
merges the import rewrite keeping the branch version of those files. It then
merges the target. Any other conflict stops the run; --continue resumes and
--abort restores the branch. Merges only; the remote is touched only with
--push.
2026-11-13 20:47:06 +00:00
alt-glitch
e12251663a chore(move): drop unit tests for the temporary move tools
The move tools are deleted after the move. The end-to-end rehearsal is their proof.
2026-11-13 20:47:05 +00:00
alt-glitch
7a20cb0edb fix(move): regenerate the skill docs in a chunk, and keep the launcher wrapper's bootstrap import
The docs pass rewrites paths in SKILL.md files, the inputs of website/scripts/generate-skill-docs.py, and
skips the generated pages. Nothing regenerated them, so the docs job failed from the first chunk that
touched a path a skill names. The chunk command and just move-generate now run that generator.

scripts/build/launcher_wrapper.py is the text of minted launchers. It imports hermes_bootstrap first: the
root file, which repairs a torn update and installs the old-name finder before hermes_agent is importable.
The rewrite turned it into hermes_agent.hermes_bootstrap; it is now an excluded site.
2026-11-13 20:47:05 +00:00
alt-glitch
dca9438261 feat(move): add move-chunk, one command for commits A and B of a chunk 2026-11-13 20:47:05 +00:00
alt-glitch
5c72e9c313 chore(move): one-line description for the move-generate recipe 2026-11-13 20:47:05 +00:00
alt-glitch
a4c8094d8e fix(move): codemod keeps import bindings, rewrites call-arg strings and pyproject entry points
`import a` became `import hermes_agent.a`, which binds `hermes_agent` for the whole
function: an earlier `hermes_agent.x` read there raised UnboundLocalError (practice
chunk 04, tests/hermes_state/test_fts_layout_drift.py). It now becomes
`import hermes_agent.a as a` and its uses keep their spelling. A function-local
`import a.b` whose new root another read in that function needs is flagged.

A string passed to a call is rewritten when its whole value names a moved module,
`module.attr` or `module:attr` of a name the module defines (`where="batch_runner.AIAgent"`,
`_tools_mod("tui_gateway.checkpoints")`); a bare top-level name needs `(module, attr)`
evidence (`_lazy("hermes_state", "SessionDB")`); a dotted name that only starts with
one is flagged. `"-m", "<mod>"` pairs in call arguments and f-string target heads
(`f"pkg.mod.{name}"`) are rewritten. DEFAULT_CONFIG keys (`agent.reasoning_effort`,
also a module) never change.

pyproject.toml entry points and package-data keys follow their module; package lists
are flagged (the old directory may still hold a shim). The run ends by naming
`just move-generate`, which regenerates the files built from rewritten docstrings.
2026-11-13 20:47:05 +00:00
alt-glitch
dd3194d1fc build(move): run the codemod with libcst from a side environment
libcst is only for the temporary move tools, so it stays out of pyproject.toml and uv.lock.
2026-11-13 20:47:05 +00:00
alt-glitch
38c0f818b8 chore(move): drop unit tests for the temporary move tools
The move tools are deleted after the move. The end-to-end rehearsal is their proof.
2026-11-13 20:47:05 +00:00
alt-glitch
60d15c0372 feat(move): rewrite old module names from a move commit and flag what it leaves
scripts/move/renames.py reads old -> new dotted module names from a git mv commit.
scripts/move/rewrite_imports.py rewrites imports and their attribute chains with LibCST, plus
the strings the strict compat finder in tests cannot see: -m module arguments of child
processes, sys.modules keys and logger names. Every other site that names a moved module or
path is printed as a flag with its class, and the run fails until it is resolved.
libcst joins the dev dependency group; just move-rewrite runs it.
2026-11-13 20:47:05 +00: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
Maciej Lisiewski
7c9a51c4dd feat(dev): just recipes for the catalog tests, plugin catalog, nix and Rust lanes
Local entry points for lanes whose workflows stay as they are: catalog-tests.yml is
grepped by tests/ci/test_classify_changes.py, and the others run before or without
setup-pm, so their steps cannot call just. Documents every new recipe.
2026-11-09 19:43:47 +01: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
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
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
05d92d3350 fix(dev): just docs-check ignores hand edits and leaves the real index alone
docs-check-generated compared the working tree with the index, so on a
laptop any unstaged docs edit failed as generator drift, just stopped before
the links and diagram checks, and `git add -N` left untracked drafts
intent-to-add in the real index. The check now works in a scratch copy of
the index, and given a generator command it snapshots the docs before
running it. CI's no-argument call compares against the committed docs as
before.

Co-authored-by: Bear Huddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-09 19:16:36 +05:30
alt-glitch
1c5312789d fix(dev): just docs-check runs on a laptop and its files start the docs job
docs-lint-diagrams called the website's lint:diagrams script, which needs
ascii-guard on PATH; only CI installed it, so `just docs-check` stopped
there locally. The recipe now runs the pinned ascii-guard through
scripts.ci.python_packages, the same pm environment CI uses, with the
same arguments: 442 files checked locally, and a malformed box fails it
as it fails the npm script.

check_generated_skill_docs.sh moves to website/scripts/, beside the
generator it checks, so a change to it starts the docs job.
2026-11-09 19:16:36 +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
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
b9d57a5757 fix(dev): just test, test-js, lock and setup work as documented
- `just test -v` passed the recipe's one-argument check and then
  discovered all of tests/. The runner takes --require-paths, which refuses
  a run naming no path or file list, and `just test` passes it.
- `just test-js` ran the TUI tests before @hermes/ink was built. It builds it
  first, as the TUI's own `check` script does.
- `just lock` went through run-in-hermes-env, which syncs first; after a
  pyproject.toml edit the sync refuses the stale uv.lock before pm lock runs.
  scripts/relock.sh runs pm lock with the bootstrap Python, then syncs.
- `just setup` on Windows called pwsh, which a stock Windows does not have.
  It uses powershell.exe, as activate.ps1's own caller does.
2026-11-09 16:34:44 +05:30
alt-glitch
ec7c695d4c feat(dev): just lists the developer commands; lefthook calls its recipes
The justfile held per-workspace eslint recipes that duplicated lefthook and
ran whatever ruff was on PATH. It is now one menu of developer commands:
setup, check, fix, test, the JS workspace checks, the desktop and TUI dev
servers, the website build and the PM re-lock. Each recipe calls an existing
script or tool. Python recipes go through scripts/run-in-hermes-env, so they
work in a shell that never ran `source ./activate`.

`just test` requires at least one path, because scripts/run_tests.sh with no
arguments starts the full suite; `just test-all` is that explicit form.

`python -m scripts.code_health.ruff_runner ARGS` runs the pyproject-pinned ruff
that scripts/check resolves. `just fix` and the pre-commit `just ruff` recipe
use it, so the hook no longer depends on the ruff version on PATH.

lefthook.yml keeps its jobs, globs and roots; each job now runs `just ruff` or
`just eslint`. A shell without `just` on PATH fails the hook with "command not
found" rather than skipping the lint.

CONTRIBUTING.md, the developer guide, the package-management reference and the
desktop and TUI READMEs name the recipes beside the commands they run.
2026-11-09 16:34:44 +05:30
Maciej Lisiewski
7062229090 chore(js): switch the workspaces from npm to pnpm
pnpm 12.15.0 (native executable) installs every JS workspace from one
pnpm-lock.yaml, imported from package-lock.json with the same resolved
versions. website/, the WhatsApp bridge and the photon sidecar stay separate
npm projects.

Configuration moves from .npmrc and the root manifest into
pnpm-workspace.yaml: the 14-day minimumReleaseAge and its excludes,
overrides, allowBuilds (the old allowScripts set, with strictDepBuilds
failing any unlisted build script), engineStrict, sideEffectsCache: false
(in-place rebuilds must not write into the store) and
verifyDepsBeforeRun: false (a `pnpm run` never installs).

The pnpm version is pinned in pm/lock.json and in root devEngines.
pmOnFail: ignore keeps that pin out of pnpm-lock.yaml: a leading pin
document makes osv-scanner read zero packages. scripts/build/node-deps.mjs
enforces the exact version instead, and every lock reader refuses a
multi-document lock. A root preinstall refuses `npm install`; devEngines
onFail is warn so npx (MCP servers, the tsc linter) keeps working inside
the checkout.

User-machine installs run --frozen-lockfile --trust-lockfile (release age is
checked when locking, in CI, not per user). node-deps removes npm-era
node_modules trees before the first pnpm install. Nix builds the store with
fetchPnpmDeps and a hash file that CI checks.
2026-11-06 04:08:24 +01:00
Maciej Lisiewski
9b4551d824 chore: pin specific js dependency versions 2026-10-10 23:58:48 +02:00