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