✨ Add pre-push hook that runs the test suite

The pre-commit hook is file-scoped (LEFTHOOK_FILES), so it can't
naturally run the test suite. Pre-push is the right tier for it:
- Runs after all commits are made but before the push leaves
  the machine, catching regressions that span multiple commits
- ~3.5s including the tsc step (negligible vs the typical push
  round-trip to CI)
- Offline and deterministic, same philosophy as pre-commit

lefthook.yml: new pre-push section, sequential (parallel: false
since there's only one command, but the explicit value documents
the intent that this hook runs commands in order rather than
racing).

project-specs.md: updated the CHECK TIERS table to add the
pre-push column with  in it. Updated the rule-of-thumb
list to include the pre-push tier. Updated the 'why' notes to
explain why  lives in pre-push rather than pre-commit
(LEFTHOOK_FILES doesn't apply to the test runner).
This commit is contained in:
tmu committed 2026-09-04 23:41:59 +02:00
1 parent 74e4538094
commit 7e9401590e
2 files changed
+37 -15

No files matched your search

+6
View File
@@ -13,3 +13,9 @@ pre-commit:
run: sh -c 'LEFTHOOK_FILES="$*" npm run check:cspell' sh {staged_files}
typecheck:
run: npm run check:tsc
pre-push:
parallel: false
commands:
test:
run: npm test