fix(#260): enforce worktree absolute-path safety via PreToolUse hook
Closes #260 Moves the step-0b absolute-path guard from prose instructions to a harness-enforced PreToolUse hook (gsd-worktree-path-guard.js). Hard-blocks Edit/Write/MultiEdit calls whose absolute path resolves outside the active worktree root.
This commit is contained in:
@@ -355,7 +355,8 @@
|
||||
"gsd-statusline.js",
|
||||
"gsd-update-banner.js",
|
||||
"gsd-validate-commit.sh",
|
||||
"gsd-workflow-guard.js"
|
||||
"gsd-workflow-guard.js",
|
||||
"gsd-worktree-path-guard.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ Full listing: `get-shit-done/bin/lib/*.cjs`.
|
||||
|
||||
---
|
||||
|
||||
## Hooks (13 shipped)
|
||||
## Hooks (14 shipped)
|
||||
|
||||
Full listing: `hooks/`.
|
||||
|
||||
@@ -470,6 +470,7 @@ Full listing: `hooks/`.
|
||||
| `gsd-workflow-guard.js` | `PreToolUse` | Detects file edits outside GSD workflow context (advisory, opt-in) |
|
||||
| `gsd-read-guard.js` | `PreToolUse` | Advisory guard preventing Edit/Write on unread files |
|
||||
| `gsd-read-injection-scanner.js` | `PostToolUse` | Scans tool Read results for prompt-injection patterns (v1.36+, PR #2201) |
|
||||
| `gsd-worktree-path-guard.js` | `PreToolUse` | Hard-blocks Edit/Write/MultiEdit with absolute paths outside the worktree root (PR #579, #260) |
|
||||
| `gsd-session-state.sh` | `PostToolUse` | Session-state tracking for shell-based runtimes |
|
||||
| `gsd-validate-commit.sh` | `PostToolUse` | Commit validation for conventional-commit enforcement |
|
||||
| `gsd-phase-boundary.sh` | `PostToolUse` | Phase-boundary detection for workflow transitions |
|
||||
|
||||
Reference in New Issue
Block a user