Expand description
Local, multi-session transcript archive.
Sessions live under an explicit archive root that callers must provide — this module never reads configuration or mutates the environment:
<root>/<session id>/meta.json entry + provider metadata (private, atomic)
<root>/<session id>/events.jsonl append-only journal of human/agent eventsSession ids are generated locally (no global state) and validated before
every use, so an id can never traverse out of the archive root. Journal
reads tolerate an incomplete final line and report — but never silently
discard — malformed records, and per-session metadata corruption is
reported per session instead of hiding other sessions. Streaming writes go
through BufferedSessionArchive, which performs all filesystem work on a
background thread and only requires durability at explicit boundaries.
Structs§
- Archive
Entry - Immutable identity and presentation data for one archived session.
- Archived
Session - A loaded archived session.
- Buffered
Session Archive - Background archive writer used from the terminal event loop.
- Create
Session - Parameters for creating a new archived session.
- Session
Archive - Local archive of every CodeSwarm session for one machine.
- Session
Failure - A session whose metadata could not be read. Reporting is per session so a single corrupt file never hides other valid sessions.
- Session
Listing - Result of listing the archive.
Enums§
- Archive
Event - One archived conversation record: a public human message or a normalized agent event, in journal order.
- Archive
State - Lifecycle description shown by the session browser.
Constants§
- ARCHIVE_
SCHEMA_ VERSION - Current on-disk schema of the archive metadata envelope.
- EVENTS_
FILE - Per-session append-only journal file name inside the archive root.
- MAX_
TITLE_ CHARS - Titles are bounded so a runaway agent response cannot bloat listings.
- META_
FILE - Per-session metadata file name inside the archive root.
Functions§
- generate_
session_ id - Generate a fresh, filesystem-safe session id.
- unix_
nanos_ time - Timestamps are stored as Unix nanoseconds; this converts to a display value.
- validate_
session_ id - Reject ids that could escape the archive root or confuse the journal.