Express fiber: light a wave through a city without its router (#58)

An express lightpath runs from A to C over your own or IRU dark fibers
A-B, B-C (up to six) and passes B through its ROADM as light: ports only
at its two ends, no hop in B, the fibers' latency added up. It takes one
channel slot on every fiber it rides, needs a ROADM line system on each,
and an optic that makes the whole run between regen sites. Routing, the
route worker, traceroute, diverse paths and saves see it as a link A-C.

A cut, a build, an amp or ROADM failure or a line system swap on any
fiber under it darkens it; backhoes and the chaos monkey still find
fibers that only carry expresses. "Express to..." on a fiber and an
Express tab in the link window plan one, with reach, slots per fiber and
the price. The intern's optics order leaves fibers that only carry
expresses bare, decom never hands one back, and the build standard keeps
a fiber's line system while an express on it carries traffic.
This commit is contained in:
jvanvik 2026-11-07 01:06:30 +01:00
parent eac0604300
commit 8e1f2d66a5
41 changed files with 883 additions and 53 deletions

View file

@ -123,7 +123,7 @@ const API_CMD={
quote:a=>{const A=a.a,B=a.b,tier=a.tier;
if(!S.pops[A])return {blocked:[linkFromWhy(A)]};
if(!waveOk(A,B,tier))return {blocked:[tr('links.a_wave_wave_needs_need_at',{wave:LT[tier].n,need:waveNeed(tier)})]};
const sib=pairLinks(A,B).filter(l=>l.kind!=='vxc'),jn=sib.length?routeJoin(A,B):null,border=cnCity(A)!==cnCity(B);
const sib=pairLinks(A,B).filter(l=>l.kind!=='vxc'&&l.kind!=='xp'),jn=sib.length?routeJoin(A,B):null,border=cnCity(A)!==cnCity(B);
const mult=(sib.length&&!(jn&&jn.k===(landTrenches(A,B)[0]||{}).k)?DIVERSE:1)*(border?3*((a.premiumCrossing&&(A==='hkg'||B==='hkg'))?1.6:1):1);
const wr=waveRoute(A,B,mult,border);if(!wr)return {blocked:[tr('links.no_cable_available_for_that_route')]};
const blocked=[],so=soldOut(A,B,tier,wr.cab);
@ -230,6 +230,13 @@ const API_CMD={
setChCount:{args:[['id','entityId'],['o','opticId'],['n','integer']],watch:['links.#id'],
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l?{setup:opticCountCost(l,a.o,a.n)}:{};},
doc:'Set how many channels of one optic model a dark-fiber span carries, in one change. Added optics come from the spares shelf when you have them (regen cards still cost their share); removed ones go back to the shelf.'},
xpBuild:{args:[['a','cityId'],['b','cityId'],['via','string'],['o','opticId']],
quote:a=>{const sp=xpParse(a.a,a.b,a.via);if(!sp||!OPT[a.o])return {setup:0,blocked:[tr('express.no_such_path')]};const old=xpFind(a.a,a.b,sp.map(s=>s.id));
return {setup:xpCost(sp,a.o,!old),blocked:[xpWhy(a.a,a.b,sp,a.o)].filter(Boolean)};},
doc:'Light an express lightpath from a to b straight through the ROADMs of the cities between: via is the ids of your ROADM dark fibers (land, own or IRU) in order from a, comma-separated, 2 to 6 of them. One optic, one channel slot on every fiber, ports only at a and b, and the light must reach the whole run between regen sites. The same path again adds a channel to that express. Give one up with rmLink.'},
xpCh:{args:[['id','entityId'],['o','opticId'],['d','step']],watch:['links.#id'],
quote:a=>{const l=S.links.find(x=>x.id===a.id),sp=l&&l.kind==='xp'&&xpSpans(l);if(!sp||!OPT[a.o]||a.d<0)return {setup:0};return {setup:xpCost(sp,a.o,false),blocked:[xpWhy(l.a,l.b,sp,a.o)].filter(Boolean)};},
doc:'Add (d:1) or unplug (d:-1) one channel of an optic on an express lightpath; unplugged optics go on the spares shelf. The last channel stays: rmLink gives the express up.'},
/* ---------- customers ---------- */
accept:{args:[['id','entityId']],
doc:'Sign a pending offer. Rejected without a POP in every city it needs, without the IPv4 addresses it needs (rule ip4: see the bank\'s Address space), without free channels for a wave sale, or after an event\'s start date. Extra waves for a carrier you already serve grow that contract.'},
@ -574,6 +581,7 @@ const API_BOUND={
via:{command:'buildLink',arg:'cable'},
route:{command:'buildLink',arg:'route'},
dfMode:{command:'orderDf',note:'opens the dark-fiber modal',arg:'a/b'},
xpOpen:{command:'xpBuild',note:'opens the link window on its Express tab: the ways your ROADM fibers chain from a to b (via, fiber ids comma-separated, puts that path first)',arg:'a/b/via'},
dfSrc:{command:'orderDf',arg:'source'},
dfSys:{command:'orderDf',arg:'system'},
seaDesign:{command:'orderCable',arg:'design'},