From 07cf655d0924ee6745cbe2e0364903110e7ac88b Mon Sep 17 00:00:00 2001 From: bdeshi Date: Sun, 2 Aug 2026 20:12:12 +0600 Subject: [PATCH] fix the pre-commit hook's path, missed by the rename ADR-0082 moved docs/ to harness/ and left scripts/hooks/pre-commit staging docs/surface.md. The hook runs on every commit, so the very commit that did the rename hit it: `git add docs/surface.md` failed with a fatal, the commit otherwise succeeded, and surface.md went in only because it had been staged by hand beforehand. The sweep missed it because the file has no extension and the grep that found every other reference was filtered by --include='*.sh'. HARNESS.md now says so where the hook is described, since the next rename will make the same mistake for the same reason. Verified by this commit: the hook ran, regenerated harness/surface.md, and staged it without error. 2 files. Co-Authored-By: Claude Opus 5 --- HARNESS.md | 5 ++++- scripts/hooks/pre-commit | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/HARNESS.md b/HARNESS.md index dd9491d..6aece25 100644 --- a/HARNESS.md +++ b/HARNESS.md @@ -255,7 +255,10 @@ that describe it, in the same change.** with `git config core.hooksPath scripts/hooks`. `--no-verify` bypasses it, and the commit body should say why. The hook also regenerates `harness/surface.md` and stages it, so a generated file is never something you have to remember — and it refuses a commit with unstaged `.go` changes, because what it - generated describes the working tree rather than what you are committing. + generated describes the working tree rather than what you are committing. It carries **no file + extension**, so a repo-wide sweep filtered by `--include='*.sh'` walks straight past it: ADR-0082's + rename left it staging a path that no longer existed, and the failure surfaced as a `fatal:` from inside + a commit that otherwise succeeded. When renaming anything the gate names, grep without an include filter. - `harness/decisions.md` registers every ADR number ever used, entries and withdrawals alike, so a citation can resolve to a decision or to a deferral but never to nothing. - `./scripts/verify.sh --list` names every gate that exists. A doc claiming enforcement is checkable diff --git a/scripts/hooks/pre-commit b/scripts/hooks/pre-commit index 85c8848..ed8540b 100755 --- a/scripts/hooks/pre-commit +++ b/scripts/hooks/pre-commit @@ -14,7 +14,7 @@ cd "$(git rev-parse --show-toplevel)" || exit 1 # Checked before generating, because a staged deletion also breaks the generator. unstaged=$(git diff --name-only -- '*.go') if [ -n "$unstaged" ]; then - printf 'FAIL unstaged .go changes — docs/surface.md would describe code this commit lacks:\n' + printf 'FAIL unstaged .go changes — harness/surface.md would describe code this commit lacks:\n' printf ' %s\n' $unstaged printf ' stage them, stash them, or commit with --no-verify and say why in the body.\n' exit 1 @@ -23,6 +23,6 @@ fi # One generated artifact, so one call. A second one makes this a two-line list; it does not make it a # registry (CLAUDE.md rule 1). ./scripts/surface.sh --write >/dev/null || exit 1 -git add docs/surface.md +git add harness/surface.md exec ./scripts/verify.sh --quiet