Repository navigation
Commit 6c57cef
committed
fix(web/shell): #107 review — an agent's command cannot make or remove a folder in a protected place either
Found while fixing the letter-case finding: the protected-path check ran over file writes and deletes
only. Folders are left to the shell to make and remove (`rest`), so a command that made an empty
.vscode, or removed an empty folder under .git, had that applied: a change in a place the review
says commands never change, in either direction.
A mkdir or rmdir whose path is protected (folded as for files) is now a refusal like any other: the
whole set is refused, and the shell is handed no folder to make or remove. Folders elsewhere are
unchanged.
Test: shellCommit.test.js "protected folders are not made or removed either…" (an rmdir under
.git, mkdir of .vscode, .GIT/hooks, .github/workflows, an rmdir of sub/.Husky — each beside an
ordinary file write that must not be applied either; and two look-alike folders that still go
through). It fails on the previous shellCommit.js.1 parent c1e7d46 commit 6c57cef
2 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
223 | 239 | | |
224 | 240 | | |
225 | 241 | | |
| |||
0 commit comments