From 2dcbcbd6602e610f502e91bf2812806d1fbad701 Mon Sep 17 00:00:00 2001 From: Ethan Date: Wed, 22 Apr 2026 15:19:18 -0700 Subject: [PATCH] fix: pin pre-commit hook --base to origin/main (mirror CI) Codex flagged that the Husky hook relied on fallow audit's auto-detection while CI passed --base explicitly, so a commit could clear the hook locally and still fail CI if origin/main was stale or the auto-detected ref differed. Pin to origin/main to match the CI step exactly. Co-Authored-By: Claude Opus 4.7 (1M context) --- .husky/pre-commit | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 3458886..e91fc5b 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,11 +1,14 @@ #!/usr/bin/env sh # Fallow gate: block commits that introduce new complexity or duplication -# beyond the frozen baselines in .fallow/. Audit auto-detects the base -# branch (typically main) and scopes to files changed on this branch — -# the same semantics CI uses, so a commit that passes here will pass CI. +# beyond the frozen baselines in .fallow/. Matches CI's --base argument +# exactly (origin/main) so audit scopes to the same diff here and in +# CI; auto-detection can pick a different ref when origin/main is +# stale or when multiple remotes are configured, giving false-green +# locally. If origin/main is behind, run `git fetch origin main` first. # To lower a baseline, refactor the flagged code and regenerate: # npx fallow health --save-baseline=.fallow/health-baseline.json # npx fallow dupes --save-baseline=.fallow/dupes-baseline.json npx fallow audit \ --health-baseline=.fallow/health-baseline.json \ - --dupes-baseline=.fallow/dupes-baseline.json + --dupes-baseline=.fallow/dupes-baseline.json \ + --base=origin/main