Skip to main content

PhaseOutcome

Struct PhaseOutcome 

Source
pub struct PhaseOutcome {
    pub phase_id: PhaseIdentity,
    pub disposition: Disposition,
    pub validity: Validity,
    pub duration_secs: f64,
    pub errors: Vec<PhaseErrorDetail>,
    pub resume_cursor: Option<ResumeCursor>,
    pub phase_hash: Option<String>,
    pub params_consumed: Option<String>,
}

Fields§

§phase_id: PhaseIdentity§disposition: Disposition

SRD-82 Part 1 — the two axes ARE the stored canonical (the storage migration the old PhaseStatus::to_outcome doc promised). Legacy checkpoint records that carried a single status string still deserialize via [PhaseOutcomeWire].

§validity: Validity§duration_secs: f64

Wall-clock duration from phase_starting to this outcome being recorded. 0.0 for skipped phases.

§errors: Vec<PhaseErrorDetail>

Errors collected during the phase. Empty for Completed / Skipped. Non-empty for Failed. Chronologically ordered by at_nanos.

§resume_cursor: Option<ResumeCursor>

Resume state for the next session. None when the phase doesn’t support cursor-resume.

§phase_hash: Option<String>

SRD-77 --scope=changed — the phase’s provenance BASE hash (SRD-107: ancestor chain below the session node composed with the config digest; param values live in Self::params_consumed instead). Hex-encoded so the storage layer can round-trip as TEXT. None for outcomes recorded before the column was added (legacy rows) or for skipped phases that never computed their hash.

§params_consumed: Option<String>

SRD-107 — the phase’s consumed-params map as canonical JSON ({"name":"<value sha256 hex>",…}, sorted keys). Skip validity’s per-param leg: current values of exactly these names must digest to these values. None on legacy rows (whose base hash never matches current formulas anyway) and on skipped phases.

Implementations§

Source§

impl PhaseOutcome

Source

pub fn reason_class(&self) -> Option<ReasonClass>

Build a Completed outcome. Convenience for the happy path; errors must be empty. SRD-83 (C3) — machine-readable class of WHY this phase ended short of a usable result. DERIVED from the first error’s class (single source of truth — the trip/error paths already stamp it), never stored: legacy outcomes classify identically. None for any Succeeded validity — a graceful stop or natural completion has no failure reason to classify.

Source

pub fn protocol_class(&self) -> &'static str

SRD-83 (C3) — the testing-protocol three-way disposition (17_/P0.5): COMPLETED (usable result, natural or graceful), OUT-OF-RANGE (a governance timeout expired — disqualified at this tier), FAILED (anything else), plus SKIPPED for resume-skipped phases. Model-level, replacing report-side string-matching conventions.

Source

pub fn completed(phase_id: PhaseIdentity, duration_secs: f64) -> Self

Source

pub fn failed( phase_id: PhaseIdentity, duration_secs: f64, errors: Vec<PhaseErrorDetail>, ) -> Self

Build a Failed outcome from a non-empty error list. Panics if errors is empty — Failed without an error is structurally invalid per SRD-76 §“Invariants”, in every build profile.

Source

pub fn skipped(phase_id: PhaseIdentity) -> Self

Build a Skipped outcome. Used by SRD-44’s resume-on-checkpoint skip path. Duration is 0.0 because no actual work was done.

Source

pub fn interrupted( phase_id: PhaseIdentity, duration_secs: f64, resume_cursor: Option<ResumeCursor>, ) -> Self

Build an Interrupted+Succeeded outcome — re-usable partial progress (a clean early halt, a cursor suspension). The resume cursor, when present, carries the resumability signal that the retired CursorSuspended status used to encode.

Source

pub fn with_phase_hash(self, hex_hash: String) -> Self

Stamp the GK chain-hash on this outcome. Builder-style so existing callers that don’t yet have the hash available (legacy / partial paths) stay unchanged; SRD-77-aware callers chain .completed(...).with_hash(h).

Source

pub fn with_params_consumed(self, json: Option<String>) -> Self

Stamp the SRD-107 consumed-params JSON on this outcome. Builder-style, same rationale as Self::with_phase_hash.

Source

pub fn first_error_message(&self) -> Option<&str>

Convenience: the first error’s message, or None when the phase didn’t fail. Used by the compact renderer to give an at-a-glance reason.

Source

pub fn outcome(&self) -> Outcome

SRD-82 Part 1 — the two-axis Outcome, straight from the stored axes (they ARE the canonical since the storage migration).

Source

pub fn is_failure(&self) -> bool

Source

pub fn glyph(&self) -> char

Source

pub fn label(&self) -> &'static str

Source

pub fn to_sqlite_row( &self, session: &str, exec_id: u64, started_at_nanos: i64, ) -> PhaseOutcomeRow

SRD-76 Push 3 — project this outcome into the storage-layer row shape used by nmbrs_metrics::reporters::sqlite::SqliteReporter::write_phase_outcome. session / exec_id come from the active session (SRD-77); started_at_nanos is supplied by the caller (the executor captures it at phase entry); ended_at_nanos is taken from SystemTime::now() so the on-disk row matches the wall-clock moment the outcome was sealed.

Trait Implementations§

Source§

impl Clone for PhaseOutcome

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 PhaseOutcome

Source§

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

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

impl<'de> Deserialize<'de> for PhaseOutcome

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 PhaseOutcome

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 PhaseOutcome

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 PhaseOutcome

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more