CultCache: every backing store marks the records it rewrites, through a protected CacheBackingStore.MarkWritten

The directory store's write of a generation marks each page it wrote once the
manifest names it, so a Push+PushAll of a loaded drifted entry no longer leaves
its persisted schema id stale. The single-file store marks through the same
member, and a store outside GameCult.Caching now has a supported way to mark
its own rewrite. The getter's doc names how a store records a rewrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-21 21:41:53 +02:00
commit 73d438dbcf
3 changed files with 24 additions and 5 deletions

View file

@ -231,7 +231,10 @@ the id the record is persisted under (`CultStoredDocument.PersistedSchemaId`),
not the one this cache decodes it as. A value change mints a `storedAt`
strictly later than the record it replaces; writers bump a minted timestamp by
one tick when it is not later. An entry loaded under compatible schema drift
keeps its persisted id until its store rewrites it. A whole-file flush or
keeps its persisted id until its store rewrites it; a store records each
record its completed write rewrote with the protected
`CacheBackingStore.MarkWritten`, and one that does not leaves the entry's
`Expect` failing closed until the next pull. A whole-file flush or
unconditional commit rewrites every record under the writer's current schema
and keeps its `storedAt`, so another cache's `Expect` on a drifted record it
read before that rewrite fails until it re-reads the store.