C# store header: the durable header owns "holds element ids"; StoredHoldsIds and KnownIdFree are deleted

A record's bytes cannot say whether it holds an element id (an id is an ordinary keyed
string), so the per-record fact decoded by whichever type loaded the record was a split
authority: a narrower type unmarked a v3 store over bytes holding ids. HeaderForWrite is now
a pure function of the durable header, the HoldsIds of the records the write encodes, and
whether it copies any record forward: a write that copies keeps a marked header, a write
that encodes every record decides by content. The directory store takes the same rule.

Also pins the three Low test findings deferred from c2a-write-set s3: the reload cause is
observed by type and message, the author's own Expect after a commit, and the directory
store's re-mint branches.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 07:04:48 +02:00
commit 25d6cb2951
5 changed files with 115 additions and 55 deletions

View file

@ -311,17 +311,14 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
var holdsIds = written.ToDictionary(key => key, key => Entries[key].HoldsIds, StringComparer.Ordinal);
var header = HeaderForWrite(
currentManifest.FormatVersion,
holdsIds.Values.Select(holds => (bool?)holds),
currentIndex.Values.Where(record => !written.Contains(record.Key)),
holdsIds.Values.Select(holds => (bool?)holds).ToArray(),
copiesAny: currentIndex.Values.Any(record => !written.Contains(record.Key)),
directoryStore: true,
holdsVariants: false);
WriteManifest(targetCatalog, currentIndex.Values
.OrderBy(record => record.Key, StringComparer.Ordinal)
.ToArray(), header);
foreach (var key in written)
Entries[key].StoredHoldsIds = holdsIds[key];
DeleteUnreferencedRecordPages(currentIndex.Values);
_dirtyKeys.Clear();