Cut C: delete ItemData.Manufacturer, derive census makers from products
The manufacturer does not belong to a design (operator ruling); it lives on FactionProductData and branding is derived, never stored on the design. - Delete ItemData.cs key 3 (Manufacturer), with a retired-key comment. - AetherDb census now attributes a design's maker to the first product (in record-key order) that sells it, matching ItemManager.Brand's rule; a design no product sells shows "(none)". - AetheriaStoresTests' catalog fixture moves its Manufacturer reference onto a FactionProductData selling the design, and FactionIsASingletonInstance reads it from there. - mutation_tests.py gets a paired mutation for that fixture wiring. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
976e80d782
commit
333a73709a
4 changed files with 35 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Mutation tests for the Cut B provenance rules (docs/item-provenance-cut.md).
|
||||
"""Mutation tests for the Cut B and Cut C provenance rules (docs/item-provenance-cut.md).
|
||||
|
||||
For each rule this applies its named mutation to an exact, unique anchor of
|
||||
source text, runs the one test that should catch it, restores the file
|
||||
|
|
@ -259,6 +259,22 @@ MUTATIONS: list[Mutation] = [
|
|||
test="RunSaveTests.CommitTakesRootsFromEveryZone",
|
||||
expect="red",
|
||||
),
|
||||
# --- Cut C: the manufacturer moves from the design to the product; the catalog fixture and its
|
||||
# round-trip assertion (FactionIsASingletonInstance) must actually depend on that wiring. ---
|
||||
Mutation(
|
||||
rule="the catalog fixture's product carries the maker, not an unset reference",
|
||||
file="tests/Aetheria.Shared.Tests/AetheriaStoresTests.cs",
|
||||
anchor=(
|
||||
'cache.Upsert(new FactionProductData { Name = "Lance", '
|
||||
"Design = new CultRecordRef<CraftedItemData>(lance.Key), Manufacturer = cache.RefOf(faction) });"
|
||||
),
|
||||
mutated=(
|
||||
'cache.Upsert(new FactionProductData { Name = "Lance", '
|
||||
"Design = new CultRecordRef<CraftedItemData>(lance.Key), Manufacturer = default });"
|
||||
),
|
||||
test="AetheriaStoresTests.FactionIsASingletonInstance",
|
||||
expect="red",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue