Repository navigation
Commit 397df3f
committed
fix(web/shell): #107 review — an agent run counts as applied only the changes that were, not a folder the review kept back
The bug. After levelcode-ai's review the runtime counted what it had applied as `total - rest - failed`: every
change of the set that the review neither handed back nor said it failed. shellCommit's `failed` counts FILE
changes, and when a delete fails it keeps back the removal of the folder the file was in: that rmdir is in neither
list, so it was counted as applied. `rm -r d` with two files, one delete failing: 3 - 0 - 1 = 2 for one change made.
The count reaches the visitor and the model in the notes of the part that follows the review (the folders it leaves
to the shell, which start from that count): with a folder to make whose creation fails, the stderr said "PARTLY
applied — 1 of 2 file changes" from the review and then "applied 2 of 4 file changes; stopped at /scratch/m"; a Stop
while that folder was being made said "2 of 4 were applied". One was.
The fix (runtime.js applyChanges). What the review applied is the set's files less the ones it could not apply and
less whatever else it handed back (unchanged: an entry that is not a folder of the set is still to be done, so it
was not done by the review). Folders are never the review's to apply; one it keeps out of `rest` is applied by
nobody and is no longer counted. The answer's shape is not changed and levelcode-ai is not touched: shellCommit's
`failed` is the file changes it could not apply (host.js's SpawnOptions.commit says "how many changes it could NOT
apply", and the review applies no others); README §5 now says that, and how the shell counts what was applied.
Tests. shell-runtime-commit.test.js runs levelcode-ai's real commitShellChanges as the review, answering as agent.js
hands it on, over a set of mkdir m, two deletes in d and rmdir d, with the second delete refused by the editor: the
folder it leaves cannot be made ("applied 1 of 4 file changes; stopped at /scratch/m: quota."), and a Stop while it
is being made ("1 of 4 were applied"). Both fail on abe8a25 (they say 2 of 4) and pass here. The other runtime suites
pass unchanged.1 parent ba7b046 commit 397df3f
3 files changed
Lines changed: 54 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1050 | 1050 | | |
1051 | 1051 | | |
1052 | 1052 | | |
| |||
1103 | 1103 | | |
1104 | 1104 | | |
1105 | 1105 | | |
1106 | | - | |
1107 | 1106 | | |
1108 | 1107 | | |
1109 | 1108 | | |
1110 | 1109 | | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1111 | 1116 | | |
1112 | 1117 | | |
1113 | 1118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
354 | 395 | | |
355 | 396 | | |
356 | 397 | | |
| |||
0 commit comments