pub fn archive_session_output(
mstore: &Arc<Store>,
filestore: &Arc<FileStore>,
block_id: &str,
archive_dir: &Path,
) -> Result<(u64, i64), String>Expand description
Archive the FileStore “output” file for block_id:
- Read bytes from FileStore.
- Compress to
archive_dir/<block_id>.jsonl.gz. - Delete the FileStore entry to reclaim SQLite space.
- Write archive meta keys to the block.
Returns (archived_bytes, archived_at_ms).
If the FileStore entry is missing or empty, returns (0, now_ms) — no-op.
The bytes come from where the pane reads them (TranscriptSource): the agent’s own zone in the global
transcript store when the block is a defined agent’s and the zone has content, else the block’s own copy.
Only the block’s own files are deleted (the zone holds the agent’s whole record and is not this block’s to
delete); with no block copy that delete finds nothing.