Skip to main content

Module discovery

Module discovery 

Source

Structs§

DiscoveredEntry
A file found during a full-filesystem walk (all files, not just known-language ones).
DiscoveredFile
A file found during directory traversal that has a recognized language extension.
DiscoveryLimits
Resource ceilings applied DURING the filesystem walk, before any in-memory index build commits to the discovered set. Bounding the streaming walk (not the post-collection Vec) is what keeps a huge but non-sensitive tree from OOM-ing or panicking the reload: we stop and return a graceful error the moment either ceiling is crossed, instead of collecting megabytes of paths and then letting LiveIndex::load blow the memory bound.
ScoutCapacityError
A candidate scout refused before a manifest exists because a catalog budget was exhausted. This is operational freshness state, never a manifest issue.
ScoutPlan
Immutable metadata-first observation consumed by later content execution.
SourceExclusions
Canonical repository-relative subtrees that are outside source scope.

Constants§

EXCLUDE_UNTRACKED_ENV
Env var gating the SF-009 opt-in “exclude untracked” admission policy. Default OFF — when unset (or set to anything other than a truthy value) the index admits files exactly as before, so admission defaults are unchanged.
INDEX_GENERATED_OUTPUT_ENV
Env var opting back INTO full indexing of untracked generated-output directories (F5). Default OFF — when unset, files under an untracked directory matching is_generated_output_dir_name are demoted to Tier-2 metadata-only. Set to a truthy value (1, true, yes, on) to restore the previous behavior (full Tier-1 admission).
WORKSPACE_ROOT_ENV
Environment override for the project root used by cold-start discovery.

Functions§

classify_admission
Classify a file’s admission tier. Returns AdmissionDecision with both tier and reason.
discover_all_files
Discover ALL files under root regardless of extension, for admission-gate classification.
discover_all_files_with_exclusions
discover_files
Discover all source files under root that have a recognized language extension.
discover_files_with_exclusions
exclude_untracked_enabled
Returns true when the opt-in SYMFORGE_EXCLUDE_UNTRACKED policy is enabled.
find_project_root
Walk upward from the current working directory, looking for a .git directory. Returns None if no git root is found and the cwd is a forbidden directory.
is_binary_content
Check if content appears to be binary. Examines up to BINARY_SNIFF_BYTES of the content using three heuristics:
is_generated_output_dir_name
Conservative name heuristic for machine-generated output directories.
load_gitignore
Load all .gitignore patterns from a repository root and nested directories.
parse_root_uri
Convert an MCP roots/list URI into a filesystem path.
path_admission_reason
Shared PATH+SIZE admission tiers (Feature 020 L-R10/L-G04 parity).
resolve_root_candidate
Resolve one declared source root without selecting or touching project state.
resolve_state_placement
resolve_workspace_root
Resolve the workspace root from the three resolution sources in strict precedence order, independent of process global state so it is unit-testable:
scout_repository
Build an immutable metadata-first plan without retaining file payload bytes.
scout_repository_with_exclusions
tracked_path_set_for_exclusion
Compute the set of git-tracked relative paths (forward-slash normalized) for the repository containing root, for the SF-009 exclude-untracked policy.
unsupported_language_decision
SF-004 / SF-012: reconcile a classify_admission result for a file whose extension maps to no supported tree-sitter grammar.
untracked_generated_output_demotions
F5: compute the set of discovered file paths to demote to Tier-2 because they live under an UNTRACKED generated-output directory.
workspace_root_env_override
Resolve and validate the SYMFORGE_WORKSPACE_ROOT cold-start override.