pub struct ReplayEntry {
pub run_id: RunId,
pub step_ref: String,
pub input_hash: String,
pub occurrence: u32,
pub ctx_snapshot_json: String,
pub step_output_json: String,
pub created_at: u64,
}Expand description
One persisted row in the replay log — a step’s completion snapshot the
dispatcher stored after DispatchOutcome::Pass.
The row’s identity is the 4-tuple (run_id, step_ref, input_hash, occurrence); the SQLite backend enforces this as a UNIQUE constraint.
ctx_snapshot_json and step_output_json are the two payloads: the
former is a full Ctx serde-JSON with operator dropped by the
#[serde(skip)] on that field, and the latter is the DispatchOutcome::Pass
value the worker produced (audit + the value the replay hit returns).
Fields§
§run_id: RunIdThe Run this dispatch belonged to (issue #13 hierarchy).
step_ref: StringBlueprint step ref that was dispatched (TaskSpec.agent at the
engine boundary).
input_hash: StringDeterministic hex-encoded SHA-256 hash of the resolved input value
— see hash_input_value.
occurrence: u32Zero-based counter for repeated dispatches of the same
(run_id, step_ref, input_hash) triple within one Run.
ctx_snapshot_json: StringSerde-JSON of the whole Ctx at the moment the step passed.
Ctx.operator is dropped by the #[serde(skip)] on that field —
see this module’s doc.
step_output_json: StringSerde-JSON of the DispatchOutcome::Pass value.
created_at: u64Unix epoch seconds — when this row was recorded.
Implementations§
Source§impl ReplayEntry
impl ReplayEntry
Sourcepub fn from_completion(
run_id: RunId,
step_ref: impl Into<String>,
input_hash: impl Into<String>,
occurrence: u32,
ctx: &Ctx,
step_output: &Value,
) -> Result<Self, ReplayStoreError>
pub fn from_completion( run_id: RunId, step_ref: impl Into<String>, input_hash: impl Into<String>, occurrence: u32, ctx: &Ctx, step_output: &Value, ) -> Result<Self, ReplayStoreError>
Build a fresh entry from the dispatch-completion state, encoding
ctx + step_output to their JSON representations and stamping
created_at to now_unix(). Returns a ReplayStoreError::Encode
if either serialization fails.
Sourcepub fn decode_step_output(&self) -> Result<Value, ReplayStoreError>
pub fn decode_step_output(&self) -> Result<Value, ReplayStoreError>
Decode the step_output_json back to a Value — used by the
replay-hit path in Engine::dispatch_attempt_with_run_ctx to hand
a DispatchOutcome::Pass back to the caller without touching the
Adapter.
Sourcepub fn decode_ctx_snapshot(&self) -> Result<Ctx, ReplayStoreError>
pub fn decode_ctx_snapshot(&self) -> Result<Ctx, ReplayStoreError>
Decode the ctx_snapshot_json back to a Ctx. Ctx.operator
is not serialized (#[serde(skip)]), so the round-tripped value
carries OperatorInfo::default() in that field.
Trait Implementations§
Source§impl Clone for ReplayEntry
impl Clone for ReplayEntry
Source§fn clone(&self) -> ReplayEntry
fn clone(&self) -> ReplayEntry
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 ReplayEntry
impl Debug for ReplayEntry
Source§impl<'de> Deserialize<'de> for ReplayEntry
impl<'de> Deserialize<'de> for ReplayEntry
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>,
Auto Trait Implementations§
impl Freeze for ReplayEntry
impl RefUnwindSafe for ReplayEntry
impl Send for ReplayEntry
impl Sync for ReplayEntry
impl Unpin for ReplayEntry
impl UnsafeUnpin for ReplayEntry
impl UnwindSafe for ReplayEntry
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