pub fn classify(msg: &Message) -> PageKindExpand description
Classify a single chat-history entry.
Heuristic (Phase A):
Role::System→PageKind::Bootstrap.Role::Toolor any content part that isContentPart::ToolResult→PageKind::Evidence.- Everything else →
PageKind::Conversation.
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);