pub fn replace_messages(id: &str, messages: &[Value])
Replace the transcript’s message list wholesale. Used by the in-loop compaction path, which operates on JSON messages.