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/// Why a persisted cache was refused, shared by the extraction cache, the
19/// graph cache, the perf table, and `fallow doctor`.
20pub mod cache_rejection;
21/// Shared churn output contracts.
22pub mod churn;
23/// Cross-surface strings for the cloud runtime-coverage path, shared by the
24/// CLI's `coverage analyze --cloud` and the MCP cloud runtime-context tool.
25pub mod cloud;
26/// File discovery types: discovered files, file IDs, and entry points.
27pub mod discover;
28/// Shared duplicate-code output contracts.
29pub mod duplicates;
30/// JSON-output envelope and utility types: `SchemaVersion`, `ToolVersion`,
31/// `ElapsedMs`, `AuditIntroduced`, plus the shared `Meta`, `BaselineDeltas`,
32/// `BaselineMatch`, `RegressionResult`, `EntryPoints`, and `CheckSummary`
33/// shapes referenced by every per-command envelope. The structs are always
34/// compiled (the JSON emission layer constructs them at runtime); the
35/// `schemars::JsonSchema` derive is gated per-struct on the `schema` feature.
36pub mod envelope;
37/// Where a fact sits on each JSON envelope shape, shared by the surfaces that
38/// read a saved envelope back rather than holding the run's typed state.
39pub mod envelope_sites;
40/// Module extraction types: exports, imports, re-exports, and member info.
41pub mod extract;
42pub mod flag_retirement;
43/// Guard output contracts for pre-edit architecture-rule lookup.
44pub mod guard;
45/// Shared issue-type contract metadata used by CLI, LSP, MCP, and suppression
46/// helpers.
47pub mod issue_meta;
48/// Levenshtein distance and closest-match policy for typo suggestions.
49pub mod levenshtein;
50/// Machine-readable manifest of the fallow MCP server's tools, shared by
51/// `fallow schema` and the telemetry tool-name allowlist; kept in sync with
52/// the live tool router by a drift test in `crates/mcp`.
53pub mod mcp_manifest;
54/// JSON-output augmentation types: `IssueAction` enum + variants.
55/// Schema-side counterpart of the augmentations the JSON layer adds to each
56/// dead-code finding. The structs are always compiled (typed dead-code
57/// wrappers in [`output_dead_code`] consume them at runtime); the
58/// `schemars::JsonSchema` derive is gated per-struct on the `schema`
59/// feature.
60pub mod output;
61/// Typed envelope wrappers for the simple 1:1 dead-code findings
62/// (`UnusedFile`, `PrivateTypeLeak`, `UnresolvedImport`, `CircularDependency`,
63/// `BoundaryViolation`). Each wrapper flattens the bare finding via
64/// `#[serde(flatten)]` and carries a typed `actions` array populated at
65/// construction time, replacing the per-finding post-pass injection that
66/// previously grafted `actions[]` and `introduced` onto the schema. The
67/// `introduced` field is set by the audit pass via JSON map insertion and
68/// is `None` when serialized directly from Rust. The `schemars::JsonSchema`
69/// derive is gated per-struct on the `schema` feature.
70pub mod output_dead_code;
71/// Shared output-format selector used by CLI, config, output, and API layers.
72pub mod output_format;
73/// Per-action types attached to health findings, hotspots, refactoring
74/// targets, and coverage-gap entries. Separated from the generic
75/// `IssueAction` tree in the `output` module so the health-specific
76/// variants live in a dedicated module. The structs are always compiled
77/// (the JSON emission layer constructs them through typed wrappers such as
78/// [`output_health::UntestedFileAction`]); the `schemars::JsonSchema`
79/// derive is gated per-struct on the `schema` feature.
80pub mod output_health;
81/// Cross-platform path classification helpers.
82pub mod path_util;
83/// The `--performance` span tree and the process-level clock.
84pub mod pipeline_spans;
85/// Analysis result types: unused files, exports, dependencies, and members.
86pub mod results;
87/// Shared TypeScript semantic identity, provenance, API surface, impact, and
88/// public-signature coupling contracts.
89pub mod semantic;
90/// Custom serde serializers for cross-platform path output.
91pub mod serde_path;
92/// Transient source-extraction contracts for provider-backed similar-code analysis.
93pub mod similar_code;
94/// Shared source-file freshness metadata used by cache invalidation.
95pub mod source_fingerprint;
96/// Inline suppression comment types and issue kind definitions.
97pub mod suppress;
98/// Agent task-to-command matrix rows shared by `fallow schema`, the
99/// `init --agents` template, the agent hook block, root `--help`, and the
100/// `fallow://task-matrix` MCP resource. Data only; the CLI owns rendering.
101pub mod task_matrix;
102/// Trace output contracts shared by core, engine, CLI, API, and MCP.
103pub mod trace;
104/// Symbol-level trace-chain output contracts.
105pub mod trace_chain;
106/// Stack-trace frame resolution output contracts (`fallow trace-error`).
107pub mod trace_error;
108/// Workspace and source-discovery diagnostic data types
109/// (`WorkspaceDiagnostic`, `WorkspaceDiagnosticKind`). Re-exported by
110/// `fallow-config` for back-compat; embedded directly by `fallow-output` so
111/// `workspace_diagnostics[]` keeps its typed JSON schema. The
112/// `schemars::JsonSchema` derive is gated on the `schema` feature.
113pub mod workspace;