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/// JSON-output envelope and utility types: `SchemaVersion`, `ToolVersion`,
23/// `ElapsedMs`, `AuditIntroduced`, plus the shared `Meta`, `BaselineDeltas`,
24/// `BaselineMatch`, `RegressionResult`, `EntryPoints`, and `CheckSummary`
25/// shapes referenced by every per-command envelope. The structs are always
26/// compiled (the JSON emission layer constructs them at runtime); the
27/// `schemars::JsonSchema` derive is gated per-struct on the `schema` feature.
28pub mod envelope;
29/// Module extraction types: exports, imports, re-exports, and member info.
30pub mod extract;
31/// Shared issue-type contract metadata used by CLI, LSP, MCP, and suppression
32/// helpers.
33pub mod issue_meta;
34/// Machine-readable manifest of the fallow MCP server's tools, shared by
35/// `fallow schema` and the telemetry tool-name allowlist; kept in sync with
36/// the live tool router by a drift test in `crates/mcp`.
37pub mod mcp_manifest;
38/// JSON-output augmentation types: `IssueAction` enum + variants.
39/// Schema-side counterpart of the augmentations the JSON layer adds to each
40/// dead-code finding. The structs are always compiled (typed dead-code
41/// wrappers in [`output_dead_code`] consume them at runtime); the
42/// `schemars::JsonSchema` derive is gated per-struct on the `schema`
43/// feature.
44pub mod output;
45/// Typed envelope wrappers for the simple 1:1 dead-code findings
46/// (`UnusedFile`, `PrivateTypeLeak`, `UnresolvedImport`, `CircularDependency`,
47/// `BoundaryViolation`). Each wrapper flattens the bare finding via
48/// `#[serde(flatten)]` and carries a typed `actions` array populated at
49/// construction time, replacing the per-finding post-pass injection that
50/// previously grafted `actions[]` and `introduced` onto the schema. The
51/// `introduced` field is set by the audit pass via JSON map insertion and
52/// is `None` when serialized directly from Rust. The `schemars::JsonSchema`
53/// derive is gated per-struct on the `schema` feature.
54pub mod output_dead_code;
55/// Per-action types attached to health findings, hotspots, refactoring
56/// targets, and coverage-gap entries. Separated from the generic
57/// `IssueAction` tree in the `output` module so the health-specific
58/// variants live in a dedicated module. The structs are always compiled
59/// (the JSON emission layer constructs them through typed wrappers such as
60/// [`output_health::UntestedFileAction`]); the `schemars::JsonSchema`
61/// derive is gated per-struct on the `schema` feature.
62pub mod output_health;
63/// Cross-platform path classification helpers.
64pub mod path_util;
65/// Analysis result types: unused files, exports, dependencies, and members.
66pub mod results;
67/// Custom serde serializers for cross-platform path output.
68pub mod serde_path;
69/// Shared source-file freshness metadata used by cache invalidation.
70pub mod source_fingerprint;
71/// Inline suppression comment types and issue kind definitions.
72pub mod suppress;
73/// Workspace and source-discovery diagnostic data types
74/// (`WorkspaceDiagnostic`, `WorkspaceDiagnosticKind`). Re-exported by
75/// `fallow-config` for back-compat; embedded directly by `fallow-output` so
76/// `workspace_diagnostics[]` keeps its typed JSON schema. The
77/// `schemars::JsonSchema` derive is gated on the `schema` feature.
78pub mod workspace;