pub struct MemoryHit {
pub score: u32,
pub memory: bool,
pub id: i64,
pub kind: &'static str,
pub scope: String,
pub anchor: Option<String>,
pub anchor_state: &'static str,
pub applies: bool,
pub evidence: f64,
pub snippet: Option<String>,
}Expand description
A hit in the memory channel: something a session learned, never a graph fact and never a re-derivable one.
Deliberately not a SearchHit, for the reason GeneratedHit is not: a
memory record has no node, no provenance and no key, and giving it a
NodeSummary would be the first step towards its being treated like one.
Unlike either of the other channels, it also carries what the tree thinks of
it — MemoryHit::applies and MemoryHit::anchor_state — because a
lesson about code that has since moved is worth reading and worth labelling,
and returning it unlabelled would be the worse of the two mistakes.
Fields§
§score: u32Relevance within the memory channel. Not comparable with a
SearchHit::score or a GeneratedHit::score: three channels, three
scorers, on purpose.
memory: boolAlways true. A marker a consumer cannot miss or forget to check.
id: i64The record’s id — its generation, and what roteiro memory forget takes.
kind: &'static strWhat kind of knowledge it is (lesson | attempt | …).
scope: StringThe namespace it was recorded in. Not a branch label.
anchor: Option<String>The node key it is anchored to, if any.
anchor_state: &'static strWhat that anchor is worth against the current tree (valid | drifted |
vanished | unverifiable | unanchored).
applies: boolWhether this record applies to the tree being searched. A false here
is a label, never a reason to have withheld the hit.
evidence: f64The evidence multiplier the record’s own ranking gave it
(base_confidence × anchor_penalty), reported so the channel’s score can
be taken apart.
snippet: Option<String>A bounded, whitespace-collapsed excerpt of the body, on the same terms as
SearchHit::snippet.