Skip to content

Inventory

The inventory phase is a read-only scan. It traverses a directory, hashes every file, and produces a structured manifest. No files are modified, moved, or renamed. This is observation only.

Every file in the target directory receives a record with the following fields:

FieldSourcePurpose
pathFilesystemAbsolute path at scan time
sizeFilesystemFile size in bytes
mtimeFilesystemLast modification timestamp
ctimeFilesystemCreation timestamp (where supported)
blake3ComputedPrimary content hash, canonical identifier
sha256ComputedSecondary hash for cross-tool verification
mime_typepython-magicDetected MIME type from file content
extensionFilesystemFile extension, lowercased
depthComputedDirectory depth relative to scan root
sync_statePlatform adapteriCloud sync status (macOS) or null

BLAKE3 is the canonical identifier. Two files with the same BLAKE3 hash are the same file, regardless of name or location. SHA256 exists for compatibility with external archival tools. See Content Hash as Identity for the rationale.


Terminal window
fialr scan ~/Documents

The scan walks the directory tree, computes both hashes for every file, detects MIME types, and writes the results to a job directory.

Output to the terminal includes:

  • Total file count
  • Total size (human-readable)
  • Extension distribution (top extensions by count)
  • Exclusion summary (count per exclusion layer)

The scan produces a manifest.json inside the job directory:

jobs/2026-03-11_scan_a1b2c3d4/
manifest.json
log.json
report.md

manifest.json contains the full file list with all fields from the table above. log.json records every operation performed during the scan. report.md is a human-readable summary.


On macOS, fialr interacts with iCloud Drive through the platform adapter:

  1. Sync pause. Before scanning, fialr pauses iCloud sync using brctl pause com.apple.CloudDocs. This prevents sync activity from modifying files mid-scan.
  2. Sync resume. After scanning completes (or if the scan is interrupted), sync is resumed.
  3. Evicted file detection. Files with the iCloud downloading extended attribute are skipped. These are cloud-only placeholders with no local content to hash. They are recorded in the manifest with their sync state, but no hash is computed.

This behavior is handled entirely by the macOS platform adapter. Core modules never reference sys.platform directly.


fialr uses a four-layer exclusion system. Each layer is evaluated in order. A file excluded at any layer is recorded in the manifest with the exclusion reason, but receives no hash computation.

LayerSourceExamplesOverridable
1. HardcodedBuilt into fialr.git/, node_modules/, .venv/, __pycache__/, .ssh/, .gnupg/, project rootsNo
2. Config directoriesfialr.toml exclude_dirsExplicit paths to skipYes
3. Config patternsfialr.toml exclude_patternsGlob/regex patternsYes
4. XATTR/sentinelPer-file or per-directory opt-outcom.fialr.exclude XATTR or .fialr-exclude sentinel fileYes

Nothing is silently skipped. Every excluded file appears in manifest.json with an exclusion_reason field identifying which layer and which rule triggered the exclusion.

To exclude a directory from all future scans, place a .fialr-exclude file in it:

Terminal window
touch ~/Documents/vendor-archives/.fialr-exclude

Or set the XATTR on individual files:

Terminal window
xattr -w com.fialr.exclude true ~/Documents/legacy/old-backup.zip

The manifest produced by inventory is the input for classification. No files have been modified. The scan is the foundation for every subsequent phase.

For the full command reference, see fialr scan.