pub struct EventLog { /* private fields */ }Expand description
In-process append-only event log.
Implementations§
Source§impl EventLog
impl EventLog
pub const fn new() -> Self
Sourcepub fn append(
&mut self,
kind: &'static str,
payload: impl Into<String>,
) -> String
pub fn append( &mut self, kind: &'static str, payload: impl Into<String>, ) -> String
Append a new event with content-addressed id.
The id is derived from the kind, the payload, and the current log length so that repeated events produce stable, distinct ids.
pub fn events(&self) -> &[Event]
Sourcepub fn first_of(&self, kind: &str) -> Option<&Event>
pub fn first_of(&self, kind: &str) -> Option<&Event>
Returns the first event of the given kind, if any.
Sourcepub fn last_of(&self, kind: &str) -> Option<&Event>
pub fn last_of(&self, kind: &str) -> Option<&Event>
Returns the most recent event of the given kind, if any.
Sourcepub fn evidence_links(&self) -> Vec<String>
pub fn evidence_links(&self) -> Vec<String>
Project the log to a list of <kind>:<id> links for the user-facing
evidence array. Each link points back to a distinct event.
Sourcepub fn steps_block(&self) -> String
pub fn steps_block(&self) -> String
Build a Links Notation steps block listing every event in order.
Used by trace serialization in crate::solver.
Sourcepub fn thinking_steps(&self) -> Vec<ThinkingStep>
pub fn thinking_steps(&self) -> Vec<ThinkingStep>
Project raw solver events into user-readable, ordered thinking steps.
This is the curated projection introduced for issue #488. Instead of a
noisy 1:1 dump of every internal event, it keeps only the meaningful
reasoning milestones, cleans each detail down to concrete content,
folds the calculator’s reduction trace into one composite compute step
with detailed children, de-duplicates consecutive repeats, and labels the
universal-algorithm phases high so the minimum granularity surfaces only
the high-level direction.
The raw, lossless trace stays available to maintainers through
EventLog::steps_block and EventLog::evidence_links.
Sourcepub fn thinking_steps_for_answer(&self, final_answer: &str) -> Vec<ThinkingStep>
pub fn thinking_steps_for_answer(&self, final_answer: &str) -> Vec<ThinkingStep>
Like EventLog::thinking_steps, but substitutes the actual composed
answer for the opaque response:<route> payload of the closing
deformalize step so the final reasoning step is concrete (issue #488).
Sourcepub fn append_to_link_store<S: LinkStore>(
&self,
store: &mut S,
) -> Result<usize, LinkStoreError>
pub fn append_to_link_store<S: LinkStore>( &self, store: &mut S, ) -> Result<usize, LinkStoreError>
Replay every in-process event into a durable link store projection.
This is additive: the original event log remains in-process, while
the target store receives memory records that can be exported as
.lino or reduced to doublets by the active backend.