pub struct RecalledMemory {
pub score: f64,
pub injected: bool,
pub text: String,
pub run_id: Option<String>,
}Expand description
One memory recalled by recall_session, with the flag that says whether
it actually reached the model (UI Phase 1; text/run_id added for
DOC-39 Slice C — the “what memory drove this / what was held back”
context-construction debugging view).
Why: see Event::MemoryRecalled — injected is the whole point of the
event. score rides along because the UI renders it beside the memory
(“41% · held”), and re-deriving it client-side is impossible: it is the
memory daemon’s own relevance score. Before DOC-39 Slice C, text was
dropped at this exact boundary: tools::recall_session::render_results
always had the recalled content in hand (it is what gets rendered/token-
budgeted), but only the score and injected flag escaped into telemetry —
so a held-back memory could be COUNTED but never READ by the UI, which
defeats the “what was held back” debugging surface’s entire point.
What: score is trusty-memory’s relevance score for the query, verbatim.
injected is true when the tool’s rendered result text included this
result whole, false when its token budget dropped it. text is the
recalled memory’s raw content (untruncated — the same string
render_results reads from content), empty string when the source
entry carried no readable content rather than panicking. run_id is the
originating run/session identifier the daemon result was tagged with,
when the daemon’s response carries one; None when absent (the current
trusty-memory memory_recall response shape does not yet emit this
field — see docs/specs/trusty-code-harness-ui.md §5.3 — so None is
the expected value today, not a parsing failure). Both new fields are
#[serde(default)] so a ring-buffer/transcript entry recorded before this
ticket still deserializes.
Test: recalled_memory_round_trips_through_json,
tools::recall_session::tests::telemetry_carries_recalled_text_and_run_id.
Fields§
§score: f64trusty-memory’s relevance score for this result, as returned.
injected: boolWhether this result entered the model’s context (false = recalled
but held back by the tool’s token budget).
text: StringThe recalled memory’s raw text content (DOC-39 Slice C). Empty string
when the source entry carried no readable content.
run_id: Option<String>The originating run/session id the daemon tagged this result with, if
any (DOC-39 Slice C). None when the daemon response carries no such
field — see the struct docs.
Trait Implementations§
Source§impl Clone for RecalledMemory
impl Clone for RecalledMemory
Source§fn clone(&self) -> RecalledMemory
fn clone(&self) -> RecalledMemory
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 RecalledMemory
impl Debug for RecalledMemory
Source§impl<'de> Deserialize<'de> for RecalledMemory
impl<'de> Deserialize<'de> for RecalledMemory
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 RecalledMemory
impl PartialEq for RecalledMemory
Source§impl Serialize for RecalledMemory
impl Serialize for RecalledMemory
impl StructuralPartialEq for RecalledMemory
Auto Trait Implementations§
impl Freeze for RecalledMemory
impl RefUnwindSafe for RecalledMemory
impl Send for RecalledMemory
impl Sync for RecalledMemory
impl Unpin for RecalledMemory
impl UnsafeUnpin for RecalledMemory
impl UnwindSafe for RecalledMemory
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<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