Expand description
The scan layer: walking a tree, producing observations, and applying reconciliation.
Public scans emit upsert observations, and a revalidation sweep is the diff between
what the index believes and what the filesystem says. Both speak the same
Observation vocabulary as the watch layer. A detached one-shot index may consume
equivalent parent-first directory groups privately because no observer can see its
construction; every later mutation still crosses the shared observation boundary.
§Status
The portable read_dir plus non-following metadata reference is what every listing
falls back to. Parallel scans use it on most platforms; on macOS they first try a
measured getattrlistbulk backend that returns directory entries and stat-tier
metadata together. Unsupported filesystems, malformed results, mount points, and
firmlinks fail closed to the portable path for the complete containing directory.
On Linux with glibc every route that lists a directory (the serial and concurrent
walks, revalidation, reconciliation, opened discovery) first tries a reader that
lists with raw getdents64 and stats with statx against the listing’s descriptor,
passing AT_NO_AUTOMOUNT; an open or enumeration failure, a malformed record, or a
kernel without statx falls back the same way, and the fallback’s own stats then
pass the flag too (observe_dir_entry), as does every stat of a path a route
verifies by itself (observe_path). Only the walk root is resolved through a mount
(root_device). So an autofs tree answers the same on every route and delivery.
Every backend produces the same Observation contract.
Structs§
- Reconcile
Report - Filesystem and index effects from an applying reconciliation pass.
- Scan
Backend Diagnostics - Directory enumeration backends used by one scan.
- Scan
Config - Knobs for a scan.
- Scan
Diagnostics - Opt-in, run-scoped evidence about a filesystem scan.
- Scan
Report - What a scan did, including the errors it walked past.
- Walk
Attribution - Where a walk’s time went, so “blocked” is never one undifferentiated number.
- Worker
Policy Diagnostics - Worker-controller configuration, trace, and terminal queue state.
- Worker
Policy Window - One controller evaluation over a half-open range of completed entry ordinals.
Enums§
- Scan
Order - The order directories are visited in.
- Worker
Policy Decision - Decision represented by a
WorkerPolicyWindow. - Worker
Policy Outcome - Final state of the automatic worker controller.
Constants§
- MAX_
SCAN_ BATCH_ SIZE - Largest producer batch accepted before work must be published incrementally.
- SCAN_
DIAGNOSTICS_ SCHEMA - Schema carried by
ScanDiagnostics. - WATCH_
SCOPE_ GUIDANCE - Why watching cannot narrow its structural scan boundary, said once for every surface. Ignored population is a supported retained-scope choice because control edits reconcile the governing directory and rebuild that population.
Functions§
- observe
- Read an entry’s kind and roll-up attributes out of its metadata.
- reconcile
- Reconcile the full index and publish each exact commit as it lands.
- reconcile_
handle - Reconcile a shared index while allowing readers between applied batches.
- reconcile_
pending - Drain and reconcile every pending invalidation, collapsing nested requests.
- reconcile_
pending_ handle - Drain and reconcile invalidations on a shared index.
- reconcile_
subtree - Reconcile one relative subtree, applying effective changes during the walk.
- reconcile_
subtree_ handle - Reconcile one subtree of a shared index, widening to a missing/non-directory ancestor when necessary.
- revalidate
- Diff the filesystem against an existing index and emit conditional observations.
- scan
- Walk
rootand emit observations describing everything found. - scan_
into_ index - Walk
rootand return a fully populated index. - scan_
into_ index_ with_ diagnostics - Walk
rootinto an index and retain the opt-in diagnostic trace for that run. - scan_
with_ diagnostics - Walk
root, emitting observations and a bounded run-scoped diagnostic trace.