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