pub struct SessionSystemContextState {
pub pending: Vec<PendingSystemContextAppend>,
pub applied: Vec<PendingSystemContextAppend>,
pub seen: BTreeMap<String, SeenSystemContextKey>,
pub active_turn_pending_keys: BTreeSet<String>,
}Expand description
Durable control state for runtime system-context append requests.
Fields§
§pending: Vec<PendingSystemContextAppend>§applied: Vec<PendingSystemContextAppend>§seen: BTreeMap<String, SeenSystemContextKey>§active_turn_pending_keys: BTreeSet<String>Implementations§
Source§impl SessionSystemContextState
impl SessionSystemContextState
Sourcepub fn stage_append(
&mut self,
req: &AppendSystemContextRequest,
accepted_at: SystemTime,
) -> Result<AppendSystemContextStatus, SystemContextStageError>
pub fn stage_append( &mut self, req: &AppendSystemContextRequest, accepted_at: SystemTime, ) -> Result<AppendSystemContextStatus, SystemContextStageError>
Stage an append request, enforcing per-session idempotency.
Sourcepub fn stage_active_turn_append(
&mut self,
req: &AppendSystemContextRequest,
accepted_at: SystemTime,
) -> Result<AppendSystemContextStatus, SystemContextStageError>
pub fn stage_active_turn_append( &mut self, req: &AppendSystemContextRequest, accepted_at: SystemTime, ) -> Result<AppendSystemContextStatus, SystemContextStageError>
Stage an append that is scoped to the currently-active turn only.
If the active turn reaches another model boundary, normal pending
consumption moves it to applied. If the turn completes first, callers
should discard the still-pending active-turn keys so the context cannot
leak into an unrelated later run.
Sourcepub fn mark_pending_applied(&mut self)
pub fn mark_pending_applied(&mut self)
Mark all currently-pending appends as applied and clear the pending queue.
Sourcepub fn discard_unapplied_active_turn_pending(
&mut self,
) -> Vec<PendingSystemContextAppend>
pub fn discard_unapplied_active_turn_pending( &mut self, ) -> Vec<PendingSystemContextAppend>
Discard active-turn-only appends that were not consumed by the turn’s next LLM boundary.
Sourcepub fn discard_active_turn_pending_by_keys(
&mut self,
idempotency_keys: &[String],
) -> Vec<PendingSystemContextAppend>
pub fn discard_active_turn_pending_by_keys( &mut self, idempotency_keys: &[String], ) -> Vec<PendingSystemContextAppend>
Discard specific active-turn-only appends that are still pending.
This is the rollback companion for live-boundary staging. The runtime owns the accepted input, so if that commit fails after the session has staged context, the session-side projection must be removed by the same idempotency keys before the caller reports failure.
Trait Implementations§
Source§impl Clone for SessionSystemContextState
impl Clone for SessionSystemContextState
Source§fn clone(&self) -> SessionSystemContextState
fn clone(&self) -> SessionSystemContextState
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 SessionSystemContextState
impl Debug for SessionSystemContextState
Source§impl Default for SessionSystemContextState
impl Default for SessionSystemContextState
Source§fn default() -> SessionSystemContextState
fn default() -> SessionSystemContextState
Source§impl<'de> Deserialize<'de> for SessionSystemContextState
impl<'de> Deserialize<'de> for SessionSystemContextState
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 SessionSystemContextState
impl PartialEq for SessionSystemContextState
Source§fn eq(&self, other: &SessionSystemContextState) -> bool
fn eq(&self, other: &SessionSystemContextState) -> bool
self and other values to be equal, and is used by ==.impl Eq for SessionSystemContextState
impl StructuralPartialEq for SessionSystemContextState
Auto Trait Implementations§
impl Freeze for SessionSystemContextState
impl RefUnwindSafe for SessionSystemContextState
impl Send for SessionSystemContextState
impl Sync for SessionSystemContextState
impl Unpin for SessionSystemContextState
impl UnsafeUnpin for SessionSystemContextState
impl UnwindSafe for SessionSystemContextState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.