Repository navigation
Commit aa07b56
committed
fix(cli): correct the delete recipe's engine claim, and test the command wiring
Three review findings, all real.
The delete recipe still told agents the opposite of what the command does.
The Errors table was corrected in the previous commit while the Goal and
Preconditions eight lines above it still read "rule delete resolves ast-grep
rules only ... A Vale or runtime rule is deleted by removing its directory by
hand", and Step 1 told the reader to list `.taskless/rules/sg/`. That is the
pre-fix assumption this whole change exists to remove, in agent-facing text
embedded in the bundle.
It is worse than stale. An agent following it would delete a rule directory by
hand, which skips the `.taskless/rule-metadata/<id>.yml` cleanup the CLI
performs and bypasses the ambiguity check added here. The recipe now describes
cross-engine resolution, says why deleting by hand is not equivalent, and
states that an id is not unique across engines. Topic bumped v3 to v4, which
the previous commit should have done when it changed the same file.
The ambiguous branch had no test through the command. The unit test covers
what `deleteRuleFiles` returns; it cannot catch the command wiring that
outcome to the wrong code, a malformed message, or a missing
`process.exitCode`. Added a `runCli` test beside the existing RULE_NOT_FOUND
one that seeds two engine directories, asserts `RULE_ID_AMBIGUOUS`, asserts
both paths appear in the message, and asserts both directories still exist.
The scan and the `rm` are not atomic, and that is now recorded as accepted
rather than left to look like an oversight. Closing the window needs a lock
over `.taskless/rules/`, which is a large mechanism for a local single-user
operation that no command runs concurrently with itself.
1297 tests pass, typecheck and lint clean.1 parent 31bd62d commit aa07b56
3 files changed
Lines changed: 58 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
7 | 6 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
21 | | - | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | | - | |
30 | | - | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
223 | 256 | | |
224 | 257 | | |
225 | 258 | | |
| |||
0 commit comments