A bad package station kind excludes the package; AetherDb opens a catalog with a kindless station hull, names it, and station-kinds hull sets it; the raw opener is gone

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-23 01:21:04 +02:00
commit d2f4b2c347
5 changed files with 59 additions and 19 deletions

View file

@ -14,10 +14,12 @@ public static class AetheriaStores
// Attaches (hydrates) the catalog read-only unless catalogWritable, then the run and player stores when given.
// Throws when a [CultGlobal] type routed to the catalog has no record. The one exemption is a writable catalog with
// no records at all, a seed store being authored from nothing; a populated catalog is held to it however it opens.
// A catalog's station hull with no Kind is refused, unless the caller gives kindlessStation: the tool that repairs a catalog
// is told the hull's name and goes on.
// The registry is the process-wide one unless the caller scopes it (the test host does, so its own document types never
// become catalog globals); the global check above is judged against whichever registry opened the cache.
public static CultCache Open(string catalogPath, string runPath = null, string playerPath = null, bool catalogWritable = false,
CultDocumentRegistry registry = null)
CultDocumentRegistry registry = null, Action<string> kindlessStation = null)
{
// A read-only open of an absent catalog would hydrate an empty game; a shipped player missing its catalog stops here.
if (!catalogWritable && !File.Exists(catalogPath))
@ -42,7 +44,7 @@ public static class AetheriaStores
foreach (var data in cache.GetAll<ConsumableItemData>()) CultRecordRefs.Validate(data);
VerseGrammarValidation.ValidateAll(cache.GetAll<VerseVerb>());
ValidateBins(cache);
StationKinds.Validate(cache);
StationKinds.Validate(cache, kindlessStation);
return cache;
}
catch

View file

@ -108,6 +108,7 @@ public static class ShipModCatalog
Exclude(directory, $"hull name '{hull.Name}' collides with an existing catalog item.");
if (shipIds.Contains(ship.Id))
Exclude(directory, $"ship ID collides with an existing catalog ship authoring record.");
if (StationKinds.HullKindFault(cache, hull) is { } kindFault) Exclude(directory, kindFault);
foreach (var product in package.Products)
{
if (!factionKeys.Contains(product.Manufacturer.Key))