pub struct DecisionEvent {Show 13 fields
pub id: String,
pub run_id: String,
pub thread_id: String,
pub seq: u64,
pub family: DecisionFamily,
pub features: Map<String, Value>,
pub legal_actions: Vec<DecisionAction>,
pub selected: DecisionAction,
pub propensity: f64,
pub policy_version: PolicyVersion,
pub role: Option<DecisionRole>,
pub outcome: Option<DecisionOutcome>,
pub decided_at: DateTime<Utc>,
}Expand description
One executor policy decision with everything offline learning needs to evaluate it.
The learning contract (R0.8+): given features and legal_actions, the
policy named by policy_version chose selected with probability
propensity. Propensity is assigned at decision time, never
reconstructed — without it, off-policy evaluation (comparing a candidate
policy against the recorded one) is impossible. outcome is None
until the affected operation completes.
v1 froze this contract without emitters; R0.8 wave 4 wires the first
emission point (the retry classifier, see
crate::durable::retry_decision_event), journaled as
RunEventKind::PolicyDecision.
Fields§
§id: StringDeterministic decision id ({run_id}:d{n} — a separate sequence from
RunEvent, so decision ids stay stable if event kinds are added).
run_id: StringThe run the decision was made in.
thread_id: StringThe thread (session) the run belongs to.
seq: u64Sequence number within the decision stream of this run.
family: DecisionFamilyWhich executor decision this is.
features: Map<String, Value>The observation the policy decided from (latency percentiles, failure class, queue depth, …). Free-form JSON: the feature schema evolves with the policy, but the envelope does not.
legal_actions: Vec<DecisionAction>Every action that was legal at decision time. Off-policy evaluation needs the full set, not just the chosen one.
selected: DecisionActionThe action the policy took. Must be a member of legal_actions
(enforced by the policy plane, not by this type).
propensity: f64The probability the active policy assigned to selected at decision
time, in (0, 1]. First-class because learning correctness depends
on it: importance weighting divides by the propensity.
policy_version: PolicyVersionThe policy that made the decision.
role: Option<DecisionRole>Whether this decision’s action executed or only scored the features
(R0.10 wave 2 shadow pairs; see DecisionRole). None — every
decision recorded before the twin — means acting: the only decisions
that existed were the ones that bound the world.
outcome: Option<DecisionOutcome>The result of the decision, None until completion.
decided_at: DateTime<Utc>When the decision was made, read from the run’s clock.