pub fn compact_text_mut( text: &str, limit: usize, cache: &mut Option<Value>, ) -> (String, bool)
Collapse code blocks then truncate if over limit, mutating cache in place. Returns (text, was_truncated).