Skip to main content

ContextAssemblyView

Struct ContextAssemblyView 

Source
pub struct ContextAssemblyView<'a> {
Show 44 fields pub memory: Option<Arc<SemanticMemory>>, pub conversation_id: Option<ConversationId>, pub recall_limit: usize, pub cross_session_score_threshold: f32, pub context_format: ContextFormat, pub last_recall_confidence: &'a mut Option<f32>, pub context_strategy: ContextStrategy, pub crossover_turn_threshold: u32, pub cached_session_digest: Option<(String, usize)>, pub digest_enabled: bool, pub graph_config: GraphConfig, pub document_config: DocumentConfig, pub persona_config: PersonaConfig, pub trajectory_config: TrajectoryConfig, pub reasoning_config: ReasoningConfig, pub memcot_config: MemCotConfig, pub memcot_state: Option<String>, pub tree_config: TreeConfig, pub last_skills_prompt: &'a mut String, pub active_skill_names: &'a mut Vec<String>, pub skill_registry: Arc<RwLock<SkillRegistry>>, pub skill_paths: &'a [PathBuf], pub correction_config: Option<CorrectionConfig>, pub sidequest_turn_counter: u64, pub proactive_explorer: Option<Arc<ProactiveExplorer>>, pub sanitizer: &'a ContentSanitizer, pub quarantine_summarizer: Option<&'a QuarantinedSummarizer>, pub context_manager: &'a mut ContextManager, pub token_counter: Arc<TokenCounter>, pub metrics: MetricsCounters, pub security_events: &'a mut dyn SecurityEventSink, pub cached_prompt_tokens: u64, pub redact_credentials: bool, pub channel_skills: &'a [String], pub scrub: fn(&str) -> Cow<'_, str>, pub tiered_retrieval_config: TieredRetrievalConfig, pub tiered_retrieval_classifier: Option<Arc<AnyProvider>>, pub tiered_retrieval_validator: Option<Arc<AnyProvider>>, pub fidelity_config: Option<&'a FidelityConfig>, pub fidelity_semantic_provider: Option<Arc<AnyProvider>>, pub fidelity_compress_provider: Option<Arc<AnyProvider>>, pub planned_next_tools: &'a [PlannedToolHint], pub status_tx: Option<UnboundedSender<String>>, pub task_supervisor: Arc<TaskSupervisor>,
}
Expand description

Borrow-lens over all fields needed for prepare_context and Agent<C>::rebuild_system_prompt.

Every field maps to a single sub-field of Agent<C> and uses a type from a lower-level crate (zeph-memory, zeph-skills, zeph-context, zeph-sanitizer, zeph-config, zeph-common, zeph-llm). No zeph-core-internal *State aggregator ever crosses this boundary.

Constructed by the zeph-core shim using one literal struct expression. The borrow checker verifies disjointness because no two &mut paths share a prefix.

Fields§

§memory: Option<Arc<SemanticMemory>>

services.memory.persistence.memoryArc clone is cheap.

§conversation_id: Option<ConversationId>

services.memory.persistence.conversation_id.

§recall_limit: usize

services.memory.persistence.recall_limit.

§cross_session_score_threshold: f32

services.memory.persistence.cross_session_score_threshold.

§context_format: ContextFormat

services.memory.persistence.context_format — determines recall entry formatting.

§last_recall_confidence: &'a mut Option<f32>

services.memory.persistence.last_recall_confidence — written by apply path.

§context_strategy: ContextStrategy

services.memory.compaction.context_strategy (Copy enum).

§crossover_turn_threshold: u32

services.memory.compaction.crossover_turn_threshold.

§cached_session_digest: Option<(String, usize)>

services.memory.compaction.cached_session_digest — cloned into assembler input.

The usize is the token count of the digest (used by ContextMemoryView).

§digest_enabled: bool

services.memory.compaction.digest_config.enabled.

§graph_config: GraphConfig

services.memory.extraction.graph_config — cloned (small, Clone).

§document_config: DocumentConfig

services.memory.extraction.document_config — cloned.

§persona_config: PersonaConfig

services.memory.extraction.persona_config — cloned.

§trajectory_config: TrajectoryConfig

services.memory.extraction.trajectory_config — cloned.

§reasoning_config: ReasoningConfig

services.memory.extraction.reasoning_config — cloned.

§memcot_config: MemCotConfig

services.memory.extraction.memcot_config — cloned.

§memcot_state: Option<String>

Current MemCoT semantic state buffer. Some when the accumulator has a non-empty state.

Snapshot taken at context-assembly time; used to prefix graph recall queries.

§tree_config: TreeConfig

services.memory.subsystems.tree_config — cloned.

§last_skills_prompt: &'a mut String

services.skill.last_skills_prompt — written by Agent<C>::rebuild_system_prompt.

§active_skill_names: &'a mut Vec<String>

services.skill.active_skill_names — written by Agent<C>::rebuild_system_prompt.

§skill_registry: Arc<RwLock<SkillRegistry>>

services.skill.registryArc clone enables concurrent read access.

§skill_paths: &'a [PathBuf]

services.skill.skill_paths — read during proactive reload.

§correction_config: Option<CorrectionConfig>

Built at the shim from services.learning_engine.config — the engine itself never crosses the crate boundary.

§sidequest_turn_counter: u64

services.sidequest.turn_counter.

§proactive_explorer: Option<Arc<ProactiveExplorer>>

services.proactive_explorerArc clone for async use without borrowing self.

§sanitizer: &'a ContentSanitizer

services.security.sanitizer — borrowed from SecurityState; not Arc-wrapped in zeph-core.

§quarantine_summarizer: Option<&'a QuarantinedSummarizer>

services.security.quarantine_summarizer — borrowed from SecurityState.

§context_manager: &'a mut ContextManager

self.context_manager — mutably borrowed for token recompute hooks.

§token_counter: Arc<TokenCounter>

runtime.metrics.token_counterArc clone is cheap.

§metrics: MetricsCounters

Accumulated metric deltas — incremented during the pass, applied to the metrics snapshot by the zeph-core shim after prepare_context returns.

§security_events: &'a mut dyn SecurityEventSink

Abstract sink for security events raised during context assembly.

§cached_prompt_tokens: u64

runtime.providers.cached_prompt_tokens — read for compression-spectrum ratio.

§redact_credentials: bool

runtime.config.redact_credentials.

§channel_skills: &'a [String]

runtime.config.channel_skills — per-channel skill filter for system prompt rebuild.

§scrub: fn(&str) -> Cow<'_, str>

Function pointer for scrubbing credentials from message content.

Passed as a function pointer so zeph-agent-context does not need to depend on zeph-core::redact. The shim in zeph-core sets this to crate::redact::scrub_content. When redact_credentials = false the service does not call this function.

§tiered_retrieval_config: TieredRetrievalConfig

MemFlow tiered retrieval configuration ([memory.tiered_retrieval]).

When enabled = true, inject_semantic_recall dispatches to zeph_memory::recall_tiered instead of the flat fetch_semantic_recall_raw path.

§tiered_retrieval_classifier: Option<Arc<AnyProvider>>

Optional provider for LLM-backed intent classification in tiered retrieval.

Resolved from tiered_retrieval.classifier_provider at agent construction. None means the HeuristicRouter is used (no LLM call).

§tiered_retrieval_validator: Option<Arc<AnyProvider>>

Optional provider for evidence quality validation and tier escalation.

Resolved from tiered_retrieval.validator_provider at agent construction. None means validation is skipped (evidence accepted as-is).

§fidelity_config: Option<&'a FidelityConfig>

Fidelity scoring configuration resolved from [memory.fidelity].

None when fidelity scoring is not configured (treated as enabled = false). Some(&cfg) with cfg.enabled = false is also a no-op (early-return inside scorer).

§fidelity_semantic_provider: Option<Arc<AnyProvider>>

LLM provider used for query and per-message embeddings when fidelity_config.semantic_scoring_provider is set. Resolved at construction time. None → keyword overlap fallback is used.

§fidelity_compress_provider: Option<Arc<AnyProvider>>

LLM provider used for Compressed rendering when fidelity_config.compress_provider is set. Resolved by the agent from [[llm.providers]] at construction time. None → truncation fallback is used.

§planned_next_tools: &'a [PlannedToolHint]

Lookahead tool hints derived from the orchestration DAG.

Empty slice when no DAG lookahead is available (PAACE deferred to P2). The scorer simply zeroes the plan signal when the slice is empty.

§status_tx: Option<UnboundedSender<String>>

TUI status channel for spinner updates during fidelity scoring.

Mirrors the channel wired in ContextSummarizationView::status_tx. None in non-TUI modes; the service skips sending when the sender is absent.

§task_supervisor: Arc<TaskSupervisor>

Background task supervisor for registering JoinHandles produced during context assembly (e.g. mark_reasoning_used in fetch_reasoning_strategies).

Handles drained from PreparedContext::background_tasks are wrapped and registered here so they remain tracked and abortable instead of being silently dropped when PreparedContext goes out of scope.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more