Skip to main content

Crate fallow_cov_protocol

Crate fallow_cov_protocol 

Source
Expand description

Versioned envelope types shared between the public fallow CLI and the closed-source fallow-cov production-coverage sidecar.

The public CLI builds a Request from its static analysis output, spawns the sidecar, writes the request to stdin, and reads a Response from stdout. Both sides depend on this crate to guarantee contract alignment.

§Versioning

The top-level protocol_version field is a full semver string. Major bumps indicate breaking changes; consumers MUST reject mismatched majors. Minor bumps add optional fields; consumers MUST forward-accept unknown fields and SHOULD map unknown enum variants to Feature::Unknown, ReportVerdict::Unknown, or Verdict::Unknown rather than erroring.

§0.2 overview

This is the first production-shaped contract. The top-level ReportVerdict (previously Verdict) is unchanged in meaning but was renamed to avoid colliding with per-finding Verdict. Each Finding and HotPath now carries a deterministic finding_id / hot_path_id hash, a full Evidence block, and — for findings — a per-function verdict and nullable invocation count. Confidence gained VeryHigh and None variants to match the decision table in .internal/spec-production-coverage.md.

StaticFunction::static_used and StaticFunction::test_covered are intentionally required (no #[serde(default)]) — a silent default would hide every safe_to_delete finding, so 0.1-shape requests must fail deserialization instead of parsing into a wrong answer.

Structs§

Action
Machine-readable next-step hint for AI agents.
DiagnosticMessage
Error / warning surfaced by the sidecar.
Evidence
Supporting evidence for a Finding. Mirrors the rows of the decision table in .internal/spec-production-coverage.md so the CLI can render the “why” behind each verdict without re-deriving it.
Finding
HotPath
License
The license material the sidecar should validate.
Options
Runtime knobs. All fields are optional so new options can be added without a breaking change.
Request
Sent by the public CLI to the sidecar via stdin.
Response
Emitted by the sidecar to stdout.
StaticFile
StaticFindings
Static analysis output the public CLI already produced.
StaticFunction
Summary

Enums§

Confidence
CoverageSource
A single coverage artifact on disk.
Feature
Feature flags present in the license JWT’s features claim.
ReportVerdict
Top-level report verdict (was Verdict in 0.1). Summarises the overall state of the run; per-finding verdicts live on Finding::verdict. Unknown variants are forward-mapped to ReportVerdict::Unknown.
Verdict
Per-finding verdict. Replaces the 0.1 CallState enum.
Watermark
What to render in the human output when the license is in the grace window.

Constants§

PROTOCOL_VERSION
Current protocol version. Bumped per spec rules above.

Functions§

finding_id
Compute the deterministic Finding::id for a production-coverage finding.
hot_path_id
Compute the deterministic HotPath::id for a hot-path finding. Uses the same canonical order as finding_id with kind "hot", emitting fallow:hot:<hash>.