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; R0.10
wave 3 adds the application loop: the retry classifier and the timeout
decision point read the bound version’s parameters through
crate::durable::resolve_retry_parameters and
crate::durable::resolve_timeout_bound_ms, with the static floor’s
constants as the read path when the version names no override (or names
an invalid one — invalid parameters fail closed to the floor).
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.
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 is_static_floor(&self) -> bool
pub fn is_static_floor(&self) -> bool
true when this policy is exactly the static floor — the read path
every decision point falls back to. Compared by value, not by
version name: a registered body identical to the floor is the
floor’s behavior, whatever string names it.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
The whole bundle’s contract: every family’s parameters validate. Decision points call this (or the per-family equivalents) before reading parameters into a decision — an invalid bundle steers nothing; the floor decides instead.
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 parsed against the
family’s contract and checked against the family’s declared envelope
(R0.10 wave 3), then overlaid onto the policy that was active (the
floor when nothing was promoted yet). Out-of-envelope parameters are
rejected — a malformed candidate can never become an active policy.
Families without a parameter contract
(DecisionFamily::WorkerPlacement,
DecisionFamily::CheckpointPlacement) are rejected: those families
are shadow-only, and a shadow family’s parameters cannot activate.