Skip to main content

classify

Function classify 

Source
pub fn classify(msg: &Message) -> PageKind
Expand description

Classify a single chat-history entry.

Heuristic (Phase A):

PageKind::Constraint, PageKind::Plan, and PageKind::Preference require explicit producers (the .tasks.jsonl loader, swarm objectives, user prefs block) and are not reachable from this syntactic classifier. That is intentional — they are load-bearing invariant tags, not best-effort guesses.

§Examples

use codetether_agent::provider::{ContentPart, Message, Role};
use codetether_agent::session::pages::{PageKind, classify};

let user = Message {
    role: Role::User,
    content: vec![ContentPart::Text { text: "hi".into() }],
};
assert_eq!(classify(&user), PageKind::Conversation);