Skip to main content

fallow_types/
lib.rs

1//! Shared types for fallow codebase intelligence.
2//!
3//! This crate contains type definitions used across multiple fallow crates
4//! (core, CLI, LSP). It has no analysis logic, only data structures.
5
6#![warn(missing_docs)]
7#![cfg_attr(
8    test,
9    allow(
10        clippy::unwrap_used,
11        clippy::expect_used,
12        reason = "tests use unwrap and expect to keep fixture setup concise"
13    )
14)]
15
16/// Typed audit cache-key inputs.
17pub mod audit_cache;
18/// Shared churn output contracts.
19pub mod churn;
20/// File discovery types: discovered files, file IDs, and entry points.
21pub mod discover;
22/// Shared duplicate-code output contracts.
23pub mod duplicates;
24/// JSON-output envelope and utility types: `SchemaVersion`, `ToolVersion`,
25/// `ElapsedMs`, `AuditIntroduced`, plus the shared `Meta`, `BaselineDeltas`,
26/// `BaselineMatch`, `RegressionResult`, `EntryPoints`, and `CheckSummary`
27/// shapes referenced by every per-command envelope. The structs are always
28/// compiled (the JSON emission layer constructs them at runtime); the
29/// `schemars::JsonSchema` derive is gated per-struct on the `schema` feature.
30pub mod envelope;
31/// Module extraction types: exports, imports, re-exports, and member info.
32pub mod extract;
33/// Shared issue-type contract metadata used by CLI, LSP, MCP, and suppression
34/// helpers.
35pub mod issue_meta;
36/// Machine-readable manifest of the fallow MCP server's tools, shared by
37/// `fallow schema` and the telemetry tool-name allowlist; kept in sync with
38/// the live tool router by a drift test in `crates/mcp`.
39pub mod mcp_manifest;
40/// JSON-output augmentation types: `IssueAction` enum + variants.
41/// Schema-side counterpart of the augmentations the JSON layer adds to each
42/// dead-code finding. The structs are always compiled (typed dead-code
43/// wrappers in [`output_dead_code`] consume them at runtime); the
44/// `schemars::JsonSchema` derive is gated per-struct on the `schema`
45/// feature.
46pub mod output;
47/// Typed envelope wrappers for the simple 1:1 dead-code findings
48/// (`UnusedFile`, `PrivateTypeLeak`, `UnresolvedImport`, `CircularDependency`,
49/// `BoundaryViolation`). Each wrapper flattens the bare finding via
50/// `#[serde(flatten)]` and carries a typed `actions` array populated at
51/// construction time, replacing the per-finding post-pass injection that
52/// previously grafted `actions[]` and `introduced` onto the schema. The
53/// `introduced` field is set by the audit pass via JSON map insertion and
54/// is `None` when serialized directly from Rust. The `schemars::JsonSchema`
55/// derive is gated per-struct on the `schema` feature.
56pub mod output_dead_code;
57/// Shared output-format selector used by CLI, config, output, and API layers.
58pub mod output_format;
59/// Per-action types attached to health findings, hotspots, refactoring
60/// targets, and coverage-gap entries. Separated from the generic
61/// `IssueAction` tree in the `output` module so the health-specific
62/// variants live in a dedicated module. The structs are always compiled
63/// (the JSON emission layer constructs them through typed wrappers such as
64/// [`output_health::UntestedFileAction`]); the `schemars::JsonSchema`
65/// derive is gated per-struct on the `schema` feature.
66pub mod output_health;
67/// Cross-platform path classification helpers.
68pub mod path_util;
69/// Analysis result types: unused files, exports, dependencies, and members.
70pub mod results;
71/// Custom serde serializers for cross-platform path output.
72pub mod serde_path;
73/// Shared source-file freshness metadata used by cache invalidation.
74pub mod source_fingerprint;
75/// Inline suppression comment types and issue kind definitions.
76pub mod suppress;
77/// Trace output contracts shared by core, engine, CLI, API, and MCP.
78pub mod trace;
79/// Symbol-level trace-chain output contracts.
80pub mod trace_chain;
81/// Workspace and source-discovery diagnostic data types
82/// (`WorkspaceDiagnostic`, `WorkspaceDiagnosticKind`). Re-exported by
83/// `fallow-config` for back-compat; embedded directly by `fallow-output` so
84/// `workspace_diagnostics[]` keeps its typed JSON schema. The
85/// `schemars::JsonSchema` derive is gated on the `schema` feature.
86pub mod workspace;