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