Ownership by declaration, staging half: a write that would change a record under an id no registered type declares is refused before staging

Declares (registry) is the one answer to whether a cache may write, relabel
or remove a record stored under an id. RefuseUndeclared applies it from
Validate's Claim, which every cache write passes, to what the home store
holds at the key: a foreign record or one held under an undeclared id.
RefuseOverwrite and its two Push calls are deleted.

Red until rewritten: ForeignRecordTests.AWriteOfTheRecordItselfStoresItUnderTheTypesOwnId
and CompatibleSchemaIdTests.AnotherNewerCacheRestoringTheIdAfterAnOlderRewriteStillFailsTheCondition,
which pin the relabel rule 3 forbids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 12:31:53 +02:00
commit e9a668769a
2 changed files with 31 additions and 18 deletions

View file

@ -150,7 +150,6 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
RefuseVariant(entry);
Held(() =>
{
RefuseOverwrite(entry.Key.Value);
Entries[entry.Key.Value] = entry;
_dirtyKeys[entry.Key.Value] = true;
_deletedKeys.TryRemove(entry.Key.Value, out _);