diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c36434..bf32aa0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
+- Check a selected link’s redundancy against current demand: see disconnected endpoints, additional service loss and full fallback links without changing the live network.
+
## [1.25.2] — 2026-10-25
- Tier 1 networks can lay their own subsea cable (#22). Pick two cities with a
diff --git a/site/i18n/it.js b/site/i18n/it.js
index 8a0542a..46aeda8 100644
--- a/site/i18n/it.js
+++ b/site/i18n/it.js
@@ -2248,4 +2248,17 @@
"Replace ten of them and the cable pays for itself in about {n} months.":"Sostituiscine dieci e il cavo si ripaga in circa {n} mesi.",
"Cuts still happen, anchors and sharks included, but the repair ship is yours to call.":"I tagli succedono lo stesso, ancore e squali compresi, ma la nave di riparazione la chiami tu.",
"Lay the cable {price}":"Posa il cavo {price}",
+"This backhoe wins.":"Questa ruspa vince.",
+"Connected, but tight.":"Connesso, ma al limite.",
+"One backhoe is not enough.":"Una ruspa non basta.",
+"Redundancy check":"Verifica della ridondanza",
+"No alternate backbone path connects these endpoints if this link fails.":"Se questo collegamento si interrompe, nessun percorso alternativo della dorsale collega questi estremi.",
+"An alternate path exists, but current routing and capacity deliver less traffic.":"Esiste un percorso alternativo, ma con routing e capacità attuali viene consegnato meno traffico.",
+"With current demand and routing, this link can fail without additional traffic loss.":"Con domanda e routing attuali, questo collegamento può interrompersi senza ulteriori perdite di traffico.",
+"Additional traffic lost":"Ulteriore traffico perso",
+"Service affected":"Servizio interessato",
+"Full links during the test":"Collegamenti saturi durante il test",
+"Snapshot only: one selected link fails. Other links on the same cable, trench or fabric stay up. Existing outages and routing rules still apply. No time, money or game state is changed.":"Solo un’istantanea: si interrompe il collegamento selezionato. Gli altri collegamenti sullo stesso cavo, scavo o fabric restano attivi. I guasti e le regole di routing esistenti si applicano comunque. Tempo, denaro e stato della partita non cambiano.",
+"What happens if this link fails right now?":"Cosa succede se questo collegamento si interrompe adesso?",
+"Check redundancy":"Verifica ridondanza",
};
diff --git a/site/index.html b/site/index.html
index 44a609b..ab5b4aa 100644
--- a/site/index.html
+++ b/site/index.html
@@ -427,6 +427,7 @@ button,.chip,.b,a{touch-action:manipulation;-webkit-tap-highlight-color:transpar
#coach{top:auto !important;bottom:calc(var(--tabbar) + 8px);width:calc(100% - 16px);padding:7px 10px;font-size:13px}
body.sheet-open #coach{bottom:calc(var(--tabbar) + 8px + min(62vh,520px))}
#modal{align-items:end;padding:0}
+ #modal.link-check{bottom:var(--tabbar)}
#modal .cta{position:sticky;bottom:calc(-16px - env(safe-area-inset-bottom,0px));z-index:1;background:var(--paper);margin:12px -16px 0 !important;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));border-top:2px solid var(--line)}
.title-art h1{font-size:34px}.title-art svg{width:54px;height:54px}
.tagline{font-size:13.5px;margin:8px 0 10px}
@@ -2443,6 +2444,7 @@ function checkGoals(){checkBadges();
/* ================= ACTIONS ================= */
function spend(c){if(S.cashNot enough cash. Wait for revenue, or speed up time.'),'bad');sfx('err');return false;}S.cash-=c;sfx('build');return true;}
const ACT={
+ linkCheck:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||linkDown(l))return;linkCheckModal(l);},
speed:({v})=>{v=+v;if(![0,0.5,1,2,4,8].includes(v))return;if(v)UI.lastSpeed=v;UI.speed=v;renderHUD();},
help:()=>showHelp(),
dash:()=>{if(!S)return;const d=$('dash');d.hidden=!d.hidden;if(!d.hidden)renderDash();},
@@ -2470,7 +2472,7 @@ const ACT={
tab:({t})=>{UI.tab=t;UI.confirm=null;renderPanel();},
leftTab:({t})=>{UI.left=t;UI.leftOpen=true;renderLeft();},
toggleLeft:()=>{UI.leftOpen=!UI.leftOpen;renderLeft();},
- phoneTab:({t})=>{if(!['goals','deals','noc','nets'].includes(t))return;haptic(8);if(UI.leftOpen&&UI.left===t&&!UI.sel){UI.leftOpen=false;}else{UI.left=t;UI.leftOpen=true;UI.sel=null;renderPanel();}$('left').classList.remove('full');renderLeft();},
+ phoneTab:({t})=>{if(!['goals','deals','noc','nets'].includes(t))return;if($('modal').classList.contains('link-check'))closeModal();haptic(8);if(UI.leftOpen&&UI.left===t&&!UI.sel){UI.leftOpen=false;}else{UI.left=t;UI.leftOpen=true;UI.sel=null;renderPanel();}$('left').classList.remove('full');renderLeft();},
phonePlay:()=>{haptic(10);if(UI.speed){UI.lastSpeed=UI.speed;UI.speed=0;}else UI.speed=UI.lastSpeed||1;renderHUD();},
phoneSpeed:()=>{haptic(8);const cur=UI.speed||UI.lastSpeed||1,i=SPEEDS.indexOf(cur),n=SPEEDS[(i+1)%SPEEDS.length];UI.speed=n;UI.lastSpeed=n;renderHUD();},
install:()=>{if(installEvt){installEvt.prompt();installEvt.userChoice.finally(()=>{installEvt=null;});return;}
@@ -3041,9 +3043,25 @@ function vxcPanel(l){
return h;
}
function prefCtl(kind,id,cur){cur=cur||'normal';return `
${t.split?tr('No alternate backbone path connects these endpoints if this link fails.'):t.loss>.01?tr('An alternate path exists, but current routing and capacity deliver less traffic.'):tr('With current demand and routing, this link can fail without additional traffic loss.')}
${tr('Additional traffic lost')}${fmtG(t.loss)}
${t.losses.length?`
${tr('Service affected')}
${t.losses.map(x=>`
${esc(x.name)}−${fmtG(x.g)}
`).join('')}`:''}${t.busy.length?`
${tr('Full links during the test')}
${t.busy.slice(0,6).map(x=>`
${esc(x.name)}${fmtG(x.g)} / ${fmtG(x.cap)}
`).join('')}`:''}
${tr('Snapshot only: one selected link fails. Other links on the same cable, trench or fabric stay up. Existing outages and routing rules still apply. No time, money or game state is changed.')}
${tr('What happens if this link fails right now?')}
${btn(tr('Check redundancy'),'linkCheck',{id:l.id},'ghost sm',linkDown(l))}`;}
function trafficSection(l){
const rec=R.ef[edgeKey(l)],n=pairLinks(l.a,l.b).length;
- let h=`
${tr("What's on this link")}
`;
+ let h=linkCheckControl(l)+`
${tr("What's on this link")}
`;
if(!rec){return h+`
${tr('No traffic right now.')}
`;}
const tot=Object.values(rec.net).reduce((a,b)=>a+b,0)||1;
const nets=Object.entries(rec.net).sort((a,b)=>b[1]-a[1]);
@@ -3297,7 +3315,7 @@ function toast(html,kind='',actions=[]){
const markLayer=()=>{UI.layerAt=performance.now();};
// Which layers are open: when that changes (a sheet, the dashboard, the bank, a selection), taps in flight are void.
function checkLayer(){const q=id=>{const e=$(id);return e?(e.hidden?0:1):0;},sig=[q('modal'),q('dash'),q('bankBox'),UI.leftOpen?1:0,UI.left||'',UI.sel?UI.sel.type+UI.sel.id:'',UI.tab||''].join('|');if(sig!==UI._layer){UI._layer=sig;markLayer();}}
-function openModal(html){if($('modal').hidden)markLayer();$('modalCard').innerHTML=html;$('modal').hidden=false;}
+function openModal(html,cls=''){$('modal').className=cls;$('modalCard').setAttribute('aria-modal',cls==='link-check'&&isPhone()?'false':'true');if($('modal').hidden)markLayer();$('modalCard').innerHTML=html;$('modal').hidden=false;}
function closeModal(){if(!$('modal').hidden)markLayer();$('modal').hidden=true;UI.pending=null;}
const NETWORK_NAMES=[
'Packet Pals','Shinternet','Post, Telegraph & Tubes','Peering Pressure','Best Effort Telecom',
diff --git a/tests/issues.test.js b/tests/issues.test.js
index 13b30b8..06bfc03 100644
--- a/tests/issues.test.js
+++ b/tests/issues.test.js
@@ -539,3 +539,20 @@ test('#35 your own trench can light another fiber pair once a ROADMaster is full
assert.equal(ev('S.links[0].pairs'), 4, 'saves are clamped to four pairs');
assert.deepEqual(errors, []);
});
+
+test('link redundancy trials distinguish a bridge, a full fallback and a healthy alternate path without changing the game',()=>{
+ const {ev,errors}=load();
+ ev("ACT.start({});S.cash=1e8;ACT.buildPop({city:'bde'});ACT.buildPop({city:'ams'});S.biz=[{id:'circuit',name:'Test Circuit',type:'l2vpn',city:'fra',city2:'bde',bw:80,rate:1,reqs:[]}];S.links=[{id:'main',a:'fra',b:'bde',kind:'wave',tier:1,km:100,mo:100,cut:0,trench:'main'}];compute();window.state=JSON.stringify(S);window.live=R;window.hot=UI.hotMap;window.cache=TE_CACHE");
+ let t=JSON.parse(ev("JSON.stringify(linkTrial('main'))"));assert.equal(t.split,true);assert.equal(t.loss,80);
+ assert.equal(ev('JSON.stringify(S)'),ev('state'));assert.equal(ev('R===live&&UI.hotMap===hot&&TE_CACHE===cache'),true);
+ ev("S.links.push({id:'a',a:'fra',b:'ams',kind:'wave',tier:0,km:100,mo:100,cut:0},{id:'b',a:'ams',b:'bde',kind:'wave',tier:0,km:100,mo:100,cut:0});compute()");
+ t=JSON.parse(ev("JSON.stringify(linkTrial('main'))"));assert.equal(t.split,false);assert.equal(t.loss,70);assert.equal(t.busy.length,2);
+ ev("S.links[1].tier=1;S.links[2].tier=1;compute()");t=JSON.parse(ev("JSON.stringify(linkTrial('main'))"));assert.equal(t.split,false);assert.equal(t.loss,0);
+ ev("S.links[1].cut=S.day+5;compute()");assert.equal(ev("linkTrial('main').split"),true,'existing failures are respected');assert.equal(ev("linkTrial('a')"),null,'an already failed link is not tested');
+ ev("S.links=S.links.slice(0,1);S.links.push({...S.links[0],id:'parallel'});compute()");assert.equal(ev("linkTrial('main').split"),false,'only the selected link fails even when a trench is shared');assert.equal(ev("linkTrial('main').loss"),0);
+ ev("S.links[0]={...S.links[0],kind:'df',sys:'roadm',ch:['tp16'],pairs:1,regen:0,ready:0,own:true};compute()");assert.equal(ev("linkTrial('main').loss"),0,'dark fiber is tested as one link');
+ ev("window.innerWidth=360;ACT.linkCheck({id:'main'})");assert.match(ev("$('modalCard').textContent"),/One backhoe is not enough/);assert.equal(ev("$('modal').className"),'link-check');ev("ACT.phoneTab({t:'noc'})");assert.equal(ev("$('modal').hidden"),true);
+ ev("S.links[0]={...S.links[0],kind:'vxc',vt:1,prov:FABS[0].id};compute()");assert.equal(ev("linkTrial('main').loss"),0,'virtual circuits are tested individually');
+ ev("window.saveRef=S;window.liveRef=R;window.originalCompute=compute;compute=()=>{throw Error('trial failed')}");assert.throws(()=>ev("linkTrial('main')"),/trial failed/);ev('compute=originalCompute');assert.equal(ev('S===saveRef&&R===liveRef'),true,'even a failed trial restores the live state');
+ assert.deepEqual(errors,[]);
+});