From ffb5d73f81e10a591a32bfb464cafb1fc117e67e Mon Sep 17 00:00:00 2001 From: soul Date: Sat, 28 Nov 2026 11:12:01 +0100 Subject: [PATCH] EconomyLoop boots the catalog the game boots (first-party packages composed): the Pirates' station hulls are a package's. The declaration test launches the demo in its own galaxy Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/ScenarioTests.cs | 7 +++++-- tools/AetherDb/EconomyLoop.cs | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ScenarioTests.cs b/tests/Aetheria.Shared.Tests/ScenarioTests.cs index 866b8d729..c9982ef82 100644 --- a/tests/Aetheria.Shared.Tests/ScenarioTests.cs +++ b/tests/Aetheria.Shared.Tests/ScenarioTests.cs @@ -791,8 +791,11 @@ public sealed partial class RunStartTests Assert.Equal(0, StationsOf(natural)); Assert.True(StationsOf(forced) >= 1); - // Through RunStart, the scenario's declaration is what reaches the generator. - Assert.Equal(2, StationsOf(RunStart.GenerateArena(_items, _zoneSettings, _planetSettings, _galaxy, new DemoTerminus()))); + // Through RunStart, the scenario's declaration is what reaches the generator: the demo, in its own galaxy (the fixture's cast has + // no Pirates), holds both stations. + var (_, demoArena, _, failures) = Launch(new DemoTerminus()); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + Assert.Equal(2, demoArena.Entities.OfType().Count(entity => entity.HullData.HullType == HullType.Station)); Assert.Equal(0, StationsOf(RunStart.GenerateArena(_items, _zoneSettings, _planetSettings, _galaxy, new MainGalaxy()))); // An order the galaxy or the catalog cannot meet is refused by name, never placed as something else. diff --git a/tools/AetherDb/EconomyLoop.cs b/tools/AetherDb/EconomyLoop.cs index 8c0585b0d..f7b2f0c12 100644 --- a/tools/AetherDb/EconomyLoop.cs +++ b/tools/AetherDb/EconomyLoop.cs @@ -120,7 +120,12 @@ public static class EconomyLoop var catalog = Path.Combine(scratch, "Aetheria.cc"); File.Copy(Path.Combine(root, "GameData", "Aetheria.cc"), catalog); new FileInfo(catalog).IsReadOnly = false; - using var cache = AetheriaStores.Open(catalog, runPath: Path.Combine(scratch, "run.cc")); + // The catalog the game boots: the first-party packages in GameData/Mods composed over the copy (the Pirates' station hulls + // are a package's), read from a derived file in the scratch, never written back to the shipped one. + var (composed, excluded) = ShipModCatalog.ResolveCatalog(catalog, Path.Combine(scratch, "derived.cc"), Path.Combine(root, "GameData", "Mods")); + if (excluded.Length > 0) + throw new InvalidOperationException("First-party packages were excluded from the catalog: " + string.Join("; ", excluded.Select(entry => entry.Package + ": " + entry.Reason))); + using var cache = AetheriaStores.Open(composed, runPath: Path.Combine(scratch, "run.cc")); var authored = AuthoredSettings.Load(root); var items = new ItemManager(1u, cache, new ProvenanceLedger(), authored.Read("GameplaySettings"), _ => { }); var zoneSettings = authored.Read("ZoneSettings");