fix(pi): fork and revert past turns whose session entry was never captured

A Pi turn gets its session-tree entry only when it finishes: finalizeTurn reads get_entries
and swaps the synthetic turn ref for the prompt's user entry. A turn that never finishes keeps
the synthetic ref for good: Pi or the server died mid-turn and recovery cancelled it, Stop's
2 s read timed out, or get_entries failed. Forking or reverting to any point before that turn
then fails every time with "Pi fork boundary has no captured session-tree entry", and the
retry button replays the identical fork.

Pi still has the prompt on disk. When the boundary turn's ref is weak, read the session tree
(the live session for a revert, the --fork process for a fork) and take the earliest user entry
on the active branch stamped after the target turn finished and before the boundary turn
ended, above the target turn's entry. Pi and the server share a clock, so the window is exact;
when nothing fits, the error stays.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
b8d2fbadc6Henry Chu committed on 10/17/2026, 1:43:12 AMparenta3e8cf6
2 files changedLine totals unavailable