Skip to content

Diagrams: the data, moving

Each file is a filmstrip: one use case told as numbered frames, top to bottom, showing the actual values, rows and tokens upstream's AsyncPostgresSaver and ours store and read at each moment. Open a file in Excalidraw (File → Open, or drag it onto the canvas). Each file ends with a Sources: line naming the code it was drawn from; ids, seq numbers and message counts are illustrative unless the file's footnote says they were measured.

file what moves
00 overview one run end to end: what crosses the saver, what each side stores, what reads back
01 anatomy a checkpoint taken apart: inline values, blobs, and our storage tiers
02 first-put the first put on a new thread, CTE by CTE
03 save-a-step a growing conversation: full copies vs base + patch, and how encode() decides
04 task-writes put_writes: task writes, interrupts, special-channel upserts
05 load-latest get_tuple without an id: which rows are read, how the value is rebuilt
06 resume-after-interrupt human in the loop across process restarts
07 time-travel-fork loading an old checkpoint and forking from it
08 list-history list: paging, and each value fetched once
09 delta-history rebuilding a DeltaChannel: paged walk vs one recursive walk
10 two-runs-collide the fence: two writers from one head
11 delete-thread deleting a thread, row by row
12 prune prune: keep_latest, keep_last, DeltaChannel threads
13 delete-for-runs deleting the checkpoints of chosen runs
14 copy-thread copying a thread, patches kept as patches
15 expire-idle-threads sweep_expired: idle threads past a cutoff
16 list-threads listing threads from the root-latest index
17 base-cache where the writer's bases come from: cache, cold start, lost base
18 adopt-and-rollback adopting on an upstream database, deploying, and rehydrate

Legend. Blue ■ one message (one unit of a value) · yellow ■ what this step added · teal box a stored full copy (base) · orange box a patch, with a dashed teal arrow to its base · lavender text ids, versions, tokens · blue headings upstream, green ours · red refused or deleted · dimmed unchanged since the previous frame · dashed outline held in memory, not in Postgres.