Identities for entities did.bot

pds: two durability follow-ups to the layout-stamp fix #201

Closed permadeath.com
Closed opened by permadeath.com

(2026-10-11 neutral review, low-priority items on the layout-stamp work)

  1. crates/didbot-pds/src/side_store.rs:~139 throws away the result of sync_dir after the stamp rename. The later wal.trim sync mitigates it, but the error should be returned.
  2. After a restamp, a damaged checkpoint falls back to reading the log from the start with today's reader (durable.rs:~213-235, ~416). This is harmless for layout 22 to 23, but a later format change would mis-decode the old segments. Pick the reader per segment on that fallback.

Item 1 is fixed in https://tangled.org/did:plc:swttlkbjvcoln67iievud7b3/pulls/1152: SideStore::save now returns the sync_dir error.

Item 2 is still open. It needs a design decision first. Segments don't record which layout wrote them, and after a migration the live segment holds frames from both layouts. Picking a reader per segment would take two things:

  • a log roll at migration, so no segment mixes layouts
  • a new pds.layout field naming the previous layout's shape and names, and the first segment written under today's layout

That is a new stamp field and a layout bump, so it needs review first. It also builds on the open restamp-before-trim change (claude/layout-stamp-durable), where the fallback hazard is sharpest.

Item 1 is fixed by 235ca6b4: SideStore::save now returns a failed directory sync after the rename. Item 2 remains: the fallback to the start of the log still reads every segment with the stamp's one reader (durable.rs:219, 250, 256), so a damaged checkpoint after a restamp would decode older-layout segments with today's reader.

Fixed by #1175 on main: 2c5f6b00 reads each log segment through its own layout on a fallback read from the origin; the side_store sync_dir result is returned (same PR).

Correction to the comment above: the side_store sync_dir result was not part of #1175. It was already returned on main, since 235ca6b4 (fix(pds): fail a side-file save whose directory sync fails). Both follow-ups are done.

Sign up or Sign in to add to the discussion.