Skip to main content

Crate fallow_api

Crate fallow_api 

Source
Expand description

Programmatic API contract types for fallow.

Runtime execution for dead-code and duplication lives here. Health output assembly is also API-owned, with the concrete runner injected while the remaining health pipeline moves out of the CLI crate. This crate owns the CLI-independent option, error, and output contracts so NAPI, future Rust embedders, and the engine facade can share them without depending on the CLI crate.

Re-exports§

pub use audit_output::AuditAttribution;
pub use audit_output::AuditCodeClimateOutputInput;
pub use audit_output::AuditJsonHeaderInput;
pub use audit_output::AuditJsonOutputInput;
pub use audit_output::AuditSarifOutputInput;
pub use audit_output::AuditSummary;
pub use audit_output::AuditVerdict;
pub use audit_output::build_audit_codeclimate;
pub use audit_output::build_audit_codeclimate_issues;
pub use audit_output::build_audit_header_json;
pub use audit_output::build_audit_header_map;
pub use audit_output::build_audit_sarif;
pub use audit_output::serialize_audit_json;
pub use combined_output::CombinedCheckJsonSection;
pub use combined_output::CombinedJsonOutputInput;
pub use combined_output::serialize_combined_dupes_json;
pub use combined_output::serialize_combined_health_json;
pub use combined_output::serialize_combined_json;
pub use compact_output::build_compact_lines;
pub use compact_output::build_duplication_compact_lines;
pub use compact_output::build_grouped_compact_lines;
pub use compact_output::build_health_compact_lines;
pub use dead_code_codeclimate::build_codeclimate;
pub use dead_code_sarif::build_sarif;
pub use dupes_output::AttributedCloneGroup;
pub use dupes_output::AttributedCloneGroupFinding;
pub use dupes_output::AttributedInstance;
pub use dupes_output::CloneFamilyFinding;
pub use dupes_output::CloneGroupFinding;
pub use dupes_output::DupesReportPayload;
pub use dupes_output::DuplicationGroup;
pub use dupes_output::DuplicationGrouping;
pub use dupes_output::build_duplication_codeclimate;
pub use editor::ChangedFilesError;
pub use editor::EditorAnalysisOutput;
pub use editor::EditorAnalysisResults;
pub use editor::EditorAnalysisSession;
pub use editor::EditorCloneFamily;
pub use editor::EditorCloneFingerprintSet;
pub use editor::EditorCloneGroup;
pub use editor::EditorCloneInstance;
pub use editor::EditorDeadCodeAnalysisOutput;
pub use editor::EditorDuplicationReport;
pub use editor::EditorDuplicationStats;
pub use editor::EditorInlineComplexityExceeded;
pub use editor::EditorInlineComplexityFinding;
pub use editor::EditorMirroredDirectory;
pub use editor::EditorProjectAnalysisOutput;
pub use editor::EditorRefactoringKind;
pub use editor::EditorRefactoringSuggestion;
pub use editor::collect_inline_complexity;
pub use editor::editor_duplicates;
pub use editor::editor_extract;
pub use editor::editor_results;
pub use editor::editor_security;
pub use editor::editor_suppress;
pub use editor::filter_inline_complexity_by_changed_files;
pub use editor::resolve_git_toplevel;
pub use editor::try_get_changed_files_with_toplevel;
pub use explain::CHECK_RULES;
pub use explain::DUPES_RULES;
pub use explain::FLAGS_RULES;
pub use explain::HEALTH_RULES;
pub use explain::RuleDef;
pub use explain::RuleGuide;
pub use explain::SECURITY_RULES;
pub use explain::coverage_analyze_meta;
pub use explain::coverage_setup_meta;
pub use explain::explain_issue_type;
pub use explain::rule_by_id;
pub use explain::rule_by_token;
pub use explain::rule_docs_url;
pub use explain::rule_guide;
pub use explain::security_meta;
pub use explain::serialize_explain_programmatic_json;
pub use explain::unknown_explain_error;
pub use grouped_output::ResultGroup;
pub use grouped_output::UNOWNED_GROUP_LABEL;
pub use grouped_output::build_duplication_grouping_with;
pub use grouped_output::group_analysis_results_with;
pub use grouped_output::largest_clone_group_owner_with;
pub use health_codeclimate::build_health_codeclimate;
pub use json_output::CheckJsonExtraOutputs;
pub use json_output::CheckJsonOutputInput;
pub use json_output::CheckJsonPayloadInput;
pub use json_output::DuplicationJsonOutputInput;
pub use json_output::GroupedCheckJsonOutputInput;
pub use json_output::GroupedDuplicationJsonOutputInput;
pub use json_output::serialize_check_json;
pub use json_output::serialize_check_json_payload;
pub use json_output::serialize_duplication_json;
pub use json_output::serialize_grouped_check_json;
pub use json_output::serialize_grouped_duplication_json;
pub use list_output::ListJsonEnvelope;
pub use list_output::ListJsonOutputInput;
pub use list_output::build_list_json_output;
pub use list_output::serialize_list_json_output;
pub use markdown_output::build_duplication_markdown;
pub use markdown_output::build_grouped_markdown;
pub use markdown_output::build_health_markdown;
pub use markdown_output::build_markdown;
pub use markdown_output::build_walkthrough_markdown;
pub use output_contracts::AuditOutput;
pub use output_contracts::BoundariesListLogicalGroup;
pub use output_contracts::BoundariesListRule;
pub use output_contracts::BoundariesListZone;
pub use output_contracts::BoundariesListing;
pub use output_contracts::CombinedOutput;
pub use output_contracts::FallowOutput;
pub use output_contracts::ListBoundariesOutput;
pub use output_contracts::ListEntryPointOutput;
pub use output_contracts::ListOutput;
pub use output_contracts::ListPluginOutput;
pub use output_contracts::SecurityGate;
pub use output_contracts::SecurityOutput;
pub use output_contracts::SecurityOutputConfig;
pub use output_contracts::SecuritySummaryOutput;
pub use output_contracts::WorkspacesOutput;
pub use runtime::AuditProgrammaticKeySnapshot;
pub use runtime::AuditProgrammaticOutput;
pub use runtime::BoundaryViolationsOutput;
pub use runtime::BoundaryViolationsProgrammaticOutput;
pub use runtime::CircularDependenciesOutput;
pub use runtime::CircularDependenciesProgrammaticOutput;
pub use runtime::CombinedProgrammaticOutput;
pub use runtime::DeadCodeOutput;
pub use runtime::DeadCodeProgrammaticOutput;
pub use runtime::DecisionSurfaceProgrammaticOutput;
pub use runtime::DuplicationOutput;
pub use runtime::DuplicationProgrammaticOutput;
pub use runtime::EngineHealthRunner;
pub use runtime::FeatureFlagsOutput;
pub use runtime::FeatureFlagsProgrammaticOutput;
pub use runtime::HealthJsonReportInput;
pub use runtime::HealthProgrammaticOutput;
pub use runtime::ProgrammaticHealthAnalysis;
pub use runtime::ProgrammaticHealthNextStepFacts;
pub use runtime::ProgrammaticHealthRun;
pub use runtime::ProgrammaticHealthRunner;
pub use runtime::TraceCloneOutput;
pub use runtime::TraceCloneProgrammaticOutput;
pub use runtime::TraceDependencyOutput;
pub use runtime::TraceDependencyProgrammaticOutput;
pub use runtime::TraceExportOutput;
pub use runtime::TraceExportProgrammaticOutput;
pub use runtime::TraceFileOutput;
pub use runtime::TraceFileProgrammaticOutput;
pub use runtime::run_audit;
pub use runtime::run_boundary_violations;
pub use runtime::run_circular_dependencies;
pub use runtime::run_combined;
pub use runtime::run_complexity_with_runner;
pub use runtime::run_dead_code;
pub use runtime::run_decision_surface;
pub use runtime::run_duplication;
pub use runtime::run_feature_flags;
pub use runtime::run_health;
pub use runtime::run_health_with_runner;
pub use runtime::run_trace_clone;
pub use runtime::run_trace_dependency;
pub use runtime::run_trace_export;
pub use runtime::run_trace_file;
pub use runtime::serialize_health_report_json;
pub use sarif_output::annotate_sarif_results;
pub use sarif_output::build_duplication_sarif;
pub use sarif_output::build_grouped_duplication_sarif;
pub use sarif_output::build_health_sarif;
pub use security_output::SecurityGateMode;

Modules§

audit_keys
audit_output
Shared audit JSON payload contracts for programmatic consumers.
ci_output
Compatibility re-exports for CI output builders now owned by fallow-output.
combined_output
Combined JSON output assembly shared by CLI and programmatic consumers.
compact_output
dead_code_codeclimate
Shared dead-code CodeClimate issue construction.
dead_code_sarif
Shared dead-code SARIF output assembly.
decision_surface
Decision-surface extractor (stage 6 / 6.G): THE product.
dupes_output
Shared duplication JSON payload contracts for programmatic consumers.
editor
Editor-facing analysis contracts shared by LSP and future editor adapters.
explain
Metric and rule definitions for explainable CLI output.
grouped_output
Shared grouped-output builders for programmatic and CLI consumers.
health_codeclimate
Shared health CodeClimate issue construction.
json_output
Shared JSON output assembly for CLI and programmatic consumers.
list_output
Shared list command JSON output assembly.
markdown_output
output_contracts
Concrete output-contract aliases shared by schema and adapter crates.
review_deltas
Diff-aware deterministic deltas for the review brief (6.A).
routing
Ownership-aware reviewer routing (6.D).
runtime
Programmatic runtime entry points that avoid depending on fallow-cli.
sarif_output
Shared SARIF output assembly for health and duplication reports.
security_output
Shared security JSON payload contracts for programmatic consumers.

Structs§

AnalysisOptions
Shared options for all one-shot analyses.
AuditOptions
Options for changed-code audit analysis.
BoundaryData
Owned boundary listing data shared by CLI and programmatic renderers.
CiIssue
Normalized CodeClimate issue used by CI comment renderers.
CloneTrace
Result of tracing a clone: all groups containing the code at a source location or addressed by a stable clone fingerprint.
CombinedOptions
Options for bare combined analysis through the programmatic API.
ComplexityCoverageInputs
Coverage inputs accepted by the programmatic API.
ComplexityOptions
Options for complexity / health analysis.
ComplexityRunOptions
Normalized programmatic complexity / health inputs owned by fallow-api.
ComplexitySectionOptions
Input for deriving effective programmatic complexity sections.
ComplexityThresholdOverrides
Health threshold overrides accepted by the programmatic API.
DeadCodeFilters
Issue-type filters for the dead-code analysis.
DeadCodeOptions
Options for dead-code-oriented analyses.
DecisionSurfaceOptions
Options for changed-code decision-surface analysis.
DependencyTrace
Result of tracing a dependency: where it is used.
DerivedComplexityOptions
Derived section selection for programmatic health / complexity runs.
DerivedHealthSections
Derived section selection for health runs.
DuplicationOptions
Options for duplication analysis.
ExportReference
A direct reference to an export.
ExportTrace
Result of tracing an export: why it is considered used or unused.
FeatureFlagsOptions
Options for feature-flag analysis.
FileTrace
Result of tracing all edges for a file.
GroupedReviewIssues
HealthSectionOptions
Input for deriving effective health sections from API-owned flags.
ListBoundariesOptions
Options for fallow list --boundaries through the programmatic API.
ListBoundariesProgrammaticOutput
Typed output for fallow list --boundaries before JSON serialization.
LogicalGroupInfo
View-model mirror of LogicalGroup with derived file-count totals.
PrCommentRenderInput
Inputs for rendering a sticky PR/MR summary comment.
ProgrammaticAnalysisContext
Resolved common programmatic analysis context.
ProgrammaticError
Structured error surface for the programmatic API.
ProjectInfoOptions
Options for MCP/project metadata listing through the programmatic API.
ProjectInfoProgrammaticOutput
Typed output for project metadata listing before JSON serialization.
ReExportChain
A re-export chain showing how an export is propagated.
ReviewCommentRenderInput
ReviewEnvelopeRenderInput
Inputs for rendering a GitHub/GitLab review envelope.
ReviewEnvelopeRenderResult
Rendered review envelope plus side-channel signals for CLI telemetry.
ReviewEnvelopeTruncation
Truncation signals produced while rendering a review envelope.
ReviewGitlabDiffRefs
GitLab diff refs for a review-envelope position.
RuleInfo
TraceCloneOptions
Options for duplicate-code trace analysis.
TraceDependencyOptions
Options for dependency trace analysis.
TraceExportOptions
Options for export trace analysis.
TraceFileOptions
Options for file trace analysis.
TracedCloneGroup
One clone group returned from a clone trace request.
TracedExport
An export with usage information.
TracedReExport
A re-export with source information.
ZoneInfo

Enums§

AuditGate
CiProvider
Supported CI review providers for generated comments.
ComplexitySort
Sort criteria for complexity findings.
DuplicationMode
Programmatic duplication mode selection.
OwnershipEmailMode
Privacy mode for ownership-aware hotspot output.
RootEnvelopeMode
JSON root envelope discriminator policy.
TargetEffort
Effort filter for refactoring targets.
TraceCloneTarget
Duplicate-code trace target.

Constants§

COMMON_ANALYSIS_OPTION_FLAGS
MARKER_PREFIX_V2
Marker prefix appended to every v2 review-comment body.
MARKER_SUFFIX_V2
Closing of the v2 marker, after the fingerprint string.
MAX_COMMENT_BODY_BYTES
PROJECT_LEVEL_RULE_IDS
Rule ids whose findings describe project-wide config state rather than a change touching a specific source line.

Functions§

boundary_data_to_output
Convert boundary listing data to the stable output contract.
cap_body_with_marker
command_title
composite_fingerprint
compute_boundary_data
Compute boundary listing data from resolved config and optional discovery.
derive_complexity_options
Derive effective programmatic health / complexity section flags.
derive_complexity_run_options
Normalize public API complexity options into engine-owned run contracts.
derive_complexity_sections
Derive effective programmatic health / complexity section flags.
derive_health_sections
Derive effective health section flags for API consumers.
escape_md
Escape a string for inclusion in a Markdown table cell.
github_check_conclusion
group_review_issues_by_path_line
Group consecutive same-(path, line) issues. Input is already sorted by (path, line, fingerprint) so a single linear pass collects runs.
is_project_level_rule
issues_from_codeclimate
issues_from_codeclimate_issues
render_pr_comment
render_review_comment_for_group
Render one comment from a group of issues sharing the same (path, line).
render_review_envelope
Render a provider-specific review envelope from typed CI issues.
resolve_programmatic_analysis_context
Resolve common programmatic analysis options once for a concrete runtime.
review_label_from_codeclimate
run_list_boundaries
Run list_boundaries through the API-owned runtime path.
run_project_info
Run project metadata listing through the API-owned runtime path.
serialize_audit_programmatic_json
Serialize typed audit output into the stable JSON compatibility contract.
serialize_boundary_violations_programmatic_json
Serialize typed boundary-family output into the JSON compatibility contract.
serialize_circular_dependencies_programmatic_json
Serialize typed circular-dependency output into the JSON compatibility contract.
serialize_combined_programmatic_json
Serialize typed combined output into the stable JSON compatibility contract.
serialize_dead_code_programmatic_json
Serialize typed dead-code output into the stable JSON compatibility contract.
serialize_decision_surface_programmatic_json
Serialize typed decision-surface output into the stable JSON contract.
serialize_duplication_programmatic_json
Serialize typed duplication output into the JSON compatibility contract.
serialize_feature_flags_programmatic_json
Serialize typed feature-flag output into the JSON compatibility contract.
serialize_health_programmatic_json
Serialize typed health / complexity output into the JSON compatibility contract.
serialize_list_boundaries_programmatic_json
Serialize typed boundary-list output to the stable JSON contract.
serialize_project_info_programmatic_json
Serialize typed project-info output to the stable JSON contract.
serialize_trace_clone_programmatic_json
Serialize typed clone-trace output into the JSON compatibility contract.
serialize_trace_dependency_programmatic_json
Serialize typed dependency-trace output into the JSON compatibility contract.
serialize_trace_export_programmatic_json
Serialize typed export-trace output into the JSON compatibility contract.
serialize_trace_file_programmatic_json
Serialize typed file-trace output into the JSON compatibility contract.
summary_fingerprint
summary_label
validate_complexity_options
Validate programmatic complexity / health inputs before invoking a concrete runner.