pub struct Playbook {
pub entries: Vec<PlaybookEntry>,
pub next_id: u32,
}Fields§
§entries: Vec<PlaybookEntry>§next_id: u32Implementations§
Source§impl Playbook
impl Playbook
Sourcepub fn add_delta(
&mut self,
kind: EntryKind,
content: &str,
turn: u32,
) -> DeltaOutcome
pub fn add_delta( &mut self, kind: EntryKind, content: &str, turn: u32, ) -> DeltaOutcome
Grow-and-refine insert: near-duplicates confirm the existing entry (bump + helpful vote) instead of creating drift. Existing entries are NEVER rewritten — that is the ACE anti-collapse invariant.
Sourcepub fn vote(&mut self, id: u32, helpful: bool) -> bool
pub fn vote(&mut self, id: u32, helpful: bool) -> bool
Vote on an entry by stable ID (agent feedback via ctx_session).
Sourcepub fn evict(&mut self, current_turn: u32) -> usize
pub fn evict(&mut self, current_turn: u32) -> usize
Local eviction only: net-harmful entries and entries unconfirmed for STALE_TURNS die. No global re-summarization ever happens.
Sourcepub fn render(&self, top_k: usize) -> String
pub fn render(&self, top_k: usize) -> String
Render ordered by stable ID (prefix-cache friendly: old entries keep
their byte positions). When top_k is exceeded, the lowest-salience
entries are elided — never rewritten.
Sourcepub fn information_volume(&self) -> usize
pub fn information_volume(&self) -> usize
Total content volume (entries × chars) — used by the brevity-bias regression test: repeated checkpoints must never shrink this.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Playbook
impl<'de> Deserialize<'de> for Playbook
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Playbook
impl RefUnwindSafe for Playbook
impl Send for Playbook
impl Sync for Playbook
impl Unpin for Playbook
impl UnsafeUnpin for Playbook
impl UnwindSafe for Playbook
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
Mutably borrows from an owned value. Read more
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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
Converts
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>
Converts
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