You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(path-guard): drift-resistant allowlist via snippet_hash + template literal detection
Sync from socket-repo-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.
Copy file name to clipboardExpand all lines: .claude/skills/path-guard/SKILL.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,18 @@ pnpm run check:paths --explain
199
199
200
200
Print the gate's findings without making any edits. Exit 0 if clean, 1 if findings present. Useful for CI / pre-merge inspection.
201
201
202
+
## Allowlisting a finding
203
+
204
+
When a genuine exemption is needed (rare — most "false positives" should be reported as gate bugs), add an entry to `.github/paths-allowlist.yml`. Two ways to pin the entry to a specific site:
205
+
206
+
- **`line:`** — exact line number. Strict; a single-line edit above shifts the entry off-target and the finding re-surfaces.
207
+
- **`snippet_hash:`** — 12-char SHA-256 prefix of the offending snippet (whitespace-normalized). Drift-resistant: survives reformatting, but any content-changing edit invalidates it. Get the hash:
208
+
```bash
209
+
pnpm run check:paths --show-hashes
210
+
```
211
+
212
+
Both may be set — either matching is sufficient. Prefer `snippet_hash` over raw `line:` when the exemption is expected to outlive routine reformatting; prefer `line:` when you specifically *want* the entry to fall off after any nearby edit.
213
+
202
214
## Mode: install (new repo)
203
215
204
216
When invoked as `/path-guard install` on a Socket repo that doesn't yet have the gate:
0 commit comments