remove postcard, make `id` calculations explicit and stable #1369
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 334 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1369"
general
weight: 0.35
rewitt94
We used to use
postcardas a serialization format, we replaced with CBOR. Can simplify the dependency tree by removing it fromid()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.
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Removes the
postcarddependency and makes persistedid()identity codes explicit so variant reordering or insertion no longer silently renumbers existing identities.identity/payload.rs; old numbers stay stable so previously dumpedid()values keep matching.#[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.BuiltinsFunctions,ExcType, and all module-function enums, plus a fixedidentity_indextable forBuiltinTypethat keeps the reserved gap left by the removedType::Instanceslot.<sup>Written for commit 30fa0126d1cc7949f2413c9785175c9dcbaf1d1e. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/1369?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/pydantic/monty/1369?returnTo=https%3A%2F%2Fgithub.com%2Fpydantic%2Fmonty%2Fpull%2F1369&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->