feat(path-guard): drift-resistant allowlist + centralized segment vocabulary#190
Merged
Conversation
…rom template@aeac8c1)
…te literal detection Sync from template@000943d. Hook + gate now flag template-literal build paths; allowlist replaces ±2 line tolerance with exact-line OR snippet_hash match. New --show-hashes flag prints SHA-256 prefix for allowlist entries that survive reformatting.
…ents.mts Sync from socket-repo-template@bb21ab5. Mantra: 1 path, 1 reference. Hook and gate now both import STAGE_SEGMENTS, BUILD_ROOT_SEGMENTS, MODE_SEGMENTS, and KNOWN_SIBLING_PACKAGES from a single canonical .claude/hooks/path-guard/segments.mts so they can no longer drift on what counts as a build-output path.
Pre-existing format drift in 7 files — collapsed multi-line array/arg literals where oxfmt would have inlined them. No semantic changes. Surfaced by the pre-commit hook running `oxfmt --check .` against the whole repo.
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.
Summary
Propagates path-guard + token-guard updates from socket-repo-template@bb21ab5.
Mantra: 1 path, 1 reference. Every build/test/runtime path is constructed exactly once; everywhere else references the constructed value.
What's new
path.join-only scanner.snippet_hashmatch.snippet_hashis a 12-char SHA-256 prefix of the whitespace-normalized snippet, surviving reformatting but invalidated by content-changing edits.--show-hashesflag: print the hash for each finding when authoring an allowlist entry..claude/hooks/path-guard/segments.mts): stage / build-root / mode / sibling-package sets are now imported by both the hook and the gate from one canonical file. The two can no longer drift on what counts as a build-output path.Companion propagations
Test plan
node scripts/check-paths.mtsexits 0)