2026-09-12 01:27:18 +02:00
/ * This Source Code Form is subject to the terms of the Mozilla Public
* License , v . 2.0 . If a copy of the MPL was not distributed with this
* file , You can obtain one at https : //mozilla.org/MPL/2.0/. */
using System ;
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
using System.Collections ;
2026-09-12 01:27:18 +02:00
using System.Collections.Generic ;
using System.IO ;
using System.Linq ;
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
using System.Reflection ;
2026-09-14 17:39:12 +02:00
using CultMath ;
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
using GameCult.Caching ;
2026-09-14 17:39:12 +02:00
using Random = CultMath . Random ;
2026-09-12 01:27:18 +02:00
// Commands over the game database, run with: dotnet run --project tools/AetherDb -- <command>
public static class Program
{
public static int Main ( string [ ] args )
{
var command = args . FirstOrDefault ( ) ? ? "help" ;
switch ( command )
{
case "census" : return Census ( ) ;
case "station-fit" : return StationFit ( ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
case "hardpoint-fit" : return HardpointFit ( ) ;
case "loadout" : return Loadout ( args . Skip ( 1 ) . FirstOrDefault ( ) ) ;
case "save" : return Save ( ) ;
case "factions" : return Factions ( ) ;
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
case "dangling" : return Dangling ( args . Skip ( 1 ) . ToArray ( ) ) ;
2026-09-12 02:09:34 +02:00
case "settings" : return Settings ( ) ;
case "settings-dump" : return SettingsDump ( ) ;
2026-09-12 01:27:18 +02:00
default :
Delete the old run, settings, layout and loadout authorities (Cut 10)
The deletion line lands before RunSave, as the spec orders. Deleted, not
demoted:
- PlayerSettings.SavedRun (Key 1 stays unclaimed) and the SavedGame
constructor that upserted a fresh SavedZone per zone on every save.
- ActionGameManager: the PlayerSettings.msgpack getter, file path and
writer; the .loadout format (_loadoutPath, Loadouts, SaveLoadout and its
default-options serializer, the commented loader); OnApplicationQuit and
SaveState; SaveZone, which had no caller.
- MainMenu's SavedRun Continue branch and both `SavedRun = null` writes.
- InventoryPanel's Save Loadout and Restore Loadout bodies.
- InputDisplayLayout's KeyboardLayouts file reader, ParseJson,
AssociateInputKeys, SaveLayout and the usings they alone needed.
- AetherDb's Cut 9 importer (Import.cs, legacy-census, import).
- The three-gates note on loading writes; Cut 3 made loading non-writing.
- .gitignore ignores GameData/run.cc and GameData/player.cc instead of
PlayerSettings.msgpack.
DOES NOT BUILD in Unity: ActionGameManager, MainMenu and InputDisplayLayout
still reference the deleted members until the next commit wires RunSave,
the settings getter and the catalog layout read. Headless builds.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:51:10 +02:00
Console . WriteLine ( "commands: census, factions, station-fit, hardpoint-fit, loadout [seed], save, settings, settings-dump, dangling [clear <Type.Member>]... [apply]" ) ;
2026-09-12 01:27:18 +02:00
return 1 ;
}
}
// Designs by kind and manufacturer, designs no product sells, and products with authored role quality.
private static int Census ( )
{
var db = AetherDb . Open ( ) ;
var items = db . Cache . GetAll < EquippableItemData > ( ) . ToArray ( ) ;
var products = db . Cache . GetAll < FactionProductData > ( ) . ToArray ( ) ;
var kinds = new Dictionary < string , List < string > > ( ) ;
foreach ( var item in items )
{
var kind = item is HullData hull ? $"Hull/{hull.HullType}"
: item is DockingBayData ? "DockingBay"
: item is CargoBayData ? "CargoBay"
: item is WeaponItemData weapon ? $"Weapon/{weapon.HardpointType}"
: item . HardpointType . ToString ( ) ;
if ( ! kinds . TryGetValue ( kind , out var makers ) ) kinds [ kind ] = makers = new List < string > ( ) ;
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
makers . Add ( db . Cache . Get ( item . Manufacturer ) ? . ShortName ? ? "(none)" ) ;
2026-09-12 01:27:18 +02:00
}
Console . WriteLine ( $"{items.Length} designs, {products.Length} products\n" ) ;
foreach ( var kind in kinds . OrderBy ( k = > k . Key ) )
Console . WriteLine ( $"{kind.Key,-22} {kind.Value.Count,3} " + string . Join ( ", " ,
kind . Value . GroupBy ( m = > m ) . OrderByDescending ( g = > g . Count ( ) ) . Select ( g = > $"{g.Key}:{g.Count()}" ) ) ) ;
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var sold = SoldDesigns ( products ) ;
var orphans = items . Where ( i = > ! sold . Contains ( db . Cache . RefOf ( i ) . Key ) ) . ToArray ( ) ;
2026-09-12 01:27:18 +02:00
Console . WriteLine ( $"\n{orphans.Length} designs no product sells, so they cannot spawn:" ) ;
foreach ( var item in orphans ) Console . WriteLine ( $" {item.Name}" ) ;
var authored = products . Where ( p = > p . Roles ! = null & & p . Roles . Count > 0 ) . ToArray ( ) ;
Console . WriteLine ( $"\n{authored.Length} products carry role quality:" ) ;
foreach ( var product in authored )
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
Console . WriteLine ( $" {product.Name,-28} by {db.Cache.Get(product.Manufacturer)?.ShortName ?? " ( none ) ",-12} " +
2026-09-12 01:27:18 +02:00
string . Join ( ", " , product . Roles . Select ( r = > $"{r.Role} {r.Mean:0.00}±{r.StandardDeviation:0.00}" ) ) ) ;
if ( authored . Length = = 0 ) Console . WriteLine ( " none yet: add roles to a design, then set each product's means" ) ;
2026-09-17 04:16:23 +02:00
// Brand() picks the first (maker, design) product in record-key order; more than one means the choice is
// arbitrary rather than authored, which the rule until segment bands exist forbids.
var duplicateBrands = products
. Where ( p = > p . Manufacturer . IsSet ( ) )
. GroupBy ( p = > ( Maker : p . Manufacturer . Key , Design : p . Design . Key ) )
. Where ( g = > g . Count ( ) > 1 )
. ToArray ( ) ;
Console . WriteLine ( $"\n{duplicateBrands.Length} (maker, design) pairs with more than one product:" ) ;
foreach ( var group in duplicateBrands )
{
var maker = db . Cache . Get < Faction > ( group . Key . Maker ) ;
var design = db . Cache . Get < CraftedItemData > ( group . Key . Design ) ;
Console . WriteLine ( $" {maker?.ShortName ?? " ( unknown ) "} / {design?.Name ?? group.Key.Design.Value}: " +
string . Join ( ", " , group . Select ( p = > p . Name ) ) ) ;
}
2026-09-12 01:27:18 +02:00
return 0 ;
}
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
private static HashSet < GameCult . Caching . CultRecordKey > SoldDesigns ( IEnumerable < FactionProductData > products ) = >
new HashSet < GameCult . Caching . CultRecordKey > ( products . Select ( p = > p . Design . Key ) ) ;
2026-09-12 01:27:18 +02:00
// Some docking bay fits every station hull, which LoadoutGenerator.GenerateStationLoadout requires.
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
// Models the rule the game applies: an interior cell is usable when no gear occupies it, empty hardpoint
// cells included. Reports both the empty hull and the case where every hardpoint is already filled, because
// generation equips hardpoint gear first and only the first of those is guaranteed.
2026-09-12 01:27:18 +02:00
private static int StationFit ( )
{
var db = AetherDb . Open ( ) ;
var bays = db . Cache . GetAll < DockingBayData > ( ) . ToArray ( ) ;
var failures = 0 ;
foreach ( var hull in db . Cache . GetAll < HullData > ( ) . Where ( h = > h . HullType = = HullType . Station ) )
{
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
var empty = new Shape ( hull . Shape . Width , hull . Shape . Height ) ;
foreach ( var v in hull . InteriorCells . Coordinates ) empty [ v ] = true ;
var hardpointsFilled = new Shape ( hull . Shape . Width , hull . Shape . Height ) ;
foreach ( var v in hull . InteriorCells . Coordinates ) hardpointsFilled [ v ] = true ;
2026-09-12 01:27:18 +02:00
foreach ( var hardpoint in hull . Hardpoints )
foreach ( var v in hardpoint . Shape . Coordinates )
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
hardpointsFilled [ hardpoint . Position + v ] = false ;
var onEmpty = bays . Where ( b = > b . Shape . FitsWithin ( empty , out _ , out _ ) ) . Select ( b = > b . Name ) . ToArray ( ) ;
var onFilled = bays . Where ( b = > b . Shape . FitsWithin ( hardpointsFilled , out _ , out _ ) ) . Select ( b = > b . Name ) . ToArray ( ) ;
if ( onEmpty . Length = = 0 ) failures + + ;
Console . WriteLine ( $"{hull.Name}: empty hull fits [{string.Join(" , ", onEmpty)}], every hardpoint filled fits [{string.Join(" , ", onFilled)}]" ) ;
if ( onEmpty . Length > 0 & & onFilled . Length = = 0 )
Console . WriteLine ( " depends on hardpoint gear leaving cells free; generation can still fail here" ) ;
}
return failures ;
}
// Every hardpoint on every hull, and which designs can fill it: LoadoutGenerator requires a matching
// HardpointType, a shape that fits the hardpoint, and exactly as many cells as the hardpoint has. A
// hardpoint no product can fill is gear the game cannot place.
private static int HardpointFit ( )
{
var db = AetherDb . Open ( ) ;
var gear = db . Cache . GetAll < GearData > ( ) . ToArray ( ) ;
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var sold = SoldDesigns ( db . Cache . GetAll < FactionProductData > ( ) ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
var unfillable = 0 ;
foreach ( var hull in db . Cache . GetAll < HullData > ( ) . OrderBy ( h = > h . HullType ) . ThenBy ( h = > h . Name ) )
{
Console . WriteLine ( $"\n{hull.Name} ({hull.HullType}):" ) ;
foreach ( var hardpoint in hull . Hardpoints . OrderByDescending ( h = > h . Shape . Coordinates . Length ) )
{
var cells = hardpoint . Shape . Coordinates . Length ;
var matches = gear . Where ( g = >
g . HardpointType = = hardpoint . Type & &
g . Shape . FitsWithin ( hardpoint . Shape , hardpoint . Rotation , out _ ) & &
g . Shape . Coordinates . Length = = cells ) . ToArray ( ) ;
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var soldMatches = matches . Where ( m = > sold . Contains ( db . Cache . RefOf ( m ) . Key ) ) . ToArray ( ) ;
if ( soldMatches . Length = = 0 ) unfillable + + ;
Console . WriteLine ( $" {hardpoint.Type,-14} {cells,2} cells: {matches.Length} designs match, {soldMatches.Length} sold" +
( matches . Length = = 0 ? " <- no design of that size" : soldMatches . Length = = 0 ? " <- designs exist but no product sells them" : "" ) ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
foreach ( var match in matches )
Console . WriteLine ( $" {match.Name,-28} {match.Shape.Coordinates.Length} cells" +
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
( sold . Contains ( db . Cache . RefOf ( match ) . Key ) ? "" : " (unsold)" ) ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
}
}
Console . WriteLine ( $"\n{unfillable} hardpoints no product can fill" ) ;
return unfillable ;
}
2026-09-12 02:09:34 +02:00
// The parsed shape of the settings asset, for checking where sequence items actually landed.
private static int SettingsDump ( )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var authored = AuthoredSettings . Load ( AetherDb . FindRoot ( ) ) ;
2026-09-12 02:09:34 +02:00
authored . Dump ( "TutorialGenerationSettings" , 2 ) ;
Console . WriteLine ( ) ;
authored . Dump ( "GameplaySettings" , 2 ) ;
return 0 ;
}
// What the authored settings asset actually yields, so a fixture using it can be trusted before it reports
// anything about galaxies. Prints the values that matter to generation and every field it could not place.
private static int Settings ( )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var authored = AuthoredSettings . Load ( AetherDb . FindRoot ( ) ) ;
2026-09-12 02:09:34 +02:00
var tutorial = authored . Read < TutorialGenerationSettings > ( "TutorialGenerationSettings" ) ;
var background = authored . Read < SectorBackgroundSettings > ( "TutorialBackgroundSettings" ) ;
var names = authored . Read < NameGeneratorSettings > ( "NameGeneratorSettings" ) ;
var zones = authored . Read < ZoneGenerationSettings > ( "ZoneSettings" ) ;
var gameplay = authored . Read < GameplaySettings > ( "GameplaySettings" ) ;
Console . WriteLine ( $"tutorial: protagonist {tutorial.ProtagonistFaction}, antagonist {tutorial.AntagonistFaction}, " +
$"buffer {tutorial.BufferFaction}, quest {tutorial.QuestFaction}, " +
$"neutrals [{string.Join(" , ", tutorial.NeutralFactions ?? new string[0])}], " +
$"{tutorial.ZoneCount} zones, link density {tutorial.LinkDensity}" ) ;
Console . WriteLine ( $"background: frequency {background.NoiseFrequency}, amplitude {background.NoiseAmplitude}, " +
$"cloud exponent {background.CloudExponent}, density at centre {background.CloudDensity(new float2(.5f)):0.000}" ) ;
Console . WriteLine ( $"names: order {names.NameGeneratorOrder}, length {names.NameGeneratorMinLength}-{names.NameGeneratorMaxLength}" ) ;
Console . WriteLine ( $"zones: sun mass {zones.SunMass}, planet mass {zones.PlanetMass}, satellite passes {zones.SatellitePasses}, " +
$"belt probability {zones.BeltProbability}" ) ;
Console . WriteLine ( $" zone radius curve {zones.ZoneRadius?.Minimum}-{zones.ZoneRadius?.Maximum} exponent {zones.ZoneRadius?.Exponent}" ) ;
Console . WriteLine ( $" sub zone count {zones.SubZoneCount?.Minimum}-{zones.SubZoneCount?.Maximum} exponent {zones.SubZoneCount?.Exponent}" ) ;
Console . WriteLine ( $"gameplay: weapon groups {gameplay.WeaponGroupCount}, shutdown performance {gameplay.DefaultEntitySettings?.ShutdownPerformance}" ) ;
Console . WriteLine ( $" tiers: {string.Join(" , ", (gameplay.Tiers ?? new RarityTier[0]).Select(t => $" { t . Name } q { t . Quality } r { t . Rarity } "))}" ) ;
Console . WriteLine ( $" price modifier {gameplay.QualityPriceModifier?.Minimum}-{gameplay.QualityPriceModifier?.Maximum} exponent {gameplay.QualityPriceModifier?.Exponent}" ) ;
// Assert counts, not non-null: an empty array reads as populated and would make every number a fixture
// reports downstream a fiction. These are the authored values as of the asset read above.
var missing = new List < string > ( ) ;
if ( zones . ZoneRadius = = null | | zones . ZoneRadius . Maximum < = 0 ) missing . Add ( "ZoneSettings.ZoneRadius" ) ;
if ( zones . SubZoneCount = = null | | zones . SubZoneCount . Maximum < = 0 ) missing . Add ( "ZoneSettings.SubZoneCount" ) ;
if ( zones . PlanetSafetyRadius = = null | | zones . PlanetSafetyRadius . Multiplier < = 0 ) missing . Add ( "ZoneSettings.PlanetSafetyRadius" ) ;
if ( gameplay . Tiers = = null | | gameplay . Tiers . Length ! = 5 ) missing . Add ( $"GameplaySettings.Tiers (expected 5, got {gameplay.Tiers?.Length ?? 0})" ) ;
else if ( gameplay . Tiers . Any ( t = > string . IsNullOrEmpty ( t . Name ) | | t . Quality < = 0 ) ) missing . Add ( "GameplaySettings.Tiers (a tier parsed without a name or quality)" ) ;
if ( gameplay . DefaultEntitySettings = = null ) missing . Add ( "GameplaySettings.DefaultEntitySettings" ) ;
if ( gameplay . QualityPriceModifier = = null | | gameplay . QualityPriceModifier . Maximum < = 0 ) missing . Add ( "GameplaySettings.QualityPriceModifier" ) ;
if ( tutorial . NeutralFactions = = null | | tutorial . NeutralFactions . Length ! = 2 ) missing . Add ( $"TutorialGenerationSettings.NeutralFactions (expected 2, got {tutorial.NeutralFactions?.Length ?? 0})" ) ;
if ( string . IsNullOrEmpty ( tutorial . ProtagonistFaction ) ) missing . Add ( "TutorialGenerationSettings.ProtagonistFaction" ) ;
Console . WriteLine ( $"\n{authored.Unplaced.Count} fields in the asset had nowhere to go" ) ;
foreach ( var field in authored . Unplaced . Take ( 20 ) ) Console . WriteLine ( $" {field}" ) ;
Console . WriteLine ( $"{missing.Count} settings generation needs came back unset" ) ;
foreach ( var field in missing ) Console . WriteLine ( $" {field}" ) ;
return missing . Count ;
}
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
// Every CultRecordRef in the catalog that resolves to nothing, as "<record> <DeclaringType.Member> -> <key>".
// Each "clear <DeclaringType.Member>" argument unsets that member's dangling refs, or removes that dictionary's
// dangling keys (Faction.BossHull clears boss hulls that would claim a chokepoint no boss can spawn in). Dry
// run unless passed "apply", which alone opens the catalog writable and lands every changed record in one commit.
private static int Dangling ( string [ ] args )
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
{
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
var apply = args . Contains ( "apply" ) ;
var clear = new HashSet < string > ( args . Select ( ( arg , i ) = > ( arg , i ) )
. Where ( p = > p . arg = = "clear" & & p . i + 1 < args . Length )
. Select ( p = > args [ p . i + 1 ] ) ) ;
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var db = AetherDb . Open ( catalogWritable : apply ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
var changed = new List < ( object Document , CultRecordKey Key ) > ( ) ;
var found = 0 ;
foreach ( var stored in db . Cache . AllStoredDocuments . OrderBy ( s = > NameOf ( s . Document ) ? ? s . Key . Value , StringComparer . Ordinal ) )
{
var name = NameOf ( stored . Document ) ? ? stored . Key . Value ;
var cleared = 0 ;
foreach ( var dangling in DanglingRefs ( db . Cache , stored . Document , new HashSet < object > ( System . Collections . Generic . ReferenceEqualityComparer . Instance ) ) )
{
found + + ;
var member = $"{dangling.Field.DeclaringType.Name}.{dangling.Field.Name}" ;
var clearing = clear . Contains ( member ) ;
Console . WriteLine ( $"{name} {member} -> {dangling.Key}{(clearing ? " ( cleared ) " : " ")}" ) ;
if ( ! clearing ) continue ;
dangling . Clear ( ) ;
cleared + + ;
}
if ( cleared > 0 ) changed . Add ( ( stored . Document , stored . Key ) ) ;
}
Console . WriteLine ( $"\n{found} dangling refs" ) ;
if ( changed . Count = = 0 ) return 0 ;
if ( ! apply )
{
Console . WriteLine ( $"Dry run. Pass \" apply \ " to land {changed.Count} changed records." ) ;
return 0 ;
}
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
db . Cache . Commit ( batch = >
{
foreach ( var ( document , key ) in changed ) batch . Upsert ( document . GetType ( ) , document , key ) ;
} ) ;
Console . WriteLine ( $"Landed {changed.Count} changed records in Aetheria.cc" ) ;
return 0 ;
}
private sealed record DanglingRef ( FieldInfo Field , CultRecordKey Key , Action Clear ) ;
// Walks fields by reflection: plain refs, list and array elements, ref-keyed dictionary keys, and nested
// [MessagePackObject] and [Union] values. Clearing a list element unsets it; clearing a dictionary key removes it.
private static IEnumerable < DanglingRef > DanglingRefs ( CultCache cache , object value , HashSet < object > seen )
{
if ( value = = null | | ! seen . Add ( value ) ) yield break ;
foreach ( var field in value . GetType ( ) . GetFields ( BindingFlags . Instance | BindingFlags . Public | BindingFlags . NonPublic ) )
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
{
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
var owner = value ;
var member = field . GetValue ( owner ) ;
if ( member = = null ) continue ;
if ( member is ICultRecordRef reference )
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
{
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
if ( Dangles ( cache , reference ) )
yield return new DanglingRef ( field , reference . Key , ( ) = > field . SetValue ( owner , Activator . CreateInstance ( field . FieldType ) ) ) ;
}
else if ( member is IDictionary dictionary )
{
foreach ( var key in dictionary . Keys . Cast < object > ( ) . ToArray ( ) )
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
{
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
if ( key is ICultRecordRef keyRef & & Dangles ( cache , keyRef ) )
yield return new DanglingRef ( field , keyRef . Key , ( ) = > dictionary . Remove ( key ) ) ;
else foreach ( var nested in DanglingRefs ( cache , key , seen ) ) yield return nested ;
if ( dictionary . Contains ( key ) )
foreach ( var nested in DanglingRefs ( cache , dictionary [ key ] , seen ) ) yield return nested ;
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
}
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
}
else if ( member is IList list & & ! ( member is Array { Rank : > 1 } ) )
{
for ( var i = 0 ; i < list . Count ; i + + )
{
var index = i ;
if ( list [ i ] is ICultRecordRef elementRef )
{
if ( Dangles ( cache , elementRef ) )
yield return new DanglingRef ( field , elementRef . Key , ( ) = > list [ index ] = Activator . CreateInstance ( elementRef . GetType ( ) ) ) ;
}
else if ( list [ i ] ! = null & & IsSerializedObject ( list [ i ] . GetType ( ) ) )
foreach ( var nested in DanglingRefs ( cache , list [ i ] , seen ) ) yield return nested ;
}
}
else if ( IsSerializedObject ( member . GetType ( ) ) )
foreach ( var nested in DanglingRefs ( cache , member , seen ) ) yield return nested ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
}
Generalize clear-boss-hulls into dangling and clear DemandProfile refs (Cut 10 step 2)
AetherDb's one-off boss hull command becomes `dangling`: it walks every
catalog record's CultRecordRef members by reflection (plain refs, list and
array elements, ref-keyed dictionary keys, nested [MessagePackObject] and
[Union] values), prints each ref that resolves to nothing as
`<record> <DeclaringType.Member> -> <key>`, and with `clear <Member>` unsets
those refs or removes those dictionary keys. Dry run unless `apply`, which
alone opens the catalog writable and lands every changed record in one
Commit. Faction.BossHull stays clearable through it.
Ran `dangling clear CompoundCommodityData.DemandProfile apply` (operator
ruling, option B): 3 keys removed, 2 on Mouth Adapting Gummy Molars and 1 on
Neural Lace, pointing at the deleted Conscientiousness and Neuroticism
attributes. `dangling` now lists exactly the three WeaponData.AmmoType refs
(DeathCluster, FastBlast+-, pretty pretty bang bang), left for the operator's
Studio click-through. census, factions and hardpoint-fit are byte-identical
to the Cut 9 captures. The commit rewrote Aetheria.cc in 1.0.59's canonical
unset-ref form.
Builds: headless.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:47:40 +02:00
}
private static string NameOf ( object document ) = > document . GetType ( )
. GetFields ( BindingFlags . Instance | BindingFlags . Public )
. FirstOrDefault ( f = > f . IsDefined ( typeof ( CultNameAttribute ) , true ) ) ? . GetValue ( document ) as string ;
private static bool Dangles ( CultCache cache , ICultRecordRef reference ) = >
reference . Key . IsSet ( ) & & cache . Get ( reference . Key ) = = null ;
private static bool IsSerializedObject ( Type type )
{
for ( var t = type ; t ! = null & & t ! = typeof ( object ) ; t = t . BaseType )
if ( t . IsDefined ( typeof ( MessagePack . MessagePackObjectAttribute ) , false ) | | t . IsDefined ( typeof ( MessagePack . UnionAttribute ) , false ) )
return true ;
return false ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
}
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
// Each faction's generation-critical links. Galaxy.GenerateNames dereferences the geoname file without a
// guard, so an unset link there stops galaxy generation outright.
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
private static int Factions ( )
{
var db = AetherDb . Open ( ) ;
var products = db . Cache . GetAll < FactionProductData > ( ) . ToArray ( ) ;
Console . WriteLine ( $"{" faction ",-26} {" short ",-13} {" geonames ",-22} {" boss hull ",-14} {" influence ",-9} products" ) ;
var broken = 0 ;
foreach ( var faction in db . Cache . GetAll < Faction > ( ) . OrderBy ( f = > f . Name ) )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var key = db . Cache . RefOf ( faction ) . Key ;
var geonames = faction . GeonameFile . IsSet ( ) ? "set" : "UNSET" ;
var boss = ! faction . BossHull . IsSet ( )
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
? "none"
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
: db . Cache . Get ( faction . BossHull ) ? . Name ? ? "DANGLING" ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
if ( geonames = = "UNSET" | | boss = = "DANGLING" ) broken + + ;
Console . WriteLine ( $"{faction.Name,-26} {faction.ShortName,-13} {geonames,-22} {boss,-14} {faction.InfluenceDistance,-9} " +
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
products . Count ( p = > p . Manufacturer . Key . Equals ( key ) ) ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
}
Console . WriteLine ( $"\n{broken} factions carry a link that would break generation" ) ;
return broken ;
}
// What the saved run actually holds per zone. A zone carrying orbits but no orbital entities was packed by a
// generation run that failed partway, and is reused on revisit rather than regenerated, so a fixed generator
// does not repopulate it.
private static int Save ( )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var path = Path . Combine ( AetherDb . FindRoot ( ) , "GameData" , "run.cc" ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
if ( ! File . Exists ( path ) )
{
Console . WriteLine ( $"no save at {path}" ) ;
return 0 ;
}
2026-09-12 01:27:18 +02:00
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
AetherDb db ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
try
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
db = AetherDb . Open ( withRun : true ) ;
2026-09-12 01:27:18 +02:00
}
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
catch ( Exception e )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
Console . WriteLine ( $"save does not open: {e.GetType().Name}: {e.Message}" ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
return 1 ;
}
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var run = db . Cache . GetGlobal < SavedGame > ( ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
if ( run ? . Zones = = null )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
Console . WriteLine ( "run store holds no SavedGame" ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
return 0 ;
}
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
Console . WriteLine ( $"{run.Zones.Length} zones, current zone {run.CurrentZone}\n" ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
var suspect = 0 ;
2026-09-17 04:16:23 +02:00
var crafted = new List < CraftedItemInstance > ( ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
for ( var i = 0 ; i < run . Zones . Length ; i + + )
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
var zone = db . Cache . Get ( run . Zones [ i ] ) ;
if ( zone ? . Contents = = null ) continue ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
var stations = zone . Contents . Entities . Count ( e = > e is OrbitalEntityPack ) ;
var ships = zone . Contents . Entities . Count ( e = > e is ShipPack ) ;
var owner = zone . Owner > = 0 & & zone . Owner < run . Factions . Length
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
? db . Cache . Get ( run . Factions [ zone . Owner ] ) ? . ShortName ? ? "(unknown)"
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
: "(none)" ;
var packedEmpty = zone . Contents . Orbits . Count > 0 & & stations = = 0 ;
if ( packedEmpty ) suspect + + ;
2026-09-17 04:16:23 +02:00
crafted . AddRange ( zone . Contents . Entities . SelectMany ( EntitySerializer . Items ) . OfType < CraftedItemInstance > ( ) ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
Console . WriteLine ( $" [{i,3}] {zone.Name,-18} owner {owner,-12} orbits {zone.Contents.Orbits.Count,3} " +
$"stations {stations,2} ships {ships,2}{(packedEmpty ? " < - packed with orbits but no stations " : " ")}" ) ;
}
Console . WriteLine ( $"\n{suspect} visited zones packed with orbits but no stations" ) ;
2026-09-17 04:16:23 +02:00
// The only headless check of a real played save: does every crafted instance still resolve its lot, and
// does its Data still equal the lot's Design (the one invariant CreateInstance(int) is meant to hold)?
var lots = RunSave . Lots ( db . Cache ) ;
var absent = 0 ;
var mismatched = 0 ;
foreach ( var item in crafted )
{
if ( ! lots . Lots . TryGetValue ( item . Lot , out var lot ) ) { absent + + ; continue ; }
if ( ! lot . Design . Key . Equals ( item . Data . Key ) ) mismatched + + ;
}
Console . WriteLine ( $"\n{lots.Lots.Count} lots, {crafted.Count} crafted instances, " +
$"{absent} instances whose lot is absent, {mismatched} instances whose Data differs from Lot.Design" ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
return 0 ;
}
// Runs the real LoadoutGenerator against every hull, so a generation failure reproduces here instead of on a
// flight to a populated sector. No galaxy, so this covers placement, roles and products but NOT availability
// filtering or distance weighting, which need a real galaxy. Seeded: a failure repeats.
private static int Loadout ( string seedArgument )
{
var db = AetherDb . Open ( ) ;
var seed = uint . TryParse ( seedArgument , out var parsed ) ? parsed : 1 u ;
var settings = new GameplaySettings
{
DefaultEntitySettings = new EntitySettings ( ) ,
Tiers = new [ ] { new RarityTier { Name = "Common" , Quality = . 5f , Rarity = 0 , Color = new float3 ( 1 , 1 , 1 ) } } ,
QualityPriceModifier = new ExponentialLerp ( )
} ;
var log = new List < string > ( ) ;
2026-09-17 04:16:23 +02:00
var itemManager = new ItemManager ( db . Cache , new ProvenanceLedger ( ) , settings , log . Add ) ;
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
var failures = 0 ;
foreach ( var hull in db . Cache . GetAll < HullData > ( ) . OrderBy ( h = > h . HullType ) . ThenBy ( h = > h . Name ) )
{
var random = new Random ( seed ) ;
var generator = new LoadoutGenerator ( ref random , itemManager , null , null , null , . 5f ) ;
log . Clear ( ) ;
string outcome ;
try
{
var pack = hull . HullType switch
{
Rewrite AetherDb over AetheriaStores and CultRecordRef
Cut 8b. AetherDb.Open composes GameData/Aetheria.cc through
AetheriaStores.Open, read-only unless clear-boss-hulls runs with apply;
save attaches GameData/run.cc when present and reads the SavedGame global.
- census, factions, station-fit, hardpoint-fit, loadout, settings,
settings-dump and clear-boss-hulls read references through the null-safe
Get(ref) and compare identity by record key (RefOf, from TryGetHandle).
Their output formats are unchanged so Cut 9 can compare them with the
Cut 0 captures.
- clear-boss-hulls lands every cleared faction in one Commit.
- The help line lists every command.
- Deleted: doctor, migrate-products, AetherDb.Save(), and
OpenWithNameFiles. The last was Cut 9's delete, but it needs the removed
multi-file store, and NameFile now routes to the catalog.
- FindRoot looks for Aetheria.Shared.csproj; AetherDB.msgpack leaves in
Cut 9.
It compiles. It cannot run until Cut 9 writes Aetheria.cc, so the pre-cut
captures do not apply to this cut.
Builds: Aetheria.Shared, AetherDb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:05:14 +02:00
HullType . Ship = > generator . GenerateShipLoadout ( candidate = > candidate = = hull ) ,
Clear dangling boss hull links, and stop the tool writing on read
Eight factions pointed at one boss hull GUID that no longer resolves,
shared wreckage from the database loss. PlaceFactionsMain gives a boss zone
to every faction carrying a BossHull, so each dangling link claimed a
chokepoint that could never spawn a boss.
AetherDb.Open no longer registers the name file store. CultCache subscribes
Add to a store EntryAdded, MultiFileBackingStore.PullAll re-emits what it
loads, and Add pushes to that type store, whose Push writes a file: opening
the cache rewrote all twelve name files, 4.4 MB, on every command. They were
byte identical, and it only surfaced as an error because Unity had one of
them memory mapped. Name files now load only on request, and the scope doc
records the underlying smell.
Adds commands: factions, clear-boss-hulls, save, loadout (runs the real
LoadoutGenerator against every hull), hardpoint-fit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 02:05:33 +02:00
HullType . Turret = > generator . GenerateTurretLoadout ( ) ,
_ = > generator . GenerateStationLoadout ( )
} ;
outcome = pack = = null ? "NO LOADOUT (nothing suitable found)" : "ok" ;
if ( pack = = null ) failures + + ;
}
catch ( Exception e )
{
outcome = $"THREW {e.GetType().Name}: {e.Message}" ;
failures + + ;
}
Console . WriteLine ( $"{hull.Name,-12} ({hull.HullType,-7}) {outcome}" ) ;
foreach ( var line in log . Distinct ( ) ) Console . WriteLine ( $" {line}" ) ;
}
Console . WriteLine ( $"\n{failures} hulls failed to generate a loadout (seed {seed})" ) ;
2026-09-12 01:27:18 +02:00
return failures ;
}
}