pub struct Persona {
pub name: String,
pub description: String,
pub tool_profile: ToolProfile,
pub default_read_mode: String,
pub compressor: String,
pub chunker: String,
pub intent_taxonomy: Vec<String>,
pub sensitivity_floor: SensitivityLevel,
}Expand description
A resolved persona ready to drive the pipeline.
Fields§
§name: String§description: String§tool_profile: ToolProfile§default_read_mode: String§compressor: String§chunker: String§intent_taxonomy: Vec<String>§sensitivity_floor: SensitivityLevelImplementations§
Source§impl Persona
impl Persona
Sourcepub fn coding() -> Self
pub fn coding() -> Self
The built-in coding persona — reproduces today’s default behavior so
existing installs see no change.
Sourcepub fn builtin(name: &str) -> Option<Self>
pub fn builtin(name: &str) -> Option<Self>
Built-in presets by name (sales is an alias of lead-gen).
Sourcepub fn builtin_names() -> Vec<String>
pub fn builtin_names() -> Vec<String>
Names of the built-in presets (sorted, canonical names only).
Sourcepub fn data_analysis() -> Self
pub fn data_analysis() -> Self
data-analysis: structured-data ingestion and reporting.
Sourcepub fn resolve(cfg: &Config) -> Self
pub fn resolve(cfg: &Config) -> Self
Resolve the active persona for this config.
Priority: LEAN_CTX_PERSONA env > config persona > DEFAULT_PERSONA.
A name is resolved against built-ins first, then a <personas_dir>/<name>.toml
file. Unknown/invalid names fall back to coding (never an error at a
call site — selection is best-effort).
Sourcepub fn effective_tool_profile(&self, cfg: &Config) -> ToolProfile
pub fn effective_tool_profile(&self, cfg: &Config) -> ToolProfile
The effective tool surface: an explicit tool-profile setting (env/config) always wins (backward compatible); otherwise the persona supplies it.
Sourcepub fn read_mode_override(&self) -> Option<String>
pub fn read_mode_override(&self) -> Option<String>
The persona’s ctx_read mode override, used when the caller passes no
explicit mode and no context policy pack pins a default. "auto"
(the coding default) means “no opinion” — the profile/auto selection
decides, exactly as before personas existed.
Sourcepub fn prompt_block(&self) -> String
pub fn prompt_block(&self) -> String
Domain prompt block for the MCP instructions (persona-spec-v1:
“vocabulary + intent list”). Empty for the coding default so existing
installs stay byte-identical (#498 prompt-cache stability). For any
other persona the block is a deterministic function of the persona —
stable across sessions, so provider prompt caching still applies.
Trait Implementations§
impl Eq for Persona
impl StructuralPartialEq for Persona
Auto Trait Implementations§
impl Freeze for Persona
impl RefUnwindSafe for Persona
impl Send for Persona
impl Sync for Persona
impl Unpin for Persona
impl UnsafeUnpin for Persona
impl UnwindSafe for Persona
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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