pub struct TrainingRow {
pub trace_id: String,
pub features: Features,
pub start_rung: u32,
pub served_rung: Option<u32>,
pub served_passed: bool,
pub cost_usd: f64,
pub propensity: Option<f64>,
pub explore: bool,
pub policy_id: String,
}Expand description
Render traces as a JSONL receipt export — one sealed receipt per line, in chain order.
This is the artifact an operator hands an auditor; the deferred-verdict side table is never
included (it is not part of the hashed body).
One decision, reshaped as a training example: context, action, reward, propensity.
A receipt is an audit record — nested, provenance-heavy, and shaped for a human or an auditor. A learner wants a flat row. The conversion is trivial except for one thing that is not, and is the reason this is worth shipping rather than leaving to a downstream script:
The propensity is already logged. Firstpass records the probability its logging policy assigned to the rung it chose, because it needs that denominator for IPS/SNIPS/DR off-policy evaluation. That is exactly the field offline RL needs and exactly the field a routing log normally lacks — without it, a learner trained on this data inherits the logging policy’s bias with no way to correct for it. Rows where it is absent are marked, not silently defaulted to 1.
Fields§
§trace_id: StringDecision id, so a row can be traced back to the receipt it came from.
features: FeaturesContext the decision was made in.
start_rung: u32The action taken: which rung the ladder started on.
served_rung: Option<u32>Which rung actually served, if any.
served_passed: boolWhether the served output passed its gate — the reward signal, and the honest one, because it is a verified outcome rather than a predicted score.
cost_usd: f64Total USD spent on the decision. Cost-aware objectives need this alongside the reward.
propensity: Option<f64>Probability the logging policy gave the chosen action. None for a deterministic policy —
an un-corrected row, which a learner must handle rather than assume away.
explore: boolWhether this was a deliberate exploration draw.
policy_id: StringLogging policy identity, so rows from different policies can be separated.
Implementations§
Source§impl TrainingRow
impl TrainingRow
Sourcepub fn from_trace(t: &Trace) -> Self
pub fn from_trace(t: &Trace) -> Self
Reshape one receipt.
Trait Implementations§
Source§impl Clone for TrainingRow
impl Clone for TrainingRow
Source§fn clone(&self) -> TrainingRow
fn clone(&self) -> TrainingRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TrainingRow
impl Debug for TrainingRow
Auto Trait Implementations§
impl Freeze for TrainingRow
impl RefUnwindSafe for TrainingRow
impl Send for TrainingRow
impl Sync for TrainingRow
impl Unpin for TrainingRow
impl UnsafeUnpin for TrainingRow
impl UnwindSafe for TrainingRow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more