Skip to main content

Module envelope

Module envelope 

Source
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§

AuditIntroduced
Audit-mode marker emitted on each finding when fallow audit --format json runs with a base ref. true means the finding’s structural key was not present at the base ref (introduced by the current changeset); false means it was inherited.
BaselineCategoryDelta
Single-category baseline delta entry inside BaselineDeltas::per_category.
BaselineDeltas
Per-category delta comparison against a saved baseline. Only present in CheckOutput when --baseline is used.
BaselineMatch
Baseline match statistics. Shows how many baseline entries existed and how many matched current issues. Useful for detecting stale baselines programmatically. Only present in CheckOutput when --baseline is used.
CheckSummary
Per-category issue counts for dead-code analysis. Always present in CheckOutput; when --summary is used the individual issue arrays are omitted but this object stays populated.
ElapsedMs
Analysis duration in milliseconds. Renders to the JSON wire as a bare integer.
EntryPoints
Entry-point detection summary embedded in CheckOutput and the combined envelope.
Meta
Metric and rule definitions emitted under _meta when --explain is passed (always present in MCP responses). Helps AI agents and CI systems interpret metric values without re-reading the docs site.
MetaMetric
Single-metric definition inside Meta::metrics.
MetaRule
Single-rule definition inside Meta::rules.
RegressionResult
Result of regression detection (--fail-on-regression). Compares current issue counts against a baseline from config or an explicit file.
SchemaVersion
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.value from a scalar string to oneOf: [string, array] so the new ignoreExports action can carry a paste-ready array of { file, exports } rule objects (the legacy ignoreDependencies etc. variants still emit strings, so consumers that switch on config_key keep 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.
ToolVersion
Fallow CLI version that produced this envelope. Renders to the JSON wire as a bare string (e.g. "2.74.0").

Enums§

RegressionStatus
Status of a regression-check pass.
RegressionToleranceKind
Interpretation of RegressionResult::tolerance.