Struct CachedNarrative
pub struct CachedNarrative {
pub narrative: String,
pub subject: String,
pub grounded: bool,
pub unmatched: Vec<String>,
pub model: String,
pub prompt_version: u32,
pub schema_version: u32,
pub fact_digest: String,
pub created_at: String,
}Expand description
A cached advisory narrative plus the provenance a caller needs to decide whether it still describes the current evidence.
subject is the stable label the narrative describes — the repo-relative
file path for a file diagnosis — so a staleness check compares only against
the subject’s own narratives, never a sibling’s. fact_digest is the digest
of the fact-sheet text the narrative was written from; comparing it against a
freshly built sheet’s digest is how a caller detects that a cached narrative
has gone stale. created_at is an ISO-8601 UTC timestamp, so a lexical
ordering of two entries is a chronological one.
Fields§
§narrative: StringThe narrative text as the model produced it.
subject: StringThe subject the narrative describes — the repo-relative file path for a file diagnosis, or a caller-chosen stable label for other lenses. Older sidecars written before this field existed deserialize as the empty string, which matches no real subject and so is simply never served.
grounded: boolThe generation-time groundedness verdict: whether every number the
narrative quoted was grounded in the fact sheet when it was written.
narrate recomputes the verdict from the cached narrative on every read,
so a checker improvement applies to warm caches; this field records what
the writing binary saw.
unmatched: Vec<String>The numeric tokens that matched no fact value at generation time (empty
iff grounded). Like grounded, this is the writing binary’s verdict;
narrate recomputes it from the cached narrative on read.
model: StringThe model id that produced the narrative.
prompt_version: u32The prompt-template version in force when it was generated.
schema_version: u32The fact-sheet schema version in force when it was generated.
fact_digest: StringLowercase-hex SHA-256 of the fact-sheet text the narrative describes.
created_at: StringISO-8601 UTC timestamp of when the narrative was cached.
Trait Implementations§
§impl Clone for CachedNarrative
impl Clone for CachedNarrative
§fn clone(&self) -> CachedNarrative
fn clone(&self) -> CachedNarrative
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for CachedNarrative
impl Debug for CachedNarrative
§impl<'de> Deserialize<'de> for CachedNarrative
impl<'de> Deserialize<'de> for CachedNarrative
§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 Serialize for CachedNarrative
impl Serialize for CachedNarrative
Auto Trait Implementations§
impl Freeze for CachedNarrative
impl RefUnwindSafe for CachedNarrative
impl Send for CachedNarrative
impl Sync for CachedNarrative
impl Unpin for CachedNarrative
impl UnsafeUnpin for CachedNarrative
impl UnwindSafe for CachedNarrative
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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