Expand description
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.
Typed envelope and utility-shape structs for the JSON output contract.
Today the JSON serialization layer (crates/cli/src/report/json.rs) builds
its envelopes (CheckOutput, HealthOutput, …) via serde_json::json!
macros and ad-hoc map merging. The types in this module are the schema-side
counterpart of those envelopes plus a small set of utility shapes
(SchemaVersion, Meta, BaselineDeltas, …) that the envelopes
reference.
Gated on the schema cargo feature so consumers that do not need the
schemars::JsonSchema derive (every crate except fallow-cli with
--features schema-emit) skip the schemars compile cost.
Structs§
- Audit
Introduced - Audit-mode marker emitted on each finding when
fallow audit --format jsonruns with a base ref.truemeans the finding’s structural key was not present at the base ref (introduced by the current changeset);falsemeans it was inherited. - Baseline
Category Delta - Single-category baseline delta entry inside
BaselineDeltas::per_category. - Baseline
Deltas - Per-category delta comparison against a saved baseline. Only present in
CheckOutputwhen--baselineis used. - Baseline
Match - Baseline match statistics. Shows how many baseline entries existed and how
many matched current issues. Useful for detecting stale baselines
programmatically. Only present in
CheckOutputwhen--baselineis used. - Check
Summary - Per-category issue counts for dead-code analysis. Always present in
CheckOutput; when--summaryis used the individual issue arrays are omitted but this object stays populated. - Elapsed
Ms - Analysis duration in milliseconds. Renders to the JSON wire as a bare integer.
- Entry
Points - Entry-point detection summary embedded in
CheckOutputand the combined envelope. - Meta
- Metric and rule definitions emitted under
_metawhen--explainis passed (always present in MCP responses). Helps AI agents and CI systems interpret metric values without re-reading the docs site. - Meta
Metric - Single-metric definition inside
Meta::metrics. - Meta
Rule - Single-rule definition inside
Meta::rules. - Regression
Result - Result of regression detection (
--fail-on-regression). Compares current issue counts against a baseline from config or an explicit file. - Schema
Version - Schema version for this output format (independent of tool version). Bump
policy: ADDITIVE changes (new optional top-level fields, new optional struct
fields, new array entries, new MCP tools, new CLI flags that map to new
optional fields) do NOT bump the version; consumers receive new fields
without breaking. BREAKING changes (renamed fields, removed fields, type
changes, enum-variant removals, semantic changes to existing fields) DO
bump. To detect newly-added fields without a bump, check field presence via
JSON-key existence rather than gating on the version. v4 was introduced
alongside fallow-cov-protocol 0.2 (per-finding verdict, stable IDs, evidence
block, renamed summary fields); v5 introduced health_score formula_version 2
with scale-invariant scoring semantics; v6 widened
AddToConfigAction.valuefrom a scalar string tooneOf: [string, array]so the newignoreExportsaction can carry a paste-ready array of{ file, exports }rule objects (the legacyignoreDependenciesetc. variants still emit strings, so consumers that switch onconfig_keykeep working unchanged). The runtime-coverage block is extended additively as the protocol evolves (currently 0.3, which adds an optional capture_quality summary field). Other additive examples: dupes –group-by adds optional grouped_by, total_issues, groups fields without bumping. - Tool
Version - Fallow CLI version that produced this envelope. Renders to the JSON wire as
a bare string (e.g.
"2.74.0").
Enums§
- Regression
Status - Status of a regression-check pass.
- Regression
Tolerance Kind - Interpretation of
RegressionResult::tolerance.