Designed for switch (err.kind) exhaustiveness per the SPEC §17.4
commitment that every discriminated union is a tagged union with
an exhaustiveness check the type system can enforce. The
schema-evolution failure mode is split across two tags —
migrate-threw (the caller supplied migrate and it threw, carries
cause) and migrate-missing (the caller never supplied a
migrate, no cause) — because the previous shape encoded those two
distinct semantic states as the presence/absence of an optional
cause?: unknown, the §17.4 anti-pattern of an
"X may or may not have Y" optional that is a state machine in
disguise. With the split, switch (err.kind) narrows correctly and
no consumer body needs a runtime presence check on cause to know
which mode fired (#370).
Discriminated union of failure modes surfaced by the persistence layer. Every error branch in
loadInitialand the write path constructs one of these and dispatches it throughPersistedInputOptions.onError. The default handler is a singleconsole.warnso existing consumers remain audible during rollout.