pub struct Evolution {
pub enabled: bool,
pub baseline: Option<Baseline>,
pub max_regression: f64,
pub allowed_kinds: Vec<ProposalKind>,
pub require_sandbox: bool,
pub require_approval: bool,
pub keep_rollback: bool,
}Expand description
The evolution policy.
Fields§
§enabled: boolMaster switch for this section. Even with features.self_evolution on,
a loop can leave evolution off for a single run.
baseline: Option<Baseline>What proposals are measured against. Without one, no proposal can be adopted — only recorded.
max_regression: f64How much a metric may worsen and still count as an improvement overall.
Expressed as a fraction: 0.02 allows a two-percent regression.
Nonzero on purpose. A change that trades a hair of accuracy for half the cost is usually right, and a zero-tolerance gate refuses every such trade while admitting any change that touches nothing measured.
allowed_kinds: Vec<ProposalKind>Which kinds of change may be proposed at all.
require_sandbox: boolRequire a proposal to have been trialled in isolation before adoption.
require_approval: boolRequire a human to approve adoption. Turning this off is refused in
prod.
keep_rollback: boolKeep the previous known-good configuration so an adoption can be undone.
Implementations§
Source§impl Evolution
impl Evolution
Sourcepub fn allows(&self, kind: ProposalKind) -> bool
pub fn allows(&self, kind: ProposalKind) -> bool
Whether a proposal of this kind may even be written.
Sourcepub fn is_improvement(&self, measured: &Baseline) -> Option<bool>
pub fn is_improvement(&self, measured: &Baseline) -> Option<bool>
Whether measured beats baseline on every metric the baseline names,
within Evolution::max_regression.
Returns None when there is no baseline — which is not “pass”, and the
caller must not treat it as one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Evolution
impl<'de> Deserialize<'de> for Evolution
Source§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>,
Source§impl JsonSchema for Evolution
impl JsonSchema for Evolution
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more