feat(pre-commit): roll pr-guard out by default now that a release carries it #1149
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/agentic-os!1149
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pr-guard-default"
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?
What
Completes the rollout #1146 could not do at the time.
pr-guardshipped in #1146 but was deliberately kept out ofDEFAULT_HOOK_IDS, because the agentic-os#187 guard correctly refuses to list a hook that the pinned release tag does not carry. Doing it anyway breaks every consumer'spre-commitinit. That precondition is now satisfied:latest_release_tag()sorts--sort=-v:refnameand returns the newest, sodefault_rev()resolvesv0.34.0, which carries the hook. The #187 guard passes withpr-guardin the list.Until this lands the hook is inert for every consumer that has not named it explicitly, which is the whole point of #1146.
Also: the release paths gap
aos-precommit-release.ymlfilters onpathsand names hook scripts individually, but onlyscripts/trufflehog-scan.shwas listed.scripts/pr-guard-pre-push.shwas not.The consequence is delayed rather than immediate. The first release fired fine, because #1146 also touched
.pre-commit-hooks.yaml. But once the hook entry is stable, a later fix topr-guard-pre-push.shalone touches no listed path, so no release is cut, no tag moves, and every consumer pinned torev=aos-precommit-vX.Y.Zkeeps running the old script with no signal a fix exists. For a hook whose job is guarding pushes to default branches, silently shipping a stale copy is the wrong failure mode.The test
Rather than fix the one path and leave the class open,
tests/test_precommit_release_paths.pyasserts the invariant: everyscripts/entry in.pre-commit-hooks.yamlappears in the release paths filter. It is the sibling of #187's rev/hook-list guard, and it fails with the offending hook named.I audited the existing hooks before writing it, so it is not adding a rule the repo already violates:
Only
pr-guardwas the gap. A second small case asserts.pre-commit-hooks.yamlitself stays in the filter, since adding or retiring a hook id must move the tag consumers pin.Verification
The new test discriminates. Removing the path line and rerunning:
Full suite, same private pytest basetemp both sides:
Plus two, exactly the new cases, no regressions.
test_default_hook_ids_present_at_default_revpasses withpr-guardin the list. The 28 are pre-existing native-Windows failures, mostlytest_statusline.py, that CI does not see.just pre-commit-allpasses clean. One note for anyone reproducing on Windows: shellcheck fails on a fresh clone withSC1017against.agents/skills/tooling-image-zoom/scripts/crop-image, because.gitattributespins*.shto LF but not extensionless scripts. Pre-existing and unrelated, worked around locally withcore.autocrlf=input. Worth a.gitattributesline of its own sometime.closes #1148
🤖 Generated with Claude Code