Release index versions forks no longer read, and compact diverged forks
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
A version is only retired while a pin can see it, and it always covers the highest pin then, so versions are left unread only when pins go. When a fork is deleted, saved whole or compacted, oc_release_index now recomputes each level's pins from the lineages that remain, keeps the highest as index_pinned, deletes the retired versions no pin falls in, and for a deleted level the live rows no pin sees (everything once nothing reads it). Migrating releases what phase 2 kept after a fork was deleted (releaseIndexes). A fork whose own moment rows reach half its moments is compacted in the background after saving: what it still reads through to is copied into rows of its own a page per transaction (the same rows, so it reads the same meanwhile and saves wait for a page at most), then its hidden rows and lineage go and what it read is released. At 200,000 moments that took 41 s in 11 steps; a save meanwhile took 0.27 s. Scans in a fork's transactions raise hash memory: past work_mem the planner compared every row with every key of nearer levels instead of hashing them. Compaction and retention look nearer levels up row by row instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/68a524e35810f4267e3b7bdeed852549c38394dc
Open Release index versions forks no longer read, and compact diverged forks in the timeline