pub struct ContextAssembler { /* private fields */ }Expand description
The main assembly engine.
Implementations§
Source§impl ContextAssembler
impl ContextAssembler
pub fn new() -> Self
Sourcepub fn with_renderer(self, renderer: Box<dyn GrainRenderer>) -> Self
pub fn with_renderer(self, renderer: Box<dyn GrainRenderer>) -> Self
Register a custom renderer (replaces default for that grain type).
Sourcepub fn with_decider(self, decider: Arc<dyn DecisionBackend>) -> Self
pub fn with_decider(self, decider: Arc<dyn DecisionBackend>) -> Self
Install a decision backend (docs/decision-model-proposal.md rows
A2/A3). With one installed and a query text on the policy (or the
hints), Self::format_with_hints asks it:
- A3 — one
choiceon the query (timeline / current_state / general) in place of the temporal and recency keyword lists. The hint flags (has_temporal_expr,has_time_range) still win. - A2 — per candidate (≥ 2 hits), relevance (
score, 4 levels) and whether a summary would lose a needed detail (noul). The relevance replaces the recall score’s input to the priority; for a CALIBRATED backend a candidate belowdrop_belowis omitted and one at or abovefull_aboveprefers Full (the 95% budget line stays final). Uncalibrated: reorder only.
Any backend error or malformed answer falls back to today’s rule for
that question. FormatPolicy::decide tunes it; None there means
DecidePolicy::default. The result’s decision field says who
judged. Host config — the backend is never persisted anywhere.
Sourcepub fn format(
&self,
hits: &[SearchHit],
policy: &FormatPolicy,
) -> FormattedContext
pub fn format( &self, hits: &[SearchHit], policy: &FormatPolicy, ) -> FormattedContext
Format a set of search hits into LLM-ready context.
Equivalent to format_with_hints(hits, policy, &RenderingHints::default()) —
no structured rendering modes are activated.
Sourcepub fn format_with_hints(
&self,
hits: &[SearchHit],
policy: &FormatPolicy,
hints: &RenderingHints,
) -> FormattedContext
pub fn format_with_hints( &self, hits: &[SearchHit], policy: &FormatPolicy, hints: &RenderingHints, ) -> FormattedContext
RF-4: Format with structured rendering hints.
Selects one of three intent-aware rendering modes based on the hints, checked in priority order:
- Aggregation mode (entity_count present)
- Timeline mode (temporal intent detected — chronological with deltas)
- Census mode (primary + census section split)
- Relevance highlighting (> 10 grains)
- Default rendering (unchanged)
JSON output bypasses all modes and renders normally.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ContextAssembler
impl !UnwindSafe for ContextAssembler
impl Freeze for ContextAssembler
impl Send for ContextAssembler
impl Sync for ContextAssembler
impl Unpin for ContextAssembler
impl UnsafeUnpin for ContextAssembler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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