1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//! Shared types for fallow codebase intelligence.
//!
//! This crate contains type definitions used across multiple fallow crates
//! (core, CLI, LSP). It has no analysis logic, only data structures.
/// Atomic cache-file replacement, shared by the extraction cache and the graph
/// cache so concurrent fallow processes never interleave a write.
/// Typed audit cache-key inputs.
/// Why a persisted cache was refused, shared by the extraction cache, the
/// graph cache, the perf table, and `fallow doctor`.
/// Shared churn output contracts.
/// Cross-surface strings for the cloud runtime-coverage path, shared by the
/// CLI's cloud `coverage` commands and the MCP cloud tools.
/// One row per analysis subcommand: its JSON kinds and the surfaces that must
/// know about it. Drift tests across the workspace read this table.
/// File discovery types: discovered files, file IDs, and entry points.
/// Shared duplicate-code output contracts.
/// JSON-output envelope and utility types: `SchemaVersion`, `ToolVersion`,
/// `ElapsedMs`, `AuditIntroduced`, plus the shared `Meta`, `BaselineDeltas`,
/// `BaselineMatch`, `RegressionResult`, `EntryPoints`, and `CheckSummary`
/// shapes referenced by every per-command envelope. The structs are always
/// compiled (the JSON emission layer constructs them at runtime); the
/// `schemars::JsonSchema` derive is gated per-struct on the `schema` feature.
/// Where a fact sits on each JSON envelope shape, shared by the surfaces that
/// read a saved envelope back rather than holding the run's typed state.
/// Module extraction types: exports, imports, re-exports, and member info.
/// Guard output contracts for pre-edit architecture-rule lookup.
/// Stable finding identity: the shared FNV-1a 64 hash and dead-code
/// `finding_id` values.
/// Shared issue-type contract metadata used by CLI, LSP, MCP, and suppression
/// helpers.
/// Levenshtein distance and closest-match policy for typo suggestions.
/// Machine-readable manifest of the fallow MCP server's tools, shared by
/// `fallow schema` and the telemetry tool-name allowlist; kept in sync with
/// the live tool router by a drift test in `crates/mcp`.
/// JSON-output augmentation types: `IssueAction` enum + variants.
/// Schema-side counterpart of the augmentations the JSON layer adds to each
/// dead-code finding. The structs are always compiled (typed dead-code
/// wrappers in [`output_dead_code`] consume them at runtime); the
/// `schemars::JsonSchema` derive is gated per-struct on the `schema`
/// feature.
/// Typed envelope wrappers for the simple 1:1 dead-code findings
/// (`UnusedFile`, `PrivateTypeLeak`, `UnresolvedImport`, `CircularDependency`,
/// `BoundaryViolation`). Each wrapper flattens the bare finding via
/// `#[serde(flatten)]` and carries a typed `actions` array populated at
/// construction time, replacing the per-finding post-pass injection that
/// previously grafted `actions[]` and `introduced` onto the schema. The
/// `introduced` field is set by the audit pass via JSON map insertion and
/// is `None` when serialized directly from Rust. The `schemars::JsonSchema`
/// derive is gated per-struct on the `schema` feature.
/// Shared output-format selector used by CLI, config, output, and API layers.
/// Per-action types attached to health findings, hotspots, refactoring
/// targets, and coverage-gap entries. Separated from the generic
/// `IssueAction` tree in the `output` module so the health-specific
/// variants live in a dedicated module. The structs are always compiled
/// (the JSON emission layer constructs them through typed wrappers such as
/// [`output_health::UntestedFileAction`]); the `schemars::JsonSchema`
/// derive is gated per-struct on the `schema` feature.
/// Cross-platform path classification helpers.
/// The `--performance` span tree and the process-level clock.
/// Analysis result types: unused files, exports, dependencies, and members.
/// Shared TypeScript semantic identity, provenance, API surface, impact, and
/// public-signature coupling contracts.
/// Custom serde serializers for cross-platform path output.
/// Transient source-extraction contracts for provider-backed similar-code analysis.
/// Shared source-file freshness metadata used by cache invalidation.
/// Inline suppression comment types and issue kind definitions.
/// Agent task-to-command matrix rows shared by `fallow schema`, the
/// `init --agents` template, the agent hook block, root `--help`, and the
/// `fallow://task-matrix` MCP resource. Data only; the CLI owns rendering.
/// Trace output contracts shared by core, engine, CLI, API, and MCP.
/// Symbol-level trace-chain output contracts.
/// Stack-trace frame resolution output contracts (`fallow trace-error`).
/// Per-specifier dependency usage contracts (`fallow trace --dependency`).
/// Workspace and source-discovery diagnostic data types
/// (`WorkspaceDiagnostic`, `WorkspaceDiagnosticKind`). Re-exported by
/// `fallow-config` for back-compat; embedded directly by `fallow-output` so
/// `workspace_diagnostics[]` keeps its typed JSON schema. The
/// `schemars::JsonSchema` derive is gated on the `schema` feature.
/// The `tracing` target of a warning that repeats a fact the JSON envelope
/// carries, or that describes the quality of the analysis inputs.
///
/// `--quiet`, `--ci` and `FALLOW_QUIET` hide this target on stderr. An explicit
/// `RUST_LOG` shows it again. Config-load warnings, such as an unknown rule
/// key, do not use this target, so they stay visible in a quiet run.
pub const ANALYSIS_DIAGNOSTIC_LOG_TARGET: &str = "fallow::analysis_diagnostic";