Files
pulse/.github
rcourtman ff58c33cfb fix(tooling): stop worktree commits from skipping prettier
The pre-commit frontend formatter resolved prettier at
REPO_ROOT/frontend-modern/node_modules/.bin/prettier, where REPO_ROOT is
derived from the script's own path. In a linked worktree that is the
worktree root, which never runs npm install, so prettier_bin() returned
None and the formatter silently returned 0. Every frontend commit made
from a Claude or Codex agent worktree skipped formatting entirely, and
the drift accumulated in already-committed files until someone ran
`make format` and picked up 14 files of unrelated churn.

The skip path's comment claimed "CI's prettier check still catches drift
that slips through here." No such check existed -- nothing under
.github/workflows referenced prettier -- so there was no backstop at all.

- Fall back to the primary worktree's node_modules, resolved via
  `git rev-parse --git-common-dir`, and say so in the hook output so a
  version mismatch between the two checkouts stays visible.
- Add the whole-tree "Check frontend formatting" step to the frontend CI
  job that the comment already promised. Staged-only formatting cannot
  see drift in untouched files; this can.
- Pin prettier exactly. "^3.3.0" let the tracked package-lock.json land
  on 3.9.5 while the gitignored pnpm-lock.yaml resolved 3.9.6, so CI and
  the dev machine were free to run different formatters.
- Resolve the test suite's prettier the same way, so its two real
  coverage tests stop silently skipping in worktrees.

Contract-Neutral: devDependency prettier version pin plus pre-commit/CI formatter tooling; no runtime, API, or deployment-surface delta
2026-08-06 21:53:44 +01:00
..