ULOG-002 MED: ULOG open must back-scan the zero pad, not forward-scan the whole log

ULOGOpenBooked (dog/ULOG.c:494) forward-scans the ENTIRE log on every open via ulog_scan_log (:196, called :537) only to position the buffer's DATA/IDLE division past the last complete row — an O(content) row-by-row walk paid on every be/jab command that touches refs/wtlog. The index that scan builds is then discarded (ulog_idx_free_anon, :538); the real idx is loaded/rebuilt separately by ULOGOpenIdx (:555) against a freshness-checked .idx sidecar. The tail only ever needs finding at the zero pad: a booked file is grown to a page boundary and abnormal termination leaves trailing NULs, so the last row's end is O(page) back from the mapped end. Replace the forward tail-scan with a BACKWARD scan over the zero pad. Surfaced while reviewing JS-073 (JS ingest.add crash-safe refs append) and relates to the ULOG-001 torn-log / initial-NUL work. Method: work.

Input

Context

Goals

Constraints

WIP

Design decisions

TODOs

Blockers and bummers

Outcome