| Filename | Latest commit message | Latest commit date |
|---|---|---|
The held index kept one key per value, last writer winning, and RemoveKey dropped a value outright. Two consequences: removing or changing one of two plain holders left the other unfindable, and the variant index rule judged a variant against that lossy view, so a variant could land on a value a plain record still held and the store then refused to reopen. - _indexes maps a value to the keys holding it, oldest first. Index, Unindex and the removal maintain the set. GetByIndex finds the most recently indexed holder of a value, so removing the winner finds the other (behaviour change for plain duplicates: it used to find nothing). - One rule, RefuseVariantIndexSharing, serves both write orders. It reads the truthful index minus what the commit replaces or removes, plus what it lands. ResolveOne no longer judges indexes; ClaimIncomingIndexValues, HeldByVariants and RefusePlainSharingWithVariant are gone. - A conditional commit merged onto the file is judged by the cache's own resolution (CacheBackingStore.Judging) on the merged set: records other writers added, records they removed, and the batch. Another writer's variant sharing a value with the batch, or a base removal that strands another writer's variant, is refused with the named refusal instead of writing an unopenable store. - Shedding is one decision at load. ToStoredDocument resolves the schema once and returns the report with it; a variant's override of a slot the type lacks is dropped from the delta there, so flush needs no predicate and every store reports through the same surface (ReportVariantSheds and OverridesTheTypeHas are gone). The directory store refuses variants and loads through the same call. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
| .. | ||
| Fixtures | ||
| AssemblyInfo.cs | ||
| BackingStoreTests.cs | ||
| ConditionalCommitTests.cs | ||
| CultAssetGuidKeyTests.cs | ||
| CultDocumentRegistryTests.cs | ||
| CultDocumentSelectionSurfaceTests.cs | ||
| CultInspectorModelTests.cs | ||
| DirectoryStoreDurabilityTests.cs | ||
| DocumentShapeTests.cs | ||
| GameCult.Caching.Tests.csproj | ||
| PreCut2FixtureDocuments.cs | ||
| PreCut2StoreFormatTests.cs | ||
| README.md | ||
| SerializationOptionsTests.cs | ||
| StoreRoutingTests.cs | ||
| VariantTests.cs | ||
GameCult.Caching.Tests
GameCult.Caching.Tests contains NUnit tests for the caching library and its
MessagePack persistence stores.
Scope
The tests currently cover:
SingleFileMessagePackBackingStoreround-trips, external pulls, and the dirty-pull guardDirectoryMessagePackBackingStorewith thecultcache.store.v4.directory-content-addressed-pagesmanifest: page writes, clean flushes, concurrent writers under the commit lease, external deltas, unflushed local keys, orphaned pages, and observers running after the lease is releasedCultCacheMessagePack.OpenAsync, persisted globals, dirty state, and flush on dispose- cache lookups (
Get,GetAll, runtime-type upserts) CultCache.Commitbatches on a directory store: visibility after the store commits, abandoned stages, sealed batches, observers committing again- Cult document payloads, registry shape rejections, canonical schema fixtures, and schema drift reports
- hand-written MessagePack snapshot and record serialization
StoreRoutingTests: the store-composition contract (routing, attachment is hydration, read-only stores, global singletons, assignable lookups, batches, all-or-nothing loads)ConditionalCommitTests:Expect,ExpectUnchanged,TryCommit, the single-file lock, strictly increasingstoredAt, and the same conditions on a directory storeDirectoryStoreDurabilityTests: failed manifest replace, content-addressed pages, the commit lease, orphan pages and tampered pages, with faults from real file locksPreCut2StoreFormatTests: stores written before Cut 2 still open
Selective hydration, the directory store's stage probes, pre-v4 directory
formats, and the SoA table are no longer in the tree; the SoA table is parked
at parked/cultcache-soa (docs/parked-features.md).
Run
dotnet test tests\GameCult.Caching.Tests\GameCult.Caching.Tests.csproj