pub struct ExecutorPolicy {
pub retry: RetryPolicyParameters,
pub timeout: TimeoutPolicyParameters,
pub concurrency: ConcurrencyPolicyParameters,
}Expand description
The executor policy contract (R0.8 wave 4): one versioned bundle of the parameters the executor’s mechanical decision points agree to decide with.
An ExecutorPolicy is what a PolicyVersion names: the registry
(server side) stores immutable policy bodies under content-derived
versions, runs bind the active version at admission, and every
DecisionEvent records which version decided. Because the version is
derived from the content (derive_policy_version), two registries that
agree on a version string agree on the exact parameters — promotion and
rollback move versions, never mutate bodies.
v1 wires versions into admission binding and decision evidence. The
static floor (ExecutorPolicy::static_v0) is the behavior every
pre-learning run already had: the retry constants of
crate::durable::classify_retry, no timeout bound, no concurrency
limit. Mechanical application of learned (non-floor) parameters to the
queue’s decision points is a later wave; wave 4 makes them addressable,
promotable, and evident.
Fields§
§retry: RetryPolicyParametersRetry parameters — the family v1 actually emits decisions for.
timeout: TimeoutPolicyParametersTimeout parameters (shape pinned; unconsumed in v1).
concurrency: ConcurrencyPolicyParametersConcurrency parameters (shape pinned; unconsumed in v1).
Implementations§
Source§impl ExecutorPolicy
impl ExecutorPolicy
Sourcepub fn static_v0() -> Self
pub fn static_v0() -> Self
The static floor: the fixed behavior of every run before the policy
plane landed, named by PolicyVersion::STATIC_V0.
The retry parameters mirror the crate::durable backoff constants and
the server’s default attempt budget (DEFAULT_MAX_ATTEMPTS = 3); the
timeout and concurrency families are uncapped, matching the executor’s
behavior when no policy is in force.
Sourcepub fn with_family_parameters(
&self,
family: DecisionFamily,
parameters: Value,
) -> Result<Self>
pub fn with_family_parameters( &self, family: DecisionFamily, parameters: Value, ) -> Result<Self>
This policy with one family’s parameters replaced by parameters
(parsed as that family’s parameter type).
This is how a promoted policy candidate — whose content is a family
plus a free-form parameter value — becomes a concrete
ExecutorPolicy: the candidate’s parameters are validated against
the family’s contract and overlaid onto the policy that was active
(the floor when nothing was promoted yet). Families without a v1
parameter contract (DecisionFamily::WorkerPlacement,
DecisionFamily::CheckpointPlacement) are rejected.
Trait Implementations§
Source§impl Clone for ExecutorPolicy
impl Clone for ExecutorPolicy
Source§fn clone(&self) -> ExecutorPolicy
fn clone(&self) -> ExecutorPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more