pub struct ContextAssemblyInput<'a> {
pub memory: &'a ContextMemoryView,
pub context_manager: &'a ContextManager,
pub token_counter: &'a dyn TokenCounting,
pub skills_prompt: &'a str,
pub index: Option<&'a dyn IndexAccess>,
pub correction_config: Option<CorrectionConfig>,
pub sidequest_turn_counter: u64,
pub messages: &'a [Message],
pub query: &'a str,
pub scrub: fn(&str) -> Cow<'_, str>,
pub active_levels: &'a [CompressionLevel],
pub router: Box<dyn AsyncMemoryRouter + Send + Sync>,
}Expand description
All borrowed data needed to assemble context for one agent turn.
All fields are shared references — ContextAssembler::gather never mutates any state.
The caller (in zeph-core) is responsible for populating this struct and passing it to
crate::assembler::ContextAssembler::gather.
Fields§
§memory: &'a ContextMemoryViewSnapshot of memory subsystem configuration for this turn.
context_manager: &'a ContextManagerContext lifecycle state machine.
token_counter: &'a dyn TokenCountingToken counter for budget enforcement.
skills_prompt: &'a strText of the skills prompt injected in the last turn (used for budget calculation).
index: Option<&'a dyn IndexAccess>Index RAG accessor. None when code-index is disabled.
correction_config: Option<CorrectionConfig>Learning engine corrections config. None when self-learning is disabled.
sidequest_turn_counter: u64Current value of the sidequest turn counter, for adaptive strategy selection.
messages: &'a [Message]Message window snapshot used for strategy resolution and system-prompt extraction.
query: &'a strThe user query for the current turn, used as the search query for all memory lookups.
scrub: fn(&str) -> Cow<'_, str>Content scrubber for PII removal. Passed as a function pointer to avoid a dependency
on zeph-core’s redact module.
active_levels: &'a [CompressionLevel]Compression tiers active for this turn, derived from the retrieval policy.
The assembler skips fetchers whose tier is not present in this slice. An empty slice means “no tier filtering” — all fetchers run subject to their own budget gates. This is the defensive default: a caller that accidentally passes an empty slice will get the same behaviour as before this field existed, rather than silently dropping all memory recall.
A caller computing this from a config-driven policy must guarantee non-empty intent or accept that an empty slice disables tier-based filtering entirely.
router: Box<dyn AsyncMemoryRouter + Send + Sync>Pre-built memory router for this turn. Built by zeph-core via build_memory_router()
and passed in to avoid a zeph-memory dependency inside zeph-context.