pub struct RunEvidenceCommit {Show 14 fields
pub run: RunRecord,
pub context_state: ResumableState,
pub environment_state: Option<Value>,
pub stream_records: Vec<AgentStreamRecord>,
pub checkpoints: Vec<AgentCheckpoint>,
pub approvals: Vec<ApprovalRecord>,
pub deferred_tools: Vec<DeferredToolRecord>,
pub stream_cursors: Vec<StreamCursorRef>,
pub display_messages: Vec<DisplayMessage>,
pub replay_events: Vec<ReplayEvent>,
pub display_snapshot: Option<ReplaySnapshot>,
pub publication_targets: StreamPublicationTargets,
pub host_event_publications: Vec<PendingHostEventPublication>,
pub related_run_updates: Vec<RelatedRunUpdate>,
}Expand description
Complete product-neutral durable evidence for one run.
A crate::SessionStore implementation must either persist all fields in this value or leave
its previous state unchanged. Repeating an identical commit is idempotent; reusing an evidence
identity with a different payload is an error.
Fields§
§run: RunRecordFinal or checkpointed run record.
context_state: ResumableStatePer-run resumable context state.
environment_state: Option<Value>Optional product-neutral serialized environment state.
stream_records: Vec<AgentStreamRecord>Raw runtime stream records.
checkpoints: Vec<AgentCheckpoint>Full runtime checkpoints. Legacy checkpoint references are not accepted here.
approvals: Vec<ApprovalRecord>Approval evidence created by the run.
deferred_tools: Vec<DeferredToolRecord>Deferred tool evidence created by the run.
stream_cursors: Vec<StreamCursorRef>Durable stream cursors selected by the caller.
display_messages: Vec<DisplayMessage>Display messages owned by this run’s replay scope.
replay_events: Vec<ReplayEvent>Replay events, including terminal markers, owned by this run’s replay scope.
display_snapshot: Option<ReplaySnapshot>Optional compact display snapshot for this run’s replay scope.
publication_targets: StreamPublicationTargetsExternal sink families transactionally enqueued with this evidence.
host_event_publications: Vec<PendingHostEventPublication>View-independent host events enqueued atomically with this evidence.
Existing runs transitioned atomically with this commit.
Implementations§
Source§impl RunEvidenceCommit
impl RunEvidenceCommit
Sourcepub const DIGEST_METADATA_KEY: &'static str = "starweaver.run_evidence_sha256"
pub const DIGEST_METADATA_KEY: &'static str = "starweaver.run_evidence_sha256"
Reserved legacy metadata key rejected to prevent caller-forged evidence digests.
Stores persist trusted digests independently from caller-controlled run metadata.
Sourcepub const fn new(run: RunRecord, context_state: ResumableState) -> Self
pub const fn new(run: RunRecord, context_state: ResumableState) -> Self
Build a run-evidence commit with no optional evidence.
Sourcepub fn validate(&self) -> SessionStoreResult<()>
pub fn validate(&self) -> SessionStoreResult<()>
Validate identities, terminal projections, cursor scopes, sequence uniqueness, snapshots, and environment shape for a new evidence write.
§Errors
Returns a store error when evidence members cannot belong to one atomic run commit.
Sourcepub fn validate_structure(&self) -> SessionStoreResult<()>
pub fn validate_structure(&self) -> SessionStoreResult<()>
Validate the legacy-compatible structure needed before exact-retry lookup.
This method does not authorize a new write: stores must call
Self::validate_terminal_projections after an exact-retry miss.
§Errors
Returns a store error when evidence members cannot safely identify one atomic commit.
Sourcepub fn validate_terminal_projections(&self) -> SessionStoreResult<()>
pub fn validate_terminal_projections(&self) -> SessionStoreResult<()>
Validate terminal projections before inserting new evidence.
Kept separate from structural validation so an exact retry of legacy evidence committed before terminal diagnostics existed remains idempotent across upgrades.
§Errors
Returns a store error when primary or related terminal evidence is incomplete.
Sourcepub fn digest(&self) -> SessionStoreResult<String>
pub fn digest(&self) -> SessionStoreResult<String>
Return the canonical SHA-256 digest for exact-retry conflict detection.
§Errors
Returns a store error when the bundle cannot be serialized.
Trait Implementations§
Source§impl Clone for RunEvidenceCommit
impl Clone for RunEvidenceCommit
Source§fn clone(&self) -> RunEvidenceCommit
fn clone(&self) -> RunEvidenceCommit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more