From 14bd2fd5a2e30667c4042946d547786fae8f0108 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 13 Sep 2026 22:07:30 +0200 Subject: [PATCH] Record the override rule Cut 4 landed and two generator follow-ups MessagePack reads the base declaration's attributes, so the generator and registry reject overrides whose Key or IgnoreMember differ from the base instead of using the most-derived declaration. The typed serialize helpers are deleted. Global-namespace type naming and generic document types in generator assemblies are recorded as follow-ups. Co-Authored-By: Claude Opus 5 --- docs/cultcache-migration-cut.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/cultcache-migration-cut.md b/docs/cultcache-migration-cut.md index 6a59e331f..bd4fcd0e6 100644 --- a/docs/cultcache-migration-cut.md +++ b/docs/cultcache-migration-cut.md @@ -808,6 +808,22 @@ reject duplicate slots and string keys with one message each, and route the typed helpers through the untyped path, proven by a descriptor-equality sweep across member shapes with a byte pin for overrides. +**Overrides (Cut 4 fix, CultLib `7c4bc2b`).** The "most-derived declaration" +rule proposed after Soul's review was wrong: MessagePack itself reads the base +declaration's attributes (an `[IgnoreMember]` override still serializes at the +base slot; a re-keyed override throws a duplicate key). Both the generator and +the registry therefore reject any override whose `[Key]` or `[IgnoreMember]` +differs from its base declaration, and accept overrides that repeat or omit +them, pinned against MessagePack's own bytes. Typed +`Serialize`/`Deserialize` are deleted rather than rerouted. + +Follow-ups outside this migration: a global-namespace document type is named +`.Type` by the generator and `Type` by `CultSchemaTypeNames`, +so its schema id differs between builds (fixing it changes those ids); and the +generator emits `typeof(Doc)` for generic document types, which does not +compile, so a generic document cannot live in an assembly that runs the +generator. + **Security.** `CultMessagePackSecurity : MessagePackSecurity` copies `UntrustedData` and overrides `GetHashCollisionResistantEqualityComparer()` to return, for `CultRecordRef`, a comparer over `Key.Value` built from