Our Panel Said Enforced for Six Days
The panel said enforced for six days while nothing enforced it. The fix was a check that names unwired hooks, and the only cut with a measurement is also the only one a hook now denies.
A whole-tree git add on our shared checkout has taken other work, a cache and a secrets file into single commits, and the rule that replaced it is to stage named paths and read the staged list first.
A commit that sweeps in everything in a folder has cost us before. In one case a commit carried three secret values into a repository's history. The first rule for our shared checkout cites ten ledger entries behind it. The rule is short. The entries are the reason it is strict.
A shared checkout is one working copy of a repository that several parallel work streams use at once. We call each stream a lane. Each lane has its own task, and all of them write into the same folder. A whole-tree add then picks up the other lanes' half-finished files.
When we checked the line numbers the rule cites, most of them had drifted. Three that we opened point at unrelated entries, about hook overhead, a checkpoint, and a test gate. So we found the matching entries by searching for the commands the rule names. That is the honest version of "ten receipts": the entries exist, but the citations need repair.
On 2026-07-25, one entry removed a directory with git rm -r. It then deleted a line from .gitignore as tidy-up, and staged the whole change with git add -A.
The secret file was still on disk. git rm -r removes only tracked files, and this file had been untracked because the ignore line hid it. Removing the ignore line exposed it, and the add took it. The commit carried three secret values: two keys and a database address. We did not copy them here.
The fix was git rm --cached on the file, then an amend of the commit before any push. The entry then checked that the history no longer reached the file, and deleted the on-disk copy after confirming that another repository held the same file.
The rule the entry wrote: removing an ignore line is an edit that exposes files, so check git status before staging.
On 2026-07-21, a whole-tree add staged a cache tree that carried about fifty "adding embedded git repository" messages. On 2026-10-14, a directory-wide add put another lane's unverified files into two commits and two version tags.
Each of these entries ends with a rule, and each rule is a version of one instruction: name what you stage. We keep the entries in the ledger so the rule has a history, not only a sentence.
The most recent case is 2026-11-10. A rename commit had 103 files. The rename itself was 75 files and 264 lines. The other 28 files were someone else's uncommitted work, more than a quarter of the commit, riding along under a rename message.
The rule has smaller parts that come from the same kind of loss. A commit run after a failed gate, with the gate's output piped into tail, takes the pipe's exit code rather than the gate's, so the commit went through on a failure. A quiet flag hid a refusal from a pre-commit hook. A filtered "ok" was read as landed. Three phase commits never landed at all.
So the rule now reads the gate's own exit code, drops the quiet flag, and reads git log --oneline -1 after each commit, comparing the subject with what was meant to land. The cost is one extra listing per commit. We have not timed it, and we think it is small next to the work of undoing a commit that took a secret.
Stage named paths. Commit with a pathspec, so the commit takes only the listed files. Read git diff --cached --stat before the commit. After it, read git log --oneline -1 and compare the subject, because a quiet commit can hide a refusal.
Comentarii
Niciun comentariu încă.
Conectare pentru a comenta.