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: DispositionSRD-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: f64Wall-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
impl PhaseOutcome
Sourcepub fn reason_class(&self) -> Option<ReasonClass>
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.
Sourcepub fn protocol_class(&self) -> &'static str
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.
pub fn completed(phase_id: PhaseIdentity, duration_secs: f64) -> Self
Sourcepub fn failed(
phase_id: PhaseIdentity,
duration_secs: f64,
errors: Vec<PhaseErrorDetail>,
) -> Self
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.
Sourcepub fn skipped(phase_id: PhaseIdentity) -> Self
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.
Sourcepub fn interrupted(
phase_id: PhaseIdentity,
duration_secs: f64,
resume_cursor: Option<ResumeCursor>,
) -> Self
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.
Sourcepub fn with_phase_hash(self, hex_hash: String) -> Self
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).
Sourcepub fn with_params_consumed(self, json: Option<String>) -> Self
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.
Sourcepub fn first_error_message(&self) -> Option<&str>
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.
Sourcepub fn outcome(&self) -> Outcome
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).
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
See Outcome::is_failure.
Sourcepub fn glyph(&self) -> char
pub fn glyph(&self) -> char
See Outcome::glyph.
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
See Outcome::label.
Sourcepub fn to_sqlite_row(
&self,
session: &str,
exec_id: u64,
started_at_nanos: i64,
) -> PhaseOutcomeRow
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
impl Clone for PhaseOutcome
Source§impl Debug for PhaseOutcome
impl Debug for PhaseOutcome
Source§impl<'de> Deserialize<'de> for PhaseOutcome
impl<'de> Deserialize<'de> for PhaseOutcome
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PhaseOutcome
impl PartialEq for PhaseOutcome
Source§impl Serialize for PhaseOutcome
impl Serialize for PhaseOutcome
impl StructuralPartialEq for PhaseOutcome
Auto Trait Implementations§
impl Freeze for PhaseOutcome
impl RefUnwindSafe for PhaseOutcome
impl Send for PhaseOutcome
impl Sync for PhaseOutcome
impl Unpin for PhaseOutcome
impl UnsafeUnpin for PhaseOutcome
impl UnwindSafe for PhaseOutcome
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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