Skip to main content

StepRow

Struct StepRow 

Source
#[non_exhaustive]
pub struct StepRow {
Show 24 fields pub cursor: Cursor, pub harness: String, pub source: StepSource, pub step_ref: String, pub session: String, pub run_id: Option<String>, pub occurred_at_ms: u64, pub provider: Option<String>, pub model: Option<String>, pub input: Option<u64>, pub cache_read: Option<u64>, pub cache_write: Option<u64>, pub cache_write_5m: Option<u64>, pub cache_write_1h: Option<u64>, pub output: Option<u64>, pub reasoning: Option<u64>, pub finish: Option<String>, pub context_limit: Option<u64>, pub request_body_len: Option<u64>, pub prompt: u64, pub retention: Option<f64>, pub verdict: Verdict, pub prompt_dropped: bool, pub request_size: Option<RequestSize>,
}
Expand description

One step in the feed. Rows carry no content: never prompt text, tool names or error text.

A row’s identity is harness plus step_ref. When any field of a step changes, the provider sends the whole row again at a new cursor; the last row for an identity wins, and a reader replaces, never appends (see crate::LatestRows).

Optional members are omitted when unknown and are never zero for unknown. output includes reasoning: reasoning is a breakdown of output, never an addition to it, so reasoning <= output whenever both are present (see StepRow::check_counts). cache_write is the sum of every cache lifetime. Unknown members are ignored when decoding; StepRow::check_closed names them for the provider’s own tests.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§cursor: Cursor

This row’s feed position.

§harness: String

The producer: a coding harness or a runner’s module id. For a step a runner announced, see live_row_identity.

§source: StepSource§step_ref: String

The producer’s own id for the step. For a step a runner announced, see live_row_identity.

§session: String§run_id: Option<String>

Runner steps only.

§occurred_at_ms: u64

Unix milliseconds. Steps without a time are not in the feed.

§provider: Option<String>§model: Option<String>§input: Option<u64>

Uncached input tokens.

§cache_read: Option<u64>§cache_write: Option<u64>

The sum of every cache lifetime.

§cache_write_5m: Option<u64>

Present only when the source split cache writes by lifetime.

§cache_write_1h: Option<u64>

Present only when the source split cache writes by lifetime.

§output: Option<u64>

Output tokens, reasoning included. Charge it once; never add reasoning on top.

§reasoning: Option<u64>

The part of output the provider reports as reasoning: a breakdown, never an addition. Absent means not reported, not zero.

§finish: Option<String>

The producer’s finish or stop reason, as a classification string.

§context_limit: Option<u64>§request_body_len: Option<u64>

Request body length in bytes.

§prompt: u64

Input plus cache read plus cache write.

§retention: Option<f64>

This step’s cache read divided by the expected cache read: a non-negative number, never rounded or clamped, so it exceeds 1 when a step reads more than expected. Absent when there was nothing to compare with.

§verdict: Verdict§prompt_dropped: bool§request_size: Option<RequestSize>

On a prompt drop, present when both compared steps report body lengths.

Implementations§

Source§

impl StepRow

Source

pub const REQUIRED_MEMBERS: &'static [&'static str]

Members every row carries.

Source

pub const OPTIONAL_MEMBERS: &'static [&'static str]

Members omitted when unknown.

Source

pub fn new( cursor: impl Into<Cursor>, harness: impl Into<String>, source: StepSource, step_ref: impl Into<String>, session: impl Into<String>, occurred_at_ms: u64, prompt: u64, verdict: Verdict, prompt_dropped: bool, ) -> Self

Builds a row from its required members; optional members start absent.

Source

pub fn identity(&self) -> (&str, &str)

The row’s identity: (harness, step_ref).

Source

pub fn check_closed(value: &Value) -> Result<(), NotClosed>

Reports a member outside the published v1 row list, by name. For the provider’s own tests: whatever it emits must stay within the published list until this crate updates it. Readers ignore unknown members instead, so decoding never calls this.

Source

pub fn check_counts(&self) -> Result<(), BadCounts>

Reports a row whose reasoning exceeds its output, naming it by identity. reasoning is a breakdown inside output, so a row with both must have reasoning <= output. For the provider’s own tests, like StepRow::check_closed; readers still decode such a row.

Source

pub fn with_run_id(self, run_id: impl Into<String>) -> Self

Source

pub fn with_provider(self, provider: impl Into<String>) -> Self

Source

pub fn with_model(self, model: impl Into<String>) -> Self

Source

pub fn with_input(self, input: u64) -> Self

Source

pub fn with_cache_read(self, cache_read: u64) -> Self

Source

pub fn with_cache_write(self, cache_write: u64) -> Self

Source

pub fn with_cache_write_5m(self, cache_write_5m: u64) -> Self

Source

pub fn with_cache_write_1h(self, cache_write_1h: u64) -> Self

Source

pub fn with_output(self, output: u64) -> Self

Source

pub fn with_reasoning(self, reasoning: u64) -> Self

Source

pub fn with_finish(self, finish: impl Into<String>) -> Self

Source

pub fn with_context_limit(self, context_limit: u64) -> Self

Source

pub fn with_request_body_len(self, request_body_len: u64) -> Self

Source

pub fn with_retention(self, retention: f64) -> Self

Source

pub fn with_request_size(self, request_size: RequestSize) -> Self

Trait Implementations§

Source§

impl Clone for StepRow

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StepRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StepRow

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for StepRow

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for StepRow

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StepRow

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.