Skip to main content

Crate fallow_engine

Crate fallow_engine 

Source
Expand description

Typed analysis engine boundary for fallow consumers.

fallow-core remains the internal orchestration backend. This crate owns the typed boundary that editor, API, and embedding surfaces can depend on without calling deprecated core entry points directly. Public modules should expose owned engine runners, typed result structs, or narrowly scoped aliases instead of broad core re-exports.

Re-exports§

pub use results::DeadCodeAnalysis;
pub use results::DeadCodeAnalysisArtifacts;
pub use results::DeadCodeAnalysisOutput;
pub use results::DeadCodeAnalysisWithHashes;
pub use results::DuplicationAnalysis;
pub use results::HealthAnalysisResult;
pub use results::ProjectAnalysisOutput;

Modules§

baseline
codeowners
CODEOWNERS file parser and ownership lookup.
health_ownership
Ownership risk analysis for hotspot files.
health_scoring
results
Analysis result types exposed through the engine boundary.
validate
vital_signs
Vital signs computation and snapshot persistence.

Structs§

AggregatedPluginResult
Aggregated results from all active plugins for a project.
AnalysisDiscovery
Reusable engine discovery prelude for one resolved project.
AnalysisSession
Reusable engine session for one resolved project.
AnalysisSessionArtifacts
Reusable artifacts produced by one session-owned dead-code run.
AuthorContribution
Per-author commit aggregation for a single file.
CategorizedEntryPoints
Entry points grouped by reachability role.
ChurnResult
Result of churn analysis.
CloneFingerprintSet
Report-scoped clone fingerprint assignment exposed through the engine boundary.
CombinedFinding
A combined finding where a clone instance overlaps with a dead-code issue.
ComplexityRunOptions
Normalized programmatic complexity / health inputs shared by API, NAPI, and engine-backed runners.
ComplexitySectionOptions
Input for deriving effective programmatic complexity sections.
CoordinationGapPaths
Engine-owned coordination gap between a changed contract and consumer.
CrossReferenceResult
Result of cross-referencing duplication with dead-code analysis.
DerivedComplexityOptions
Derived section selection for programmatic health / complexity runs.
DerivedHealthSections
Derived section selection for health runs.
DirectImporterSummary
Engine-owned importer details for one file that directly imports a target module.
DiscoveredFile
A discovered source file on disk.
EngineError
Error type exposed by the typed engine boundary.
EntryPoint
An entry point into the module graph.
FeatureFlagsAnalysis
Typed result from running feature flag analysis.
FileChurn
Per-file churn data collected from git history.
FileId
Compact file identifier.
FocusFileFactsPaths
Engine-owned focus facts for one changed file.
HealthCoverageInputs
Command-neutral Istanbul coverage inputs for health CRAP scoring.
HealthExecutionOptions
Command-neutral inputs needed to execute a health analysis.
HealthGateOptions
Command-neutral health exit gate options.
HealthPipelineInputs
Discovery / parse inputs the CLI resolves before calling the engine.
HealthRunOptions
Normalized health inputs shared by CLI, API, NAPI, and future runners.
HealthRunOptionsInput
Command-neutral inputs used to normalize a health run before it reaches a concrete runner.
HealthScopeInputs
Scope inputs the CLI resolves before calling the engine.
HealthSeams
CLI-supplied callbacks the command-neutral health pipeline needs.
HealthSectionOptions
Input for deriving effective health sections from command-neutral flags.
HealthSharedParseData
Pre-parsed health input reused from another analysis in the same process.
HealthThresholdOverrides
Command-neutral threshold overrides for health complexity findings.
HiddenDirScope
Package-scoped hidden directories that source discovery should traverse.
ImpactClosurePaths
Engine-owned impact closure with file ids resolved to paths.
ImportedSymbolSummary
Engine-owned symbol details for a direct import edge.
InventoryComplexity
Per-function static complexity collected alongside the inventory walk.
InventoryEntry
A single static-inventory entry for one function.
ModuleValueExport
Engine-owned snapshot of one value export in a module graph.
PartitionOrderPaths
Engine-owned review partition and dependency-sensible order.
PluginRegexValidationError
Invalid user-authored regex extracted from a plugin config file.
PluginRegistry
Registry of all available plugins.
ProjectConfig
Resolved project config plus the config file path when one was loaded.
ProjectConfigOptions
Scalar config-loading knobs for one analysis family.
RetainedModuleGraph
Engine-owned retained graph handle.
ReviewUnitPaths
Engine-owned changed-file review unit.
RuntimeCoverageOptions
Command-neutral runtime coverage input for health analysis.
RuntimeCoverageSeamInput
Inputs the runtime coverage seam needs from the analysis core.
SinceDuration
Parsed duration for the --since flag.
Suppression
A suppression directive parsed from a source comment.

Enums§

ChangedFilesError
Classification of a changed-file git failure.
ChurnTrend
Churn trend indicator based on comparing recent vs older halves of the analysis period.
DeadCodeKind
The type of dead code that overlaps with a clone instance.
EntryPointSource
Where an entry point was discovered from.
HealthSort
Command-neutral sort criteria for health complexity findings.
IssueKind
Issue kind for suppression matching.

Constants§

AMBIENT_GIT_ENV_VARS
Environment variables that describe an enclosing git operation’s repository state and should not leak into fallow-owned git subprocesses.
FINGERPRINT_PREFIX
PRODUCTION_EXCLUDE_PATTERNS
SOURCE_EXTENSIONS

Traits§

HealthGroupResolver
Command-neutral grouping resolver contract for --group-by health output.

Functions§

analyze
Run dead-code analysis for a resolved config.
analyze_churn
Analyze git churn for files under root.
analyze_churn_cached
Analyze churn with disk caching.
analyze_feature_flags
Run feature flag analysis for a resolved project config.
analyze_retaining_modules
Run dead-code analysis while retaining module and file artifacts.
analyze_with_file_hashes
Run dead-code analysis with source hashes for drift-sensitive fixers.
analyze_with_parse_result
Run dead-code analysis from pre-parsed modules.
analyze_with_trace
Run dead-code analysis with trace timings and retained graph artifacts.
analyze_with_usages
Run dead-code analysis with export usage collection for a resolved config.
analyze_with_usages_and_complexity
Run dead-code analysis with export usage and retained complexity artifacts.
builtin_env_prefixes
Built-in environment variable prefixes treated as feature flags.
builtin_plugin_names
Names of every built-in framework plugin in registry order.
builtin_sdk_providers
Distinct built-in SDK provider labels, in declaration order.
changed_files
Resolve changed files for a git ref relative to a project root.
clear_ambient_git_env
Strip ambient git repository-state environment variables from a Command.
clone_fingerprint
Compute the stable fingerprint for a clone group.
collect_plugin_hidden_dir_scopes
Collect plugin-derived hidden directory scopes.
config_for_project
Resolve the analysis config for a project.
config_for_project_analysis
Resolve config for a specific analysis without depending on the CLI crate.
cross_reference
Cross-reference duplication findings with dead-code analysis results.
derive_complexity_sections
Derive effective programmatic health / complexity section flags.
derive_health_run_options
Normalize health run inputs into the engine-owned run contract.
derive_health_sections
Derive effective health section flags for CLI and embedders.
derive_security_severity
Derive the review-priority severity for a security candidate.
discover_entry_points
Discover configured and inferred entry points.
discover_files
Discover source files for a resolved config.
discover_files_with_additional_hidden_dirs
Discover source files with additional package-scoped hidden directories.
discover_files_with_plugin_scopes
Discover source files for a resolved config, including plugin scopes.
discover_plugin_entry_points
Discover entry points from plugin results.
discover_workspace_entry_points
Discover entry points for a workspace package.
dominant_identifier
Return the best-effort dominant identifier for a clone group.
emit_error
Emit an error as structured JSON on stdout when --format json is active, then return the given exit code. For non-JSON formats, emit to stderr as usual.
execute_health_inner
Run the command-neutral health analysis pipeline.
export_lines_for_changed_paths
Compute changed-file export line anchors without exposing graph nodes.
filter_by_changed_files
Scope dead-code results to findings affected by changed files.
filter_duplication_by_changed_files
Scope duplication groups to clone groups touching at least one changed file.
filter_results_by_changed_files
Scope dead-code results to findings affected by changed files.
filter_to_workspaces
Scope dead-code results to the union of the given workspace roots.
find_duplicates
Run duplication detection on a discovered file set.
find_duplicates_touching_files_with_defaults
Run focused duplication detection and include metadata about built-in ignored files.
find_duplicates_with_defaults
Run duplication detection and include metadata about built-in ignored files.
fingerprint_for_fragment
Compute a clone fingerprint directly from a representative source fragment.
focus_facts_for_changed_paths
Compute path-resolved focus graph facts for absolute changed paths.
format_plugin_regex_errors
Format plugin regex validation errors for user-facing diagnostics.
get_changed_files
Get changed files if git can resolve them, otherwise return None.
health_shared_parse_data_from_artifacts
Build health shared parse data from retained dead-code artifacts.
impact_closure_for_changed_paths
Compute a path-resolved impact closure for absolute changed paths.
internal_consumers_for_changed_paths
Compute direct non-diff internal consumer counts for absolute changed paths.
is_allowed_hidden_dir
Check if a hidden directory name is on the discovery allowlist.
is_file_suppressed
Check if the entire file is suppressed for issue types that do not have line numbers.
is_git_repo
Check whether root is inside a git repository.
is_suppressed
Check if a specific issue at a given line should be suppressed.
module_value_exports
Return value exports with test-reference state without exposing graph node internals to downstream crates.
parse_since
Parse a --since value into a git-compatible duration.
partition_order_for_changed_paths
Compute path-resolved partition order for absolute changed paths.
public_api_package_entry_points
Compute the exports-aware public API entry-point set for a project graph.
recompute_stats
Recompute duplication statistics after clone groups have been filtered.
refresh_clone_families
Refresh clone-family and mirrored-directory fields after clone groups change.
resolve_cache_max_size_bytes
Resolve the parse-cache size limit for a resolved config.
resolve_git_common_dir
Resolve the canonical git common directory for cwd.
resolve_git_toplevel
Resolve the canonical git toplevel for cwd.
run_ungrouped_health
Run health analysis without a presentation grouping resolver.
security_catalogue_title
Return the human-readable title for a security catalogue identifier.
set_churn_spawn_hook
Install a spawn hook for git churn analysis.
set_spawn_hook
Install a spawn-hook for changed-file git subprocesses.
source_token_kinds_equivalent
Compare two JS/TS sources by duplicate-token kind sequence.
trace_clone
Trace duplicate-code groups that contain a source location.
trace_clone_by_fingerprint
Trace a duplicate-code group by its stable content fingerprint.
trace_dependency
Trace where a dependency is used.
trace_export
Trace why an export is considered used or unused.
trace_file
Trace all graph edges for a file.
trace_impact_closure
Trace the impact closure for a file.
trace_symbol_chain
Run symbol-level call-chain tracing through the engine boundary.
try_get_changed_diff
Return the raw git diff for a ref.
try_get_changed_files
Get files changed since a git ref.
try_get_changed_files_with_toplevel
Get changed files and the git toplevel used to resolve them.
validate_coverage_root_absolute
Validate that a coverage-data root is absolute under Unix or Windows path conventions.
validate_git_ref
Validate a user-supplied git ref before passing it to git.
validate_health_churn_file
Validate an explicit --churn-file up front so a malformed import is a loud hard error rather than a silent hotspot skip. Runs before the pipeline, and only when churn would actually be consumed (--hotspots / --targets; --ownership is subsumed because the dispatch layer sets hotspots = hotspots || ownership before building HealthExecutionOptions), so an inert --churn-file on a non-churn run is not penalized.
walk_source
Walk source and emit engine-owned function inventory entries.
walk_source_with_complexity
Walk source once and emit inventory entries plus static complexity by source hash.

Type Aliases§

CloneTrace
DependencyTrace
EngineResult
Result alias for typed engine operations.
ExportReference
ExportTrace
FileTrace
ImpactClosureGap
ImpactClosureTrace
PipelineTimings
ReExportChain
TracedCloneGroup
TracedExport
TracedReExport