diff --git a/CHANGELOG.md b/CHANGELOG.md index 086c892..f9c6f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Traceroute no longer shows an "embedded cache in your rack" hop on paths that leave over transit, an exchange or a PNI. Only traffic that really ends at one of your cache boxes shows it now. + ## [2.6.0] — 2026-11-03 - New Best Effort mode, the gentlest way to play: rare outages, no DDoS, no chaos monkey, no conferences and no cable ships, with sea cuts that mend on their own. PNIs are up the moment you order them, customers are more patient, a rescue loan from the Ministry of Tubes replaces game over, builds take days and prices never spike. A new Quiet notifications setting, on by default in Best Effort and available in every mode, only pops up trouble and milestones; everything else goes into the NOC log. diff --git a/src/game/60-features/50-traceroute.js b/src/game/60-features/50-traceroute.js index ce195c1..cb35437 100644 --- a/src/game/60-features/50-traceroute.js +++ b/src/game/60-features/50-traceroute.js @@ -40,7 +40,7 @@ function traceroute(src,to){const P=trPaths(src),me=slug(S.name)+'.net',lines=[] else if(e.k==='p'){hop(`pni-${slug(NET[e.via||N.id].name)}.${e.city}.${me}`,ip(hstr(N.id),3),0.2,tr('traceroute.private_cross_connect'));} // Down the cone one customer at a time: the shortest chain of upstreams from the peer to the network, each AS on the path. if(e.via){const ch=coneChain(e.via,N.id);for(let i=0;iS.day?35:20}):''; diff --git a/tests/traceroute.test.js b/tests/traceroute.test.js new file mode 100644 index 0000000..a0caf05 --- /dev/null +++ b/tests/traceroute.test.js @@ -0,0 +1,21 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); + +test('traceroute shows an embedded cache hop only when a cache is the exit', () => { + const { ev, errors } = load(); + ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0"); + ev("S.pops.fra.bb={d:20/NSH.cfl};ACT.buyTransit({city:'fra',net:'cog',tier:1});compute()"); + // The hops, without the "traceroute to …" header line. + const trace = () => { const r = ev("traceroute('fra',{net:'cfl'})"); return { ...r, hops: r.text.split('\n').slice(1).join('\n') }; }; + const before = trace(); + assert.match(before.why, /Cogentle/, 'over transit'); + assert.doesNotMatch(before.hops, /cache-|embedded cache/, 'no cache hop without a cache'); + assert.match(before.hops, /www\.crowdflare\.example/, 'ends at the network itself'); + ev("ACT.cache({city:'fra',net:'cfl'});compute()"); + assert.equal(ev('S.caches.length'), 1); + const after = trace(); + assert.match(after.hops, /cache-crowdflare\.fra\..*embedded cache in your rack$/, 'the cache is the last hop'); + assert.doesNotMatch(after.hops, /cogentle|www\.crowdflare/, 'nothing leaves the network'); + assert.deepEqual(errors, []); +});