pub struct MessageContentSignal {
pub message_length: usize,
pub line_count: usize,
pub has_code_blocks: bool,
pub file_path_count: usize,
pub symbol_density: f64,
pub is_question: bool,
pub is_single_sentence: bool,
}Expand description
Signal derived from the structural properties of the last user message.
Language-agnostic — measures length, line count, code blocks, file paths, symbol density, etc. No keyword matching.
Fields§
§message_length: usizeCharacter count of the last user message.
line_count: usizeNumber of lines.
has_code_blocks: boolWhether the message contains code fences ( ).
file_path_count: usizeNumber of distinct file path references detected.
symbol_density: f64Ratio of code-like symbols to total characters.
is_question: boolWhether the message ends with ‘?’.
is_single_sentence: boolWhether it’s a short single-sentence (≤3 words, no newlines).
Implementations§
Source§impl MessageContentSignal
impl MessageContentSignal
Sourcepub fn extract(messages: &[Message]) -> MessageContentSignal
pub fn extract(messages: &[Message]) -> MessageContentSignal
Extract from the last user message in the conversation.
Sourcepub fn from_text(text: &str) -> MessageContentSignal
pub fn from_text(text: &str) -> MessageContentSignal
Analyze a raw text string.
Sourcepub fn normalized(&self) -> f64
pub fn normalized(&self) -> f64
Normalize to [0, 1] for scoring.
Contributions:
- length: 0–0.25
- line count: 0–0.15
- code blocks: 0 or 0.15
- file paths: 0–0.15
- symbol density: 0–0.15
- down-weight: question/short → −0.08/−0.06
Sourcepub fn decisive_tier(&self) -> Option<RouterTier>
pub fn decisive_tier(&self) -> Option<RouterTier>
Quick override: returns Some(tier) if the signal is decisive enough
to skip the full scoring pipeline.
Used by Layer 0 (“확실한가?”) — only triggers when the signal is overwhelmingly simple or complex.
Trait Implementations§
Source§impl Clone for MessageContentSignal
impl Clone for MessageContentSignal
Source§fn clone(&self) -> MessageContentSignal
fn clone(&self) -> MessageContentSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more