pub fn select(
messages: &[MessageRecord],
tail_turns: usize,
keep_tokens: usize,
) -> SelectionResultExpand description
Selects which messages to compact and which to retain.
§Arguments
messages- The full session message history, in chronological order.tail_turns- Number of recent turns to preserve intact (default 2).keep_tokens- Token budget for the retained tail.
§Returns
A SelectionResult with head (to compact), tail (to retain),
and tail_start_id (first retained message ID).