SIGN IN SIGN UP

test(export): assert byte-stable JSONL across all record types (#4086)

TestExportMemoryDeterminism (GH#3474) proves only memory lines are
stable. This generalizes the invariant from gh beads 3787: running
`bd export` repeatedly over unchanged data must produce byte-identical
output for every record type, not just memories.

The new test seeds issues at the same priority and creation time (so the
export ORDER BY must fall through to the id tiebreaker — the total-order
property the determinism guarantee depends on), each with multiple
labels, parent-child dependencies, and comments, plus several memories
keyed out of sorted order. It exports five times and asserts every run
is byte-identical, then sanity-checks that each record type was actually
present so a future change can't make the stability assertion pass
vacuously.

Catches any future collection serialized without a stable total order
(Go's randomized map iteration being the usual culprit) before it ships,
rather than spot-fixing per record type.

_claude-opus-4-7-medium on behalf of matt wilkie_

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
M
matt wilkie committed
4dc8dbd2c2ea6656f74fefc946978d5241663cfb
Parent: 3ede7ac
Committed by GitHub <noreply@github.com> on 5/22/2026, 6:08:23 AM