Commit eb648b4
committed
feat: add preflight checks for path length, disk space, and write permission
Before loading configuration, ValidateRunDirectories() now runs three
pre-flight checks that all map to exit code 2:
1. Path-length check: the constructed Reports/<label> path is validated
against the OS limit via PathValidator.ValidateAbsolutePathLengthOrThrow()
(260 chars on Windows, 1024 on macOS, 4096 on Linux).
2. Disk-space check (CheckDiskSpaceOrThrow): requires at least 100 MB free
on the target drive via DriveInfo; best-effort skip when drive info is
unavailable (network shares, virtual drives).
3. Write-permission check (CheckReportsParentWritableOrThrow): creates and
deletes a temporary probe file in the Reports/ parent directory to confirm
write access before any real output is produced.
Added IOException and UnauthorizedAccessException catches to
TryValidateAndBuildRunArguments so all three failures produce exit code 2.
Both new helpers are internal static for direct unit testing.
Tests added to ProgramRunnerTests:
- RunAsync_WhenReportsFolderPathExceedsOsLimit_ReturnsInvalidArgumentsExitCode
- CheckDiskSpaceOrThrow_WithSufficientFreeSpace_DoesNotThrow
- CheckReportsParentWritableOrThrow_WhenDirectoryIsReadOnly_ThrowsUnauthorizedAccessException
Updated README.md (EN+JA) and CHANGELOG.md (EN+JA).
https://claude.ai/code/session_0174R4FzjudFBdynScKbhX6m1 parent 5fe9fec commit eb648b4
4 files changed
Lines changed: 202 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| 255 | + | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
495 | 577 | | |
496 | 578 | | |
497 | 579 | | |
| |||
0 commit comments