/// Derive a canonical `channel_id` from a `session_id` string.
///
/// Used when only a session identifier is available (e.g., background learning pipelines)
/// but we still want channel-scoped memory provenance.
///
/// Session IDs commonly follow patterns like:
/// - Slack: `slack:CHANNEL_ID:thread_ts` or `slack:CHANNEL_ID`
/// - Telegram: `bot:telegram:CHAT_ID`, `telegram:CHAT_ID`, or bare numeric chat IDs
/// - Discord: `discord:ch:ID` or `discord:dm:ID` (kept as-is)