Skip to main content

Module store

Module store 

Source
Expand description

Session persistence: one file per review source under .diffler/reviews/, atomically written, self-gitignored. The legacy single-session file .diffler/session.json is read once and migrated to reviews/working.json. A file written before a walkthrough was a source of its own carries it embedded (walkthroughs, or the older singular walkthrough); reading any such file splits each one out into its own walkthrough-<id>.json.

Enums§

StoreError

Functions§

delete_source
Remove a source’s review file entirely, e.g. deleting a walkthrough deletes its walkthrough-<id>.json. A missing file is not an error.
load
Working-tree session, the common case.
load_all
Every persisted review, for aggregating across sources (e.g. the MCP feed), plus the path of any review file that failed to parse. Ordered by key for deterministic output. A corrupt file is skipped rather than failing the whole call, so one bad file never hides every other review; its path comes back in the second list, for a caller that wants to tell the reader. The directory listing is taken up front, so a split a file triggers mid-scan never feeds back into this same call.
load_source
Load the session for one source. The working tree falls back to the legacy single-session file when no per-source file exists yet; the file is moved on the next save_source.
save
Persist the working-tree session.
save_source
Persist one source’s session atomically (temp file then rename). Migrates the working tree off the legacy file by removing it once the new file lands.

Type Aliases§

LoadedReviews
Every review load_all found, plus the path of any file it had to skip because it would not parse.