A focused headless run keeps one subsystem real and replaces the rest with something cheaper that still feeds and drains the target. This page is the design reference: the groups, each group's boundary, each mode's mechanism and the state it touches, and the status of the phased build-out. Code: standins.mjs, stacks.mjs, passive.mjs; what is specific to this repo's scripts sits in profiles/code_terraform.json ("Profile" below). Scenario format: scenarios.md. Fidelity numbers: ab_results.md.
- Level 1 works on scripts and archive keys only: stop a group's scripts (
off), park them (park), stop all but the needed generators (trim), or run a cheap Python script in the slot (standin, phase 1). Power, fluids and every machine stay real, so no simworker patch is needed and a game update cannot break it. - Level 2 patches the simworker:
scalecollapses N identical terraformers into one record (phase 2),movermoves items between stores in code instead of flying drones (phase 3). Faster, and dependent on the anchors in anchors.md.
Both levels are reported in summary.json (standins), so a result always says what it verified.
The registry is per machine type (TYPES in standins.mjs: {typeId: {group, reason}}); a group is the set of types with that name. Grouping follows the chain (who feeds whom), not what a machine looks like. A scenario's assign moves a type for one run.
| Group | Types | Boundary when off: produces / consumes |
|---|---|---|
terraforming |
temp_heater, heat_generator, oxygen_generator, pressure_generator | atmosphere (heat, O2, pressure) / power, steam_in and water_in (Mk III), fuel rods (Mk IV) |
power |
solar_generator, steam_turbine, oil_generator, reactor, oil_pump, water_pump, thermal_cap, steam_condenser, charging_station, fuel_assembler, lead_cask | grid power, steam, water, oil / oil, steam, water |
orchestrator |
automation and panel slots (# ct-automation: / # ct-panel: marker, or automation_N / panel_N ids) |
production.demand, power.shedded, cash.budget, script.parked, fleet.commission, build.jobs / telemetry keys |
logistics |
drone_small/medium/large, drone_station (+medium, large), drone_service_station, pioneer, rover, supply_dock | items at outposts (logistics.requests served), ore at smelters, construction / logistics.requests, power |
factory |
smelter, fabricator, garbage_disposal, mining_drill (+industrial, heavy) | ingots, crafted items, kits / ore, ingots, fabricator.orders, production.demand |
plants |
harvester, crop_automator, scanner, sprinkler, grow_lamp, dispenser, seed_maker, plant_terraformer | forage, seeds, km² / seeds, water, salt, fertilizer |
biolab |
bio_lab, bio_collector, bio_exchange, bio_caster, bio_luminizer, bio_processor, bio_conditioner, dna_sequencer | samples, life-form items / reagents, power |
wildlife |
habitat, feed_maker, refiner, exotic_gas_cap, exotic_spring_tap | revived species, Insight / feed, refined fluids |
biomass |
essence_liquifier, biomass_mixer | biomass / essence |
weather |
weather_station | weather.signals / nothing |
construction |
no machine type: the jobs in planet.constructionBlueprints (the builder Pioneers stay logistics) |
finished blueprints (machines, outposts, pipes, power lines) / build time; off stops nothing |
system |
boot, uplink, planet_*, contract_* slots; the sensor and fixture machines (oxygen_sensor, pressure_sensor, thermometer, clock, gps, inventory) |
never touched |
Why these groups (owner's calls, 2026-10-14): seed_maker and plant_terraformer behave like fabricators but only the harvester chain uses them, so they sit with plants; refiner and the exotic caps only serve wildlife; supply_dock ships orders, so it is logistics; mining_drill is the smelters' ore source once drills exist. The bio chain is split three ways because a test rarely needs all of it.
A machine's script slots come from m.scriptSlots (ids that exist in state.scripts). Slots no machine owns are matched by marker, id or system name; the rest go to summary.standins.unclassified (strict: true fails instead). An unowned slot that is not running (a recycled machine's old slot, e.g. o2gen_51 after the generator was undeployed) is only counted (orphans).
| Mode | Groups | Mechanism | Ghosts |
|---|---|---|---|
real |
all | nothing changes | 0 |
off |
all but system |
script.stop for every running slot of the group (minus keep). The machines stay; a stopped machine draws no power (the game gates draw on a running script) and makes nothing. The profile's stubs for the group are written ("Profile" below) and the stopped scripts' archive records are swept ("Left-overs" below). |
scripts stopped |
park |
terraforming | Parker from passive.mjs on the group's types: the real scripts stay waiting and run a loop pass only on a trigger (waste, gauge window, new day, power or tier change, low feed, one-minute refresh). A/B in ../plans/done/headless/headless_sim.md. |
0 |
trim |
power | Watches each subnet for warmupTicks (600): peak consumed, and per running turbine or oil generator the rated output data.power_output / data.throttle (max seen; the scripts throttle generators to demand, so generated / n would measure demand, not capacity). Then, once, per subnet: the unrated generators (no throttle seen) and keep slots stay; of the rated ones the highest-rated are kept until the kept rating reaches peak × margin (at least keepMin rated unpinned ones; keep slots do not count), the rest stop. A subnet idle through the warm-up is cut to keepMin. Then every reevalTicks (default warmupTicks; 0 = one-shot) the window's peak consumed is checked against the kept rating: when peak × margin exceeds it, stopped generators restart (script.run, highest-rated first, a refused restart is dropped from the pool) until it is covered again. A refused stop (the game's script.stop answers {ok: false}, in practice only for a bad script id) leaves the generator running: it counts as kept and stays a second-stop candidate, and its slots that did stop go to the pool at rating 0 (they restart without changing the kept count). With quietWindows 0 (default) nothing is stopped twice, so the kept set only grows; with quietWindows k a restarted generator stops again (lowest-rated first, back into the pool) once the kept rating without it covers max peak × margin over the last k windows, so a daily load restarts generators for the day and stops them again k windows into the night without flapping. With floor warmup (default) the generators the trim itself kept never stop later; with floor keepMin they are candidates too once k windows have passed, down to keepMin rated unpinned generators per subnet, so a warm-up that saw the day peak trims further at night. A restart and a second stop can land in the same re-evaluation (a higher-rated one comes in, a lower-rated one goes out). The second stop checks max peak × stopMargin (default margin): a stopMargin above margin is a hysteresis band, a cut must leave more headroom than a restart demands, so a load that drifts within the band neither restarts nor stops anything. stopMargin step makes the band the cut generator's own rating: the kept rating without it must cover max peak × margin plus its rating, so a dip smaller than one generator step never restarts what it cut, whatever the step size. quietWindows needs reevalTicks > 0; floor keepMin needs quietWindows > 0; stopMargin must be at least margin or step (a smaller one would stop a generator the next window restarts) and, when set, needs quietWindows > 0. A generator without a running script makes no power and drains no steam or oil. Solar stays real (cheap, no fluid). |
scripts stopped at the moment (trim stops minus restarts plus second stops) |
standin |
terraforming | Each running slot of a heater, O2 or pressure generator gets the type's Python stand-in from standins/ (sim.setScript, same slot, so self binds): heater.py, o2gen.py, pressure.py. The harness runs the Mk III steam guard in JS every guardTicks (600): banked steam over every steam Gas Tank on the network (data.level / data.capacity, as lib/power.py steam_pool() reads it), guard closed below stop (0.50), open again at start (0.70), written to archive key standin.terraforming ({heater_power: {id: W}, guard_off: [id], tick}); heaterPower (a number for every heater, or {id: W}) overrides the learned setpoint. keep slots and idle slots stay as they are. |
0 (same script count) |
scale |
terraforming | Level 2, needs features.scale (anchors.md), else falls back to standin with a warning. Identical machines (type, tier, tierUpgrade, outpost, subnet, ioConnections; a running slot not in keep) collapse into records of at most perRecord (10) members: the members with the highest *_in_level survive, the others have their scripts stopped (script.stop, as off; a refused stop keeps that member real and starts its other slots again). A stopped member stays deployed and does nothing: the worker gates a terraformer's output, fluid drain and power draw on a running script. Its building slot, its id in outpost.buildings(), its component and the overcrowding count stay as in a real run. Each survivor gets data.scale = N, so the patched worker does N machines' atmosphere output, fluid drain and power draw in one record; max (50) caps the scaled members per group, the rest stay real. Every survivor and lone machine runs the standin script (same params). The members are stopped slots like any stopping mode's: the sweep removes their records and the revival guard stops them again, the guard even under sweep: false (a revived member would add its output to the record that counts it). A record whose port level reads 0 at every check over 6,000 ticks warns once (stalled). |
members' scripts stopped |
mover |
logistics | Level 2 item mover: the group's running slots are stopped like off (haulers, drones, depots; Supply Docks that must stay real go in keep), and every every (100) ticks the harness serves logistics.requests in code: per destination and item, the ladder is walked from the highest band down, the deficit is the band's level minus the live store count (stacks.mjs outpost:<id>, never the entry's have) minus every fresh pickup bound for that outpost (any vehicle, as in_flight() sums them); the nearest other outpost by planet.outposts[].x/y gives what it holds above its own level at that band (or its keep), minus other vehicles' reservations; buy: true entries fall back to sim.buy() from the Inventory (source shop). Items leave the source at once and land at the destination after loadTicks (50) + 10 × distance / speedMps (12) ticks; a full store keeps the remainder queued and retries every pass. While in flight the trip is a pickup pull:standin_mover:<dest>:<item>:<source> = {vehicle: "standin_mover", dest, source, item_id, units, tick, aboard: true} (the reserve_pickup() shape), deleted on arrival. Stale requests (REQUEST_STALE_TICKS) and entries without a ladder are skipped; the stopped haulers' own pickups are dropped at setup (nothing else would release them for PICKUP_STALE_TICKS). No capacity, charge or weather: a throughput upper bound. |
scripts stopped |
produce |
plants | The group's running slots are stopped like off and the stated rates become rate_h flows into the Inventory (by: "produce" in the summary's flows): forage_h (Forage per game hour) and rates ({item: units per hour}, e.g. seeds_* for the plant.seed_demand readers). At least one rate is required, and the start line prints them: the save's telemetry has no harvest rate (plant.automators harvest_yield is Forage per harvest without a cadence; plant.status has no harvest field). Read the rate off a real run of the same save: the Crop Automators' harvest <sector> ok +N Forage debug lines summed over the window (mid-game the field grid is empty and every unit of Forage comes from the automators). |
scripts stopped |
cash |
plants | Early game only (later the harvester is a forage source, not a cash source): the group's running slots are stopped like off and creditsPerHour lands in state.player.credits (what commander.get_credits() returns) every 100 ticks, whole credits, the fraction carried. |
scripts stopped |
topup |
power | Before every tick each powered battery (battery, battery_large, nuclear_battery) gets data.charge = data.capacity (default config.power.batteryCapacity); subnets (default all; subnet_0+subnet_1 on the command line, a list in a scenario file; an unknown id fails at setup) limits that to the listed subnets' batteries, so another grid stays real. The PowerSystem sums data.charge over a subnet's powered batteries before it balances the tick and clamps the sum to the capacity, so a surplus tick adds nothing and a deficit tick draws from a full bank: no brownout while the deficit per tick stays under the bank. Generators and their scripts stay real (not combinable with trim). summary.standins.topup.addedWh is the energy the batteries lacked over the run. |
0 |
instant |
construction | Before every tick each active job in planet.constructionBlueprints gets endsAtGameTime = planet.clock.elapsedTime: the ConstructionSystem derives progress from the end time (no per-tick increment), so the job finishes in the next ConstructionSystem tick (the game's own completion: ghost machine real, powerStartupPending, pipes and lines placed, deconstructs removed). A job turns active only when a builder starts it after consuming the kit, so the builder's drive, loading and start are still real and only the on-site build time is skipped; pending jobs stay pending. The builder's construction command itself yields a scheduler wait for the whole remaining build time, so the state write alone leaves the vehicle asleep (measured: same finish tick as real); the instantBuild simworker patch (anchors.md, INSTANT_PATTERN) makes that wait 2 ticks while the mode is on (tick +1 the end moves and the ConstructionSystem completes the job, tick +2 the command's onResume finds it done). Without the patch (features.instantBuild off) the mode warns and only the state finishes early. summary.standins.instant reports jobs and savedS (clock seconds of build time skipped, the unit of planet.clock.elapsedTime and of --hours; a build of constructionGameHours h lasts h × dayCycleDuration / 24 = 25 h seconds: a pipe segment (0.05 h) 1.25 s, an outpost (4 h) 100 s). |
0 |
A mode name a group lacks fails validation with the group's valid modes.
off stubs (stubs in the profile, "Profile" below): an off group leaves the keys its scripts would have published, so the readers that stay real see "nothing" rather than a stale record. A key the scenario's archive section seeds is left to the seed. With this repo's profile: orchestrator off writes power.shedded = [] once and refreshes cash.budget every 100 ticks (tick, balance from the credits, floor = the profile's budget.floor, income_h / burn_h null, planned 0, queue empty; asks and holds kept until they age out as _prune() does), so can_spend() sees a fresh manager instead of the LEGACY_RESERVE floor. wildlife off: wildlife.plan = {} once (every reader treats it as "no plan": no feed demand, no forage reserve). biomass off: biomass.retire = {complete: false} once (the status panel's sell button stays hidden). summary.standins.stubs lists the keys written. Not stubbed: production.demand (its readers compute locally when it is missing), the per-grid power.shedded:<anchor> keys (only the Power Guard's own startup reads them).
A stopped script leaves its last archive records behind, and the scripts that stay real read them as live: this repo's readers age an entry by its tick only (status keys 36,000 ticks, a whole one-hour run; logistics.requests 6,000; logistics.pickups 36,000) and never ask whether the writer still runs. The game's own pruner (lib/archive_cleaner.py) runs from a UI button, never headless. Phase 14's field report (ab_results.md "Phase 14") is what that looks like: requests of stopped machines kept haulers busy, a deleted heater kept its tank assignment, the parking manager's list kept the stopped scripts.
The sweep removes what the dead ids own, by shape, not by key name (sweepValue in standins.mjs; it works for any script set). The dead ids are every stopped slot id with the machine that owns the slot (m.scriptSlots); scale members are stopped slots too. Three rules, in this order:
- Whole key: a key whose last
.or:segment is a dead id goes (biomass_mixer.gate.<id>, a legacydrone.mission:<id>). - Id-keyed entries at depth 1 and 2:
value[<dead id>]andvalue[k][<dead id>]go (script.parked,*.statusdicts,fluid_routing.tank_assignments). - Owner field at depth 0, 1 and 2: a plain object whose owner field names a dead id goes (at depth 0 the whole key). The owner fields are
sweep.fields(defaultby,vehicle,owner,machine_id,requester,writer;"*"means any string-valued field).logistics.requests[outpost][item].by,logistics.pickups[*].vehicle. A reference field such asdestorsourceis not ownership: a live writer's record that mentions a dead machine must survive, which is why the default is a short list and not"*".
Arrays are never touched (a list of ids may be positional), emptied parents stay (readers iterate outposts by shape), and these keys are skipped: sweep.skipKeys (the profile's plus the scenario's), the stand-in's own standin.terraforming, the stubs, every key the scenario's archive section seeds. This repo's profile skips script.parked: a machine that is neither running nor parked is a stray to lib/script_parking.py (a warning every pass, breaker on and script start after 3,000 ticks), so a stopped script keeps its parked entry and reads as parked (ab_results.md "Phase 14", finding 4). sweep.extraKeys names whole keys to delete at every sweep for a key a stopped group owned wholesale.
When it runs: once at the end of setup (after every group's stops), after a power trim stop or a re-evaluation that stopped a generator again, every 100-tick flow pass (live scripts file records about dead ids later: restart requests, park requests), and after a revival (below). A key whose dead-id entries come back on three flow passes in a row has a running writer (this repo: machine.activity, the census of every machine; biomass_mixer.gate.<id>, the orchestrator's gate managing the stopped mixers): it is left alone from then on, warned once and listed in summary.standins.sweepLive. summary.standins.leftovers counts the entries removed per key, and one standins: swept N left-over key(s): ... (setup|trim|pass|revive) line per sweep with a hit names them.
Revival guard. A real script can start a stopped one again (this repo: the parking manager's sunrise loop for script.parked entries in mode stopped, the stray switch-on, start_script() in the fleet upgrade, the pillar swap, the plants retirement, the orchestrator's restart requests). Every pass, a slot in a stopped group that counts for the allowance again is stopped again, counted in summary.standins.revived and warned about three times, then counted silently; what it published meanwhile is swept. A refused re-stop is counted in reviveRefused the same way (the script keeps running next to the stand-in, open item 1 of the phase 13 handoff). A standin-mode slot is never dead: the machine keeps running, under the stand-in script, and owns its records. trim is exempt (its pool restarts on purpose), park stops nothing. sweep: false turns the guard off except for scale members. A restart every tick would show as a climbing count.
Per group, sweep: false leaves that group's left-overs (the A/B control); the scenario's top-level sweep: false turns the sweep and the guard off. What the sweep does not cover, and the way out for each:
| Left-over class | Handled | Otherwise |
|---|---|---|
per-id dict entries, owner-field records, <prefix>.<id> keys |
yes | |
| a key a stopped group owned wholesale (no id in it) | no | sweep.extraKeys, or seed a stub in archive |
a record a live writer keeps about a dead id by a non-owner field (dest, source) |
no, by design | sweep.fields: ["*"] for a script set whose records carry no other reference |
| arrays of ids | no | archive seed of the list without the dead ids |
| a live writer's record about every machine (census, gate) | swept three times, then left alone (sweepLive) |
sweep.skipKeys to leave it alone from the start |
a stopped orchestrator slot (automation_N, no machine id) |
nothing per id to sweep | the stubs |
| a group boundary (items the group produced or consumed) | not a left-over | flows, the group's produces / consumes |
The tool is meant for any player's script set. Game facts stay in code (TYPES, SYSTEM_SLOT, the automation_N / panel_N ids, state shapes, the simworker anchors). What depends on how a script set names its archive keys and shapes its records is data: a profile file ($schema headless-profile-v1), loaded by validateScenario from the scenario's profile field (a path relative to the scenario file, or none), overridden by run.mjs --script-set PATH|none, defaulting to this repo's profiles/code_terraform.json. summary.standins.profile names the one used. _doc members are comments.
| Field | What it carries | With none |
|---|---|---|
orchestratorMarkers |
regexes over a slot's source that mark an automation or panel slot (this repo: # ct-automation: / # ct-panel:) |
only automation_N / panel_N ids classify as orchestrator |
stubs |
{group: {key: value}} written once when the group is off |
no stubs |
budget |
{key, floor, askStaleTicks, holdTicks}: the record orchestrator-off refreshes every 100 ticks (null = none) |
no refresh |
requests |
{key, pickupsKey, staleTicks, pickupStaleTicks}: the request protocol the mover serves |
mover fails validation |
sweep |
fields, skipKeys defaults for the left-over sweep (the scenario's sweep section merges over them) |
the built-in field list, no skips |
What still encodes this repo, and why it stays where it is (2026-10-15):
| Place | Repo-specific | Status |
|---|---|---|
GROUPS[g].produces / consumes |
archive key names in the boundary prose | code: warnings and docs only, no behavior |
mover ladder walk (levels as [[prio, cum], ...], buy, keep, the pickup record shape) |
this repo's logistics_requests.py protocol |
code: the mover is a Level-2 stand-in for this repo's logistics; a foreign script set uses off plus flows (keys and stale ticks come from the profile) |
standins/heater.py reading heat.optimal_setpoints, the standin.terraforming key |
the heater setpoint record is this repo's | code: heaterPower overrides the learned setpoint |
#budgetPass field names (balance, floor, asks, holds, planned, queue) |
lib/cash.py record shape |
code behind profile.budget (null turns it off) |
The game grants each script min(stepsPerTick, floor(totalStepsPerTick / N)) interpreter steps per tick, N = scripts in running, waiting or flushing status (cheatsheet dev_workflow §1d-1; the scheduler reads both numbers from its config object every tick). Stopping 70 scripts would hand the target 1,000 steps instead of the ~700 it has in the full base, which changes its timing. So before every tick the harness sets
config.interpreter.totalStepsPerTick = floor(base × n / (n + ghosts))
with n the real count and ghosts the scripts the stand-ins removed (each mode reports its own; a scenario's ghosts overrides a group). sim.config is the simworker's config object (bootstrap anchor config in simhost.mjs), so this needs no patch. summary.standins.allowance shows {n, ghosts, steps}. Parity check (0262 save, --only-scripts harvester_1, 71 ghosts): the harvester got 694 steps, the full base's value.
Rule of thumb for ghosts when a mode has no count of its own (owner, 2026-10-14): haulers 1.5 per outpost before drones, 1 per outpost with drones; extractor drones 2 per biome with life-form sites; miner Pioneers 3 per smelting outpost before any mining drill, 1.5 with drills, 0 with a large drill.
stacks.mjs reads and writes item stores in the raw state (a game command would notify the UI or drop overflow on the field):
| Store | State | Capacity |
|---|---|---|
| base Inventory | state.inventory.slots: `Array<{id, count} |
null>` |
| store machines | m.itemStacks: Array<{id, count}> (drone_station*, vehicles) |
m.itemStacksCap units in total, m.itemStackSlots distinct stacks |
| bin stores | m.bins: {slot_i: {itemId, stacks: [{id, count}], capacity}} (warehouse, large_warehouse, storage_bin) |
per bin: capacity units; an empty bin takes any item, a holding bin only its own (its itemId resets when emptied), as the worker's bin add does |
m.locationId names the outpost (outpost_home, or absent, at home); outpost:<id> addresses that outpost's stores, the Inventory first at home. Fabricators and smelters also carry itemStacks but are not stores (their stock is work in progress).
Flows (Flows in stacks.mjs) run every 100 ticks (keep, rate_h; the latter keeps a fractional balance and moves whole units) and every tick (after, a queue of arrivals). Totals per flow go to summary.standins.flows.
| Phase | Content | Status |
|---|---|---|
| 0 | registry, scenario file and flags, off, park, trim, flows over any store, archive seeds, virtual script count, Node tests, this folder |
done 2026-10-14; parity with the 306e188 --only-scripts run (identical metrics) |
| 1 | Level-1 Python stand-ins for heaters, O2 and pressure generators (standins/*.py, a JS steam guard writing standin.terraforming) |
done 2026-10-14; A/B below |
| 2 | scale: one record per group of identical terraformers with data.scale = N (atmosphere output, fluid drain, power draw multiplied; perRecord split against fluid stall), anchors.mjs |
done 2026-10-14; A/B in ab_results.md |
| 3 | mover: direct item moves serving logistics.requests, with logistics.pickups bookkeeping so the real orchestrator sees one world |
done 2026-10-14; A/B in ab_results.md |
| 4 | plants produce (stated rates; the telemetry has no harvest rate) and cash; off-stubs for orchestrator, wildlife, biomass; buildorder_search.py --scenario |
done 2026-10-14; A/B in ab_results.md |
| 5 | A/B rows for every open mode (park, standin, orchestrator off, cash, produce, trim), docs |
done 2026-10-14; ab_results.md "Phase 5" |
| 6 | construction instant, power topup |
done 2026-10-14; ab_results.md "Phase 6" |
| 7 | power trim by rated output (a row with an effect), topup subnets |
done 2026-10-14; ab_results.md "Phase 7" |
| 8 | power trim re-evaluation (reevalTicks, restarts for a later peak) |
done 2026-10-14; ab_results.md "Phase 8" |
| 9 | power trim hysteresis (quietWindows, restarted generators stop again after k quiet windows) |
done 2026-10-14; ab_results.md "Phase 9" |
| 10 | power trim floor keepMin (the trim's own kept set stops after k quiet windows, down to keepMin) |
done 2026-10-14; ab_results.md "Phase 10" (no effect on 1220 in 0.67 h) |
| 11 | power trim stopMargin (second-stop hysteresis band) and a row where the floor fires |
done 2026-10-14; ab_results.md "Phase 11" |
| 12 | power trim stopMargin step (the band is the cut generator's rating) and the open floor rows |
done 2026-10-14; ab_results.md "Phase 12" |
| 13 | power trim refused stops (#stop reads the command result; first stop and re-evaluation keep a refused generator counted), the open rows: reevalTicks 300 with stopMargin 1.25, a warm-up that sees the day peak |
done 2026-10-15; ab_results.md "Phase 13" |
| 14 | left-over sweep (generic rules over the archive, live-writer detection), revival guard, the script-set profile (profiles/code_terraform.json, --script-set), the 1631 factory rows |
done 2026-10-15; ab_results.md "Phase 14" |
Facts below were read from the decompiled simworker on 2026-10-14 (build in internals/ at that date); re-check line references with the anchors after a game update.
- Terraforming Level 1 (
standin, done): Python sources underdevtools/simulation/headless/standins/(nolib/imports, game-interpreter rules ofCODE_GUIDES.md;ruff.tomlandpyrightconfig.jsontreat the folder as game code), deployed withsim.setScript(slot, src, {run: true}). O2: intake CO2 / 10, dump waste at 50, 1 s poll. Pressure: sync inside the window when unsynced, reset on gauge wrap, polls paced to the measured sweep speed likePressureController. Heater: power fromstandin.terraformingheater_power[id], elseheat.optimal_setpoints[thermal_state](read, and written back after a 1-10 W sweep likeHeatController), re-evaluated on a day or thermal-state change;guard_offmakes a Mk III heater remembersteam_in.connected_id(),disconnect(), andconnect()it back when its id leaves the list._feed.py(prepended to every stand-in bystandinSource()) keeps a Mk III port fed: a port under 20 % of its capacity on two checks 5 s apart moves to the next candidate, tanks latched to the fluid first, then producers, own outpost first (the realFluidInputRouterwith no reachability check, blacklist or pipe-conflict handling; POI pumps are not candidates). The Mk IV rod feed is not modelled (a Mk IV heater runs its magazine dry). The stand-in sources land infinal_save.json: never load that save in game. Per-machinewaste,gauge,efficiencydo not matter for fidelity (owner: waste is deleted on dump, efficiency stays 100 % after the first gauge loops). - Terraforming Level 2 (
scale, done): grouping and member stops as in the Modes table. Until 2026-10-15 the members were undeployed; why they are stopped now: DESIGN_HISTORY.md §10b-5. Five simworker lines multiply bydata.scale ?? 1(SCALE_PATTERNSinanchors.mjs, stable strings only, each exactly once or the feature is off): the AtmosphereSystem loops (O2Math.min(<output>, <atmosphere>.co2), heat.heatUnits = <add>(<state>.planet.temperature.heatUnits, <output>), pressure<atmosphere>.pressure = <add>(<atmosphere>.pressure, <output> * <dt>); the data local is thelet <data> = <machine>.data;of the enclosing loop, found by looking back from the anchor), the fluid drain (`${<port>.portType}_level`two lines above<port>.ratePerGameHour * <hours>; the fuel-rod branch stays unscaled, so a Mk IV record burns one machine's rods) and the power draw (return <base> * <tierFactor>(<machine>.data.tier ?? 1, <machine>.data.tierUpgrade ?? 0); the heater's dynamicdata.powerdraw is inside<base>, so it scales too). The survivor keeps one running script, so thescriptSlots.some(running)gate needs no patch. Fluid stall: a port has one declared target and its own buffer and flow cap, so one record draining N machines' worth can run its port dry;perRecordsplits the group into several records (same tank, separate ports), andsummary.standins.scale.minLevelandstalledshow whether that was enough. Grid shed is binary per subnet, so totals shed at the same moment as N real machines; the Python Power Guard loses per-id granularity. A save written withdata.scalemust not be loaded in game. What a script sees of a member: a deployed machine whose script is stopped (run_control.is_running()false, no output, no draw, its port levels frozen), the same as underoff. A script set that restarts stopped machines shows up inrevived. - Logistics
mover: everyeveryticks readlogistics.requests({outpost: {item: {levels, have, by, tick, buy?, keep?}}},lib/logistics_requests.py), drop stale entries, compute each outpost's deficit from the live store count (never fromhave: requesters do not republish on stock changes) minus in-flight units, take from the nearest outpost's surplus (orsim.buy()forbuyentries), deliver afterloadTicks + 10 × distance / speedMps. Writelogistics.pickups["pull:standin_mover:<dest>:<item>:<source>"] = {vehicle, dest, source, item_id, units, tick, aboard: true}while in flight and delete it on arrival, soin_flight()caps over-asking and the real orchestrator sees one world.drone.mission,drone.heli_free,depot.stageare drone-only and stay untouched. The mover is a throughput upper bound (no capacity, charge or weather); never size a fleet from it. - Plants
produce/cash(done): as in the Modes table. The planned telemetry default was dropped:plant.automatorspublishesharvest_yield(learned Forage per harvest) and no harvest count or timestamp,plant.statusnothing about harvests (lib read 2026-10-14), so a rate derived from them would be a guess.cashwrites the sim fieldcommander.get_credits()returns (e.player.creditsin the worker's component table). - Off-stubs (done): as in the Modes table; readers verified 2026-10-14 in
lib/power.py(power.sheddedlist membership),wildlife_common.py/habitat.py/feed_maker.py/plant_terraformer.py(wildlife.planmissing or{}= no plan),biomass_retire.py(biomass.retire),cash.py(floor_for(),_prune()). - Power
trimrating (done): read 2026-10-14 in the decompiled worker: a steam turbine drawsthrottle × 90steam per game hour (less when the port runs dry) and outputs 1.2 W per unit drawn per hour, times the tier factor (108 W at full throttle, tier 1) and an oil generatorconfig.power.oilGeneratorMaxOutputW × throttle × siteFactor(700 W on the 20261008 saves); both writedata.power_outputand readdata.throttle, sopower_output / throttleis the rating while the fuel lasts (a starved generator rates low, which is what it can deliver). The generator scripts throttle to demand, which is why the phase 5 rows (generated / n) kept every generator. Re-evaluation (phase 8) keys onsubnet.consumed, which is the demand, not the served load: on 1220 it exceedsgeneratedwhile the trimmed grid is capped (6,716 W against 6,572 W), so a shortfall raises the need and restarts generators instead of hiding behind the cap. Phase 8 restarted only, never stopped twice: a stop-restart cycle on a daily load would make the kept set oscillate and the ghosts count with it. Phase 9 adds the second stop behind a hysteresis (quietWindows): a restarted generator stops again only when the peaks of the last k windows are covered without it, and only the restarted ones are candidates (the trim's own kept set is the floor), so the oscillation is bounded to one stop and one restart per load cycle. Phase 10 addsfloorkeepMin: the one-shot warm-up sizes the kept set to whatever load it happened to see, so a warm-up in the day keeps the day's generators all night; withfloorkeepMinthe kept set is a candidate like the restarted ones, bounded by the same hysteresis and bykeepMin, so the night cuts to the night's load. The default stayswarmupbecause the kept set as a floor is what phases 7 to 9 measured. Phase 11 splits the second-stop threshold off (stopMargin, defaultmargin): with one margin a cut that lands just over the line (the phase 10 mixed-libs run cut 700 W with 39 W of slack) is one dip away from a restart, and a lowermarginalone would make the floor fire more often only to restart the cut the next window. The stop threshold above the restart threshold is the hysteresis in watts,quietWindowsthe hysteresis in time. Phase 11's run showed the numeric band must satisfystopMargin − margin ≥ rating / peakfor the generator it gates (a 5 % band at 4.3 kW is 215 W, under the 700 W oil-generator step, and the cut flapped), and the right band depends on which generator is lowest-rated at the time. Phase 12 addsstopMarginstep: the second stop of a generator rated r needsmax peak × margin + r, the band in watts is the step it gates, derived per cut, so no number has to be tuned to the generator mix. - Construction placement without a builder (not done): the worker registers no blueprint command (
inventory.*,machine.*,shop.buyonly); a job turnsactivein the builder's own construction command (script API), which also consumes the kit. A harness-side placement would be a state write that copies that command (status,materialConsumed, the kit out of a store), or a Python snippet in a script slot. Neither is a boundary the logistics group'sconstructionoutput can stand in for cheaply; left open. - Power
topup/ constructioninstant(done): as in the Modes table; both are state writes inStandins.beforeTick(), no simworker anchor. Read 2026-10-14 in the decompiled worker:PowerSystem.ticksumsdata.chargeof the powered batteries of a subnet (t.batteries.filter(e => e.powered)), balancesc + (generated - consumed) * dt, clamps to the summeddata.capacity ?? config.power.batteryCapacityand writes the fill fraction back to every battery;ConstructionSystem.tick(minifiedSA, found by itsConstructionSystem failedlog line) setsjob.progress = 1 - remaining / durationfromjob.endsAtGameTime - planet.clock.elapsedTimeand completes a job at progress 1; the builder's start command consumes the kit once (materialConsumed) and setsendsAtGameTime = elapsedTime + duration × (1 - progress) × dayCycleDuration / 24. The end time is the only state to move, but the builder's construction command (kind: \yield`, action{type: \wait`, ticks: (), onResume};onResumecompletes the job itself through the same check the system uses, or reportspaused/not_ready/canceled) sleeps the script for the full duration regardless of the job's state, so the mode also needs theINSTANT_PATTERNpatch on that wait (2 ticks whileglobalThis.__ctInstantBuild` is set).