From 0c19d080b39f07ebaffc8fe2edbcf08eaf5e2aef Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 27 Oct 2026 06:26:15 +0100 Subject: [PATCH] Cut the read-whole flag's copies in Resolved and Flatten: the staging half asks only the store's loaded view Hand mutants dropping each copy survived the full Caching suite; the flag is read only through the store's Entries (RefuseUndeclared), which ToStoredDocument sets, so the cache's resolved variants and flattens were never asked. Co-Authored-By: Claude Sonnet 5.5 --- src/GameCult.Caching/CultCache.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GameCult.Caching/CultCache.cs b/src/GameCult.Caching/CultCache.cs index 5cbb0980..3a59f769 100644 --- a/src/GameCult.Caching/CultCache.cs +++ b/src/GameCult.Caching/CultCache.cs @@ -520,7 +520,8 @@ namespace GameCult.Caching // it whole and owns it (CultDocumentRegistry.Owns). Set by ToStoredDocument from the schema comparison's ignored slots, // before any variant override is shed. A record this cache constructed or wrote is stored under Descriptor's own id, which // the registry declares, so only a loaded record under another id is ever asked. The staging half asks it; - // ConditionsHold never reads it. + // ConditionsHold never reads it. Only the store's loaded view carries it: the cache's resolved copies and flattens are never + // asked. internal bool StoredSchemaReadWhole { get; set; } // Names the bytes this record was read from or written as: the SHA-256 of its persisted encoding, set by the store that @@ -565,7 +566,7 @@ namespace GameCult.Caching } internal CultStoredDocument Resolved(object document, CultVariantDelta delta, bool idsInMemoryOnly, CultCodec codec) => - new(Key, StoredAt, Descriptor, delta, document, codec) { IdsInMemoryOnly = idsInMemoryOnly, StoredSchemaId = StoredSchemaId, StoredSchemaReadWhole = StoredSchemaReadWhole, StoredVersion = StoredVersion }; + new(Key, StoredAt, Descriptor, delta, document, codec) { IdsInMemoryOnly = idsInMemoryOnly, StoredSchemaId = StoredSchemaId, StoredVersion = StoredVersion }; } public sealed class CultDocumentRegistry @@ -3318,7 +3319,6 @@ namespace GameCult.Caching { Flattens = true, StoredSchemaId = variant.StoredSchemaId, - StoredSchemaReadWhole = variant.StoredSchemaReadWhole, StoredVersion = variant.StoredVersion }; }