pub struct ParameterizedPolicy { /* private fields */ }Expand description
The application loop as a twin policy (R0.10 wave 3): an
ExecutorPolicy — the registry body a promoted candidate produced —
deciding every family with its parameters, so the twin prices the
exact behavior a bound run would execute.
Per family: retry applies the per-class backoff table and narrowed
attempt budget (resolve_retry_parameters) — the gates stay the
runtime’s own (the legal set is computed before the policy sees it, so
no parameter set can route around them); timeout applies the
per-callee/default bound (resolve_timeout_bound_ms) honored by the
smallest ladder rung that covers it; placement, concurrency, and
checkpoint placement decide exactly as the floor — those families
have no parameter contract (ExecutorPolicy::with_family_parameters
rejects them), so a registered policy can never carry their parameters
and there is nothing to apply. Every selection is deterministic
(propensity 1.0): learned exploration belongs to shadow candidates
with declared propensities, not to a promoted body.
Fail-closed at two layers, matching the production read path:
construction refuses an invalid policy (ExecutorPolicy::validate —
an out-of-envelope body cannot even be evaluated), and the
resolve_* functions re-check at every decision point, so a policy
that somehow reaches a decision invalid steers nothing and the floor
decides.
Implementations§
Source§impl ParameterizedPolicy
impl ParameterizedPolicy
Sourcepub fn new(policy: ExecutorPolicy, version: PolicyVersion) -> Result<Self>
pub fn new(policy: ExecutorPolicy, version: PolicyVersion) -> Result<Self>
A policy deciding with policy’s parameters, journaling under
version (the body the registry holds for that version —
mismatched pairs are the caller’s integrity failure to make).
Sourcepub fn policy(&self) -> &ExecutorPolicy
pub fn policy(&self) -> &ExecutorPolicy
The parameters this policy decides with.
Trait Implementations§
Source§impl Clone for ParameterizedPolicy
impl Clone for ParameterizedPolicy
Source§impl Debug for ParameterizedPolicy
impl Debug for ParameterizedPolicy
Source§impl TwinPolicy for ParameterizedPolicy
impl TwinPolicy for ParameterizedPolicy
Source§fn version(&self) -> PolicyVersion
fn version(&self) -> PolicyVersion
Source§fn decide(&self, ctx: &DecisionContext<'_>, _draw: f64) -> (DecisionAction, f64)
fn decide(&self, ctx: &DecisionContext<'_>, _draw: f64) -> (DecisionAction, f64)
ctx.legal_actions and declare its
propensity. draw is a seeded uniform from [0, 1).Source§fn retry_delay_ms_for(
&self,
class: Option<ErrorClass>,
attempt: u32,
draw: f64,
) -> u64
fn retry_delay_ms_for( &self, class: Option<ErrorClass>, attempt: u32, draw: f64, ) -> u64
ParameterizedPolicy); policies that do not override this keep
TwinPolicy::retry_delay_ms’s class-blind behavior. The default
delegates, so every pre-wave-3 policy is unchanged.Source§fn retry_delay_ms(&self, attempt: u32, draw: f64) -> u64
fn retry_delay_ms(&self, attempt: u32, draw: f64) -> u64
Retry decision, in milliseconds. The
closed action set carries no delay member — the delay is
policy-parameterized within declared bounds, per the family’s
contract — so it is a method, not an action. Defaults to the
floor’s full-jitter exponential backoff.