Compose and validate judge a package's bins; the schematic gate reads offered-ness through them

MarketFault (renamed from SchematicFault) refuses a product bin whose line is neither an unbinned shipped product nor an unbinned product of the same package, which the catalog read would crash boot on, and which let an offered hull with no lines pass through a cross-package bin. The carve-out guard is gone: IsOffered now has an overload taking a line resolver, so it judges package-own lines too. Tests pin bin-derived offeredness, any-vs-all products, null SchematicLines and the exclusion of bad bins with the derived catalog still opening. The LFS staging derivation includes tests/fixtures/mods.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-17 19:12:07 +01:00
commit 8b2d1f5442
6 changed files with 144 additions and 40 deletions

View file

@ -53,10 +53,10 @@ public static class ShipAuthoringCommands
var judged = model != null && File.Exists(model) ? "records and model" : "records only, no model yet";
if (judged == "records and model") ShipModCatalog.ReadPackage(args[1]);
else ShipAuthoringStore.ValidateLoaded(hull, ship, products);
// Compose refuses an offered hull with no schematic; the author sees that verdict here, before compose.
// A package with no products is never offered, so the shipped catalog (which only resolves a product's bin) is opened for none.
// Compose's verdict on a package's bins and its offered hull's schematic; the author sees it here, before compose.
// A package with no products has no bin and is never offered, so the shipped catalog is opened for none.
using var catalog = products.Length > 0 ? AetherDb.Open().Cache : null;
if (ShipModCatalog.SchematicFault(catalog, ship, products) is { } fault) throw new InvalidOperationException(fault);
if (ShipModCatalog.MarketFault(catalog, ship, products) is { } fault) throw new InvalidOperationException(fault);
Console.WriteLine($"{ship.Id}: {hull.Name}, {hull.Hardpoints.Count} hardpoints, {ship.Anchors.Count} anchors, {ship.SchematicLines.Count} lines ({judged})");
return 0;
}