pub struct Handoff {
pub text: String,
pub version: String,
pub covered_turns: usize,
pub covered_messages: usize,
pub covered_from: Option<u64>,
pub covered_to: Option<u64>,
pub generated_at_ms: u64,
pub judgement: Option<Judgement>,
}Expand description
The deterministic handoff compiled from the dropped middle, stored beside the summary so the work is done once per covered range rather than once per request.
It carries the renderer’s own version: a handoff written by a build that shaped the text differently is not reused, because reusing it would put two shapes of the same document in one session’s history.
Fields§
§text: String§version: Stringcrate::compact::VERSION when it was compiled.
covered_turns: usizeMiddle turns this document stands in for.
covered_messages: usizeMiddle messages this document stands in for.
covered_from: Option<u64>The seq of the first and last message the document stands in for, when the caller knew
them. The counts describe a size, not a window: crate::context::Trimmed is relative
to head_end, and head_end flips between 0 and first_end when the budget, the
model or protect_last_n changes while the tail shifts to compensate — so “1 turn, 2
messages” names several different windows, and a document reused for the wrong one
describes messages that are still verbatim in the same request.
covered_to: Option<u64>§generated_at_ms: u64§judgement: Option<Judgement>The bounded judgement pass’s answer, when one survived the validator and went into
Handoff::text. Kept beside it so the readout and the harness can say what the model
contributed and on whose authority, without parsing the document.
Implementations§
Source§impl Handoff
impl Handoff
Sourcepub fn covers(
&self,
turns: usize,
messages: usize,
from: Option<u64>,
to: Option<u64>,
) -> bool
pub fn covers( &self, turns: usize, messages: usize, from: Option<u64>, to: Option<u64>, ) -> bool
Usable as-is for turns/messages only when it was compiled for exactly that range and
by this shape of compiler. A handoff for a larger range is not an extension of a
smaller one — the sections are re-rendered, not appended — so a wider document would
describe messages that are still present verbatim.
The counts alone are not the range: the same pair of numbers names a different window
whenever head_end moves. from/to are the seq of the first and last covered
message, and a stored document that does not carry them is not reused — a recompile costs
milliseconds, and a wrong document costs the model’s trust in its own history.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Handoff
impl<'de> Deserialize<'de> for Handoff
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>,
impl Eq for Handoff
impl StructuralPartialEq for Handoff
Auto Trait Implementations§
impl Forget for Handoff
impl Freeze for Handoff
impl Move for Handoff
impl RefUnwindSafe for Handoff
impl Send for Handoffwhere
RawVecInner: Send,
impl Sync for Handoffwhere
RawVecInner: Sync,
impl Unpin for Handoff
impl UnsafeUnpin for Handoff
impl UnwindSafe for Handoffwhere
RawVecInner: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.