${btn(tr('hud_and_panels.install_auto_te_cost_mo_mo',{cost:fmt$(TE_COST),mo:fmt$(TE_MO)}),'buyTE',{},'pink sm',lvl()<3||S.cash
`;
+ h+=corePanel();
+ h+=S.te&&!coreTE()?`Auto-TE${tr('core.paused')}
${tr('core.auto_te_is_paused_it_needs')}
`:S.te?`Auto-TE${S.te.on?tr('hud_and_panels.on_moving_g_onto_alternate_paths',{g:fmtG(R.teMoved||0)}):tr('common.off')}
${btn(S.te.on?tr('hud_and_panels.turn_auto_te_off'):tr('hud_and_panels.turn_auto_te_on'),'teToggle',{},'ghost sm')}${btn(S.te.script?tr('common.edit_routescript'):tr('hud_and_panels.write_a_routescript'),'teEdit',{},'pink sm')}
${S.te.script?`RouteScript: ${teRules()?tr('hud_and_panels.n_rules_live',{n:teRules().n}):S.te.on?tr('hud_and_panels.has_errors_not_running'):tr('common.controller_off')}${R.teBlack?` · ${tr('hud_and_panels.blackholing_g',{g:fmtG(R.teBlack)})}`:''}
`:''}`
+ :`Auto-TE${lvl()<3?tr('hud_and_panels.unlocks_at_customer_level_3'):tr('common.not_installed')}
${tr('hud_and_panels.traffic_takes_the_shortest_path_even')}
${coreTE()?'':`${tr('core.auto_te_needs_an_rsvp_te_or')}
`}${btn(tr('hud_and_panels.install_auto_te_cost_mo_mo',{cost:fmt$(TE_COST),mo:fmt$(TE_MO)}),'buyTE',{},'pink sm',lvl()<3||S.cash
`;
const hot=S.links.filter(l=>!linkDown(l)&&capOf(l)>0&&(R.load[l.id]||0)/capOf(l)>=0.85).sort((a,b)=>(R.load[b.id]/capOf(b))-(R.load[a.id]/capOf(a)));
if(hot.length){h+=`${tr('common.congested_links')}
${S.te&&S.te.on?'':''+tr('hud_and_panels.raise_a_full_link_s_metric')+'
'}`+hot.map(l=>`${CITY[l.a].name} ⇄ ${CITY[l.b].name}
${capName(l)} · ${tr('hud_and_panels.p_full',{p:pct((R.load[l.id]||0)/capOf(l))})}
${btn(tr('common.inspect'),'selLink',{id:l.id},'pink sm')}
`).join('');}
h+=hwCard();
diff --git a/src/game/93-ui/45-core-panel.js b/src/game/93-ui/45-core-panel.js
new file mode 100644
index 0000000..77a4454
--- /dev/null
+++ b/src/game/93-ui/45-core-panel.js
@@ -0,0 +1,14 @@
+/* ---------- NOC: the backbone's technology ---------- */
+const CORE_WHAT=[N_('core.shortest_paths_only_every_router'),N_('core.labels_switch_traffic_that_only'),N_('core.tunnels_unlock_auto_te_and'),N_('core.segment_routing_te_detours_up'),N_('core.segment_routing_over_ipv6_the')];
+function corePanel(){if(!S.core||S.mode==='puzzle'||S.pz||S.ar||S.scn)return '';const C=S.core,run=C.run,lv=C.lv,n=lv+1;
+ let h=`${tr('core.backbone')}
${tr('core.running')}${tr(CORE_LV[run])}
`;
+ h+=`${tr(CORE_WHAT[run])}${run?' '+tr('core.uses_p_of_router_cpu',{p:pct(CORE_CPU[run])}):''}
`;
+ if(C.legacy)h+=`${tr('core.your_auto_te_predates_backbones')}
`;
+ // Run any level already paid for: one step down is the safe way past vendor squabbles.
+ if(lv>0)h+=`${CORE_LV.slice(0,lv+1).map((l,i)=>btn(tr(l),'coreSet',{v:i},i===run&&!C.legacy?'pink sm':'ghost sm')).join('')}
`;
+ if(n<=4){const lk=lvl()${btn(lk?tr('core.lv_at_customer_level_n',{lv:tr(CORE_LV[n]),n:CORE_REQ[n]}):tr('core.upgrade_to_lv_cost',{lv:tr(CORE_LV[n]),cost:fmt$(CORE_COST[n])}),'coreUp',{},'sm',lk||S.cash`;
+ h+=`${tr(CORE_WHAT[n])}
`;}
+ const out=coreOut();if(out.length)h+=`${trn('core.n_pop_outside_the_core_its',out.length,{list:out.slice(0,5).map(c=>CITY[c].name).join(', ')+(out.length>5?'…':''),lv:tr(CORE_LV[run])})}
`;
+ const v=coreOn()&&run>=1?coreVendors():null;
+ if(v&&v.size>1)h+=coreIopRisk()?`${tr('core.n_vendors_at_the_top_of',{n:v.size,lv:tr(CORE_LV[run])})}
`:`${tr('core.n_vendors_one_step_below_their',{n:v.size})}
`;
+ return h;}
diff --git a/src/game/93-ui/50-city-panel.js b/src/game/93-ui/50-city-panel.js
index 2b34ea2..7259571 100644
--- a/src/game/93-ui/50-city-panel.js
+++ b/src/game/93-ui/50-city-panel.js
@@ -67,7 +67,7 @@ function cityPanel(c){
const ls=S.links.filter(l=>l.a===c||l.b===c);
const rt=p.routers||1,g=p.rgen||0,G=RG[g],nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||nodeCap(c),Ni=g===mainRG(G.cls)?mainRG(G.cls+1):-1,N=Ni>=0?RG[Ni]:null,pu=portsUsed(c),pm=portsMax(c);
h+=`${tr('common.routers')}
${tr('city_panel.the_model_sets_your_fastest')}
- ${G.badge||'R'+(G.cls+1)}${rt} × ${esc(G.n)}
${tr('city_panel.up_to_pn_interfaces_ports_ports',{pn:G.pn,ports:G.ports,cap:fmtG(G.cap)})} · ${esc(G.blurb)}
+ ${G.badge||'R'+(G.cls+1)}${rt} × ${esc(G.n)}
${tr('city_panel.up_to_pn_interfaces_ports_ports',{pn:G.pn,ports:G.ports,cap:fmtG(G.cap)})} · ${esc(G.blurb)}
${coreMeta(g)}
${coreOn()&&coreRun()>0&&!inCore(c)?`
${tr('core.this_router_can_t_run_your',{lv:tr(CORE_LV[coreRun()])})}
`:''}
${tr('common.router_ports')}${tr('city_panel.used_max_in_use',{used:fmtPorts(pu),max:pm})}
${pu>=pm?`${tr('city_panel.every_port_is_taken_add_a')}
`:''}
${tr('common.forwarding_chip')}${esc(G.chip)}
${tr('common.boot_time')}${slowBoot(c)?`${tr('city_panel.n_min_a_slow_one',{n:bootMin(c)})}`:tr('city_panel.n_min',{n:bootMin(c)})}
${slowBoot(c)?`${tr('city_panel.this_chassis_takes_forever_to_boot')}
`:''}
${tr('common.forwarding_load')}${fmtG(nl)} / ${fmtG(nc)}
diff --git a/src/i18n/en.js b/src/i18n/en.js
index 4734859..a856a11 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -1526,6 +1526,40 @@
"connections.no_connections_yet_buy_transit_or":"No connections yet. Buy transit or join an exchange from a POP.",
"connections.on_order_n_days":"on order: {n} days",
"connections.virtual_circuits_and_fabric":"virtual circuits and fabric customers",
+"core.a_firmware_update_on_the_va":"A firmware update on the {va} side in {a} changed how it reads {lv}. The {vb} router in {b} no longer agrees, and the link between them is down.",
+"core.auto_te_is_paused_it_needs":"Auto-TE is paused: it needs an RSVP-TE or segment-routing backbone. Run one again and it picks up where it left off.",
+"core.auto_te_needs_an_rsvp_te_or":"Auto-TE needs an RSVP-TE or segment-routing backbone first.",
+"core.backbone":"Backbone",
+"core.both_tacs_say_it_is":"{va} support says it is a {vb} bug, {vb} support says it is a {va} bug. Meanwhile the link from {a} to {b} is down.",
+"core.can_t_run_your_lv":"can't run your {lv} backbone",
+"core.interop_failure":"Vendor interop failure",
+"core.labels_switch_traffic_that_only":"Labels switch traffic that only passes through a POP, so it costs that router less. No traffic engineering yet.",
+"core.ldp_mpls":"LDP/MPLS",
+"core.lv_at_customer_level_n":"{lv} customer level {n}",
+"core.n_pop_outside_the_core_its":{"one":"{n} POP is outside the backbone, its router can't run {lv}: {list}. It routes plain IP, and traffic engineering won't steer through it.","other":"{n} POPs are outside the backbone, their routers can't run {lv}: {list}. They route plain IP, and traffic engineering won't steer through them."},
+"core.n_pops_stay_outside":{"one":"{n} POP stays outside: its router can't run it.","other":"{n} POPs stay outside: their routers can't run it."},
+"core.n_vendors_at_the_top_of":"{n} vendors share the backbone, and {lv} is the top of what some of their routers can do: expect interop failures. Run one level lower, or stick to one vendor.",
+"core.n_vendors_one_step_below_their":"{n} vendors, all running below their top level: they get along fine.",
+"core.needs_customer_level_n":"That needs customer level {n}.",
+"core.no_mpls_srv6_only":"no MPLS, SRv6 only",
+"core.open_a_ticket_with_both":"Get both vendors on a call",
+"core.paused":"Paused",
+"core.plain_igp":"Plain IGP",
+"core.rsvp_te_mpls":"RSVP-TE/MPLS",
+"core.running":"Running",
+"core.segment_routing_over_ipv6_the":"Segment routing over IPv6: the same detours, almost no router CPU, and the most arguments between vendors.",
+"core.segment_routing_te_detours_up":"Segment routing: traffic engineering detours up to twice the shortest path, with less router CPU than tunnels.",
+"core.shortest_paths_only_every_router":"Shortest paths only. Every router looks up every packet, and a full link drops what doesn't fit.",
+"core.sr_mpls":"SR-MPLS",
+"core.srv6":"SRv6",
+"core.this_router_can_t_run_your":"This router can't run your {lv} backbone: this POP routes plain IP.",
+"core.tunnels_unlock_auto_te_and":"Tunnels unlock Auto-TE and RouteScript: overflow detours up to one and a half times the shortest path.",
+"core.upgrade_to_lv_cost":"Upgrade to {lv} {cost}",
+"core.uses_p_of_router_cpu":"Uses {p} of router CPU.",
+"core.va_and_vb_disagree_about":"{va} and {vb} disagree about {lv} between {a} and {b}. Both are sure they follow the RFC. The link is down.",
+"core.vendor_v_backbone_up_to_lv":"{v} · backbone up to {lv}",
+"core.your_auto_te_predates_backbones":"Your Auto-TE was installed before backbones had a technology, so it runs as it always did. Changing the backbone switches to the new rules.",
+"core.your_backbone_now_runs_lv":"Your backbone now runs {lv}.",
"customers.attacks_on_city_are_hauled_to":"attacks on {city} are hauled to {to} for scrubbing: +{ms} ms",
"customers.everyone_who_pays_you_happiest_last":"Everyone who pays you, happiest last. Below 60% they start to grumble, below 30% they are furious, and at 0% they cancel.",
"customers.from_unhappy_customers":"from unhappy customers",
@@ -3278,8 +3312,10 @@
"routers.a_few_dozen_arm_cores":"a few dozen ARM cores",
"routers.a_hundred_and_forty_four_3":"A hundred and forty-four 3.2T ports and buffers deep enough to hide a whole fleet. Still boots before your flat white. The beard now has a beard.",
"routers.a_mystery_asic":"a mystery ASIC",
+"routers.a_refurbished_network_processor":"A refurbished network processor, firmware frozen in time",
"routers.an_absolute_unit_with_800g_ports":"An absolute unit with 800G ports, built around the Junipurr PacketOinker™ forwarding chip. Oinks at line rate. Takes 800ZR+ optics.",
"routers.booted_panicked_about_a_missing_fan":"booted, panicked about a missing fan tray, and started again",
+"routers.bought_the_magician_s_hat":"Bought the magician's hat. Tunnels everything, segments nothing. 1.6T ports at a mid-range price.",
"routers.bought_used_on_ebuy_the_fans":"Bought used on eBuy. The fans sound like a jet engine.",
"routers.built_like_a_sauna_door_heavy":"Built like a sauna door: heavy, hot and nearly impossible to break. The config is now so hierarchical it has a royal family.",
"routers.cheap_chassis_eternal_subscription":"Cheap chassis, eternal subscription. Every port needs a licence, every licence needs a licence server, and the licence server needs a licence.",
@@ -3301,12 +3337,14 @@
"routers.jerry_cho_deep_buffer_silicon":"Jerry-cho deep-buffer silicon",
"routers.packetoinker2_two_pigs_one_chassis":"PacketOinker² (two pigs, one chassis)",
"routers.packetoinker3_a_whole_litter":"PacketOinker³ (a whole litter)",
+"routers.pulls_rsvp_tunnels_out_of_a":"Pulls RSVP tunnels out of a hat. The vendor vanished, the firmware stopped, the tunnels keep coming. Sold refurbished.",
"routers.several_hundred_arm_cores_and_a":"several hundred ARM cores and a prayer",
"routers.sharp_edgy_and_finally_speaks_400g":"Sharp, edgy, and finally speaks 400G and 400ZR+.",
"routers.sixty_four_1_6t_ports_on":"Sixty-four 1.6T ports on open-source software for the price of one line card. There is still nobody to call at 3 a.m., but now the crashes are 1.6T crashes.",
"routers.the_modular_one_ninety_six_800g":"The modular one. Ninety-six 800G ports, buffers deep enough to lose a ship in, and a vinyl-only release notes policy. Arrr.",
"routers.tomahack_5_merchant_silicon":"Tomahack 5 merchant silicon",
"routers.tomahack_merchant_silicon":"Tomahack merchant silicon",
+"routers.tridont_merchant_silicon":"Tridon't merchant silicon",
"routers.two_hundred_and_fifty_six_3":"Two hundred and fifty-six 3.2T ports and enough forwarding for a small galaxy. Boots in 42 minutes. Nobody remembers what the question was.",
"routescript.a_cap_of_0_gbps_means":"# A cap of 0 Gbps means no limit: fewer checks, faster forwarding.",
"routescript.a_ceiling_on_one_provider_so":"A ceiling on one provider, so you stay at your commit and the 95th percentile bill does not jump. Traffic above it has to find another way out, or it is dropped.",
diff --git a/tests/backbone-core.test.js b/tests/backbone-core.test.js
new file mode 100644
index 0000000..5cca646
--- /dev/null
+++ b/tests/backbone-core.test.js
@@ -0,0 +1,175 @@
+const test = require('node:test');
+const assert = require('node:assert/strict');
+const { load } = require('./harness');
+
+const start = "ACT.start({});S.cash=1e9;S.lvl=13;S.nextFail=1e9;S.nextEvent=1e9;for(const g of GOALS)S.done[g.id]=0";
+const g = n => `RG.findIndex(r=>r.n===${JSON.stringify(n)})`;
+
+test('every router is classed by the highest backbone it runs', () => {
+ const { ev, errors } = load();
+ const want = {
+ 0: ['Rusty Router 9000', 'Edge Lord 400', 'Sonic the Whitebox 32'],
+ 1: ['Mikrowtik CCR', 'Mikrowtik CCR 3.2T'],
+ 2: ['Chonk 800', 'Brocadabra MLX-16', 'Extremely Networks SLX 9740'],
+ 3: ['Absolute Unit 1.6T', 'Arrrhipster 7280R', 'Arrrhipster 7800R', 'Arrrhipster 7800R5'],
+ 4: ['Absolute Unit 3.2T', 'Disco 8K', 'Disco 8K Ultra', 'Knockia 7750', 'Knockia 7950 XRS', 'Sonic the Whitebox 64', 'The Router at the End of the Universe'],
+ };
+ for (const [lv, names] of Object.entries(want)) for (const n of names) assert.equal(ev(`RG[${g(n)}].cr`), +lv, n);
+ assert.equal(ev('RG.length'), Object.values(want).flat().length, 'every model is classed');
+ assert.equal(ev("RG.filter(r=>r.v==='arrrhipster').some(r=>r.cr>=4)"), false, 'no Arrrhipster runs SRv6');
+ assert.equal(ev("RG.filter(r=>r.v==='disco'||r.v==='knockia').every(r=>r.cr===4)"), true, 'every Disco and Knockia does');
+ // Everything below its top, except the whitebox that does SRv6 natively and no MPLS at all.
+ assert.equal(ev(`[0,1,2,3,4].map(L=>rgCore(${g('Disco 8K')},L)).join()`), 'true,true,true,true,true');
+ assert.equal(ev(`[0,1,2,3,4].map(L=>rgCore(${g('Sonic the Whitebox 64')},L)).join()`), 'true,false,false,false,true');
+ assert.equal(ev(`[0,1,2].map(L=>rgCore(${g('Mikrowtik CCR')},L)).join()`), 'true,true,false');
+ // The two new ones go at the end, so saved POPs keep their models.
+ assert.equal(ev(g('Brocadabra MLX-16')), ev('RG.length') - 2);
+ assert.equal(ev("RG[RG_TOP].n"), 'The Router at the End of the Universe');
+ assert.equal(ev("RG_ART.length"), ev("RG.length"), 'a picture for each');
+ assert.equal(ev("mainRG(1)"), ev(g('Edge Lord 400')), 'the default upgrade path is unchanged');
+ assert.equal(ev(`PZ_RG.includes(${g('Brocadabra MLX-16')})`), false, 'puzzles keep their router list');
+ assert.deepEqual(errors, []);
+});
+
+test('a new network runs plain IGP: no Auto-TE until the backbone is upgraded, one step at a time', () => {
+ const { ev, dom, errors } = load();
+ ev(start);
+ assert.deepEqual(JSON.parse(ev('JSON.stringify(S.core)')), { lv: 0, run: 0 });
+ ev('ACT.buyTE()');
+ assert.equal(ev('!!S.te'), false, 'no Auto-TE on plain IGP');
+ ev("ACT.leftTab({t:'noc'})");
+ assert.match(dom.window.document.body.textContent, /Backbone/);
+ assert.match(dom.window.document.body.textContent, /Auto-TE needs an RSVP-TE/);
+ const cash = ev('S.cash');
+ ev('ACT.coreUp()');
+ assert.equal(ev('S.core.lv'), 1);
+ assert.equal(cash - ev('S.cash'), ev('CORE_COST[1]'));
+ ev('ACT.buyTE()');
+ assert.equal(ev('!!S.te'), false, 'LDP has no TE either');
+ ev('ACT.coreUp()');
+ assert.equal(ev('S.core.run'), 2);
+ ev('ACT.buyTE()');
+ assert.equal(ev('!!S.te'), true, 'RSVP-TE unlocks Auto-TE');
+ // Customer levels gate each step.
+ ev('S.lvl=3;ACT.coreUp()');
+ assert.equal(ev('S.core.lv'), 2, 'SR-MPLS needs customer level 5');
+ assert.deepEqual(errors, []);
+});
+
+test('running a lower level is free, and Auto-TE and RouteScript pause below RSVP-TE', () => {
+ const { ev, errors } = load();
+ ev(start + ";ACT.coreUp();ACT.coreUp();ACT.coreUp();ACT.buyTE();S.te.script='spill at 80%'");
+ assert.equal(ev('S.core.lv'), 3);
+ assert.ok(ev('!!teRules()'), 'RouteScript runs on SR-MPLS');
+ const cash = ev('S.cash');
+ ev('ACT.coreSet({v:1})');
+ assert.equal(ev('S.core.run'), 1);
+ assert.equal(ev('S.cash'), cash, 'free');
+ assert.equal(ev('teRules()'), null, 'paused on LDP');
+ ev('compute()');
+ assert.equal(ev('R.teMoved'), 0);
+ ev('ACT.coreSet({v:3})');
+ assert.ok(ev('!!teRules()'), 'back on, script and all');
+ ev('ACT.coreSet({v:4})');
+ assert.equal(ev('S.core.run'), 3, 'cannot run what was never bought');
+ assert.deepEqual(errors, []);
+});
+
+test('the core costs router CPU, less the higher it goes; POPs whose router cannot run it stay outside', () => {
+ const { ev, errors } = load();
+ ev(start + `;ACT.buildPop({city:'ams'});S.pops.fra.rgen=${g('Disco 8K')}`);
+ const cap = c => ev(`nodeCap('${c}')`);
+ const base = cap('fra');
+ const at = [];
+ for (let L = 1; L <= 4; L++) { ev('ACT.coreUp()'); at.push(cap('fra') / base); }
+ assert.deepEqual(at.map(x => +x.toFixed(2)), [0.9, 0.92, 0.95, 0.97], 'LDP costs the most CPU, SRv6 the least');
+ assert.equal(ev("inCore('ams')"), false, 'a Rusty Router cannot run SRv6');
+ assert.equal(cap('ams'), ev('RG[0].cap'), 'and pays no CPU for it');
+ assert.deepEqual(JSON.parse(ev('JSON.stringify(coreOut())')), ['ams']);
+ assert.deepEqual(errors, []);
+});
+
+test('label switching: traffic passing through a POP costs its router less from LDP up', () => {
+ const pass = lv => {
+ const { ev, errors } = load();
+ ev(start + ";ACT.buildPop({city:'ams'});ACT.buildPop({city:'bru'});ACT.launchBB({city:'ams'});S.pops.ams.bb.d=150");
+ ev(`for(const c in S.pops)S.pops[c].rgen=${g('Mikrowtik CCR')};S.pops.bru.rgen=${g('Chonk 800')};`);
+ ev("const L=(a,b,t)=>{openLinkModal(a,b);ACT.buildLink({tier:t});closeModal();};L('ams','bru',1);L('bru','fra',1);ACT.buyTransit({city:'fra',net:'cog',tier:1})");
+ for (let i = 0; i < lv; i++) ev('ACT.coreUp()');
+ ev('compute()');
+ assert.deepEqual(errors, []);
+ return { load: ev("R.nodeLoad.bru||0"), served: ev('R.served') };
+ };
+ const ip = pass(0), ldp = pass(1);
+ assert.ok(ip.served > 50 && Math.abs(ldp.served - ip.served) < 1, 'same traffic either way');
+ assert.ok(ldp.load < ip.load * 0.7, `Brussels only passes it on: lighter with labels (${ldp.load.toFixed(1)} vs ${ip.load.toFixed(1)})`);
+});
+
+test('interop failures: only with mixed vendors at the top of what some router can do', () => {
+ const { ev, errors } = load();
+ ev(start + `;ACT.buildPop({city:'ams'});S.pops.fra.rgen=${g('Disco 8K')};S.pops.ams.rgen=${g('Knockia 7750')};`);
+ ev("const L=(a,b,t)=>{openLinkModal(a,b);ACT.buildLink({tier:t});closeModal();};L('fra','ams',1)");
+ for (let i = 0; i < 4; i++) ev('ACT.coreUp()');
+ assert.ok(ev('coreIopRisk()') > 0, 'Disco and Knockia at SRv6, the top for both');
+ ev('ACT.coreSet({v:3})');
+ assert.equal(ev('coreIopRisk()'), 0, 'one step below: they get along');
+ ev('ACT.coreSet({v:4})');
+ ev(`S.pops.ams.rgen=${g('Disco 8K Ultra')}`);
+ assert.equal(ev('coreIopRisk()'), 0, 'one vendor never fights itself');
+ ev(`S.pops.ams.rgen=${g('Knockia 7750')};ACT.coreSet({v:2})`);
+ assert.equal(ev('coreIopRisk()'), 0, 'RSVP-TE is below both');
+ ev(`S.pops.fra.rgen=${g('Chonk 800')}`);
+ assert.ok(ev('coreIopRisk()') > 0, 'a Chonk 800 at RSVP-TE is at its top');
+ assert.ok(ev('coreIopRisk()') < ev('CORE_IOP[4]'), 'and RSVP-TE squabbles less than SRv6');
+ ev("fireFailure('interop')");
+ const inc = "S.inc.find(i=>i.type==='interop')";
+ assert.ok(ev(`!!${inc}`), 'an interop incident');
+ assert.equal(ev(`linkDown(S.links.find(l=>l.id===${inc}.ref))`), true, 'the link between the vendors is down');
+ assert.equal(ev("incTitle('interop')"), 'Vendor interop failure');
+ assert.deepEqual(errors, []);
+});
+
+test('a new game never gets interop incidents or CPU costs: the classic game is unchanged', () => {
+ const { ev, errors } = load();
+ ev(start + `;ACT.buildPop({city:'ams'});S.pops.ams.rgen=${g('Knockia 7750')};S.pops.fra.rgen=${g('Disco 8K')}`);
+ assert.equal(ev('coreIopRisk()'), 0);
+ assert.equal(ev("nodeCap('ams')"), ev(`RG[${g('Knockia 7750')}].cap`));
+ assert.deepEqual(errors, []);
+});
+
+test('saves: an old save with Auto-TE keeps it on the old rules, scenarios ignore the core, garbage is repaired', () => {
+ const { ev, errors } = load();
+ ev(start + ";ACT.coreUp();ACT.coreUp();ACT.buyTE()");
+ ev("const s=JSON.parse(JSON.stringify(S));delete s.core;window.__t=migrate(s)");
+ assert.deepEqual(JSON.parse(ev('JSON.stringify(__t.core)')), { lv: 2, run: 2, legacy: true }, 'Auto-TE bought before backbones: legacy RSVP-TE');
+ ev("S=__t;compute()");
+ assert.equal(ev('coreOn()'), false, 'the old rules');
+ assert.equal(ev('coreTE()'), true, 'Auto-TE keeps running');
+ ev('ACT.coreSet({v:2})');
+ assert.equal(ev('coreOn()'), true, 'changing the backbone switches to the new rules');
+ ev("const s=JSON.parse(JSON.stringify(S));delete s.core;delete s.te;window.__t=migrate(s)");
+ assert.deepEqual(JSON.parse(ev('JSON.stringify(__t.core)')), { lv: 0, run: 0 }, 'no Auto-TE: plain IGP');
+ ev("const s=JSON.parse(JSON.stringify(S));s.core={lv:9,run:-3,legacy:'yes'};window.__t=migrate(s)");
+ assert.deepEqual(JSON.parse(ev('JSON.stringify(__t.core)')), { lv: 4, run: 0 });
+ ev("S.scn={id:'x',rules:{},days:9};S.core={lv:0,run:0}");
+ assert.equal(ev('coreOn()'), false, 'scenarios set TE up themselves');
+ assert.deepEqual(errors, []);
+});
+
+test('the backbone panel and the router panels, on a phone too', () => {
+ for (const w of [1280, 360]) {
+ const { ev, dom, errors } = load();
+ ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip()");
+ ev(`window.innerWidth=${w};` + start.replace('ACT.start({});', '') + `;ACT.buildPop({city:'ams'});S.pops.fra.rgen=${g('Disco 8K')};ACT.coreUp();ACT.coreUp();ACT.leftTab({t:'noc'});renderAll()`);
+ const txt = dom.window.document.body.textContent;
+ assert.match(txt, /RSVP-TE\/MPLS/, `${w}px`);
+ assert.match(txt, /outside the backbone/, 'Amsterdam is left out');
+ assert.match(txt, /Upgrade to SR-MPLS/);
+ ev("UI.sel={type:'city',id:'fra'};UI.tab='links';UI.models=true;renderPanel()");
+ const p = dom.window.document.getElementById('panelBody').textContent;
+ assert.match(p, /Disco · backbone up to SRv6/);
+ assert.match(p, /Brocadabra · backbone up to RSVP-TE\/MPLS/);
+ assert.match(p, /Whitebox · backbone up to SRv6 · no MPLS, SRv6 only/);
+ assert.deepEqual(errors, []);
+ }
+});
diff --git a/tests/gameplay-rules.test.js b/tests/gameplay-rules.test.js
index fb1603c..2878099 100644
--- a/tests/gameplay-rules.test.js
+++ b/tests/gameplay-rules.test.js
@@ -100,7 +100,7 @@ const REAL_NAMES = [
// cables
'2Africa', 'Amitié', 'Dunant', 'EllaLink', 'Equiano', 'Grace Hopper', 'Hibernia Express', 'Jupiter', 'MAREA', 'PEACE', 'SEA-ME-WE 6',
// vendors
- 'Arista', 'Ciena', 'Cisco', 'Huawei', 'Infinera', 'Juniper', 'MikroTik', 'Nokia',
+ 'Arista', 'Brocade', 'Ciena', 'Cisco', 'Extreme Networks', 'Huawei', 'Infinera', 'Juniper', 'MikroTik', 'Nokia',
];
const { ev, errors } = load();
diff --git a/tests/i18n.test.js b/tests/i18n.test.js
index 29729c2..c111d8a 100644
--- a/tests/i18n.test.js
+++ b/tests/i18n.test.js
@@ -32,7 +32,7 @@ function tour(ev) {
for (const [label, src] of [['dash', 'ACT.dash({});ACT.dashClose()'], ['bank', 'ACT.bank();ACT.bankClose()'],
['help', 'showHelp();closeModal()'], ['menu', 'ACT.menu();closeModal()'], ['reset', 'ACT.resetAsk();closeModal()'],
['scenarios', 'scenarioModal();closeModal()'], ['trace', "traceModal('fra');closeModal()"],
- ['route script', 'ACT.buyTE();ACT.teEdit();ACT.teExample();ACT.teCheck();closeModal()'],
+ ['route script', 'S.lvl=Math.max(S.lvl,3);S.cash+=1e6;ACT.coreUp();ACT.coreUp();ACT.buyTE();ACT.teEdit();ACT.teExample();ACT.teCheck();closeModal()'],
['routers', "selectCity('fra');ACT.tab({t:'links'});ACT.models()"], ['vxc', "openVxcModal({from:'fra',to:'ams'});closeModal()"],
['tutorial', 'S.tut=0;renderCoach();S.tut=3;renderCoach();S.tut=null;renderCoach()'], ['win', 'showWin()']]) step(label, src);
const failSrc = ev('fireFailure.toString()');
diff --git a/tests/issues.test.js b/tests/issues.test.js
index f515607..ead2e88 100644
--- a/tests/issues.test.js
+++ b/tests/issues.test.js
@@ -139,7 +139,8 @@ test('Auto-TE spills overflow onto an alternate path when the shortest one is fu
ev("for(const c of ['ams','lon','par'])ACT.buildPop({city:c});const L=(a,b,t,v)=>{UI.via=v||null;openLinkModal(a,b);ACT.buildLink({tier:t});closeModal();};L('fra','ams',0);L('ams','lon',1,'uly');L('fra','par',1);L('par','lon',1,'chn');ACT.buyTransit({city:'lon',net:'lvl',tier:1});compute()");
const dem = ev("R.demand");
assert.ok(ev("R.served") < dem - 1, 'without TE the 10G link caps it');
- ev("ACT.buyTE();compute()");
+ // Auto-TE needs an RSVP-TE backbone, and routers that can run it: Chonk 800s.
+ ev("for(const c in S.pops)S.pops[c].rgen=RG.findIndex(r=>r.n==='Chonk 800');ACT.coreUp();ACT.coreUp();ACT.buyTE();compute()");
assert.ok(ev("R.served") > dem * 0.97, 'with TE nearly everything is served');
assert.ok(ev("R.teMoved") > 1);
assert.ok(ev("R.load[S.links.find(l=>l.a==='fra'&&l.b==='par').id]") > 1, 'the Paris path carries the overflow');
@@ -356,7 +357,7 @@ test('#31 #33 #38 connections overview lists every port, filters it and jumps to
const { ev, dom, errors } = load();
base(ev);
const doc = dom.window.document;
- ev("ACT.buildPop({city:'ams'});S.pops.fra.rgen=S.pops.ams.rgen=RG.length-1;S.pops.ams.bb={d:200};compute()");
+ ev("ACT.buildPop({city:'ams'});S.pops.fra.rgen=S.pops.ams.rgen=RG_TOP;S.pops.ams.bb={d:200};compute()");
ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'ams',net:'lvl',tier:1});ACT.buyIx({city:'ams~3',tier:1});ACT.buyIx({city:'ams',tier:1});compute()");
ev("S.pni.push({id:uid(),city:'fra',net:'ggl',tier:1});R.demTo.nfx=1e4;ACT.cache({city:'fra',net:'nfx'});R.demTo.nfx=1e4;ACT.cache({city:'fra',net:'nfx'});compute()");
const all = JSON.parse(ev('JSON.stringify(conns())'));
@@ -496,7 +497,7 @@ test('#42 the share card draws links across the date line on both edges of the m
test('#45 unplugged optics go on a spares shelf, get reused for free, or sold for 40%', () => {
const { ev, errors } = load();
base(ev);
- ev("S.lvl=4;ACT.buildPop({city:'ams'});S.pops.fra.rgen=S.pops.ams.rgen=RG.length-1;S.links.push({id:'df1',a:'fra',b:'ams',kind:'df',km:450,sys:'roadm',ch:[],ready:0,mo:500,day:0,cut:0});compute()");
+ ev("S.lvl=4;ACT.buildPop({city:'ams'});S.pops.fra.rgen=S.pops.ams.rgen=RG_TOP;S.links.push({id:'df1',a:'fra',b:'ams',kind:'df',km:450,sys:'roadm',ch:[],ready:0,mo:500,day:0,cut:0});compute()");
const o = ev("Object.keys(OPT).find(k=>!chWhy(S.links[0],k))");
const c0 = ev('S.cash');
ev(`ACT.addCh({id:'df1',o:'${o}'})`);
@@ -521,7 +522,7 @@ test('#45 unplugged optics go on a spares shelf, get reused for free, or sold fo
test('#35 your own trench can light another fiber pair once a ROADMaster is full', () => {
const { ev, errors } = load();
base(ev);
- ev("S.lvl=4;ACT.buildPop({city:'ams'});S.pops.fra.rgen=S.pops.ams.rgen=RG.length-1;S.pops.fra.routers=S.pops.ams.routers=RMAX;S.links.push({id:'own1',a:'fra',b:'ams',kind:'df',own:true,km:450,sys:'roadm',ch:[],ready:0,mo:500,day:0,cut:0});compute()");
+ ev("S.lvl=4;ACT.buildPop({city:'ams'});S.pops.fra.rgen=S.pops.ams.rgen=RG_TOP;S.pops.fra.routers=S.pops.ams.routers=RMAX;S.links.push({id:'own1',a:'fra',b:'ams',kind:'df',own:true,km:450,sys:'roadm',ch:[],ready:0,mo:500,day:0,cut:0});compute()");
assert.equal(ev("chMax(S.links[0])"), 64);
ev("ACT.addPair({id:'own1'})");
assert.equal(ev("S.links[0].pairs||1"), 1, 'not before the first pair is full');
diff --git a/tests/modes.test.js b/tests/modes.test.js
index 92c56c8..9048682 100644
--- a/tests/modes.test.js
+++ b/tests/modes.test.js
@@ -149,7 +149,7 @@ test('the map draws at every zoom, with and without animations, without throwing
test('RouteScript: parses safely, reports errors helpfully, and changes routing', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
- ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});ACT.buyTE();compute()");
+ ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});ACT.coreUp();ACT.coreUp();ACT.buyTE();compute()");
let p = JSON.parse(ev("JSON.stringify(teParse('spill at 80%\\ncap transit cogentle at 3 gbps\\nprefer ix for goggle\\nnonsense here\\navoid transit for gogle'))"));
assert.equal(p.errors.length, 2, 'the nonsense line and the typo fail');
assert.match(p.errors[1], /Did you mean Goggle/, 'typos get a suggestion');
@@ -176,7 +176,7 @@ test('RouteScript: parses safely, reports errors helpfully, and changes routing'
test('RouteScript BGP: local-pref and prepending move transit, protected customers go first, the optimizer drafts a script', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
- ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});ACT.buyTE();for(let i=0;i<30;i++)dayTick();compute()");
+ ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});ACT.coreUp();ACT.coreUp();ACT.buyTE();for(let i=0;i<30;i++)dayTick();compute()");
const use = n => ev(`R.useT[S.transit.find(t=>t.net==='${n}').id]||0`);
const p = JSON.parse(ev("JSON.stringify(teParse('prefer transit level tree\\navoid transit cogentle\\nprepend transit cogentle 2\\nprotect customers\\nprepend transit cogentle 9'))"));
assert.equal(p.n, 4);
@@ -435,7 +435,7 @@ test('#114 Only Spätzle-IX can be won by peering alone', () => {
test('RouteScript: help, ready-made scripts and the AI button', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
- ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});ACT.buyTE();compute()");
+ ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});ACT.coreUp();ACT.coreUp();ACT.buyTE();compute()");
// every ready-made script parses on a real network and is listed in the help
for (const id of JSON.parse(ev('JSON.stringify(TE_RECIPES.map(r=>r.id))')))
assert.deepEqual(JSON.parse(ev(`JSON.stringify(teParse(TE_RECIPES.find(r=>r.id==='${id}').src().join('\\n')).errors)`)), [], id);
diff --git a/tests/peering.test.js b/tests/peering.test.js
index 9377df9..003720d 100644
--- a/tests/peering.test.js
+++ b/tests/peering.test.js
@@ -30,7 +30,7 @@ test('Rackstar requests require enough Crowdflare traffic and a free router port
test('Rackstar serves cacheable Crowdflare traffic locally and overflow uses transit', () => {
const { ev, errors } = load();
setup(ev);
- ev("S.pops.fra.rgen=RG.length-1;S.pops.fra.bb={d:200/NSH.cfl};ACT.buyTransit({city:'fra',net:'cog',tier:PORT.length-1});ACT.lagT({id:S.transit[0].id,d:1});ACT.lagT({id:S.transit[0].id,d:1});compute()");
+ ev("S.pops.fra.rgen=RG_TOP;S.pops.fra.bb={d:200/NSH.cfl};ACT.buyTransit({city:'fra',net:'cog',tier:PORT.length-1});ACT.lagT({id:S.transit[0].id,d:1});ACT.lagT({id:S.transit[0].id,d:1});compute()");
const transit = ev('R.useT[S.transit[0].id]');
ev("ACT.cache({city:'fra',net:'cfl'})");
assert.equal(ev('R.useCache[S.caches[0].id]'), ev('CACHE_CAP'), 'first box fills to 100G');
@@ -219,7 +219,7 @@ test('Amsterdam has FRIES-IX, with free 10G and 100G ports and paid larger ports
const { ev, errors } = load();
setup(ev);
assert.deepEqual(JSON.parse(ev("JSON.stringify(ixIdsIn('ams'))")), ['ams', 'ams~2', 'ams~3']);
- ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG.length-1;compute()");
+ ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG_TOP;compute()");
const cash = () => ev('S.cash');
let c0 = cash();
assert.equal(ev("ixPortMo('ams~3',0)"), 0, '10G port is free');
@@ -274,7 +274,7 @@ test('community exchanges are wired up in every city, and Barcelona has Catnip-I
assert.equal(ev("ixName('bcn')"), 'Catnip-IX');
for (const k of exchanges) {
const c = k.split('~')[0];
- ev(`if(!S.pops.${c})ACT.buildPop({city:'${c}'});S.pops.${c}.rgen=RG.length-1;ACT.buyIx({city:'${k}',tier:1});ACT.rs({city:'${k}'})`);
+ ev(`if(!S.pops.${c})ACT.buildPop({city:'${c}'});S.pops.${c}.rgen=RG_TOP;ACT.buyIx({city:'${k}',tier:1});ACT.rs({city:'${k}'})`);
assert.equal(ev(`S.ixp['${k}']`), 1, `port at ${k}`);
}
ev('compute()');
diff --git a/tests/pni-all.test.js b/tests/pni-all.test.js
index c6ba3b0..60e8e23 100644
--- a/tests/pni-all.test.js
+++ b/tests/pni-all.test.js
@@ -5,7 +5,7 @@ const { load } = require('./harness');
function setup(ev, cities = []) {
ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0");
for (const city of cities) ev(`ACT.buildPop({city:'${city}'})`);
- ev('for(const p of Object.values(S.pops))p.rgen=RG.length-1;compute()');
+ ev('for(const p of Object.values(S.pops))p.rgen=RG_TOP;compute()');
}
test('bulk PNIs add missing shared POPs and upgrade smaller ports once, preserving existing orders and LAGs', () => {
diff --git a/tests/pni-global.test.js b/tests/pni-global.test.js
index 9661a0d..21f83ce 100644
--- a/tests/pni-global.test.js
+++ b/tests/pni-global.test.js
@@ -3,13 +3,13 @@ const assert = require('node:assert/strict');
const { load } = require('./harness');
function setup(ev) {
- ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;S.pops.fra.rgen=RG.length-1;compute()");
+ ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;S.pops.fra.rgen=RG_TOP;compute()");
}
test('global PNIs cover every eligible network and shared POP, including the long tail, in one transaction', () => {
const { dom, ev, errors } = load();
setup(ev);
- ev(`ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG.length-1;
+ ev(`ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG_TOP;
S.pni.push({id:'small',net:'cfl',city:'fra',tier:0,n:2,site:'ab',pref:'high'},
{id:'big',net:'drz',city:'ams',tier:2},
{id:'pending',net:'nfx',city:'fra',tier:1,ready:S.day+30});
@@ -139,7 +139,7 @@ test('the global batch, now in the Ops sheet, preserves scope, keyboard focus an
test('bulk PNIs follow each network\'s own minimum port and lead time (pniMin, pniLead)', () => {
const { ev, errors } = load();
setup(ev);
- ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG.length-1;compute();for(const n of NETS)R.demTo[n.id]=1e4");
+ ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG_TOP;compute();for(const n of NETS)R.demTo[n.id]=1e4");
// Ask everyone for 10G: networks that start at 100G get 100G, the rest get 10G.
const b = JSON.parse(ev('JSON.stringify(pniBatch(null,0))'));
const big = b.orders.filter(q => ev(`pniMin('${q.net}')`) > 0), small = b.orders.filter(q => ev(`pniMin('${q.net}')`) === 0);
diff --git a/tests/routing-reference.test.js b/tests/routing-reference.test.js
index 2fb7538..3fe9e05 100644
--- a/tests/routing-reference.test.js
+++ b/tests/routing-reference.test.js
@@ -33,7 +33,7 @@ test('indexed routing matches the simple allocation loop across network changes'
const changes = [
'',
"S.pni.forEach((p,i)=>p.pref=i%3===0?'high':i%3===1?'low':'normal')",
- "S.te={on:true,script:''}",
+ "S.te={on:true,script:''};S.core={lv:2,run:2,legacy:true}",
"S.te.script='prefer pni for goggle\\nspill at 80%\\navoid transit for netchill'",
"S.te.script='prefer transit Cogentle\\nprepend transit Cogentle 2\\nprotect customers'",
"S.ev.rpki={nets:['ggl','nfx'],until:S.day+3};S.ev.depeer=S.day+3",
@@ -66,7 +66,7 @@ test('indexed routing matches the simple allocation loop on a network of islands
const changes = [
'',
"S.pni.forEach((p,i)=>p.pref=i%3===0?'high':i%3===1?'low':'normal')",
- "S.te={on:true,script:'prefer pni for goggle\\nspill at 80%'}",
+ "S.te={on:true,script:'prefer pni for goggle\\nspill at 80%'};S.core={lv:2,run:2,legacy:true}",
"S.ev.ddos={city:'fra',until:S.day+3,gbps:300,vec:'syn',entry:{k:'edge'}}",
"S.links[0].cut=S.day+2",
"S.te=null;S.links[0].cut=0;S.links.push({id:'join',a:'par',b:'pek',kind:'wave',tier:2,km:8000,cut:0,mo:100})",
diff --git a/tests/speed.test.js b/tests/speed.test.js
index 936952b..2b03e05 100644
--- a/tests/speed.test.js
+++ b/tests/speed.test.js
@@ -303,7 +303,7 @@ test('fast routing gives exactly the same result as the plain path it replaces',
for(const c of cs)for(const x of ixIdsIn(c)){try{ACT.buyIx({city:x,tier:1});}catch(e){}if(S.dk&&S.dk.q){S.dk.q=null;closeModal();}if(S.ixp[x]!==undefined&&!S.rs[x])ACT.rs({city:x});}
compute();for(const n of NETS)for(const c of cs)if(n.pops.includes(c)&&peerOk(n.id,'pni',c).ok&&S.pni.length<150)S.pni.push({id:'p'+n.id+c,net:n.id,city:c,tier:1,n:1});
for(const n of NETS.filter(n=>n.cache))for(const c of cs.slice(0,15))for(const k of [1,2])S.caches.push({id:'c'+k+n.id+c,city:c,net:n.id,site:'a'});
- if(S.pni[3])S.pni[3].pref='high';if(S.transit[1])S.transit[1].pref='low';S.te={on:true,day:0};S.nextFail=1e9;S.nextEvent=1e9;`);
+ if(S.pni[3])S.pni[3].pref='high';if(S.transit[1])S.transit[1].pref='low';S.te={on:true,day:0};S.core={lv:2,run:2,legacy:true};S.nextFail=1e9;S.nextEvent=1e9;`);
const sig = () => ev(`JSON.stringify({served:R.served,demand:R.demand,reach:R.reach,peered:R.peered,teMoved:R.teMoved,egT:R.egT,
srv:Object.keys(R.citySrv).sort().map(c=>[c,R.citySrv[c]]),load:S.links.map(l=>R.load[l.id]||0),node:Object.keys(R.nodeLoad).sort().map(c=>[c,R.nodeLoad[c]]),
t:Object.keys(R.useT).sort().map(k=>[k,R.useT[k]]),p:Object.keys(R.usePni).sort().map(k=>[k,R.usePni[k]]),ix:Object.keys(R.useIx).sort().map(k=>[k,R.useIx[k]]),c:Object.keys(R.useCache).sort().map(k=>[k,R.useCache[k]])})`);
@@ -326,11 +326,11 @@ test('Auto-TE routes around a full link exactly like the plain path', () => {
plainCompute(ev);
// Frankfurt reaches its only upstream in Amsterdam over a 10G wave, or the long way through Brussels on 800G.
ev(`ACT.start({});S.cash=1e12;S.lvl=13;for(const g of GOALS)S.done[g.id]=0;for(const c of ['ams','bru'])ACT.buildPop({city:c});
- for(const c of ['fra','ams','bru']){S.pops[c].rgen=RG.length-1;S.pops[c].routers=RMAX;}if(!S.pops.fra.bb)ACT.launchBB({city:'fra'});S.pops.fra.bb.d=CITY.fra.P*0.8;
+ for(const c of ['fra','ams','bru']){S.pops[c].rgen=RG_TOP;S.pops[c].routers=RMAX;}if(!S.pops.fra.bb)ACT.launchBB({city:'fra'});S.pops.fra.bb.d=CITY.fra.P*0.8;
const L=(a,b,t)=>{UI.via=null;UI.lmode='wave';UI.route='main';openLinkModal(a,b);ACT.buildLink({tier:t});closeModal();};
L('fra','ams',0);L('fra','bru',3);L('bru','ams',3);
S.transit=[];const t=NETS.find(n=>n.price&&n.pops.includes('ams')&&n.type==='t1');ACT.buyTransit({city:'ams',net:t.id,tier:3});
- S.ixp={};S.pni=[];S.caches=[];S.te={on:true,day:0};S.nextFail=1e9;S.nextEvent=1e9;`);
+ S.ixp={};S.pni=[];S.caches=[];S.te={on:true,day:0};S.core={lv:2,run:2,legacy:true};S.nextFail=1e9;S.nextEvent=1e9;`);
const sig = () => ev('JSON.stringify({served:R.served,teMoved:R.teMoved,egT:R.egT,load:S.links.map(l=>R.load[l.id]||0),node:R.nodeLoad,t:R.useT})');
for (const script of ['', 'spill at 70%']) {
ev(`S.te.script=${JSON.stringify(script)}`);
diff --git a/tests/utilities-caches.test.js b/tests/utilities-caches.test.js
index c9bfbe6..1543587 100644
--- a/tests/utilities-caches.test.js
+++ b/tests/utilities-caches.test.js
@@ -110,7 +110,7 @@ test('cache requests reject stale eligibility and insufficient port capacity ato
test('balanced caches keep serving when either site fails', t => {
const { ev, errors } = setup(t);
- ev("Object.assign(S.pops.fra,{site2:true,routers:2,rgen:RG.length-1,bb:{d:5000}});S.caches=[{id:'one',city:'fra',net:'ggl'},{id:'two',city:'fra',net:'ggl'}];compute();ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost})");
+ ev("Object.assign(S.pops.fra,{site2:true,routers:2,rgen:RG_TOP,bb:{d:5000}});S.caches=[{id:'one',city:'fra',net:'ggl'},{id:'two',city:'fra',net:'ggl'}];compute();ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost})");
for (const site of ['a', 'b']) {
ev(`S.inc=[{id:'site-failure',type:'site',ref:'fra',site:'${site}',until:S.day+2}];compute()`);
assert.ok(ev('Object.values(R.useCache).reduce((a,b)=>a+b,0)') > 0);