Caching: a binary-encoded stamp is refused; directory manifest readers name their stamp rule; the I/O refusal test fails the real read

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-22 17:33:24 +02:00
commit 6adc321a73
4 changed files with 13 additions and 19 deletions

View file

@ -198,6 +198,9 @@ public static class CultDocumentMessagePackSerialization
if (fieldCount > 0)
{
// A stamp encoded as binary is not one this runtime wrote or reads; it is refused here, not parsed as damage.
if (reader.NextMessagePackType == MessagePackType.Binary)
throw new NotSupportedException("Store snapshot declares its format version as binary; this runtime reads " + CultPersistedStoreSnapshot.FormatV1 + " and " + CultPersistedStoreSnapshot.FormatV2 + " as strings.");
snapshot.FormatVersion = reader.ReadString()
?? throw new NotSupportedException("Store snapshot declares no format version; this runtime reads " + CultPersistedStoreSnapshot.FormatV1 + " and " + CultPersistedStoreSnapshot.FormatV2 + ".");
requireReadable(snapshot.FormatVersion);