Struct Gates
pub struct Gates {Show 14 fields
pub cognitive_max: Option<f64>,
pub code_health_min: Option<f64>,
pub hotspot_score_max: Option<f64>,
pub hotspot_anchored_max: Option<f64>,
pub disallow_clone_type_1: bool,
pub max_dependency_cycles: Option<u32>,
pub max_propagation_cost: Option<f64>,
pub max_red_effort_pct: Option<f64>,
pub red_effort_exempt_improving: bool,
pub code_familiarity_min: Option<f64>,
pub max_findings_in_hot_files: Option<u32>,
pub corpus_percentile_max: Option<f64>,
pub fail_on_degraded: bool,
pub fail_on_skipped: bool,
}Fields§
§cognitive_max: Option<f64>Maximum cognitive complexity per file. Files exceeding fail the gate.
code_health_min: Option<f64>Minimum code-health score per file. Files below fail.
hotspot_score_max: Option<f64>Maximum hotspot score per file.
hotspot_anchored_max: Option<f64>Maximum corpus-anchored hotspot score per file (the hotspot-score-anchored
column). Same [0, 10] scale as hotspot_score_max, but the file’s
complexity is ranked against the calibration corpus rather than the repo,
so improving a file in place does not shift any other file’s anchored
score — the complexity term is corpus-anchored. The revisions term stays
repo-relative by design, so a change to the revision population itself (a
new file clearing min_revs, a refactor commit that reorders the churn
ranks) can still move an untouched file’s score; this ceiling carries
margin above the measured worst to absorb that, keeping it an absolute
standard rather than a moving target.
The gate is skipped (not failed, not passed) when no calibration
artifact is active — no embedded world corpus and no --calibration
override means hotspot rows carry no hotspot_score_anchored, so there is
nothing to compare against. The skip is recorded in the ledger with
verdict = "skipped" and printed as a distinct warning line; it does not
affect the exit code — mirroring corpus_percentile_max.
disallow_clone_type_1: boolDisallow ANY Type-1 clone families.
max_dependency_cycles: Option<u32>Maximum number of dependency cycles (non-trivial import-graph
SCCs) allowed repo-wide. Exceeding fails the gate. 0 enforces a
fully acyclic architecture.
max_propagation_cost: Option<f64>Maximum propagation cost (import-graph transitive-closure density,
[0,1]). Exceeding fails — a ceiling on “a change to a random
file reaches this fraction of the system”.
max_red_effort_pct: Option<f64>Maximum share of window LOC churn (lines added + deleted) allowed
to land in the red code-health band, as a percentage ([0, 100]).
Exceeding fails — enforces “don’t spend most engineering effort
fighting fires in the worst-health files.” Missing red band
(zero red files) counts as 0 %, which passes any positive threshold.
red_effort_exempt_improving: boolCompanion to max_red_effort_pct: when
true, the ceiling is compared against only the degrading share of
red-band window churn — churn that landed in red files whose own health
did NOT improve over the window — exempting churn that refactored a red
file toward health. Default false leaves the gate comparing the full
red churn share (behaviour unchanged). Has no effect unless
max_red_effort_pct is also set; like fail_on_degraded it is a
modifier, not a gate, so it never makes the thresholds non-empty on its
own.
code_familiarity_min: Option<f64>Minimum code-familiarity score ([0, 100]). Below this threshold
the code-familiarity analysis emits a "risky" verdict. When
absent the analysis applies a built-in default of 70.0.
max_findings_in_hot_files: Option<u32>Maximum number of "act-now" rows in the finding-hotspot-overlap
analysis. Fails the gate when the count exceeds the threshold.
The gate is skipped (not failed, not passed) when the external
findings sidecar is absent or empty — a missing sidecar means
codelore ingest-sarif has not been run, not that there are zero
findings. The skip is recorded in the ledger with
verdict = "skipped" and printed as a distinct warning line; it
does not affect the exit code.
corpus_percentile_max: Option<f64>Maximum corpus-relative percentile ([0,1]) any file may reach. A
file whose worst raw metric sits above this fraction of a reference
corpus fails the gate — a ceiling on “how extreme is this file versus
the world (or your org)”.
The gate is skipped (not failed, not passed) when no calibration
artifact is active — no embedded world corpus and no --calibration
override means code-health rows carry no corpus_percentile, so there
is nothing to compare against. The skip is recorded in the ledger with
verdict = "skipped" and printed as a distinct warning line; it does
not affect the exit code.
fail_on_degraded: boolWhen true (the default), a gate whose underlying analysis
produced no evaluable data where data was expected is recorded as
verdict = "degraded" and treated as a failure — a gate must not
green on blindness. Set to false to downgrade degraded gates from
failure to a warning (the degraded verdict is still printed and
recorded in the ledger).
Adapted from the explicit-degradation contract in SAST tooling: an analyzer that silently returns “no findings” on an empty scan is indistinguishable from one that found nothing. Degraded status makes the difference explicit.
fail_on_skipped: boolWhen true, a gate recorded verdict = "skipped" — its underlying
analysis had nothing to evaluate (no external-findings sidecar, no
calibration artifact, a history shallower than a window, or a change-set
that measured no delta) — is treated as a failure, so a gate that
silently stopped evaluating is no longer indistinguishable at the exit
code from one that evaluated and passed. Default false leaves a skipped
gate exit-0 (behaviour unchanged). Honoured by codelore check,
codelore gate, and codelore diff; like fail_on_degraded it is a
policy modifier, not a gate, so it never makes the thresholds non-empty
on its own, and the ledger keeps the honest "skipped" verdict either
way.
Trait Implementations§
§impl<'de> Deserialize<'de> for Gates
impl<'de> Deserialize<'de> for Gates
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Gates
impl RefUnwindSafe for Gates
impl Send for Gates
impl Sync for Gates
impl Unpin for Gates
impl UnsafeUnpin for Gates
impl UnwindSafe for Gates
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more