From fc1c0526fe98753e37ca23ad739771da36573dac Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 17 Sep 2026 12:42:37 +0200 Subject: [PATCH] Census: list every distinct maker, don't invent a single one MakerOf picked the first product for a design from any maker, the same tie-break Brand() uses to resolve a runtime item's actual attribution. That made census silently agree with an attribution it has no business asserting on its own. Census's job is to report what the catalog says, including when a design has more than one seller. MakerOf now lists every distinct maker that sells a design (via its products, manufacturer set), in record-key order, or "(none)" when no product sells it. The existing duplicate (maker, design) detector is unchanged. Verified byte-identical `census` output before and after, since today's catalog has no design with two makers. Co-Authored-By: Claude Opus 5 --- tools/AetherDb/Program.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index 662001dd7..25e704998 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -43,13 +43,21 @@ public static class Program var products = db.Cache.GetAll() .OrderBy(p => db.Cache.RefOf(p).Key.Value, StringComparer.Ordinal).ToArray(); - // The manufacturer no longer lives on the design: it is derived the way Brand() derives it, from the - // first product in record-key order that sells the design. A design no product sells shows "(none)". + // The manufacturer no longer lives on the design; a runtime item picks one via Brand()'s tie-break, but + // census must not invent that same attribution for a design with several sellers. Instead it lists every + // distinct maker that sells the design (via products), in record-key order. A design no product sells, + // or that only unset-manufacturer products sell, shows "(none)". string MakerOf(EquippableItemData item) { var design = db.Cache.RefOf(item).Key; - var product = products.FirstOrDefault(p => p.Design.Key.Equals(design)); - return product == null ? "(none)" : db.Cache.Get(product.Manufacturer)?.ShortName ?? "(none)"; + var makers = products + .Where(p => p.Design.Key.Equals(design) && p.Manufacturer.IsSet()) + .Select(p => p.Manufacturer.Key) + .Distinct() + .OrderBy(k => k.Value, StringComparer.Ordinal) + .Select(k => db.Cache.Get(k)?.ShortName ?? "(none)") + .ToArray(); + return makers.Length == 0 ? "(none)" : string.Join(", ", makers); } var kinds = new Dictionary>();