Expand description
Offline session scanners - stateless filesystem helpers that read
transcripts from <config_dir>/projects/<project_key>/*.jsonl.
list_sessions- lists sessions, either for one project or all.get_session_messages- reads the full transcript for one session.
Session metadata (list_sessions) comes from an internal head +
tail lite read, so the fields it parses cost two 64 KiB reads
whatever the transcript’s size. The worker tag is the exception and
is read in full: it can sit anywhere in the file and the last one
wins, so there is no window that settles it.
Structs§
- Session
TagCache - Carries the previous run’s tag scans into this one and collects what changed, so the whole catalog costs one store read up front and one store write at the end rather than a transaction per transcript.
- Session
TagScan - What a tag scan learned about one transcript, and how far into it the answer is known to hold.
Enums§
- Workers
- Which worker sessions a listing may carry.
Constants§
- SPAN_
CAP_ BYTES - SPAN_
ROWS_ PER_ TURN - How many rows a page’s own turn count may ask for.
- SPAN_
STEP_ BYTES - How many bytes of a transcript one paging pass reads before growing, and how wide a single window it takes may be.
Functions§
- get_
session_ messages - Read the full transcript for one session.
- has_
a_ transcript_ row - Whether a transcript row carries this frame.
- list_
sessions - List sessions. When
directoryisSome, scans that project dir; whenNone, scans every project directory underconfig_dir’sprojects/tree. A capped listing stats each candidate for its mtime, reads newest first on the tokio blocking pool (at most 16 at once), and stops once the rows the cap serves are in hand - a short batch is filled by the next, so the cap bounds the reads without shortening the listing. An uncapped listing (the boot scan) reads every candidate.workersdecides which worker-tagged rows may appear, and it lands before the cap: a listing is never shortened by rows it would not have carried. - project_
key_ for_ directory - Map a directory path to the CLI’s on-disk project key. Canonicalises
the path first and then applies the CLI’s JS-style sanitisation
hash.
Nonedefaults to"."(the process’s current working directory). - read_
rows - Read the rows of
session_id’s transcript that sit strictly beforebelow, newest first, up torows_wantedof them. - read_
session_ info_ at - The one transcript at
path, read for its title and clock. - should_
exclude_ worker_ tag - True when
inforepresents a worker session: one whose transcript carries aforge:worker:<label>tag.