CultCache: [CultIndex] is unique at commit and load; grouping and selection declarations become [CultRole]

RefuseIndexSharing in Resolve judges every admission; _indexes holds one key per value; cacheless writes and moved-file writes of unique-indexed types are refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-11 00:49:52 +00:00
commit 46a40e774b
19 changed files with 460 additions and 245 deletions

View file

@ -493,11 +493,11 @@ namespace GameCult.Networking.Tests
public string Name = string.Empty;
[Key(1)]
[CultIndex("mass")]
[CultRole("mass")]
public float Mass;
[Key(2)]
[CultIndex("kind")]
[CultRole("kind")]
public string Kind = string.Empty;
}

View file

@ -581,7 +581,7 @@ namespace GameCult.Networking.Tests
return instance;
}
// A plain data member "Owner" with no [CultIndex] (its role falls back to its bare name)
// A plain data member "Owner" with no [CultRole] (its role falls back to its bare name)
// and a reference member whose alias is explicitly "Owner" - the exact shape Soul probed.
var ownerMember = MakeMember(typeof(GuardProbeShape).GetField(nameof(GuardProbeShape.Owner))!,
typeof(string), 0, indexAlias: null, isReference: false, targetType: null);

View file

@ -130,7 +130,7 @@ namespace GameCult.Networking.Tests
public string Name = string.Empty;
[Key(1)]
[CultIndex("kind")]
[CultRole("kind")]
public string Kind = string.Empty;
}

View file

@ -62,7 +62,7 @@ namespace GameCult.Networking.Tests
public sealed class SurvivorNumericLeaf
{
[Key(0)] [CultName] public string Name = string.Empty;
[Key(1)] [CultIndex("level")] public int Level;
[Key(1)] [CultRole("level")] public int Level;
}
[CultDocument("cultnet.selection-tests.survivor_string_leaf", "cultnet.selection-tests.survivor_string_leaf.v1")]
@ -70,7 +70,7 @@ namespace GameCult.Networking.Tests
public sealed class SurvivorStringLeaf
{
[Key(0)] [CultName] public string Name = string.Empty;
[Key(1)] [CultIndex("level")] public string Level = string.Empty;
[Key(1)] [CultRole("level")] public string Level = string.Empty;
}
// ---------------------------------------------------------------------------------------------
@ -173,7 +173,7 @@ namespace GameCult.Networking.Tests
// The declared index alias ("linkRole") differs from the member name ("Link") - the exact
// shape section 2's role-naming rule exists for, and no prior fixture had one.
[Key(1)]
[CultIndex("linkRole")]
[CultRole("linkRole")]
[CultReference(typeof(SurvivorAliasTarget))]
public CultRecordRef<SurvivorAliasTarget> Link;
}
@ -408,7 +408,7 @@ namespace GameCult.Networking.Tests
[Key(0)] [CultName] public string Name = string.Empty;
[Key(1)]
[CultIndex("hopRole")]
[CultRole("hopRole")]
[CultReference(typeof(SurvivorAliasTarget))]
public CultRecordRef<SurvivorAliasTarget> Link;
}
@ -431,12 +431,12 @@ namespace GameCult.Networking.Tests
[Key(0)] [CultName] public string Name = string.Empty;
[Key(1)]
[CultIndex("zLastRole")]
[CultRole("zLastRole")]
[CultReference(typeof(SurvivorAliasTarget))]
public CultRecordRef<SurvivorAliasTarget> RefZ;
[Key(2)]
[CultIndex("aFirstRole")]
[CultRole("aFirstRole")]
[CultReference(typeof(SurvivorAliasTarget))]
public CultRecordRef<SurvivorAliasTarget> RefA;
}

View file

@ -586,11 +586,11 @@ namespace GameCult.Networking.Tests
public string Name = string.Empty;
[Key(1)]
[CultIndex("kind")]
[CultRole("kind")]
public string Kind = string.Empty;
[Key(2)]
[CultIndex("mass")]
[CultRole("mass")]
public float Mass;
}
@ -631,7 +631,7 @@ namespace GameCult.Networking.Tests
public string Name = string.Empty;
[Key(1)]
[CultIndex("narrow_ref")]
[CultRole("narrow_ref")]
[CultReference(typeof(ParityLeafA))]
public CultRecordRef<ParityLeafA> NarrowRef;
}