Expand description
Workspace discovery — the first cross-trust-boundary phase.
Given a workspace root, walk the filesystem with the ignore crate (the
same engine ripgrep uses), classify each directory as a component,
module, or environment, and emit an ordered, deterministic
Discovered structure for the loader and Terragrunt resolver to
consume.
No HCL parsing happens here — only a regex-grade shallow probe of file bytes (per 11-discovery.md § 3.3) that the loader will redo definitively.
This module is the first slice of code that touches user-controlled filesystem state. Every byte off disk is treated as hostile per 70-security.md § 1: paths are NUL-rejected, canonicalised, and verified to remain underneath the workspace root before any open.
Structs§
- Discovered
- Output of
crate::discovery::Discoverer::discover. - Discovered
Dir - A single discovered directory.
- Discovered
File - A single source file discovered inside a
DiscoveredDir. - Discovery
Options - Discovery configuration (caps, excludes, classification hints).
- FsDiscoverer
- Default
Discovererimplementation.
Enums§
- Classification
Reason - Why the classifier picked the kind it did. Surfaced in
Discovered.diagnosticsand in CLI verbose output for auditability. - DirKind
- What kind of directory the walker thinks it is.
- Glob
Config Error - Errors raised while compiling user-supplied glob patterns.
Constants§
- MAX_
DISCOVERY_ THREADS - Cap on walker thread count. Per [11-discovery.md § 3.5], beyond 8 the fs metadata calls saturate on macOS APFS / Linux ext4. The current sequential walker uses one thread; the cap is reserved for the parallel implementation that lands in Phase 9.
- MAX_
GLOB_ PATTERN_ BYTES - Hard cap on the byte length of any user-supplied glob pattern, per
70-security.md § 3.4. Beyond this length
regex compilation is rejected before reaching
globset.
Traits§
- Discoverer
- Trait every discoverer implements. The default impl is
FsDiscoverer; downstream tests / embedders may supply an in-memory variant by implementing this trait directly.
Functions§
- compile_
glob_ set - Compile a user-supplied glob list into a
GlobSet, applying the length cap from 70-security.md § 3.4.