Commit 7002bad
feat: Phase 0 Sealing - error recovery and visibility improvements
Fixed silent persistence failures and improved transaction rollback
error handling:
State Persistence (src/state.rs):
- Fixed 4 silent .save().ok() calls that hid state file corruption
- record_operation(): Now warns if state fails to persist
- mark_undone(): Warns on undo state save failure
- begin_transaction(): Warns on transaction start save failure
- commit_transaction(): Warns on transaction commit save failure
All warnings use colored output (bright yellow) and explain that the
operation succeeded but may not persist across restarts.
Transaction Rollback (src/commands.rs):
- Improved rollback_transaction() to collect rollback failures
- Changed from silent .ok() to proper error propagation
- Collects all failures before reporting (doesn't abort early)
- Reports detailed summary:
- Success: "Transaction rolled back: N operations" (green)
- Partial: "Partial rollback: N succeeded, M failed" (yellow)
- Lists each failed operation with path and error
- Returns error if any rollback operations fail
Benefits:
- Users now see when state persistence fails
- Transaction rollback failures are visible and actionable
- Better error messages guide debugging
- State consistency issues no longer hidden
Test results: 90/90 passing (no regressions)
Phase 0 Sealing: Component 2/6 complete (error recovery layer 1)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 90c7921 commit 7002bad
2 files changed
Lines changed: 92 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
389 | 392 | | |
390 | 393 | | |
391 | 394 | | |
392 | 395 | | |
393 | 396 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
398 | 407 | | |
399 | 408 | | |
400 | | - | |
| 409 | + | |
401 | 410 | | |
402 | 411 | | |
403 | 412 | | |
404 | | - | |
| 413 | + | |
405 | 414 | | |
406 | 415 | | |
407 | 416 | | |
408 | 417 | | |
409 | 418 | | |
410 | 419 | | |
411 | 420 | | |
412 | | - | |
413 | | - | |
414 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
415 | 428 | | |
| 429 | + | |
| 430 | + | |
416 | 431 | | |
417 | 432 | | |
418 | 433 | | |
419 | 434 | | |
420 | 435 | | |
421 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
422 | 442 | | |
423 | 443 | | |
424 | 444 | | |
425 | 445 | | |
426 | 446 | | |
427 | 447 | | |
428 | 448 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
434 | 465 | | |
435 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
436 | 476 | | |
437 | 477 | | |
438 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
196 | 204 | | |
197 | 205 | | |
198 | 206 | | |
| |||
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
217 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
218 | 234 | | |
219 | 235 | | |
220 | 236 | | |
| |||
233 | 249 | | |
234 | 250 | | |
235 | 251 | | |
236 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
237 | 261 | | |
238 | 262 | | |
239 | 263 | | |
| |||
248 | 272 | | |
249 | 273 | | |
250 | 274 | | |
251 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
252 | 284 | | |
253 | 285 | | |
254 | 286 | | |
| |||
0 commit comments