Harden scanner accounting and expose controlled scan reports

This commit is contained in:
2026-10-09 18:28:48 -04:00
parent 9c8d1d43fd
commit 8b177e21a0
9 changed files with 839 additions and 179 deletions
+18 -3
View File
@@ -35,9 +35,24 @@ sized [path]
```
### Key Concepts
- **Disk Usage** (Default): The actual physical space consumed on disk (Blocks * 512 bytes). This is the "true" footprint and the metric `sized` prioritizes.
- **Disk Usage** (Default): Filesystem-reported allocation (Blocks * 512 bytes), with hard links counted once per scan. Shared extents and snapshots can make this differ from the space recovered by deletion.
- **Apparent Size**: The logical size of the entry (file length). Available via the `-a` or `--apparent` flag.
- **Blocks**: The actual filesystem blocks allocated.
- **Blocks**: Filesystem-reported 512-byte units of allocation. Directory metadata is included.
Symlinks are scanned as leaves, including dangling links; their targets are not
followed. Missing targets or unreadable entries are reported on stderr. Partial
scans return a nonzero exit status and JSON includes `complete: false`; inspect
that status before relying on a total.
### Filesystem Boundary (`-x` / `--one-file-system`)
Skip entries whose device differs from the scan root, useful when a directory
contains mounted filesystems. Boundary entries contribute no size, and JSON
marks them with `skipped_mount`.
```bash
sized -x /path/to/volume
```
### Path Display
- **Relative Path** (Default): `sized` shows paths relative to the current directory.
@@ -53,7 +68,7 @@ sized -d 1
```
> [!NOTE]
> Regardless of the display depth, `sized` always calculates the *total* size of all subdirectories accurately by traversing the entire tree.
> Display depth limits output, not scanning. The tree is traversed unless filtered or excluded by a filesystem boundary; scan errors mark totals incomplete.
## Filtering and Sorting