remove postcard, make `id` calculations explicit and stable
Merged
DA
16d ago+1489+1489+0123456789012345678901234567890123456789-576-576-012345678901234567890123456789
We used to use postcard as a serialization format, we replaced with CBOR. Can simplify the dependency tree by removing it from id() calculations, and arguably we should be deliberate about these as they need to remain stable indefinitely as they are persisted in dumps.
I decided to add a macro which we can use to enforce explicit numbering and checksum on enums which will affect dump contents. This adds a bit of bloat and ceremony but seemed on balance possibly worth it given we don't want these to change unknowingly ever.
Summary by cubic
Removes the postcard dependency and makes persisted id() identity codes explicit so variant reordering or insertion no longer silently renumbers existing identities.
- Replaces postcard-based identity payloads with hand-written LEB128 encoders in
identity/payload.rs; old numbers stay stable so previously dumpedid()values keep matching. - Adds
#[explicit_discriminants(checksum = ...)], which requires an explicit integer on every variant of identity-bearing enums and rejects implicit or computed codes; a checksum mismatch reports the replacement attribute. - Adds explicit discriminants to
BuiltinsFunctions,ExcType, and all module-function enums, plus a fixedidentity_indextable forBuiltinTypethat keeps the reserved gap left by the removedType::Instanceslot. - Pins legacy identity numbers with insta snapshot tests.