Commit graph

791 commits

Author SHA1 Message Date
Frederic Jung
dd6e4f4f8a
Fix CodeQL code-scanning alerts
- 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
2026-11-05 21:24:26 +01:00
Frederic Jung
e7729d0a1e
Harden workflows and dev scripts against code-scanning findings
- auto-release: pass step outputs to run scripts through env, not ${{ }} interpolation
- perf-comment: download the PR's perf artifact to RUNNER_TEMP, outside the workspace
- dev server: log errors to the terminal instead of sending stack traces in the response
- i18n-add/i18n-check: escape every regex metacharacter when building patterns from labels
2026-11-05 21:04:21 +01:00
Frederic Jung
1a6c63e920
Tools: playwright-core 1.64.1, ws 8.22.1 (#301)
Dependabot's group update, applied on top of the jsdom update (#302),
whose lockfile it conflicted with.
2026-11-05 20:35:55 +01:00
Frederic Jung
b5fba00e0b
Merge pull request #302 from fjaeckel/dependabot/npm_and_yarn/jsdom-30.1.3
Tools: Bump jsdom from 24.1.3 to 30.1.3
2026-11-05 20:30:54 +01:00
Frederic Jung
bf6090f413
Merge branch 'main' into dependabot/npm_and_yarn/jsdom-30.1.3 2026-11-05 20:26:08 +01:00
Frederic Jung
478e767c83
Latency test: no padding is zero however the DOM spells it
jsdom 30 reports an unset padding as '0', not '0px', which failed the
check for the yellow bars in the jsdom update (#302).
2026-11-05 20:25:23 +01:00
Frederic Jung
7c0f1b3b05
Merge pull request #303 from fjaeckel/dependabot/github_actions/actions-b2576794da 2026-11-05 20:22:56 +01:00
Frederic Jung
131e2f7b9c
Container smoke test: container names Docker accepts
A name must be at least two characters; the build itself passed.
2026-11-05 20:15:44 +01:00
dependabot[bot]
8d3db207be
CI: Bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/download-artifact` from 4.3.0 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](d3f86a106a...9000827ccb)

Updates `actions/upload-artifact` from 4.6.2 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](ea165f8d65...cf430e030d)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-05 19:15:08 +00:00
dependabot[bot]
8ebd1fd425
Tools: Bump jsdom from 24.1.3 to 30.1.3
Bumps [jsdom](https://github.com/jsdom/jsdom) from 24.1.3 to 30.1.3.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Commits](https://github.com/jsdom/jsdom/compare/v24.1.3...v30.1.3)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 30.1.3
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-05 19:15:05 +00:00
Frederic Jung
aa444c2d94
Merge #297: the MCP server as a container image
Its change landed as 9c8cda4, with the follow-up in 98735eb; this records
the pull request's own commit as merged. No files change.
2026-11-05 20:14:36 +01:00
Frederic Jung
98735eb769
Container image: releases only, a token by default, lean layers; every action pinned
The image is published to GHCR as the release's version when a release
dispatches docker.yml, and never as latest or per commit. Pushes and pull
requests that touch it build it and try headless (with and without a
token) and browser mode, without publishing.

The image: node:24-slim pinned by digest (the major CI tests on), npm ci
from the lockfile in its own layer, only src, site, scripts and the
harness copied in (an allow-list .dockerignore), root-owned and run as
node, /saves ready for --save-dir. The entrypoint runs the servers with
node directly and, with no SOT_MCP_TOKEN, makes a token for the run and
prints it (MCP_NO_TOKEN=1 to opt out); the docs publish ports to
127.0.0.1 and explain --allow-host. Labels, SBOM and provenance on push.

Every GitHub Action in every workflow is pinned to a commit SHA with its
version, and Dependabot keeps the actions, the image's base and the npm
tools current. tests/docker.test.js guards all of it. The ADR and the
github-pages skill say the image is a tool: GHCR only, never Pages.
2026-11-05 20:14:04 +01:00
Wolfgang Nagele
9c8cda44c1
Build container images for easy MCP use 2026-11-05 20:14:04 +01:00
Frederic Jung
908f2e0de9
Puzzles on phones that never scroll, a fairer meet-halfway, Fujairah on its coast (2.10.1) 2026-11-05 17:33:36 +01:00
Frederic Jung
107b0b825a
Puzzles on phones: fixed overlays that never scroll
A bar pinned at the top holds the puzzle's state (name, stars, money,
undo, menu), the goal being worked on with Show me, and a chip per flow
that opens its city. A city or a link opens a short card at the bottom,
split into tabs (links, router, traffic; size, traffic, routing) that
each fit on a 360 px phone, portrait or landscape. Architect runs get
the same bar. Reset moves to the menu on phones. Desktop is unchanged.
The old swipe-up sheet and its peek state are gone.
2026-11-05 17:18:50 +01:00
Frederic Jung
d7fb2a9617
Fujairah one step west, onto the coast it lands on
The nudge to [2,2] put the city just off the UAE coastline, so the
landmass test failed; [1,2] is on land, still on the east coast where
its cables land and well away from Muscat.
2026-11-05 17:18:37 +01:00
Frederic Jung
8c96fa5bc1
Meet halfway between the bill and the ask; Fujairah back on its coast (#293, #295)
Meeting halfway split the difference between the ask and today's market
price, which after a fall in prices sat right next to the ask. It now
splits the two prices the Deals row shows, and the button names it.
Fujairah's display nudge moved it a degree south onto Muscat; it now
sits on the UAE's east coast where its cables land.
2026-11-05 17:10:22 +01:00
Wolfgang Nagele
f19b337d7b Build container images for easy MCP use 2026-11-05 10:17:05 -05:00
Frederic Jung
eb294e9b14
WebGL map, customer contracts and a sales desk (2.10.0) 2026-11-05 11:39:40 +01:00
Frederic Jung
151b7786ed
Tests wait for state instead of sleeping, on free ports
The relay, parity and benchmark server tests slept fixed times before
asserting, which a busy CI runner overran. They now wait for what they
need (the relay reports what it holds), take a port from the OS, and
use fresh HTTP connections. npm test -- --stress N hunts flakes.
2026-11-05 11:38:26 +01:00
Frederic Jung
02d3709944
GPU benchmark server test: listen on 127.0.0.1, where it connects
On the CI runners localhost resolves to ::1 first, so the server listened
there while the test connected to 127.0.0.1.
2026-11-05 11:22:53 +01:00
Frederic Jung
aef744af50
Show a cable's name and a repair button from a save as text
The city panel put the name of your own subsea cable and an incident's
repair label into its HTML as they came from the save. Both are escaped
now, and sanitize() keeps a cable's name to a string of 60 characters.
2026-11-05 11:15:05 +01:00
Frederic Jung
7f4fdf6043
WebGL map: join each line's segments, and draw a link being dragged out under the cities
A see-through line on the card was one round-ended quad per segment, so
where two met it was blended twice: the selected tube's halo showed a
darker blob at every point, and the cables a notch at every corner. Each
segment now knows its neighbours' directions and keeps only its side of
the corner's bisector, as the 2D canvas strokes a path once.

The link being dragged out was painted on the overlay, above the cities
and their labels; it now goes to the card, under them, as in 2D, and its
price label is a picture like the others.

Auto after Always 2D, when the browser will not give the context back,
gives the card up instead of waiting for it all session. Firefox reads
the card's name from RENDERER, without the extension it warns about.
2026-11-05 11:15:05 +01:00
Frederic Jung
f9c85ab0c3
GPU benchmark: answer only its own page, and print what it sends as plain text
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.
2026-11-05 11:15:05 +01:00
Frederic Jung
57c0594a90
Merge pull request #291 from thesysadmindev/unbuilt-pops
A dashboard tab listing the cities with no POP yet
2026-11-05 11:12:07 +01:00
Frederic Jung
c1d726c105
Relay test waits for the late page instead of a fixed 2.5 s
On a busy CI runner the page took longer than that to load and answer,
and the test failed although the server did proceed.
2026-11-05 11:04:47 +01:00
thesysadmindev
e62e4c7c98
Merge branch 'main' into unbuilt-pops 2026-11-05 21:01:24 +11:00
Frederic Jung
13768c61cb
Merge #281: draw the map with WebGL2 by default, 2D as fallback 2026-11-05 10:13:28 +01:00
Frederic Jung
939aaeea59
Sales and contract rolls hash what a deal is, not its clock-made id
Offer and customer ids come from Date.now(), so the shark's oversell, the CEO's veto, his promises
and every contract roll differed each time the same game was played, and the shark test could fail
on CI (67% oversold against 54%, short of its 15-point margin). They now hash the deal or the
customer (type, cities, name, size), and a test checks two ids give the same roll.
2026-11-05 09:45:19 +01:00
Frederic Jung
27c4977412
A sales desk: the engineer turned salesdroid, the shark, or the CEO
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.
2026-11-05 09:32:24 +01:00
Frederic Jung
b9860edc77
Dark fiber leases cost half as much again (#203)
A leased pair was $400 + $1/km a month, so a single 400G wave on the
same route cost two to three times the whole fiber. It is now $600 +
$1.50/km (amplifiers as before): a lease pays off at a couple of 400G
waves, as dark fiber does. Leases already signed keep their price (l.mo).
Alien-wave rent follows, since it is priced against the fiber.

The differential route fuzz now also compares link prices, so a
deliberate price change compares this checkout with itself, as a change
to the world already does.
2026-11-05 08:19:05 +00:00
Christopher Hawker
5259e93034 Merge remote-tracking branch 'upstream/main' into unbuilt-pops
# Conflicts:
#	CHANGELOG.md
2026-11-05 18:27:21 +11:00
Christopher Hawker
0cdbef97fe A dashboard tab listing the cities with no POP 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.
2026-11-05 18:26:44 +11:00
Frederic Jung
8841fdacb9
Customers come and go: contracts, renewals at the market price, growth, haggles and leaving (#178)
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.
2026-11-05 08:15:53 +01:00
Frederic Jung
b8d313b029
Alien waves priced against their fiber; crews halve a build at most (#203)
An alien wave rented for about as much as leasing the whole fiber, so a
route sold out to its market earned 11 to 35 times its lease and the
gear paid back in one to three months. A wave now rents for 30% of the
fiber's monthly cost (lease plus amplifiers), and each one sold between
the same two cities goes cheaper, down to 40% of the first: a full
route earns 2 to 6 times its lease. Signed contracts keep their price.
Gameplay rule F6.

Extra crews could bring any land build to the next day. They now cut it
to half its planned time at most, and the button says when it would be
done. Gameplay rule F7.

A typed order (the agent API) could end a wave, dark fiber or cable in a
city the map does not show, and opened a POP there.
2026-11-05 06:50:25 +00:00
Frederic Jung
45ffdba8ae
Sweden beyond Stockholm: Gothenburg, Malmö and Haparanda (closes #206)
Gothenburg between Oslo and Copenhagen on Netnod's exchange, Malmö across the Øresund on SONIX, and Haparanda where GlobalConnect's fibre crosses the land border to Finland. A Nordic fibre carrier sells transit along that route; Tele2, Telenor and Arelion reach the new cities.
2026-11-05 07:31:17 +01:00
Frederic Jung
28e732448e
Merge pull request #290 from fjaeckel/claude/fix-289
Scrubbed clean traffic no longer shows as DDoS junk on links (#289)
2026-11-05 07:05:29 +01:00
Frederic Jung
72f4bb54f3
Scrubbed clean traffic no longer shows as DDoS junk on links (#289)
What a scrubbing center sends back to its target is the target's own
traffic, but compute() carried it under the junk bucket, so a small
flood at a big customer showed up as hundreds of gigabits of DDoS junk
on the backbone. It now has its own bucket, shown as scrubbed clean
traffic in the link panel.
2026-11-05 02:09:52 +00:00
Antoine
c3e1dd9348
WebGL map: keep each picture in a clear border in the atlas
The card blends the texels around the point it reads, so a picture drawn
off whole pixels, or stretched while a zoom moves, read half a texel past
its edge: its neighbour in the atlas, or a picture left from before the
last reset. The map showed thin coloured lines along the edges of cities
and labels. Each picture now goes in with a clear one-texel border, and
painting on the pad is clipped to the picture so the border stays clear.
2026-11-05 00:59:38 +01:00
Antoine
8c2000f6b1
CHANGELOG: one bullet per change players will see
The WebGL work had eight bullets, so with upstream's three the app's What's new (five bullets) showed only two of
ours, and four described fixes to the WebGL map itself, which no release has had: a zoom that lost the context, the
cities repainted at every step of a zoom, the coastlines' points, the garbage per frame. What a player gets from them
goes into the first bullet (smooth zooms, the coastlines, Always 2D freeing the card, a lost card coming back), which
leaves four, each with the pull request's number.
2026-11-05 00:21:38 +01:00
Antoine
32f330b1c3
WebGL map: check the pictures sent to the card at most once a second
A frame that sent pictures read getError() to know whether the card took them. In every browser WebGL runs in another
process, and each read waits for it to finish everything sent so far, uploads included: a wait on the main thread on
exactly the frames that already cost the most (a pan or a zoom sends pictures on most frames, up to 321 in one).

The card keeps an error until it is read, so one read a second still finds a refusal: the pictures are now checked at
most every GL_MEM_EVERY (1 000) ms, and a picture refused in between shows at worst as a dark box until then, after
which the map goes to 2D as before. The first pictures sent into a new atlas are still checked at once, where a card
that allocates it lazily refuses. The cost could not be timed here (no Vulkan driver on this machine for Chromium to
reach the graphics card); the change bounds it whatever it is.

Tests: webgl-out-of-memory reads at most twice in two seconds of panning, and a refusal after the first check gives
the map to 2D within a second.
2026-11-05 00:21:37 +01:00
Antoine
c652bce7d2
Diagnostic info: say how often the map was drawn, and drop a key no release had
The loop runs at the screen's rate even when a still map is not drawn again, so the readout's "fps" said 60 or 240 on
a map that was not being drawn at all, which a bug report would take for the map's speed. It now also says how often
the map was drawn ("map drawn N/s"). The sot-fps setting it carried over only ever existed on this branch, never in a
release, so it is no longer read or removed; ?fps and ?nofps still open and close the readout.
2026-11-05 00:21:36 +01:00
Antoine
b7a9ec3e3c
Settings: say whether the card can draw the map without setting it up
Settings › Map drawing said "This browser cannot" by calling glInit(), so opening Settings on the title screen or in a
puzzle, where the map is drawn in 2D, made the WebGL context and its 64 MB atlas. It now says what is known without
asking the card (glCan()): a card given up or a browser without WebGL2 cannot; a card not tried yet counts as able.
A card that turns out to be the processor's is still named once the game draws its first frame, in Diagnostic info
and in Settings. Test in webgl-context-restore.
2026-11-05 00:21:35 +01:00
Antoine
351b3aa522
WebGL map: take a lost context back, and let it go for Always 2D
The first loss of the WebGL context gave the card up for the session. A context can come back (a driver reset; on a
phone, sometimes just leaving the app), so a phone that went to another app came back to the slower 2D map until the
page was reloaded. Always 2D, chosen in Settings, kept the context and its 64 MB atlas for a map drawn in 2D.

A loss now leaves the 2D map drawing while the context is away (glLost(): the event is cancelled so the browser may
give it back), and everything on the card is built again on the same context when it comes back (glRestored(),
glForget(): glInit() runs as for the first frame). A card lost more than GL_LOSSES (2) times is given up for the
session, so a card that keeps failing does not keep the map switching. Always 2D lets the context go through
WEBGL_lose_context and Auto asks for it back, the same path, never counted as a loss; a context the browser gives back
after the player chose Always 2D is let go again. Without the extension, and for the GPU benchmark's switches
(mapGl(on,false)), the context is kept as before. The listeners and the overlay's wrappers are set once.

Diagnostic info says when the map waits for a lost context. Tests: webgl-context-restore (7), and the loss test of
webgl-out-of-memory now waits for the context instead of giving it up.
2026-11-05 00:21:35 +01:00
Antoine
57546ea18e
2D map: hold its pictures to 48 MB, letting go of those unused the longest
The 2D map keeps a canvas per picture, and the list was capped only by its length (1 400). A long zoom on a big
network paints every city again at each step of its scale, so a pinch from 0.6 to 3.2 and back held 181 MB of
pictures (the TTL save: 179 MB) where one frame uses 2 to 23 MB.

At the end of a frame over 48 MB, the pictures it did not use go, those unused the longest first, down to 36 MB, and
each canvas let go is emptied (0×0) so its pixels are freed without waiting for the collector. The frame's own
pictures are never let go, so a screen that needs more keeps what it needs. Finding a picture now marks it as used.

Measured in jsdom on the same pinch (1280×800 at 2×): 43 MB at most (TTL: 40 MB); 4 781 pictures painted against
4 083 (TTL: 5 549 against 6 030); at most 321 painted in one frame, the same as before (the zoom's own steps).
The card's atlas is unchanged: it has its own fixed size.
2026-11-05 00:21:34 +01:00
Antoine
d57b3ae10f
WebGL map: say how the land's stencil counts, and what the land costs the card 2026-11-05 00:21:33 +01:00
Antoine
10ef838e87
WebGL map: free what the card holds when it is given up for good
Given up while its context still lived (memory refused, a setup failing half-way), the card kept the atlas (64 MB at
4096 px), the tubes' points and the rest while the 2D map began painting its own pictures. glKill() now deletes the
biggest and lets the context go (WEBGL_lose_context, where the browser has it), unless the browser already lost it;
glInit() keeps the context from the start so a failed setup is let go too, and the loss event of a context let go on
purpose does not give the card up a second time. Always 2D still keeps the card for later.
2026-11-04 23:07:25 +01:00
Antoine
123b3d00ea
WebGL map: give the card up for 2D when it refuses a picture without saying so
The atlas, the land, the tubes and the cables read getError() after they are sent, but a picture sent into the atlas
(texSubImage2D) was marked as sent at once: a card short of memory that only set OUT_OF_MEMORY left it kept and
drawn from an atlas that never got it. A frame that sent new pictures now asks once, at its end and before drawing
them; a refusal gives the map to 2D in the same frame and forgets the card's pictures. A frame that only reuses the
atlas still asks nothing.
2026-11-04 23:06:11 +01:00
Antoine
fe109cff84
WebGL map: fill overlapping coastlines as land, as the 2D map does
The card filled the land by an odd/even count over all the coastlines at once, so two coasts that overlap cancelled
out into sea: Timor, drawn by two coastlines, lost most of its inside and its shadow when zoomed in. The 2D map fills
each coast on its own. The fan now turns every coast the same way and the stencil counts windings (+1 and -1 by the
triangles' facing, filled where not zero), which is the 2D canvas's nonzero rule: an overlap counts 2 and stays land.
Same number of draws.
2026-11-04 23:04:48 +01:00
Antoine
b03bec267c
2D map: keep the land picture on the graphics card in Firefox on a computer
The 2D map paints its land into an offscreen picture. In Firefox that picture was a software canvas
(willReadFrequently), because Firefox on Android garbled big paths on its graphics card (#43). Firefox on a computer
had it too, and a software canvas is sent to the card again on every frame, at a cost that grows with the picture:
the whole world at mid zoom, four screens of it zoomed in.

Only Firefox on Android keeps it now (softCanvas()). Measured in Firefox 159 on Windows (RTX 4090, full screen
2560x1440), 2D map, frames per second at zoom 0.6 / 1.1 / 1.6 / 3.2:
- big-network fixture, main: 56 / 37 / 34 / 26; with this change: 64 / 49 / 51 / 78;
- the 183-POP save, main: 32 / 25 / 25 / 22; with this change: 36 / 26 / 33 / 55.
(Measured with the change injected into main's page; the land picture is the same code on this branch.)

tests/world-layer-firefox.test.js: which browsers get the software canvas, and that the land is an ordinary one
elsewhere.
2026-11-04 22:37:15 +01:00