Skip to content

fix(ci): install prettier via mise; ignore agent tooling output - #126

Merged
aguil merged 2 commits into
masterfrom
fix/ci-prettier-flake
Aug 9, 2026
Merged

fix(ci): install prettier via mise; ignore agent tooling output#126
aguil merged 2 commits into
masterfrom
fix/ci-prettier-flake

Conversation

@aguil

@aguil aguil commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Two independent repo-hygiene fixes, one commit each.

1. Prettier CI flake (acd19051)

The pre-commit prettier hook ran npm exec --yes --package prettier@3.8.1,
reinstalling prettier into ~/.npm/_npx on every invocation. Nothing caches
that directory, so CI refetched it each run and the install intermittently raced
itself:

npm error ENOTEMPTY: directory not empty, rename
  .../node_modules/prettier -> .../node_modules/.prettier-rObPqhmw

and on another run, a half-written module:

node_modules/prettier/internal/legacy-cli.mjs:3630
SyntaxError: Unexpected end of input

This failed 2 of 4 runs on #125 and passed on re-run each time — pure
infrastructure noise, unrelated to the content being checked.

prettier now comes from .mise.toml like every other QA tool, and the hook uses
mise exec --locked, matching the sibling stylua hook. mise-action already
runs with install: true / cache: true, so the install is provisioned once and
cached instead of refetched per run.

Verified:

  • Formatting is byte-identical to the old npx path, checked against a
    deliberately mangled file both with and without the repo's .prettierrc.json
    (printWidth: 80, proseWrap: "always").
  • Works under the exact CI environment (MISE_EXPERIMENTAL=0, MISE_PARANOID=1,
    MISE_TRUSTED_CONFIG_PATHS) — the npm backend does not require experimental
    mode.
  • Forced clean reinstall (mise install prettier@3.8.1 --force) succeeds with
    experimental off.
  • 4 consecutive green CI runs on this branch (1 initial + 3 re-runs),
    vs 2 failures in 4 runs on the old path. First run 41s while mise installed
    prettier fresh; 10-12s thereafter on a warm mise cache. CI logs confirm
    prettier resolving from ~/.local/share/mise/installs/prettier/3.8.1/
    with no _npx involvement.

One caveat worth knowing: mise's npm backend records only the version in
mise.lock, not a checksum, so --locked pins what version runs but not a
hash. The old npm exec --yes gave no hash either, so this is not a regression —
but it is weaker than the aqua-backed tools.

2. Ignore agent tooling output (7b6c6581)

agents code-review / agents triage write .agents-code-review/ and
.agents-triage/ into the repo root. These were only being kept out of commits
by a machine-local ~/.gitignore_global, so a fresh clone would see them as
untracked and could commit them by accident. The run directories contain full
context bundles of the working tree.

Added .agents-*/ so future agents subcommands are covered without another
edit. Verified with git check-ignore against an empty global excludes file;
dot_agents/ is unaffected and nothing tracked matches the pattern.

Gates

pre-commit --all-files, both Neovim suites, qa.just verify-shell
(23 unit + 4 integration), and qa.just verify-nvim-lua all pass locally.

aguil added 2 commits August 9, 2026 08:29
The pre-commit prettier hook ran `npm exec --yes --package prettier@3.8.1`,
which reinstalls prettier into ~/.npm/_npx on every invocation. Nothing caches
that directory, so CI refetched it each run and the install raced with itself:

  npm error ENOTEMPTY: directory not empty, rename
    .../node_modules/prettier -> .../node_modules/.prettier-rObPqhmw

and, on another run, a truncated module:

  node_modules/prettier/internal/legacy-cli.mjs:3630
  SyntaxError: Unexpected end of input

That failed 2 of 4 runs on PR #125 and passed on re-run each time -- a pure
infrastructure flake with no relation to the content being checked.

prettier now comes from .mise.toml like every other QA tool, and the hook uses
`mise exec --locked`, matching the sibling stylua hook. mise installs it once
into a versioned directory that mise-action already caches, so CI stops
refetching and the lockfile pins what runs.

The old comment justified avoiding pre-commit's mirrors-prettier node
environment. That reasoning does not apply to mise, which manages its own
install prefix rather than reusing a pre-commit node env.
`agents code-review` and `agents triage` write .agents-code-review/ and
.agents-triage/ into the repo root. Both are disposable local output and must
never be committed.

They were only being kept out of commits by a machine-local
~/.gitignore_global, so any other checkout -- or this one after a fresh clone --
would see them as untracked and could commit them by accident. The run
directories also contain full context bundles of the working tree.

Uses the .agents-* glob so future agents subcommands are covered without
another edit. Nothing tracked matches the pattern. .review-agent/ stays for the
legacy CLI layout.
@aguil
aguil merged commit 4462aa6 into master Aug 9, 2026
4 checks passed
@aguil
aguil deleted the fix/ci-prettier-flake branch August 9, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant