diff --git a/CHANGELOG.md b/CHANGELOG.md
index dfdfd6c..ee34752 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ All notable changes to this project are documented here. The project follows
- The map zooms in twice as far, for crowded regions like New England or around Washington.
- Cable ships at anchor sit a little further out from their port, and a tap on a city picks the city even with a ship close by.
- Agents playing through the Agent API can no longer start a link in a city where you have no POP, just as on the map. Before, an agent could sign a dark fiber IRU, lease a wave or lay a cable from such a city; now it is told why, and so is its dry run.
+- An agent that tries to open a POP in one of the small cities that are off the map is now told why it can't, and which city nearby to build in instead. Before, nothing happened and nothing was said.
## [2.8.0] — 2026-11-04
diff --git a/site/i18n/de.js b/site/i18n/de.js
index 0276d81..8f0f329 100644
--- a/site/i18n/de.js
+++ b/site/i18n/de.js
@@ -3,6 +3,7 @@
// Style: informal "du"; networking terms stay English (Peering, Transit, Dark Fiber, Wave, Port, POP, IX…), but
// plain "fiber" is "Glasfaser" and "fiber pair" is "Faserpaar". The add-strings skill has the full style notes.
(window.I18N=window.I18N||{}).de={
+"action_helpers.city_is_off_the_map_small":"{city} ist nicht mehr auf der Karte.
Kleine Städte so nah an einer größeren gibt es in neuen Spielen nicht mehr. Bau stattdessen in {near}.",
"action_helpers.light_fiber_pair_n_price":"Faserpaar {n} beleuchten {price}",
"action_helpers.light_fiber_pair_n_price_mo":"Faserpaar {n} beleuchten {price} + {mo}/Monat",
"action_helpers.n_fiber_pairs_lit_the_trench":"{n} Faserpaare beleuchtet, der Graben ist voll",
diff --git a/site/i18n/es.js b/site/i18n/es.js
index addcb86..9e010f8 100644
--- a/site/i18n/es.js
+++ b/site/i18n/es.js
@@ -1,6 +1,7 @@
// Spanish: the translation of every label in src/i18n/en.js. One entry per line, sorted by label; plurals are
// {"one":…,"other":…}. Add or change entries with scripts/i18n-add.js, check with npm run i18n:check.
(window.I18N=window.I18N||{}).es={
+"action_helpers.city_is_off_the_map_small":"{city} ya no está en el mapa.
Las ciudades pequeñas tan cerca de una más grande ya no aparecen en partidas nuevas. Construye en {near}.",
"action_helpers.light_fiber_pair_n_price":"Iluminar el par de fibra {n} {price}",
"action_helpers.light_fiber_pair_n_price_mo":"Iluminar el par de fibra {n} {price} + {mo}/mes",
"action_helpers.n_fiber_pairs_lit_the_trench":"{n} pares de fibra iluminados, la zanja está llena",
diff --git a/site/i18n/fr.js b/site/i18n/fr.js
index f3b94ba..5686a28 100644
--- a/site/i18n/fr.js
+++ b/site/i18n/fr.js
@@ -1,6 +1,7 @@
// French: the translation of every label in src/i18n/en.js. One entry per line, sorted by label; plurals are
// {"one":…,"other":…}. Add or change entries with scripts/i18n-add.js, check with npm run i18n:check.
(window.I18N=window.I18N||{}).fr={
+"action_helpers.city_is_off_the_map_small":"{city} n’est plus sur la carte.
Les petites villes aussi proches d’une plus grande ne figurent plus dans les nouvelles parties. Construis plutôt à {near}.",
"action_helpers.light_fiber_pair_n_price":"Allumer la paire {n} {price}",
"action_helpers.light_fiber_pair_n_price_mo":"Allumer la paire {n} {price} + {mo}/mois",
"action_helpers.n_fiber_pairs_lit_the_trench":"{n} paires de fibres allumées, la tranchée est pleine",
diff --git a/site/i18n/it.js b/site/i18n/it.js
index 30b912b..4dbfd1f 100644
--- a/site/i18n/it.js
+++ b/site/i18n/it.js
@@ -1,6 +1,7 @@
// Italian: the translation of every label in src/i18n/en.js. One entry per line, sorted by label; plurals are
// {"one":…,"other":…}. Add or change entries with scripts/i18n-add.js, check with npm run i18n:check.
(window.I18N=window.I18N||{}).it={
+"action_helpers.city_is_off_the_map_small":"{city} non è più sulla mappa.
Le città piccole così vicine a una più grande non ci sono più nelle nuove partite. Costruisci invece a {near}.",
"action_helpers.light_fiber_pair_n_price":"Accendi la coppia {n} {price}",
"action_helpers.light_fiber_pair_n_price_mo":"Accendi la coppia {n} {price} + {mo}/mese",
"action_helpers.n_fiber_pairs_lit_the_trench":"{n} coppie di fibre accese, il cavidotto è pieno",
diff --git a/site/i18n/pt.js b/site/i18n/pt.js
index 20a2dd1..460f93c 100644
--- a/site/i18n/pt.js
+++ b/site/i18n/pt.js
@@ -1,6 +1,7 @@
// Portuguese (Brazil). Keys are the English text exactly as passed to tr()/trn()/N_() in src/ (or as it stands
// in its data-i18n markup, aria-label or title); sorted; check with: npm run i18n:check, add with scripts/i18n-add.js
(window.I18N=window.I18N||{}).pt={
+"action_helpers.city_is_off_the_map_small":"{city} saiu do mapa.
Cidades pequenas tão perto de uma maior não entram mais em jogos novos. Construa em {near}.",
"action_helpers.light_fiber_pair_n_price":"Acender par {n} {price}",
"action_helpers.light_fiber_pair_n_price_mo":"Acender par {n} {price} + {mo}/mês",
"action_helpers.n_fiber_pairs_lit_the_trench":"{n} pares de fibras acesos, a vala está cheia",
diff --git a/src/agent/20-commands.js b/src/agent/20-commands.js
index 34568ec..92d311b 100644
--- a/src/agent/20-commands.js
+++ b/src/agent/20-commands.js
@@ -14,8 +14,8 @@ const API_CMD={
downP:{args:[['id','entityId']],watch:['pni.#id'],doc:'Step a PNI down one size. Not while an augment is on order.'},
/* ---------- footprint: buildings, routers, POPs ---------- */
buildPop:{args:[['city','cityId']],
- quote:a=>({setup:popCost(a.city),blocked:cnCity(a.city)&&!cnOk()?[tr('pops_transit_ix.you_need_a_license_first_foreign')]:[]}),
- doc:'Open a POP in a city you do not have one in. Costs popCost(city).'},
+ quote:a=>({setup:popCost(a.city),blocked:[cityOn(a.city)?'':popOffWhy(a.city),cnCity(a.city)&&!cnOk()?tr('pops_transit_ix.you_need_a_license_first_foreign'):''].filter(Boolean)}),
+ doc:'Open a POP in a city you do not have one in. Costs popCost(city). Not in a retired small city (off the map in new games).'},
launchBB:{args:[['city','cityId']],watch:['pops.#city'],
quote:a=>({setup:bbCost(a.city)}),
doc:'Launch broadband to the eyeballs of a city you have a POP in. The core revenue source; one per POP.'},
diff --git a/src/game/90-actions/20-pops-transit-ix.js b/src/game/90-actions/20-pops-transit-ix.js
index 32ff2f1..5a74050 100644
--- a/src/game/90-actions/20-pops-transit-ix.js
+++ b/src/game/90-actions/20-pops-transit-ix.js
@@ -1,5 +1,5 @@
Object.assign(ACT,{
- buildPop:({city})=>{if(S.pops[city]||!cityOn(city))return;const flipNote=CITY[city]&&CITY[city].au;if(cnCity(city)&&!cnOk()){toast(tr('pops_transit_ix.you_need_a_license_first_foreign'),'bad');sfx('err');return;}if(!spend(popCost(city)))return;S.pops[city]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false};popStdApply(city);floater(CITY[city].x,CITY[city].y-30,tr('common.new_pop'),'#FF4F9A');if(flipNote)toast(pick([tr('pops_transit_ix.router_installed_in_city_upside_down',{city:CITY[city].name}),tr('pops_transit_ix.router_installed_in_city_the_vendor',{city:CITY[city].name})]),'good',[],{a:'city',v:city});UI.tab='cust';after();},
+ buildPop:({city})=>{if(S.pops[city]||!CITY[city])return;if(!cityOn(city)){toast(popOffWhy(city),'bad');sfx('err');return;}const flipNote=CITY[city]&&CITY[city].au;if(cnCity(city)&&!cnOk()){toast(tr('pops_transit_ix.you_need_a_license_first_foreign'),'bad');sfx('err');return;}if(!spend(popCost(city)))return;S.pops[city]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false};popStdApply(city);floater(CITY[city].x,CITY[city].y-30,tr('common.new_pop'),'#FF4F9A');if(flipNote)toast(pick([tr('pops_transit_ix.router_installed_in_city_upside_down',{city:CITY[city].name}),tr('pops_transit_ix.router_installed_in_city_the_vendor',{city:CITY[city].name})]),'good',[],{a:'city',v:city});UI.tab='cust';after();},
launchBB:({city})=>{const p=S.pops[city];if(!p||p.bb)return;const C=CITY[city];if(!spend(bbCost(city)))return;p.bb={d:bbStart(city)};floater(C.x,C.y-30,tr('common.eyeballs_online'),'#16A866');after();},
ad:({city})=>{const p=S.pops[city];if(!p||!p.bb)return;if(!spend(8000))return;p.boost=S.day+30;floater(CITY[city].x,CITY[city].y-30,tr('common.ad_campaign'),'#FF8A3D');after();},
buyTransit:({city,net,tier})=>{tier=+tier;if(scnRule('noTransit')){toast(tr('pops_transit_ix.no_transit_in_this_scenario_peering'),'bad');sfx('err');return;}if(!S.pops[city]||!NET[net]||!sellsAt(NET[net],city)||!PORT[tier])return;if(!portOk(city,tier)){toast(tr('actions.your_router_can_t_take_a',{port:PORT[tier].n}),'bad');sfx('err');return;}const ex=S.transit.find(t=>t.city===city&&t.net===net);if(ex&&tier<=ex.tier)return;if(!portGate(city,ex?(PORT_SLOT(tier)-PORT_SLOT(ex.tier))*(ex.n||1):PORT_SLOT(tier)))return;if(!spend(PORT[tier].setup*(ex&&ex.n||1)))return;if(ex)ex.tier=tier;else S.transit.push({id:uid(),city,net,tier,down:0,...(premOnlyAt(NET[net],city)?{premium:true}:{})});toast(tr('pops_transit_ix.net_transit_is_live_in_city',{net:esc(NET[net].name),city:CITY[city].name}),'good');after();},
diff --git a/src/game/90-actions/90-action-helpers.js b/src/game/90-actions/90-action-helpers.js
index 046e4c3..aeee63f 100644
--- a/src/game/90-actions/90-action-helpers.js
+++ b/src/game/90-actions/90-action-helpers.js
@@ -12,6 +12,9 @@ function dfAllowed(a,b){if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)=
// A link starts at one of your POPs. The map only drags one from a POP, but a typed order (the agent API) names both ends.
function linkFromWhy(a){return S.pops[a]?'':tr('action_helpers.you_have_no_pop_in_city',{city:CITY[a].name});}
function linkFromOk(a){const w=linkFromWhy(a);if(w){toast(w,'bad');sfx('err');}return !w;}
+// A retired small city (off: true) takes no new POP; the nearest open city in its country stands in for it.
+function popOffWhy(c){const C=CITY[c],near=CITIES.filter(o=>!o.off&&o.cc===C.cc).sort((x,y)=>kmBetween(c,x.id)-kmBetween(c,y.id))[0];
+ return tr('action_helpers.city_is_off_the_map_small',{city:C.name,near:near?near.name:''});}
/* Optics you unplug go on a spares shelf instead of in the bin (#45): the next channel of that type uses a spare
for free (only the regen sites' transponders are new), or you sell it on eBuy for part of the price. */
const SPARE_RESALE=0.4,spareN=o=>(S&&S.spares&&S.spares[o])|0,spareValue=o=>Math.round(optCost(o)*SPARE_RESALE);
diff --git a/src/i18n/en.js b/src/i18n/en.js
index 27a6158..46549f1 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -2,6 +2,7 @@
// Inlined into the page at build. One entry per line, sorted by label; plurals are {"one":…,"other":…}.
// Add or change text with scripts/i18n-add.js, check with npm run i18n:check.
(window.I18N=window.I18N||{}).en={
+"action_helpers.city_is_off_the_map_small":"{city} is off the map.
Small cities this close to a bigger one are retired from new games. Build in {near} instead.",
"action_helpers.light_fiber_pair_n_price":"Light fiber pair {n} {price}",
"action_helpers.light_fiber_pair_n_price_mo":"Light fiber pair {n} {price} + {mo}/mo",
"action_helpers.n_fiber_pairs_lit_the_trench":"{n} fiber pairs lit, the trench is full",
diff --git a/tests/link-preconditions.test.js b/tests/link-preconditions.test.js
index 42daa70..3e05fb7 100644
--- a/tests/link-preconditions.test.js
+++ b/tests/link-preconditions.test.js
@@ -1,5 +1,7 @@
-// Typed orders (the MCP act tool) name both ends of a link, where the map only drags one from a POP of yours.
-// A link from a city with no POP is refused, with a toast that says why and a dry run that reports it as blocked.
+// Typed orders (the MCP act tool) name both ends of a link and any city for a POP, where the map only offers what
+// a player can reach: a link dragged from one of your POPs, a POP in a city that is on the map. These hold the same
+// lines: a link from a city with no POP is refused, and so is a POP in a retired small city, each with a toast that
+// says why and a dry run that reports it as blocked.
const test = require('node:test');
const assert = require('node:assert/strict');
const { createSession, TOOLS } = require('../scripts/lib/mcp-game');
@@ -54,3 +56,36 @@ test('from one of your POPs the same orders still go through and open a POP at t
assert.ok(ev('!!S.pops.cwb'));
assert.deepEqual(s.errors(), []);
});
+
+test('a POP in a retired small city is refused with a toast naming an open city nearby, and its dry run is blocked', () => {
+ const { s, ev, act, pops } = sandbox();
+ const q = act('buildPop', { city: 'aju' }, true);
+ assert.deepEqual(q.quote.blocked, [ev("apiText(popOffWhy('aju'))")]);
+ assert.match(q.quote.blocked[0], /Aracaju is off the map/);
+ const r = act('buildPop', { city: 'aju' });
+ assert.equal(r.outcome, 'rejected');
+ assert.ok(r.toasts.some((t) => /Aracaju is off the map.*\n.*Build in Salvador instead/s.test(t)), JSON.stringify(r.toasts));
+ assert.equal(r.charged, 0);
+ // every retired city names an open city in its own country to build in instead
+ const near = JSON.parse(ev(`JSON.stringify(CITIES.filter(c=>c.off).map(c=>{const m=popOffWhy(c.id).match(/Build in (.+) instead/);
+ const o=m&&CITIES.find(x=>x.name===m[1]);return {c:c.id,ok:!!o&&!o.off&&o.cc===c.cc};}))`));
+ assert.ok(near.length > 0, 'there are retired cities');
+ assert.deepEqual(near.filter((x) => !x.ok), []);
+ // an open city still takes a POP; an unknown id does nothing and says nothing
+ assert.equal(act('buildPop', { city: 'ssa' }).outcome, 'applied');
+ ev("ACT.buildPop({city:'nope'})");
+ assert.deepEqual(pops(), ['sao', 'ssa']);
+ assert.deepEqual(s.errors(), []);
+});
+
+test('an old save that kept a POP in a retired city keeps it, and buildPop there stays quiet', () => {
+ const { s, ev, act } = sandbox();
+ ev("S.pops.aju={day:0,bb:null,boost:0,down:0,routers:1,gen:false};S=migrate(JSON.parse(JSON.stringify(S)));compute()");
+ assert.ok(ev("!!S.pops.aju&&cityOn('aju')"));
+ const r = act('buildPop', { city: 'aju' });
+ assert.equal(r.outcome, 'no_effect');
+ assert.deepEqual(r.toasts, []);
+ // and a link may start there, since it is one of your POPs
+ assert.equal(act('orderDf', { a: 'aju', b: 'rec', source: 'lease', system: 'roadm' }).outcome, 'applied');
+ assert.deepEqual(s.errors(), []);
+});