1. Catalog: typed composition
-
[E] A catalog entry is a key plus optional, typed components:
leveled,unit,produces,consumes,storage,energyThreshold,fields,limit,placement,combat,mobile. -
[E] Each component has exactly one rule module in
src/core; only that module reads the component. No other code asks for a key. -
[E] Behaviour that differs per entry is a typed function field of a component, for example the rate formula of
produces, or data that the rule module evaluates, for example the drive switches ofmobile(owner, 2026-11-14, replaces the exampledrive: (research) => DriveKey). There are no free hooks (onBuild,onSettle): they bring the scattered special cases back. -
[E] A component is created when at least two entries need it, or an issue requires the rule to be generic. Until then the special rule stays in the folder of its entry.
-
[V] No ECS framework and no runtime registry of systems: components are plain fields, the rule modules are plain functions.
-
[E] Decided for the first pull request of #114 (owner, 2026-11-13): all 49 entries get
src/features/<key>/entry.ts; onlyproduces,consumes,storageandleveledbecome components, every other field moves unchanged and becomes a component in its group’s pull request. Eachentry.tsexports itskind(building, research, ship, defense) and a numericorder;catalog.tsbuildsBUILD,RES,SHIPS,DEFandUNITfrom the generated index by kind and order, today’s order stays and the core holds no key list.producesandconsumesare one rate function per resource plus a production order; the base income (20 Adamant, 10 Kristall) is a core constant;prod()stays bit-identical, proven by a property test against the oldprod().leveledis{ cost, f? }with the default 2 inlvlCost;storageis{ res: 'm' | 'c' | 'd' }with the capacity formula in the core. One file per component undersrc/core/components/, its contract test next to it. -
[E] Built with #114 (production group):
entry.tsexportskind,order, its components (leveled,produces,consumes,storage) and the remaining fields asdef;catalog.tsadded the texts of the key fromsrc/core/texts.tsuntil #113 moved them into the entry folders.src/core/components/holdsleveled.ts(lvlCost,sumLevels),storage.ts(capOf,capacities),produces.ts(BASE_INCOME,energyMade,made: base income plus the rates times the universe speed, never below 0) andconsumes.ts(energyUsed,left);economy.tskeeps its exports and composes them inprod()andcaps().PRODUCTION,STORAGEandPRODUCERSare derived from the components;PRODUCERSstays deeply equal (it was [V] in #114). The level of a ship in a rate is its number on the planet (Solarsatellit). -
[E] Choices of #114 within the decisions above, confirmed by the owner (2026-11-14): the
ordervalues step by 10 (room for new entries without renumbering); the production order is the fieldorderofproduces, and an entry that consumes also produces (contract test); the formulas the rates share (growth,grows, Solarsatellit and Fusionskraftwerk) are insrc/core/rates.ts, the shared formula module of the entries; the throttle of the Fusionskraftwerk (balancedShare) still names its key and becomes generic with the events of #115. -
[E] Decided for the second pull request of #114, the combat group (owner, 2026-11-13):
unitis{ cost }, the cost of one piece, the counterpart ofleveled;reqstays indef, „once per planet“ waits forlimitand the flight fields wait formobile.combatis{ atk, sh, rf? }with today’s names; the hull is not stored but derived fromunit.cost((Adamant + Psikristall) / 10) in the rule modulesrc/core/components/combat.ts, and the contract test checks that it is above 0. The default rapid fire against easy targets is the flageasy: trueincombatof the Spähschädel and the Sonnenreliquiar plus a core constant 5 instead of the key list inbattle.ts: every ship that is not easy itself and names no rapid fire against the target gets 5, defense gets none (replaces the [V] „a field ofcombatinstead of a key list“ of #114). Onlybattle.tsreads the new components, through the rule module; the shipyard, points, the server unit check and the battle reports keep reading theUNIT,SHIPSandDEFtables until #118, as the first pull request left the resources page. The test that scanssrcfor catalog keys comes with the last pull request of #114 (ProducerTable). The exports stay deeply equal and battles bit-identical, proven by a property test against the oldbattle(). -
[E] Built with #114 (combat group): the ship and defense entries export
unitandcombat, anddefkeeps their other fields (ShipFields,DefenseFields).src/core/components/unit.tsholds the typeUnit;src/core/components/combat.tsholdsCombat,EASY_RAPID_FIRE,strength(hull, shield and attack of one piece before the research bonus) andrapidFire.catalog.tsderivesFIGHTERS(every entry withunitandcombat, by key, with its kind) and buildsSHIPS,DEFandUNITfromunit,combatwithouteasyanddef, deeply equal to before;battle.tsreadsFIGHTERSthroughstrengthandrapidFireand keeps its exports. -
[E] Decided for the third pull request of #114, the flight group (owner, 2026-11-14):
mobileis{ cargo, speed, fuel, drive, drives? }with today’s names as data, likecombat; the drive switch stays a list[{ drive, speed, from: { research, level } }]that the rule module evaluates. The Sonnenreliquiar has nomobile: „can fly“ is „hasmobile“, and its flight values come from a core constantSTATIONARYinstead ofdef; the contract test checks speed > 0 for every entry withmobile. Onlyflight.tsreadsmobile, through the rule module, andcanFlyis derived from it; the shipyard, the fleet view and the server keep readingSHIPSuntil #118.DRIVE_BONUSandDriveKeymove tosrc/core/components/mobile.ts;catalog.tsexports them unchanged. -
[E] Built with #114 (flight group): every ship that flies exports
mobile, anddefkeepsreq(ShipFields).src/core/components/mobile.tsholdsMobile,DriveSwitch,DriveKey,DRIVE_BONUS,STATIONARY({ cargo: 0, speed: 0, fuel: 0, drive: 'comb' }, the values of version 1),activeDriveandspeed.catalog.tsderivesMOBILE(the ships withmobile, by key) andcanFly(an own key ofMOBILE), and buildsSHIPSfrommobileorSTATIONARY, deeply equal to before;flight.tsreadsMOBILEthrough the rule module and keeps its exports. -
[E] Decided for the fourth pull request of #114, the limits group (owner, 2026-11-14):
limitis{ perPlanet: number }, at most that many per planet, the stock plus the shipyard queue; the rule isperPlanet − have − queued, never below 0, and Infinity without a limit; both shield domes carryperPlanet: 1.energyThresholdis{ base, f }with today’s data (Gravitonforschung, Weltenschmiede); the formulabase × f^(level−1)stays in the rule module, and the contract test checks base > 0, f ≥ 1 and a need that is finite and never falls for levels 1 to 60.energyNeedandenergyShortmove tosrc/core/components/energy-threshold.ts, andresearch.tsexports them unchanged; the limit rule lives insrc/core/components/limit.ts, andunitRoominyard.tscalls it. Only the core reads the components (unitRoom, the energy check through the rule module); the client shipyard („max. 1“), the resources page andBuildings.sveltekeep readingDEF,BUILDandenergyNeeduntil #118 (since #118 the list ofsrc/client/logic/catalog-list.tsreads them).DEFkeepsonce: trueand the tables keep the fieldenergyuntil #118; the exports stay deeply equal. -
[E] Built with #114 (limits group): the two shield domes export
limit, the Gravitonforschung and the WeltenschmiedeenergyThreshold;defno longer holdsonceandenergy(DefenseFields,BuildingFields,ResearchFields).src/core/components/limit.tsholdsLimitandroom;src/core/components/energy-threshold.tsholdsEnergyThreshold,energyNeedandenergyShort.catalog.tsderivesLIMIT(the defense withlimit, by key) and buildsDEFwithonce: truefor alimitof 1 andBUILDandRESwithenergyfromenergyThreshold, deeply equal to before;unitRoomreadsLIMITthrough the rule module (own keys only),requirements.tsimports the energy check from the rule module, andyard.tsandresearch.tskeep their exports. -
[E] Choices of the limits group within the decisions above, confirmed by the owner (2026-11-14):
limitis only on defense, becauseunitRoomcounts the stock in the planet’s defense, and the contract test checks this and a wholeperPlanet≥ 1;energyThresholdis only on buildings and research, the entries with levels; the table fieldonce: trueis derived fromperPlanet === 1instead of being kept twice indef. -
[E] Decided for the last pull request of #114,
ProducerTable(owner, 2026-11-14): the rows of the resources page come from a core functionproducerRows()ineconomy.tswith the same list, energy factorfand throttled share asprod(): per entry its level or number, share, production and use, plus the row of the base income fromBASE_INCOME; a property test checks that the rows add up toprod(). Text and numbers stay, the E2E tests unchanged; the label is „(Stufe n)“ for a building and „(n)“ for a ship, and the plural „Sonnenreliquiare“ is a text field of the entry.ProducerTable.svelteis mounted likeBuildings.svelte.rates.tsstays the shared formula module of the entries. The displays with a fixed key become generic with the same text: the shipyard shows the energy of one piece fromproduces.ewith „je Reliquiar“ from the texts of the entry, the buildings the use per hour at the next level fromconsumes. The test that scanssrcfor comparisons with a key has a named allow-list (file, key, count, issue) whose counts may only fall:settle.ts(nextSatellite,techChange),server/game/actions.tsandbalancedSharewith #115, the check of the Spähschädel with #116, the lab and shipyard locks with #183 („Lab lock and shipyard lock without catalog keys“, owner, 2026-11-14). -
[E] Built with #114 (ProducerTable):
producerRows(p, u, research)insrc/core/economy.tsreturnsf, the base income times the universe speed and one row per entry ofPRODUCTIONin the production order: key, kind, level (a ship’s number), share as it runs,throttled, andmadeandusedwith the rates the entry has (a resource made times the universe speed, asprod()adds it). It runs on the planet asproduction()runs it, with the throttled Fusionskraftwerk.useAt()gives the resource use per hour of an entry at a level fromconsumes,pieceEnergy()the energy of one piece of a ship withproduces.e.EntryTexthas the optional fieldspluralandper; the Sonnenreliquiar has „Sonnenreliquiare“ and „je Reliquiar“. The browser no longer callsrates.ts.balancedSharenames the key only as a share (pct.fusion), not in a comparison, so the scan has no entry for it; it stays for #115. -
[E] Built with #53 (first pull request, owner’s decisions of 2026-11-13 and 2026-11-14): the component
placementis the list of the kinds of place where a building can stand ('planet','moon'); a building without it stands on planets only.src/core/components/ placement.tsholdsPlacement,PLANET_ONLYandplaceable, its contract test checks that only buildings carry it and that it names known kinds once each.catalog.tsderivesPLACEMENTandbuildable(key, kind); the build action, the requirements list and the buildings page askbuildable. The Mondzitadelle adds fields through the existingfieldsofBuildingFields, like the Weltenschmiede. -
[V] Built with #54 (Missiles): the components
silo({ slots }, places per level, buildings only) andmissile({ slots, intercepts? }, defense only) with one rule module,src/core/components/silo.ts, and its contract test;catalog.tsderivesSILOandMISSILE, andFIGHTERSleaves the missiles out (fights(key));yard.tsasks the module for the room of the silo. -
[V] Built with #183 (lab lock and shipyard lock without catalog keys; the owner left open whether they become a component, how the lab lock fits the rule of two entries and the release, 2026-11-14; the recommendation was taken, no behaviour changes): the component
locks,{ stops: 'shipyard' | 'research', home?: true }, on buildings only. An upgrade of such a building stops what it names while it runs, and waits until that is idle;homemarks the building that is the place of it (the Schiffsschmiede for the shipyard, the Scholarium for the research), exactly one per kind. Three entries share it (Schiffsschmiede, Machina-Schwarmhalle, Scholarium), so the rule of two entries holds, with two kinds of lock. The rule module issrc/core/components/locks.ts(stops,stoppers,homeOf) with its contract test;catalog.tsderivesLOCKS;lab.tsandyard.tskeep their exports (hasLab,labUpgrading,waitsForLab,hasYard,yardLockedBy,waitsForYard,YARD_LOCK) and read the component,hasLabandhasYardthe level of thehomebuilding (YARD_HOME). The name of a lock in a message is the short textshortof the entry (the Schiffsschmiede, whose name is „Orbitale Schiffsschmiede“), else its name;YARD_LOCKis derived from them with today’s values, andlockNotice()compares withYARD_HOME.src/core/locks-reference.test.tscompares every rule with its form before, for every key of the catalog and inherited names.