Pre-package risk gate for Zarf integration.
Evaluates LEI analysis reports against configurable risk thresholds and returns pass/fail decisions suitable for use as a Zarf action hook or CI/CD gate.
Summary
Functions
Evaluate a single-repo LEI report against a risk threshold.
Returns true if the given risk level exceeds the threshold.
Format gate result as JSON string.
Types
@type gate_result() :: %{ pass: boolean(), threshold: String.t(), summary: %{ total: non_neg_integer(), passing: non_neg_integer(), failing: non_neg_integer() }, failing_repos: [map()], report: map() }
Functions
@spec evaluate(map(), String.t()) :: {:ok, gate_result()}
Evaluate a single-repo LEI report against a risk threshold.
Returns {:ok, result} where result contains :pass boolean and details.
Threshold levels (fail when risk >= threshold)
- "low" - fail on any risk level (low, medium, high, critical)
- "medium" - fail on medium, high, or critical risk
- "high" - fail on high or critical risk (default)
- "critical" - fail only on critical risk
Returns true if the given risk level exceeds the threshold.
Format gate result as JSON string.