fix(gate): let the gate see a file git has never seen #352
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!352
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/gate-sees-a-new-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
closes #343
I filed this with the wrong cause, and the right one is worse
I wrote that pre-commit "only sees the staged set". That is not it. The gate already runs
--all-files, and several hooks enumerate git's own file list rather than the paths pre-commit hands them — so--all-filesmeans every tracked file, and--fileschanges nothing for them.Measured, not assumed:
Same file, same content, same hook. The only difference is whether git knows the path exists.
Why this is the case that mattered most
A new file is the most likely thing in a change to carry a fresh violation, and it was the one thing the gate silently did not check.
AGENTS.mdpromises the gate closes the gap thatvetandtestleave. It did, except for new files.The fix
Every untracked, non-ignored file is marked with
git add --intent-to-addbefore the hooks run. Intent only — no content is staged.The marks come off however the run exits. The failure exit is the one that matters: a red gate that left the index rearranged would be a worse problem than the one being fixed, so removal is a
trap, not a line after the check.Demonstrated, both halves
With a violating untracked file present:
It fails by name, and the file is still untracked after the failure exit.
Cost
real 15.37before,real 14.55after — noise. The work is per-file and the file count barely moves. That was the acceptance criterion I wrote on the issue, so it gets a number rather than an assurance.ward exec gategreen: build, policy-check, vet, test, test-skips, pre-commit.