chore(hooks): path-guard + token-guard + .sh→.mts conversion#628
Merged
John-David Dalton (jdalton) merged 2 commits intomainfrom Apr 27, 2026
Merged
chore(hooks): path-guard + token-guard + .sh→.mts conversion#628John-David Dalton (jdalton) merged 2 commits intomainfrom
John-David Dalton (jdalton) merged 2 commits intomainfrom
Conversation
Self-landable split from #620. Combines the hook overhaul into one atomic PR: path-guard infra, token-guard hook, .sh→.mts conversion of git hooks, and the assorted fleet hooks (private-name-guard, public-surface-reminder, release-workflow-guard, check-new-deps). What's included: Path-guard infra - .claude/hooks/path-guard/ (hook + tests + segments.mts) - .claude/skills/path-guard/ (audit-and-fix skill) - .claude/skills/_shared/path-guard-rule.md (canonical rule) - scripts/check-paths.mts (the gate) - .github/paths-allowlist.yml (empty starter, full schema docs) - .claude/settings.json (wires hook on Edit|Write) - scripts/check.mts (invokes the gate) Token-guard hook - .claude/hooks/token-guard/ (renamed from token-hygiene; word- boundary match for sensitive env names; ALWAYS_DANGEROUS check skips when redaction pipeline is present) .sh → .mts hook conversion (Node 25+) - .git-hooks/_helpers.mts (was _helpers.sh) — exports filterAllowedApiKeys + scanners (personal paths, AWS keys, GitHub tokens, private keys, AI attribution) - .git-hooks/{commit-msg,pre-commit,pre-push}.mts (were .sh) - .husky/* shims invoke node directly Fleet hooks - .claude/hooks/check-new-deps (npm dep introspection) - .claude/hooks/private-name-guard - .claude/hooks/public-surface-reminder - .claude/hooks/release-workflow-guard Verification: pnpm install ✓ pnpm run check --all ✓ pnpm test --all ✓ 565/565 tests pass
Contributor
Author
|
bugbot run |
Bill Li (billxinli)
approved these changes
Apr 27, 2026
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.
Self-landable split from #620. Combines the hook overhaul into one atomic PR.
Path-guard infra
.claude/hooks/path-guard/— hook + tests + canonicalsegments.mts.claude/skills/path-guard/— audit-and-fix skill.claude/skills/_shared/path-guard-rule.md— canonical mantra rulescripts/check-paths.mts— the whole-repo gate.github/paths-allowlist.yml— empty starter, full schema docs.claude/settings.json— wires hook onEdit|Writescripts/check.mts— invokes the gateDetection features: template-literal path detection · drift-resistant allowlist via
snippet_hash·--show-hashesCLI flag · paren-balanced parser · multi-line YAML reasons.Token-guard hook
.claude/hooks/token-guard/— renamed fromtoken-hygiene. Word-boundary match for sensitive env names.ALWAYS_DANGEROUScheck skips when a redaction pipeline is present (soenv | sed s/=.*/=<redacted>/— the suggested fix — actually passes)..sh→.mtshook conversion (Node 25+).git-hooks/_helpers.mts(was_helpers.sh) — exportsfilterAllowedApiKeys+ scanners for personal paths, AWS keys, GitHub tokens, private keys, AI attribution.git-hooks/{commit-msg,pre-commit,pre-push}.mts(were.sh).husky/*shims invokenodedirectlyFleet hooks
.claude/hooks/check-new-deps— npm dep introspection.claude/hooks/private-name-guard.claude/hooks/public-surface-reminder.claude/hooks/release-workflow-guardVerification
Test plan