pub struct MessageMetadata {
pub visibility: MessageVisibility,
pub compacted_at: Option<i64>,
pub deferred_summary: Option<String>,
pub focus_pinned: bool,
pub focus_marker_id: Option<Uuid>,
pub db_id: Option<i64>,
pub fidelity_tag: Option<ContextFidelity>,
pub embedding: Option<Vec<f32>>,
pub trust_level: Option<u8>,
}Expand description
Per-message visibility and metadata controlling agent context and user display.
Constructors agent_only, user_only,
and focus_pinned cover the most common combinations.
Fields§
§visibility: MessageVisibilityWho can see this message.
compacted_at: Option<i64>Unix timestamp (seconds) when this message was compacted, if applicable.
deferred_summary: Option<String>Pre-computed tool pair summary, applied lazily when context pressure rises. Stored on the tool response message; cleared after application.
focus_pinned: boolWhen true, this message is excluded from all compaction passes (soft pruning, hard summarization, sidequest eviction). Used for the Focus Knowledge block (#1850).
focus_marker_id: Option<Uuid>Unique marker UUID set when start_focus begins a session. Used by complete_focus
to locate the checkpoint without relying on a fragile raw index.
db_id: Option<i64>SQLite row ID for this message. Populated when loading from DB or after persisting.
Never serialized — always re-populated from the database on load.
fidelity_tag: Option<ContextFidelity>Fidelity level assigned by FidelityScorer during context assembly.
None when fidelity scoring is disabled or the message has not yet been scored.
Used for debug tracing and compaction input filtering (INV-02).
embedding: Option<Vec<f32>>Cached embedding vector for semantic fidelity scoring.
In-memory only — not serialized or persisted to the database.
trust_level: Option<u8>Write-time memory-consent gate content-trust tier (issue #6490 MemGhost, #6558 fix).
Raw u8 discriminant of zeph_sanitizer::ContentTrustLevel (kept as a plain integer
here, not the enum itself, since zeph-llm does not depend on zeph-sanitizer — mirrors
zeph_core::memory_tools::MemoryConsentTrustSlot’s same representation choice). Set on
tool-result batch messages by Agent::process_tool_result_batch to the batch’s
worst-case trust tier. Scanned by Agent::context_max_trust_level so untrusted content
is still recognized by the memory-consent gate for as long as it remains in the live
conversation context — including across a user-turn boundary — rather than only for the
single turn in which it was fetched.
Implementations§
Source§impl MessageMetadata
impl MessageMetadata
Sourcepub fn agent_only() -> Self
pub fn agent_only() -> Self
Message visible only to the agent (e.g. compaction summary).
Sourcepub fn focus_pinned() -> Self
pub fn focus_pinned() -> Self
Pinned Knowledge block — excluded from all compaction passes.
Trait Implementations§
Source§impl Clone for MessageMetadata
impl Clone for MessageMetadata
Source§fn clone(&self) -> MessageMetadata
fn clone(&self) -> MessageMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more