Problem
The standard (Author identity) explains why personal-name guard patterns must stay out of the tree — but leaves the actual guard for each repo to hand-roll. Hand-rolled guards fail silently. Real case from a scaffolding session: a pre-commit hook filtered diff noise with grep -v '^\+\+\+' (no -E); in GNU BRE, \+ is a quantifier, so the filter matched every added line and -v discarded them all — the guard passed everything, including a staged test leak. Only a deliberate negative test caught it.
Suggestion
- Ship
scripts/install-privacy-guard.ps1 (Core tier): prompts for the patterns locally, writes an untracked .git/hooks/pre-commit that scans staged additions and staged filenames, and enforces the noreply commit identity. Patterns never touch the tree; the installer script itself is clean and trackable.
- Have the installer finish with an automatic negative test: stage a synthetic leak, assert the hook blocks it, clean up.
- Add one line to
pre-commit-checklist.md / the hook guidance: "a guard that has never failed a negative test is not yet a guard."
- Note in the docs that the hook does not travel with clones and must be re-installed per machine.
🤖 Generated with Claude Code
Problem
The standard (Author identity) explains why personal-name guard patterns must stay out of the tree — but leaves the actual guard for each repo to hand-roll. Hand-rolled guards fail silently. Real case from a scaffolding session: a pre-commit hook filtered diff noise with
grep -v '^\+\+\+'(no-E); in GNU BRE,\+is a quantifier, so the filter matched every added line and-vdiscarded them all — the guard passed everything, including a staged test leak. Only a deliberate negative test caught it.Suggestion
scripts/install-privacy-guard.ps1(Core tier): prompts for the patterns locally, writes an untracked.git/hooks/pre-committhat scans staged additions and staged filenames, and enforces the noreply commit identity. Patterns never touch the tree; the installer script itself is clean and trackable.pre-commit-checklist.md/ the hook guidance: "a guard that has never failed a negative test is not yet a guard."🤖 Generated with Claude Code