Seed git's clone template with the pre-commit hooks #986
No reviewers
Labels
No labels
burndown-2026-06
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure!986
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/ee98-hooktemplate"
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 the fresh-clone half of
coilyco-flight-deck/agentic-os#1382. The resident-checkout half landed asagentic-os#1385.The gap
pre-commitwrites a config into every catalog repository and nothing installed the git hooks that run it, so the gate bound only where somebody had run an install by hand. For a non-resident repository likehousecast, a fresh clone is every session rather than an edge case, so the step was due every time and its result thrown away every time. Two agents hit it in one evening and one pushed 8 violations tomain.What this adds
A
git-hook-templaterole that seeds~/.config/git/template/hookswithpre-commit init-templatedirand points globalinit.templateDirat it. Every later clone is gated from its first commit, with no install step.pre-pushis in the hook set deliberately.init-templatedirwith no--hook-typeseedspre-commitalone. Taking that default would have reproduced the exact gap being closed: commits gated, pushes silently not, and the repair would have looked landed. The science seat measured that default and flagged it before I got there.Verified, both halves
Only the second proves
pre-pushlanded, which is why it is tested separately.The lane flip was synthetic and necessary: every repository that enables
pr-guardtoday is onmerge-remote-main, the one lane the guard now stands down on, so nothing in the estate would have exercised the refusing path.Two properties that shaped the implementation
--skip-on-missing-config, so a clone with no.pre-commit-config.yamlno-ops rather than erroring. The setting applies to every clone on the host, and this is what bounds it to catalog repositories in effect.Both halves are needed
init.templateDirapplies at clone and init only, so it never reaches a checkout that already exists. Those are covered by agentic-os's rollout script, which now installspre-pushtoo, and which I ran across the fleet: 18 of 20 resident checkouts carry it, the two exceptions being the deliberate.agentic-os-ignoreopt-out and agentic-os itself, which the script skips as the source repo.Not established
Whether this should also run on Windows hosts. I did not guard the role by OS, so it will attempt there, and the
which pre-commitcheck degrades it to a no-op if the binary is absent. Whether the template path and hook shebang behave under native Windows git is untested, andgroup_vars/windows.ymlis staged rather than converged today anyway.