Commit graph

626 commits

Author SHA1 Message Date
Frederic Jung
4630ba99af
Clear the open code scanning alerts
- auto-release.yml: the by-hand test run passes github.sha (what it got anyway) instead of an
  output that also reads workflow_run.head_sha, so CI never checks out a ref a workflow_run
  handed over in a job that uses caches (cache poisoning, 7 alerts in ci.yml).
- tests/harness.js: the script splitter also matches end tags like </SCRIPT > (bad HTML
  filtering regexp).
- Tests paste the fixture saves into the page with lit(), which escapes what could end a
  script or a string, instead of plain JSON.stringify (improper code sanitization).
2026-11-09 12:36:08 +00:00
Frederic Jung
f00bc733d0
Two CSS checks read jsdom 31 as well as 30
jsdom 31 (#327) serializes calc() with its terms sorted and expands the
overflow shorthand into overflow-y; the diagnostic readout and puzzle
dock tests now accept both.
2026-11-09 13:30:28 +01:00
Frederic Jung
d6b08dded3
Kept exit orders also check each exit's kind
An exit that turned from an exchange into a PNI at the same place in the list, city and
preference kept the order made for the exchange, which sorts behind a PNI at the same
distance, so the cached routing could differ from routing without the cache (#320 review).
The exit signature now includes the kind. Also drops the unused e.vis.
2026-11-09 10:40:39 +00:00
Frederic Jung
249ad4d478
Merge pull request #320 from antt0n/perf/routing-core 2026-11-09 10:21:20 +00:00
Frederic Jung
1e15c61e3d
Merge remote-tracking branch 'origin/main' into claude/fix-321
# Conflicts:
#	CHANGELOG.md
2026-11-08 18:20:34 +00:00
Frederic Jung
71e7dcec59
Say how to reach a coast where no subsea cable lands yet (#321)
Iqaluit, Adamstown, Murmansk and the Russian Arctic towns have a beach but
no cable, so the link modal listed nobody to hop through ("Cables from
Iqaluit reach . Hop through one of those."), and from the other side it
suggested hops that could never get there. Now it says to go overland when
a road leads in, or that only your own cable reaches it, with the own-cable
button (or its level hint) underneath.
2026-11-08 17:57:32 +00:00
Frederic Jung
d971ded259
Hold the lay ship through a construction delay instead of restarting the lay (#322)
A delay that hit your own subsea cable while it was being laid moved the
whole laying stretch later: the ship vanished, the laid km went back to
zero and the survey and factory could be hurried and paid for again. The
delay now holds the ship where it is (l.lay: start, share laid, resume
day), so laying picks up after the delay. Old saves without the field lay
as before; sanitize() repairs or drops it.
2026-11-08 17:57:27 +00:00
Frederic Jung
4292cd4c74
Merge pull request #319 from antt0n/perf/intern-and-promises 2026-11-08 11:00:54 +00:00
Antoine
44116103be
The intern and customers' promises counted once per network: ports, caches and PNIs in one pass, shared searches
The game plays exactly as before.

* The NOC intern plans every POP in one pass: portsAt() counts router ports for all cities at once (routers, ports
  and cache orders; the ports job keeps ports in use and reserved by city between two jobs), cachePlan() sorts the
  boxes by POP once and cityShSum() sums a city's shares once per table, pniFlows() reads every POP's flows from
  routing's columns (R.flc) in one pass and pniWant() gives the weekly PNI round its sort key from typed columns.
  pniBatchRun() lets a frame through every few networks; pniQuote() looks existing PNIs and ports up from the batch.
* A dark fiber's capacity asks optG() once per run of identical optics (dfLit()); linkDown() and ownGlass() ask
  dfOn(), whether it carries anything for you, without the sum unless an optic is out or managed waves are sold on
  it. terrIslands() tests !l.sub first.
* Latency: latGraph() lists each city's links once in S.links order (typed arrays), latRun() is the same search with
  the same sums, latPairs() searches once per city for a boutique's finance routes and the latency offers.
* Diverse paths: divGraph()/divOn() number the cities and risks once; promiseCheck() shares a diversity graph, the
  land islands and one latency search per origin across every customer when the intern weighs taking a fiber out,
  and spots0() shares the graph for sovereign offers.

Tests: day-steps (cache planner, ports at every POP and flows from columns equal the old ways; the PNI round through
pniBatchRun), fiber-lit-and-latency (with failed optics and managed waves), shared-promise-checks, intern-personas.
2026-11-07 23:55:37 +01:00
Antoine
1edf0abb54
Routing core made once, list orders kept, and Auto-TE's detour searches cut: same routing, much less work
The game plays exactly as before.

* The core of compute() (rankPass, directPass, sendGroup, send, push, carry, altPath) is ROUTE in 29-route-core.js,
  built once by routeCore(): made inside compute() they were new functions every call and V8 threw away their code.
  Exits are read by number from typed columns (USED, CAPX, CIX, HPX, VISX), each list is an object of one shape.
* The route cache keeps, for each list and source city, the order routing tries it (xOrder()); a list whose exits,
  cities and preferences are unchanged on the same graph keeps its orders when other exits change (rcExitKeep()).
* Auto-TE: pairs with no detour are marked (TEF), exits that cannot help are skipped (dud()), one failed search
  answers the next ones, dijkstraTo() searches in arrays kept between calls, teSearch() runs on the graph as flat
  arrays and picks up where the last search from the same POP stopped.
* The PNI/IX tie-break (#298) reaches the core.

Tests: route-cache, routing-reference, speed (the fast core against the plain path, Auto-TE on crowded meshes with
POPs outside the core, picked-up searches counted).
2026-11-07 23:51:35 +01:00
Antoine
b9d6319302
The page stays free while big networks play: ambient map at 30 fps, saves in the worker, less to carry back
The game plays exactly as before; only what holds the page changes.

* mapStill() tells three cases apart: still (drawn once a second), ambient (only the animation clock moved: drawn at
  most every 29 ms, so 30 fps on 60 and 120 Hz screens) and moving (camera, pointer, selection, network: every frame).
  The animations follow the clock, so they keep their speed.
* save() skips the storage write when the text is the one the slot already holds (SLOT.txt) and no write is on its
  way; leaving the page still writes. A big autosave that moved on is packed, turned into text, stamped and
  compressed in the route worker (rwSave(), rwGzip()); the page only writes what comes back. A lost worker hands its
  pending saves back to the page (rwSaveBack(), rwGzBack()).
* Less crosses back from the worker: R.efg stays there while R is its own last answer (RW.wR, efg 0), R.egDesc comes
  as 0 or as the entries that changed (rwDescOut()/rwDescIn()), what crossed each link travels as typed arrays decoded
  on demand (rwLOut()/rwLIn()), and the full ports (hotMap) come along with R. Every message is read in order
  (rwMsg()), so both sides always hold the same last answer.
* Idle frames build the diverse-paths map and the latency floors a millisecond at a time (diversityWarm(),
  latWarm()), before the first offer asks.
* Diagnostic info shows how fast days really come: speed asked, speed held, how long a day takes (15-day-pace.js).
* perf-bench: "The NOC intern's shift: opsDay()" and, in Chromium, "One game day in play: page time only", a day
  played with the real route worker counting only the time it holds the page.

Tests: frame-pacing, day-pace, save-size, persist, route-worker (efg as typed arrays, hotMap from the worker),
day-steps (a second page plays the worker: answers without R.egDesc, with only its changes, posts without R.efg,
renewal haggles answered through the worker), intern-dark-fiber-worker, webgl-zoom-sprites, speed.
2026-11-07 22:22:51 +01:00
Frederic Jung
2f738dceda
Lambda Bazaar: a capacity market for your dark fiber
A new NOC tab sells spectrum, managed 100G, 400G, 800G and 1.6T waves, and dark pair IRUs on every route you hold
fiber on. Demand per route moves every day (its own cycle, noise, and news: fiber cuts, hyperscalers, AI clusters,
rivals lighting glass, mergers) and grows about 15% a year, with buyers moving to bigger waves over the years and
carriers on your glass asking to move up a size. You choose what to keep back for your own traffic, from what demand
the broker lists, and the price it never sells below. Managed waves come out of capacity you lit; prices follow the
fiber's cost, how hot and how full the route is, and its latency (400G at 2.7x 100G on land, 3.8x subsea). A Cable
broker pays 3% instead of 10% and sees each route's forecast and routes worth building.

Rule F5 now bounds sales by the moving market; new rule F8 covers managed waves. The route fuzz skips dashboard tabs
main does not have yet.
2026-11-07 13:34:41 +01:00
Frederic Jung
fcb7264570
Traffic badges: a Tbps ladder and an odometer up to a zettabyte
Serving 1 Tbps (rare) and 10 Tbps (epic) now earn badges below the old
100 Tbps and 1 Pbps ones. S.vol counts the petabytes a game has carried
(a day of 1 Gbps is 10.8 TB), with badges at 1 PB, 100 PB, 1 EB and
1 ZB, and a Carried tile on the dashboard. Old saves start the count
from the 180 days of history they keep. The route fuzz takes badges
only this checkout has off its page, since an unlock's log line shifts
every id after it.
2026-11-07 13:08:11 +01:00
Frederic Jung
0342d90657
Faster tests, split everywhere: one sharded CI for pushes and releases
- The harness builds the DOM without the page's 2 MB of script text and
  runs the scripts straight in the window: a page load in tests takes
  about half the time (jsdom's parser was slow on the script text).
- That also took the game's source out of the DOM, which showed three
  tests that matched a phrase in the page source rather than the screen;
  they now check the panel, the routing window and the dictionary.
- CI plans its split once and runs the tests on 6 runners; every run on
  main records each file's time and caches it, so the parts stay even
  without anyone refreshing tests/durations.json.
- auto-release.yml and release.yml call the same sharded tests instead
  of running all 170 files on one runner each (11 and 15 min); a release
  is tested once, before it is tagged.
- Audit: five tests that duplicated a gameplay rule or checked nothing
  are gone; the two slowest checks sample a third of the cities, and a
  year of play to reach one due date became a moved due date.
2026-11-07 07:24:09 +01:00
Frederic Jung
52e740cdae
A slow phone gives a day longer slices between frames
A device that cannot hold 50 frames a second waited a whole slow frame at almost every rest of a big day, so the
game played up to a third slower at 8x. There a day gets half of its own frame, up to 32 ms; screens that keep up
keep 3 to 8 ms.
2026-11-06 22:48:52 +01:00
Frederic Jung
410eb81544
Merge pull request #313: every routing a day needs runs in the route worker, and a long day lets frames through
Conflicts with main resolved: the intern's chosen router model, optical upgrades and personas are generators like the
other orders, with a rest after each job. The optical upgrade's fiber test is a step the day answers, in the route
worker in play (opsDark(), {dark}), like the sales desk's trial; the renewal desk's reroute is a step too (slRenRun()).
2026-11-06 22:47:54 +01:00
Frederic Jung
ed0cac9974
Interns: the same orders, each best at one part of the job
The three interns run every order the same way at the same salary;
each is now better at one thing, and says so when hired:
- Anycast Annie peers: the IX order runs every day, not only weekly, and
  the PNI order twice a week.
- Kevin from the night shift does maintenance: two line system swaps a
  night instead of one, and never a fat finger. He rolls the same dice
  (catching it before Enter), so a seeded game plays the same whoever is
  hired.
- Tracy Route plans ahead: the transit, ports, routers, optics and
  optical transport orders act as if traffic were already 10% higher
  (OPS_AHEAD).
2026-11-06 20:23:25 +00:00
Frederic Jung
74e8611f8e
The sales desk answers renewal haggles, each salesperson their way
With the new switch at the sales desk, whoever runs sales answers a
renewal haggle three days after it opens, unless the player did first.
The engineer gives business customers their discount and keeps nerdy
ones at the market price (nobody leaves); the shark holds the old price,
often with a fresh promise, bills a month of the saving, and loses some
(nerds most); the CEO gives 10% more off for a double term, says yes, or
picks a fight. Every answer is a hash of the contract. The switch is
stored only when on, so existing saves are unchanged.
2026-11-06 20:56:50 +01:00
Frederic Jung
d7aad7d965
France follow-up: pun names only, real Lille calibration, Lyon appended
Toulouse's data center is the Pink City Colo. SFR, Bouygues, OVH, Scaleway and Free join the
real-name blocklist, and the CHANGELOG bullet names only the puns. Lille calibration is what
PeeringDB lists within reach (4 facilities, 24 networks, Tourcoing and Roubaix included).
Lyon goes at the end of the big and mid city lists like every other addition. The Tier 1
island guardrail stays at 70: on current main the French networks leave the count at 64.
2026-11-06 20:49:31 +01:00
Frederic Jung
f317b25bc5
Merge pull request #288 from Lambro-codes: seven French cities, four French networks, and the Atlantic cables on the Atlantic coast 2026-11-06 20:26:25 +01:00
Frederic Jung
647e302f1c
The intern upgrades optical transport
A new standing order, Upgrade optical transport. On fiber that is full
and runs above a level, it moves the line system up one size (the
Upgrade click), or trades the smallest lit channels for the biggest
optic that fits, one at a time (setChCount; the old optics go to
spares). With a line system chosen, every fiber below it is moved up,
both steps in one night if need be, cold or not.

A line system swap is a day without the fiber, so only where another
live path joins its cities, no customer rides it, and routing the
network without it serves as much as today (one compute, measured
against today's routing). One fiber is tested and swapped a night,
and a fiber that failed is left alone for a week (not saved), so the
order costs at most one routing more, and only on a night with a
fiber to try.
2026-11-06 18:26:24 +00:00
Frederic Jung
1e7638c4b9
The intern standardizes routers on a chosen model; Ops settings are lists
Some checks are pending
CI / test 1/4 (push) Waiting to run
CI / test 2/4 (push) Waiting to run
CI / test 3/4 (push) Waiting to run
CI / test 4/4 (push) Waiting to run
CI / build (push) Waiting to run
CI / test (push) Blocked by required conditions
CI / translations (push) Waiting to run
Keep routers ahead gets a Model setting: the next generation when busy
(as before), or a model to standardize on. With a model, every POP on a
smaller one is swapped to it, the busiest first, within the monthly budget,
through the same upRouter click: never a step down, only unlocked models
that fit, and only where a second router carries the traffic or nothing
runs yet. Busy POPs on it only get more routers.

Every setting in the Standing orders sheet (each order's dials, budgets,
the cash floor) is a dropdown instead of a button that steps through the
values. The change handler passes a select's data-args, the actions take
the picked position (v) and still step without one for the MCP tools,
which now declare v as optional.
2026-11-06 17:19:17 +00:00
Antoine
f3df5e5d23
Steps resumed after the worker routes read the game as it is: a sales trial, the intern's PNI round and a failure's incident
While a step of the day waits for the route worker, the player can act. Three steps then resumed on what they had
noted before:
- a sales trial overtaken by an action ran again with the happy customers as indices into S.biz: a customer dropped
  meanwhile made one point past the end and the day stopped on an exception. dayAgain() makes the trial's checks,
  the customer and who is happy again on the game as it is; an offer signed or declined by hand meanwhile is not
  the desk's;
- the intern's PNI round placed the batch's quotes as they were: a PNI ordered by hand while it waited was ordered
  a second time. pniRequote() quotes each order again just before it is placed;
- a failure and the monkey's snip took the last incident after their routing: repaired meanwhile, it was gone or
  another one. They keep their own incident before the routing, and offer a repair only while it stands.
2026-11-06 14:24:18 +01:00
Antoine
3c45d7dca1
A day that reroutes no longer stops the page at x8: every routing it needs goes to the route worker
The day split of #312 on its own, from 3.0.0, without its routing core, save or map changes. On a big network at
x8 the game stopped whenever a day rerouted: after a failure, an event, the NOC intern's shift or the sales desk's
signing, dayPost() routed on the page.

* The day is a generator (dayRun(), dayPreRun(), dayPost()): each yield is a compute() it needs. dayTick() answers
  them on the spot (tests, fallback); in play rwGo() posts each one to the route worker. A failure (failureRun()), a
  DDoS and Auto-RTBH (ddosNewsRun()), the chaos monkey's snip (mkSnipRun()), an event's cut (eventRun()), the
  intern's shift (opsRun()) and the sales desk (slAutoRun(), its trials answered by the worker with offerTrial())
  are steps of the day. fireFailure(), opsDay() and slAutoDay() still play them in one go.
* yield DAY_REST lets a long day draw a frame between two steps (half a frame, 3 to 8 ms, RW.budget). One day in
  flight at a time, resting or routing: the clock waits for the day, and a half day is never saved.
* UI.tick is set around every step (dayStep()), so quiet notifications hold in play, not only in dayTick().
* The daily mood check works out the land islands once per pass over the customers (TERR), instead of walking
  every land link for each customer afraid of sharks. This fix is thesysadmindev's, from #310; here the islands are
  worked out again if something routed meanwhile (RW.gen), since the mood loop can now rest between customers.

Same game either way: tests/day-steps.test.js plays a second page as the worker and compares each day with
dayTick(), the intern on every order, failures, events, DDoS and the monkey forced.

Thanks to thesysadmindev for the profiling in #310 that pointed at the reroutes, and for the sharks fix.
2026-11-06 14:24:18 +01:00
Frederic Jung
9a5522bbb1
Deals belong to Sales: the intern sticks to the network, the sales desk signs deals for you, orbit ones too
The NOC intern loses the sales order. Saves that had it load cleanly: sanitize drops the order, its log lines and its
weekly tally, and an intern who was running it hands its switch and minimum to the sales desk (S.slAuto).

With someone at the sales desk, the player can let them sign offers once a game day and decline the ones under a
minimum (39-sales-auto.js), each in their own style: the engineer and the CEO sign after the #185 routing trial (one a
day, a misfit waits a week), the shark signs every offer whose POPs are up, promises and commission included, and the
CEO's declines are a handshake away. Orbit offers need room on their landing dish instead of a trial. Nobody at the
desk (the default; the CEO is a choice, not a given): every deal is signed by hand. The sales desk runs before the
intern's shift, so a deal signed today is in the loads the intern works from. The sheet shows the switch, the minimum
and this week's and last week's tally; the NOC gets one notice a week.

Orbit offers go through the desk too (99-pie-sales.js): they carry o.by, so commission, renewal haggles and each
one's mark at renewal apply. The engineer only offers where the landing dish has 1.5x room on a well-served POP, and
those customers renew like the nerds (0.5x leave). The shark rings airlines, cruise lines and the Mars mission first,
at the biggest size that fits and 25% more, and half of them get a full-sky promise (REQS.skyfull: a crust at 90%)
before there is one; they grumble down to 40 happiness and never cancel over the promise alone. The CEO plays every
other golf game with the Founder: the biggest orbit deal that fits, Mars first, at 30% off; jitters cut his orbit
prices by 0.4x the jitters and from 0.6 the Founder skips golf. Without a salesperson orbit offers are drawn exactly
as before (the O7 balance save has nobody at the desk: payback unchanged, 7.0 years on seed 7, 7.5 on seed 11).

Also: the scenario reference plays 'sales' as the CEO signing for you; the route fuzz leaves out the state and
buttons of a standing order only main still has; the intern's on/off dials (paid peering, keep a spare) show their
translated value in the shipped page instead of the raw label.
2026-11-06 09:58:01 +01:00
Frederic Jung
2243280aff
Pie in the Sky: the Founder's antics make markets jumpy, then it wears off
- Every 60 to 120 days while a rocket company exists (the first 90 days after the plan starts), the
  Founder does something daft: a post, a gasp toast and a temporary effect (99-pie-jitters.js).
  A once-a-game antic takes orbit billing down for 3 to 5 days (no orbit income, then a restore post);
  a 3 a.m. spree (orbit offers x0.6 and a 4-point orbit mood dip for 14 days); a fight with a regulator
  (a landing-rights spat via pieSpatStart in a country with a dish or rights, within the spat limit);
  a leaked launch date (insurance 8% -> 14% for 30 days); Mars next year (offers x1.5 for 14 days, a
  promise like the others whose slip cancels the unhappiest 2% of orbit customers).
- Market jitters (S.pie.founder.jit, 0..1): each antic bumps it, it fades by 1/30 a day, and while
  high it lowers orbit offer odds (up to -30%) and holds orbit happiness under 100-25*jit (never low
  enough to cancel at renewal). The Company tab shows one line and a small meter next to the feed.
- Rule O5: harm only with pieChaos(); with chaos off he only posts. Dice only with a company.
- Saves: new founder fields in pieBlank, repaired in pieSanitize (pieAnticFix); old saves load calm.
- Insurance button shows the current premium (pie.ins_on_p replaces pie.ins_on). Agent docs updated.
- pie-balance: compute() also reruns when orbit billing goes down or comes back.
- tests/pie-founder.test.js: each antic, decay, once-only billing outage, chaos off, saves, 360 px.
2026-11-06 09:58:00 +01:00
Frederic Jung
9d74873edb
NOC tab and Pie Control tidied for phones: Pie Control in the NOC top row, traceroute in Routing & DDoS, government money in the bank
- NOC tab: Pie Control is a button in the top row next to "Open NOC dashboard" (only once the rocket
  company is unlocked) and replaces the Pie in the Sky card; a spat waiting for an answer keeps its card.
  The Connections button is gone (it lives in the NOC dashboard), and the traceroute moved into the
  Routing & DDoS modal as an entry that opens the unchanged traceroute modal.
- Government money (Rural Digital Pie Fund, Pitcairn grant, Ex-Im Pie Bank) is a section of the bank,
  shown with a rocket company or anything of the fund's to show. pieGovOpen, the action the toasts use,
  opens the bank there; pieTab({t:'gov'}) does too.
- Pie Control has four tabs (Traffic, Company, Launch, Dishes) in one segmented control that fits 360 px,
  styled like the HUD's speed buttons. The Founder's posts and the orbit books moved into the Company tab,
  newest three posts shown and the rest folded. A stale UI.pieTab of 'gov', 'book' or 'founder' falls back.
- Agent docs for pieGovOpen, pieTab, routingOpen and connOpen; the route fuzzer drops connOpen from the
  NOC tab on both pages to stay in lockstep with main.
- Tests: tests/noc-panel-layout.test.js, and the pie tests follow the moves.
2026-11-06 09:58:00 +01:00
Frederic Jung
176a6995b1
Pie globe: continents clip cleanly at the rim instead of fluttering
Hidden coast was pushed onto the rim, so coasts on the edge shivered while the globe turned, and from some angles Eurasia's
fill ran the long way round and painted the whole globe green for a step (up to 47% of the picture flipping between two
half-degree steps). Each ring is now clipped at the horizon as map libraries do: the fill follows the rim in the ring's own
turning direction to the next point where coast comes back, and only real coast is outlined.
2026-11-06 09:58:00 +01:00
Frederic Jung
95f3851557
Pie in the Sky: a grand opening when a crust starts carrying traffic, so regular customers sign as the patchy ones fade 2026-11-06 09:58:00 +01:00
Frederic Jung
7001174d79
Pie in the Sky, the early game: a pace forecast on the Launch tab, patchy-sky customers before 40%, a hint to wait on dishes
- Launch tab: each crust being filled says when it is full at today's pace (piePace: the pads that reach it, one launch per
  leadDays(gap) each with the rocket last queued or the fastest available, capped by the factory with the shelf and the
  queue as a buffer). Past two years and pad-bound, one nudge for another pad at the coastal POP nearest the equator,
  with a build button (piePadTip).
- Patchy-sky customers (60-features/99-pie-patchy.js): a revenue line in pieMoney, no flows, so routing is unchanged and
  games without a rocket company never see it. Up to $30M/mo for Shortcrust (scaled by crust size), ramping from 10% to
  40% coverage with one working dish under the crust, then times (1 - pieCarry) so it hands over to regular orbit
  customers by 60%. Shown on the Traffic tab; booked in S.pie.book like all orbit income.
- Dishes tab: under 30% coverage, a gentle note that dishes earn nothing yet and cost money every month.
- Payback on the O7 run is unchanged at one decimal (seed 7: 7.2 years, seed 11: 8.2).
2026-11-06 09:58:00 +01:00
Frederic Jung
267f9efc72
Pie in the Sky for agents: every Pie action classified and typed, its state and results documented 2026-11-06 09:57:59 +01:00
Frederic Jung
b4a7576251
Pie in the Sky: closing a panel stops the globe again, after the rebase onto 2.10.0
The merge that mounted the globe in Pie Control did not survive the rebase: closeModal() stops the globe once more, and its tests are back.
2026-11-06 09:57:51 +01:00
Frederic Jung
8b92adcaa8
Pie in the Sky: government money for rocket companies
A Gov tab in Pie Control with three state programmes:

- Rural Digital Pie Fund: reverse auctions for towns only orbit reaches
  (a cut-off POP on backhaul, or a small town of your terminals). Ask
  90%, 70% or 50% of the reserve against a rival; the lower ask is paid
  monthly for five years while the town stays 70% served (monthly
  average) from a 90-day deadline. One bad month warns, two revoke the
  award and claw back half of the last year's support.
- Ex-Im Pie Bank: a BANKS loan of half the value of the pies flying and
  booked (at most 20% of a full Shortcrust, counted by O7), 1.5-2.5%
  over 60 months, never offered by the usual banks. Space covenants:
  launch n pies in a year, keep a pie dish in the lending country. A
  breach brings the bank's penalty, +3 points, a new launch deadline
  and, with chaos on, a "data stays home" or landing-rights spat there.
- Pitcairn: served from orbit (backhaul or home terminals) at 90% of its
  demand, latency forgiven, the UK pays a $120k/mo satellite grant.

Subsidies count in the orbit's books. tests/pie-gov.test.js covers the
features; pie-balance.test.js gains a run with government money, which
must pay back sooner by at most two years.
2026-11-06 09:57:51 +01:00
Frederic Jung
1de0723c35
Pie in the Sky: a full constellation pays back in about seven years
Rule O7's payback half is now played through the game loop
(tests/pie-balance.test.js): the big-network save runs a full lasered
Shortcrust by a sensible policy until its books balance, in 5 to 10 years
(6.3 on seed 7; 7.4 and 6.9 on seeds 11 and 3). The static formula is gone.

Retune: pies $0.5M (+$0.25M lasers), from $1M (+$0.5M); landing rights
$12,000 per eyeball up to $100M a year, from $28,000 up to $200M; orbit
rates x1.25 (pizza 25k, flywifi 36k, boat 27.5k, marsorb 44k); PIE_SELL
0.25 -> 0.4; PIE_OFFER_RATE 1/6 -> 1/3.
2026-11-06 09:57:51 +01:00
Frederic Jung
46ba4e04d2
Pie in the Sky: a terminal lands where all of it fits
pieLand() prefers the nearest dish with room for the whole terminal and
only then the nearest with any room left, so a nearly full dish no longer
serves a sliver of a customer who then cancels while other dishes sit idle.
2026-11-06 09:57:51 +01:00
Frederic Jung
d7d5d21372
Pie in the Sky: dips in orbit hurt instead of emptying the sky
A crust carries a share of its traffic from 40% coverage, growing to all
of it at 60% (pieCarry/pieCap), instead of nothing until 60%. Pies wear out
over the last 30% of their life (pieAlive), deterministic, so a launch month
no longer deorbits on one day. Storms take 2-10% and food fights 5-10% of a
crust (PIE_HIT), down from up to 40% and 20%. Orbit customers lose at most
PIE_PATIENCE happiness a day without service, about a month to cancel.
2026-11-06 09:57:51 +01:00
Frederic Jung
48d2cedbee
Pie Control globe: replay recent launches, with payload release or a fireball
The last six flights (UI only, never saved) replay on the globe every six seconds: a good one
spills its pies at the top and a reusable booster flies home; a failed one blows up partway
with a flash, smoke and debris. About 0.4 ms per frame while Pie Control is open.
2026-11-06 09:57:50 +01:00
Frederic Jung
ff0276f325
Pie Control: backhaul rows, globe arcs and orbit traceroute for cut-off POPs
The Traffic tab gets a Backhaul group (how full, where it lands, the ms
it adds, or why it is missing), the empty-sky checklist a backhaul item,
dish rows count backhaul; the globe draws backhaul as a sky arc,
highlighted on tap; the traceroute to and from a cut-off POP shows its
hops through space. Strings in every language; tests in
tests/pie-backhaul.test.js.
2026-11-06 09:57:50 +01:00
Frederic Jung
940ce0df10
Pie in the Sky: backhaul for POPs cut off from the backbone
A pie dish at a POP the backbone does not reach now lifts all of that
POP's own traffic to a landing dish on the backbone (bent pipe within
1,000 km, lasers past that): one virtual edge, capacity min(dish, landing
dish, crust) after terminals, latency the orbit path. Its IGP weight is
Infinity; only the cut-off POP's paths are rerun with it (pieRelink), so
POPs on the backbone never route through orbit and saves without a
cut-off dish route exactly as before. Spats, safe mode, a down crust,
landing rights and backhoes cut it.

A cut-off dish now reports 'backhaul' or 'isl' (it said 'ok' when it
had local terminals). Rule O3 now reads: a cut-off pie dish carries only
its own POP's traffic and local terminals, never transit between other
cities.
2026-11-06 09:57:40 +01:00
Frederic Jung
4ad080cb91
Pie Control: Traffic tab, empty-sky checklist, orbit traceroute
A new first tab shows what rides the sky: a headline, load per crust,
who is riding (tap to highlight on the globe), per-dish load and why a
dish is idle, and a checklist when nothing flows. The traceroute lists
circuits through orbit with their uplink, laser and downlink hops.
Strings in all languages, tests in tests/pie-traffic.test.js.
2026-11-06 09:57:40 +01:00
Frederic Jung
52c31d94b5
Pie routing test: simpler sky check 2026-11-06 09:57:39 +01:00
Frederic Jung
6812638a5b
Pie in the Sky: orbit prices, rules O2-O4 and both bounds of O7
Terminal customers are priced so that a full lasered Shortcrust on the
big-network save pays back in about 9.6 years, and no crust pays back in under
5 even with the whole sellable sky sold at the dearest prices (Shortcrust 5.3,
Flaky 7.4, Upper 9.2, Frozen 40). O2, O3 and O4 get rules and tests.
2026-11-06 09:57:39 +01:00
Frederic Jung
8035fc03cc
Pie in the Sky: routing through orbit
Baked crusts become sky nodes in the routing graph: each dish on the backbone
gets an uplink, and with lasers dishes 3,000 km or more apart are joined through
space at c in vacuum, priced along the great circle at the shell's height. Only
latency-routed circuits fly (O4); IP traffic never sees orbit. Half-baked
crusts carry nothing, dishes carry at most their antennas (O2), dishes off the
backbone carry no transit (O3). Terminal customer types and their strings come
with it. Saves without S.pie add no work to compute().
2026-11-06 09:57:39 +01:00
Frederic Jung
727541a9d8
Pie in the Sky: incidents in orbit and geopolitical spats
Solar storms (safe mode saves most pies), food fights (debris, launches dearer for a year,
Space Roomba fix), rain fade on tropical dishes, backhoes at the dish, astronomers
(VisorSat or science customers sulk), the Founder's 3 a.m. posts and the chaos monkey
snipping laser links. Nine spats with two answers each on a bottom sheet: landing rights
refused, data stays home, spectrum squabble, kill switch, orbital land grab, jamming,
launch diplomacy, not over my airspace. All gated by chaos and 90 quiet days (O5),
seeded, repaired by sanitize, translated in every language.
2026-11-06 09:57:38 +01:00
Frederic Jung
112450d158
Pie globe: launches by pad city, crust sizes from CRUSTS when present 2026-11-06 09:57:38 +01:00
Frederic Jung
d3174600e7
Pie in the Sky: animated 3D globe for Pie Control, with a night view
An orthographic Earth on a 2D canvas (sticker look, plus a night view with stars,
city lights and terminator) showing a capped sample of each crust's pies, laser
links, pie-dish beams and launches. One rAF loop only while open (30 fps cap,
DPR <= 2, idle while hidden), nothing left behind once closed. Land comes from
LANDS_LL. The world map only gets a pink pie-dish badge at cities with a dish,
behind one null check per visible city when there are none.
2026-11-06 09:57:38 +01:00
Frederic Jung
2729779501
Tests for Pie in the Sky, and rules O1, O5 and O7 2026-11-06 09:57:37 +01:00
Frederic Jung
50e0119497
Charters: tests follow the popup, the tutorial waits only for a picker on screen
The tutorial waited for a charter whenever one was due, also where the
picker is not shown (seeded tests); it now waits only while the picker is
open. Two tests still read the old wording for own subsea cables (level 9
or Tier 1 now), and the route fuzz signs the classic charter on both pages
when a normal game starts, so neither shows charter buttons the other
has not.
2026-11-06 08:45:42 +01:00
Frederic Jung
934a83588a
Charters: a popup at the start, and a third one, the Cable broker (#300)
A new Normal game now asks what it is building before anything else, in
a popup that holds the clock and cannot be closed without an answer;
the tutorial waits for it. A save still in its first month that never
picked is asked on load. Sandbox, puzzles and scenarios never ask.

The Cable broker builds and lights glass from day one at the prices
everyone pays at the top level: dark fiber, every line system and optic,
digging without the pioneer markup, own subsea cables and their
upgrades, eight pairs, and every router those optics need. Everything
else unlocks by level as before. Its offers lean to carriers buying
waves and pairs, capacity conferences are open to it at any level, and
carriers call about three times a year with a capacity deal. It runs its
own ten-goal ladder and wins Glass Baron (own cables on five continents,
$1M a month of capacity sales), with a badge; Tier 1 stays its own win.

Classic and boutique networks may lay their own subsea cable from
customer level 9 as well as after Tier 1.

Rule M6 (gameplay-rules): a charter changes what you set out to do,
never what things cost. Closes #300.
2026-11-06 08:41:44 +01:00
Frederic Jung
f303f29f22
PNIs and IX ports are both peering: traffic leaves at the nearest one (#298)
Routing tried every PNI (rank 1) before any IX port (rank 2), like a
local-pref above peering, so a PNI in London pulled New York's traffic
across the Atlantic even with the same network at the New York IX. PNIs
now route at rank 2 with the IX ports, nearest first. At the same distance
the PNI goes first: an IX port counts as PNI_TIE (0.001) further away,
far below any link weight (at least 1). Distances compare as
(Da-Db)+(dta-dtb) so exits at one distance stay exactly equal, and the
POP-local shortcut skips lists that mix PNIs and IX ports. Backup only and
RouteScript's prefer pni keep their say. The traceroute, the reference
allocation in the tests and the RouteScript help follow.
2026-11-06 06:31:21 +00:00