pi-mono 深度導讀 5:Session Tree——Append-only JSONL、Branching 不改歷史、Compaction 邏輯完整解析
SessionManager 核心:JSONL append-only 儲存、id/parentId 形成樹、branch() 移動 leaf pointer 不改歷史、buildSessionContext() 處理 compaction entry、createBranchedSession() fork 新檔案。完整 Entry 類型:message、thinking_level_change、model_change、compaction、branch_summary、custom、custom_message、label、session_info。Migration v1→v2→v3 細節。