fix(hook-kit): relocate domain-owned ask guards and retire the unregistered duplicates - #372
Draft
daegunjhy wants to merge 2 commits into
Draft
fix(hook-kit): relocate domain-owned ask guards and retire the unregistered duplicates#372daegunjhy wants to merge 2 commits into
daegunjhy wants to merge 2 commits into
Conversation
…kills
hook-kit's own frontmatter describes it as a hook management toolkit —
audit / edit / install / move / remove. It is not a repository for every
hook. Two guards had accumulated there whose logic belongs to a single
other skill's domain:
block-squash-recommend-multi-commit.sh -> github-flow/resources/
Gates a PR merge-method recommendation. github-flow already owns
the PR-domain ask guard block-pr-url-gate.sh, and merge.md defines
the commit-count/distinctness rule this enforces.
block-new-skill-ready-without-ask.sh -> skill-kit/resources/
Gates readying a PR that introduces a new skill directory. Skill
publication scope is skill-kit's domain.
Placing them here was justified by precedent ("similar guards already live
in hook-kit") rather than by ownership — the reasoning the workspace notes
explicitly warn against, since it lets hook-kit accrete unrelated hooks
until nothing can be moved without touching it.
Neither script carries relative references, so this is a pure relocation
plus the two hooks.json path updates. Both self-tests still pass and bats
24/24 passes, including the check that every registered command path
resolves on disk.
hook-kit carried its own ask-guard.sh and block-axis-merged-ask.sh while the ask-user plugin carried the same two under the same names. Only the ask-user copies were ever registered, so every commit landing on these files ran nowhere — and the two lines kept diverging anyway. By the time this was noticed the unregistered copies were the NEWER of the two (2026-08-21 vs 08-20) and each side held fixes the other lacked. Both lines were merged into the registered copies first, so this removal drops no behaviour. Their three standalone test scripts move with them; no CI target referenced those, so nothing here loses coverage. The registry entries become tombstones rather than deletions — the hook-kit registry treats deletion records as data that survives regeneration, and a duplicate that silently never fired is exactly the history worth keeping. hook_registry_verify --check: 8 findings, unchanged from the pre-change baseline (the 2 SCHEMA findings this introduced are resolved by the tombstone blocks). bats 24/24.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hook placement cleanup, in two independent commits.
Why this came up
hook-kit's own frontmatter describes it as a hook management toolkit — audit / edit / install / move / remove. It is not a repository for every hook. But guards had been accumulating there justified by precedent ("similar guards already live in hook-kit") rather than by ownership, and two separate problems had grown out of that.
1. Relocate domain-owned guards (
3b772cc6)Two guards whose logic belongs to a single other skill's domain:
block-squash-recommend-multi-commit.shgithub-flow/resources/block-pr-url-gate.sh, andmerge.mddefines the commit-count/distinctness rule this enforcesblock-new-skill-ready-without-ask.shskill-kit/resources/Neither script carries relative references, so this is a pure relocation (
R100) plus twohooks.jsonpath updates.2. Retire the unregistered ask-guard duplicates (
02e6bb20)hook-kit carried its own
ask-guard.shandblock-axis-merged-ask.shwhile the ask-user plugin carried the same two under the same names. Only the ask-user copies were ever registered — so every commit landing on these files ran nowhere, and the two lines kept diverging anyway.By the time this surfaced, the unregistered copies were the newer of the two (2026-08-21 vs 08-20), and each side held fixes the other lacked:
:-→:+pattern-variable convention (the git-ignored locale file was replacing committed patterns wholesale), retrospect append-guarantee, solo-infra-repo exemption, CI-gate-only exemption as a runtimegh pr checksprobe,resolve_guards_config()HG_ASK_CI_GATE_ONLY_ATTESTATIONBoth lines were merged into the registered copies first (daegunsoftDev/skills PR #24), so this removal drops no behaviour. The three standalone test scripts move with them; no CI target referenced those, so nothing here loses coverage.
Registry entries become tombstones rather than deletions —
hook-registry.yamltreats deletion records as data that survives regeneration, and a duplicate that silently never fired is exactly the history worth keeping.Test plan
bats tests/→ 24/24 pass, including test 24 (everyhooks.jsoncommand path resolves on disk) after both relocations--testself-tests → PASS at their new pathshook_registry_verify.py --check→ 8 findings, unchanged from the pre-change baseline (the 2 SCHEMA findings the tombstones introduced are resolved; the remaining 8 are pre-existing and unrelated)hook-registry.yamlparses as valid YAML (81 hooks)Related
daegunsoftDev/skills PR #24 is the other half of the divergence — it holds the merged guards this PR retires, plus a new guard for the failure that exposed all of this.