Two places left a key in a shape that sanitize() repairs on the next load, so
the live game was not its own save (the server-run engine refuses such an
action at its gate, and its strict day check would refuse such a day):
- buyTE wrote S.te as {on, day}; a reload adds script:''. It now writes the
script slot itself (src/game/90-actions/30-route-script-and-tools.js).
- mkLeave turned the monkey off but kept start, until, snip, n, hurt and c;
sanitize() keeps only next and on for a monkey that is away. It now leaves
S.monkey as {next, on:0}, after the toasts that still read the visit's count
(src/game/85-incidents/40-chaos-monkey.js). This covers the visit running
out, the banana and the rules sending it home.
No new state field, nothing for old saves: both keys load as before. Nothing a
player sees changes, so no CHANGELOG bullet.
Tests: tests/backbone-core.test.js (S.te after buyTE equals what a reload makes
of it) and tests/chaos-monkey.test.js (S.monkey after each way home: outlasted,
hurt, sent home by calmer rules, bribed). Both fail without this change. The
server-run tests take their workarounds out: buyTE and the banana pass the gate
and leave the network the page leaves (tests/mp-sim-acts.test.js, the former
todo), the 60-day realm-vs-page plan clicks buyTE on day 21 instead of setting
S.te, and the gate audit no longer excuses either act.
The Pie in the Sky line the review also named (60-pie.js:66, S.monkey.n++ on a
monkey that is away) is not reachable: its only caller fires a laser incident
behind mkOn(), so it is left as it is.
Performance (npm run perf -- --base-ref 61e31c5, headless, big network, median
of 15 runs, ms):
| What | Base | This | Change | p |
|---|--:|--:|--:|--:|
| Routing: compute() | 27.3 | 26.1 | -4% | 0.51 |
| One game day: dayTick() | 29.7 | 30.1 | +1% | 0.71 |
| An action: after() | 1.96 | 1.86 | -5% | 0.48 |
| Side panel and left list | 62.0 | 59.2 | -5% | 0.023 |
| NOC dashboard tabs | 110 | 110 | +0% | 0.93 |
| Map at three zoom levels | 3.69 | 3.90 | +6% | 0.43 |
| The NOC intern's shift: opsDay() | 4.06 | 3.95 | -3% | 0.11 |
Routing results identical to the base; no change beyond noise.