Skip to main content

Module scan

Module scan 

Source
Expand description

Parallel repository scan: walk + hash + extract in one pass, with checkpointed caches so interrupted runs resume.

Scanner invariants:

  • Monotonic resume: the collector seeds from the previous cache and checkpoints a superset; deleted files are pruned only at the successful final save. Interrupting a resume run never loses prior progress.
  • Racy-mtime guard: a file whose mtime is not strictly older than the cache’s saved_at is never stat-trusted (git’s racily-clean rule); (0, 0) mtimes are never trusted either.
  • Cache failures degrade: an unwritable .radar/ costs persistence, never the scan (warn once, keep going).
  • Parse cache is keyed by (lang, hash) - identical bytes in different languages parse differently.

Structs§

LangStats
ScanOpts
ScanStats

Functions§

scan
Run a full scan of opts.root, reusing and updating .radar/state.bin.
scan_full
Like scan, but also returns the final in-memory cache (used by radar map/check so they never depend on cache persistence).