- Values pasted into eval'd or inline-script code go through lit() (scripts/lib/js-literal.js), which escapes <, >, /, U+2028 and U+2029 after JSON.stringify
- build test and i18n-check read script tags with a DOM parser or a plain search, not HTML regexes
- mcp.js parses the Authorization header without a backtracking regex
Any site open in the same browser could POST results (printed to the
terminal, escape sequences included, and written to --out), and DNS
rebinding could read the save. The server now checks the Host header and
the origin of a POST, caps the body at 2 MB, drops control characters,
and no longer sends stack traces. The panel no longer shows <sub> tags.
From customer level 2, one person runs sales at a time, next to the NOC intern:
- The engineer turned salesdroid ($9k/mo) books you into every network operators' meeting 30 days
ahead at the usual ticket price, brings 40% more offers (half as many again while a meeting's glow
lasts) but never the huge deals, and their customers leave less often at renewal (half as often
for the nerdy ones: HFT, ISPs, universities, L2). Haggles badly.
- The shark ($15k/mo) brings bigger sizes at 25% more, takes a month of each deal as commission,
oversells half of them with a requirement the network does not meet yet, never brings technical
customers, makes selective peering desks want 25% more traffic, wins most haggles, and their
customers leave 50% more often.
- The CEO (free) signs the biggest internet customer the network can take on the golf course every
50-80 days at 30% off, often with a promise nobody checked, signs about a third of the offers you
decline anyway, and has opinions. He cannot be fired: a board meeting brings a VP of Sales a month
later.
Customers remember who signed them (by), which the renewals read. Every roll is a hash of the day
or the deal, so games without a salesperson keep their random stream.
The differential fuzz also leaves out buttons for actions main does not have yet.
The dashboard shows what you have built, not what you haven't. The new tab lists every city you could still open, with its eyeballs, exchange and price, and sorts, filters by region and pages like the other long lists. Open selects the city on the map, so a build still goes through the city panel and its warnings. The tab also works in the NOC window.
Every customer now signs for a term (enterprise and hosting 1-3 years, wholesale and circuits 2-5,
fiber pairs 10-20). When it ends most renew at today's bandwidth price, happy ones often grow to
the next size, a few with competitors around ask for a discount 30 days ahead (match, meet halfway
or let go in Deals; no answer matches), and some leave: unhappy ones because of the service, others
acquired, bust, insourced, moved (they stay if you have a POP there), multihomed, project ended,
a cheaper bid, or now and then one of the odder reasons (never more than one every 60 days).
The bandwidth market is flat for six months, then about 10% cheaper a year, slowed by dearer
hardware, moving in a slow three-year cycle and pushed up during a shortage. New offers and
renewals are priced in it; one renewal moves a price at most 25% down or 10% up.
Nothing happens in a first term. Rolls are hashes of the customer and its term, never Math.random,
so seeded games keep their stream. Old saves get renewals spread over the next year. Happy
customers of a year or more send a referral about every six weeks. The dashboard's Customers tab
shows customers won and lost each month and why, renewals due and the market; customer rows show
the contract end.
The differential fuzz now leaves out state fields only this checkout has, so a new feature's state
does not fail the comparison with main while everything both games share must still match.
With the perf benchmark now waiting for the surface the map was drawn on,
headless Chromium showed what WebGL costs without a graphics card: its
SwiftShader renderer spends about 8 µs per instance, so the coastlines alone
(29k segments, twice) took about 480 ms and a big map 1.4 s a frame, where the
2D canvas takes 46 ms. Players get the same with a blocked driver, a virtual
machine or Mesa's llvmpipe. glInit() now reads the renderer first and keeps
the 2D map on SwiftShader, llvmpipe, softpipe, lavapipe, WARP or any
"software" renderer; GLX.soft lets the GPU benchmark measure them anyway.
- A trial now ends before the next starts: the clock stops, the frame
callback is cancelled (and a queued one turned away), a day still in the
route worker is waited for (or dropped), the clock's leftovers are cleared,
and every trial starts from the same random numbers.
- The renderers take turns going first, scenario by scenario; ?reps=N runs
each N times and reports medians.
- draw() is labelled as CPU submission time; the card's own time comes from
EXT_disjoint_timer_query_webgl2 where available (read frames later, never
waited for, disjoint results dropped); a run drawn by the other map is
flagged.
- npm run perf --browser reads its sync pixel back from the surface the map
was drawn on (the WebGL canvas waits for the card) and says which map each
version drew with.
- Sea, land, waves, clouds, cables, tubes and packets are drawn by the
graphics card; the land is geometry built once, so panning and zooming
repaint nothing.
- Cities, labels and markers are painted once into a sprite atlas and drawn
in one call (with drawImage in 2D, which speeds up the 2D map too).
- Settings > Map drawing: Auto or Always 2D, per device. Browsers without
WebGL2, a lost context and puzzles keep the 2D map.
- npm run bench:gpu compares 2D and WebGL in a real browser on a real GPU;
?fps shows a frame meter.
foundIx returned without a word in mainland China, where an exchange
already runs (incumbent or your own), and without a POP, while its dry
run quoted $80k with nothing blocked. foundIxWhy() gives the reason, most
lasting first (China reuses the panel's own text), for the toast and the
quote alike.
The route fuzz's direct moves called foundIx at every POP city. They now
offer it only where the city panel shows the button, as their comment
says, so a refusal that now logs a toast does not count as diverging
from main.
The MCP server gains a second session, --browser: the game in the player's tab, reached through the
agent relay npm run dev hosts at /agent (loopback unless --host; Host and Origin checked, no token).
The player turns it on in Settings → Agent API, a section only the development page has, and picks the
clock: a pace of 30 s to 5 min a day that nobody can pause, or the agent's own. Headless gets the
running clock too (--clock realtime --pace MS) and both get a wait tool.
All of it lives in src/agent/ (development page only). The game offers HOOKS, UI.clockLocked,
setSpeed() and runClock(dt), the frame's day block moved out unchanged, and nothing more: the page
players get grows by under 1 KB gzipped and runs exactly as before.
scripts/mcp.js registers the same tools on @modelcontextprotocol/server (2.4.0, with
@modelcontextprotocol/node 2.1.2 for node:http; dev dependencies, pinned) instead of its own JSON-RPC
loop. stdio works as before; --http [HOST:]PORT serves Streamable HTTP at /mcp, on loopback unless
told otherwise.
Over HTTP every request's Host must be an address of this machine (or --allow-host), an Origin other
than localhost is refused, and a bearer token (SOT_MCP_TOKEN or --token-file) is optional; bound
beyond loopback without one, the server warns. load_save and export_save take JSON only there, or files
under --save-dir and nowhere else. Calls from every client run one at a time, in order.
The command tables and the page-side reads, screens and dispatch (scripts/lib/mcp-commands.js and
mcp-page.js) become src/agent/, the facade window.TUBES.call(tool, args) in the page's own scope.
A new <!-- @include-dev agent --> line in src/index.html pastes it in after the game, but only in the
development page (npm run dev, the MCP server, i18n-check, tests that ask with load({agent:true})).
The build drops the line whole: _site/ is byte for byte what main builds.
Tests load the page players get by default, the build test fails if anything outside src/agent/ names
the facade's api/API_ names, and the pages test checks the built page carries none of it and still
plays. ADR 0004 records the rule.
$ moves the map to the next offer's city, in the Deals list's order,
opens the Customers tab on a POP and marks the offer under Offers here
(UI.offerAt, the existing .row.on style). Two offers in one city each
get a press; any other selection clears the mark. With nothing on the
table it says so with the Deals tab's own "No open offers" text.
Before laying starts, seaRush buys 30 days a step (or all of them at once)
at $500k plus $60 a km, with the market's build prices. The floor is the
factory: 60 days plus a day per ~80 km from the order (prepMin, through
leadDays), then the lay ships still need their time at sea, which a second
ship still halves. 6,000 km: from 600 days of prep to 132 for about $13M.
The left panel's four tabs overflowed its 272px width on tablets and small
laptops: Goals wrapped its count, Networks ran off the edge. Counts now sit
on the tab's corner, labels stay on one line and shrink last.
Backbone, Auto-TE and DDoS settings sat below every notification in the NOC
tab. A Routing & DDoS button at the top opens them in a modal that redraws
in place after each action, with a red dot when Auto-TE is paused.
scripts/route-fuzz.js plays many random games (every mode: presets, sandbox, scenarios,
the weekly, puzzles, architect runs, or a save) on two pages in one process and compares
all of R, R.fl, R.ef, the PNI lists and S after every move and every day, and routing with
the kept tables against routing without them. tests/route-fuzz.test.js plays four.
scripts/mcp.js speaks MCP over stdio and loads the game from src/ in jsdom,
seeded, like the tests. Tools: new_game, load_save, export_save, status,
advance (with per-day timings), network, city, find, traceroute,
peering_check, hot_spots, actions, act, screen, panel, click, open_link.
Actions go through ACT as buttons do; files, slots, settings and the clock
stay out of reach, and nothing evaluates code in the page. Nothing is
hosted and the page is unchanged. See docs/MCP.md.
Every puzzle now carries demand (eyeballs pulling from a content origin, circuits
with latency caps, best-effort flows) routed by compute(). Stars: delivered,
within budget, N-1 under load. Routers, ports, metrics, standby and the
redundancy check work in puzzles; the whole world is open. Weekly schema 2
carries the demand; scripts/lib/puzzle-solver.js sizes and searches builds.
The build swaps every label for a short id in the shipped page, the inlined
English and the translation files (scripts/lib/compile-labels.js). Labels
passed to N_() stay whole because saves keep them. Against 1.33: page +4%
gzipped (321 -> 335 KB), translations -40% (it.js 143 -> 85 KB); routing,
day, panels, dashboard, map and boot time unchanged.
- i18n-check rejects labels the build cannot see (outside tr/trn/N_)
- tests/pages.test.js plays the shipped page in English, Italian and French
- docs/adr/0003, add-strings skill, ARCHITECTURE, README, CONTRIBUTING,
CLAUDE.md describe labels
tr('pnis.delivery_2_to_6_weeks') instead of tr('Delivery: 2 to 6 weeks'): the
English lives once, in src/i18n/en.js (inlined into the page at build, so no
extra request), and it/pt/fr map the same labels. Changing English wording no
longer renames a key in every dictionary.
- 2,899 labels, made from where each text is used and its first words; short
shared words are common.*
- plurals are one label with {one, other}: trn('label', n)
- static markup: data-i18n="label", data-i18n-aria-label, data-i18n-title
- saves from 1.33 and older stored English text in a few places; tr() still
resolves it
- i18n-check: undefined/unused labels, markup drift, plural shape; i18n-add.js
works on labels and --rename updates src/ too
- the old-branch port tool gives old English-keyed code and dictionaries the
same labels
- ACT is split by area into game/90-actions/*.js (const ACT in the first file,
Object.assign in the rest)
- CITY_LL, CITY_NUDGE and LANDS_LL have one entry per line; the id-keyed ones
are sorted
- site/i18n/*.js are sorted, one entry per line; i18n-check enforces it and
--fix (npm run i18n:fix) restores it; scripts/i18n-add.js adds, removes
and renames entries in place
- scripts/legacy/port-branch.js moves a branch's site/index.html edits into
src/ during a merge with main
- perf workflow and PR template build the base page with scripts/lib/page.js
site/index.html (900 KB of HTML, CSS and JS in one file) becomes src/: a shell
(src/index.html), styles/ and game/, concatenated in path order by
scripts/lib/page.js. The assembled page is byte-identical to the old file, so
load time and in-game performance are unchanged.
- scripts/build.js replaces build.sh (same env vars, same output)
- npm run dev: a zero-dependency dev server that assembles on every request
- tests assemble the page in memory; npm test runs every tests/*.test.js
- perf-bench takes --base-ref to build a git ref's page
- scripts/legacy/split-index-html.js is the splitter, kept for older branches