- symptom: `seed` of docs/examples/residency on a FRESH log, rc 139, in both
WO_DATA forms — found smoke-testing databasev2 7, independent of it
- root cause, two defects composing: wo_wal_fold_row_at wrote `*msg`
unguarded while wo_idx_probe borrows with msg = NULL; and the databasev2 12
schema head was staged lazily AFTER db.c captured the first keys-resident
row's offset (`koff`), so that offset pointed at the schema record
- fix (already on dev, prefix db2-keys): wo_wal_next_offset stages the
pending head before returning an offset; the fold tolerates a NULL msg;
both failing-first, and a control build with wal.c reverted reproduces
the trace
- third finding: residency-accept.sh never checked seed's rc, so 20/0 was
green over a crash — `e274f4a`; the gate is 32/0 since
- `residency.keys.fit` rc 74 confirmed a SEPARATE defect (compaction/replay
of keys-resident offsets), still open under codd.md "Next bugs"
- `status: done`, `readiness: ready`; counts test_wal 6629 → 6660,
make -C runtime test 8462/0 at the time of the fix
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit b5b1da795917f0446a1e4a0317d9136c33acb262)