keep_latest now deletes a subgraph call's namespace together with the root
checkpoint the call started from. A checkpointer=True subgraph keeps its
latest checkpoint, since its one namespace holds state across calls, and a
call whose root checkpoint isn't saved yet is left alone.
Each thread is pruned in one REPEATABLE READ transaction that deletes
everything its snapshot sees except the kept checkpoints, so what a run
commits meanwhile survives whatever its ID. Writes go by the checkpoints
deleted, since a run can commit a superstep's writes before its checkpoint.
The per-thread statements live in one generator shared by the sync and
async savers, run unprepared: a cached generic plan checks an = ANY array
one element per row.
keep_latest now clears parent_checkpoint_id on the kept checkpoints whose
parent it deleted, in the same transaction, so their parent_config is None
instead of pointing at a deleted checkpoint.
The DeltaChannel check also matches delta_writes_versioned. LangGraph.js
inlines no channel values, so a thread it wrote at snapshot points shows
neither counters nor inline snapshot markers, but it sets this key on the
threads its DeltaChannel graphs start.
New tests commit a DeltaChannel checkpoint right after the per-thread check
and show the fence keeps everything it rebuilds from.
`delete` removes every checkpoint, write and blob of the given threads.
`keep_latest` keeps the latest checkpoint of each namespace, with its
pending writes and the blobs it references, and deletes everything older,
including blobs only those checkpoints used. Checkpoints saved while the
prune runs are left alone.
`keep_latest` refuses threads that use a DeltaChannel, since a
DeltaChannel rebuilds the latest value from older checkpoints; nothing is
pruned when any requested thread uses one.