A lot records its product: Lot.Product owns an item's brand, Brand reads it

Brand no longer re-derives the product from maker and design (key-first pick);
CreateLot(product) is the one writer of Lot.Product. The census duplicate-brand
block and the key-order tie-break test go with the derivation they policed.
Unverified at this commit; build and tests follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-08 16:45:56 +02:00
commit 978632bc26
6 changed files with 89 additions and 56 deletions

View file

@ -58,8 +58,8 @@ public class ProvenanceLedger
}
}
// One lot: the design it built, who made it and from what, its rolled workmanship, and how well each design role
// was filled. Immutable once minted; instances carry a LotId, never a copy.
// One lot: the design it built, who made it and from what, its rolled workmanship, how well each design role
// was filled, and the branded product it was made as. Immutable once minted; instances carry a LotId, never a copy.
[MessagePackObject]
public class Lot
{
@ -68,6 +68,10 @@ public class Lot
[Key(2)] public float Quality;
[Key(3)] public List<RoleFill> Roles;
// The product the lot was made as: the one owner of which product names its units. Unset for unbranded lots
// (console give, presets, extracted), which brand their maker only.
[Key(4)] public CultRecordRef<FactionProductData> Product;
// The quality a stat reads for one of the design's roles. An unnamed role, a design without roles, and a lot
// minted before roles existed all fall back to the lot's own workmanship.
public float QualityForRole(string role)