Merge branch 'claude/latency-contracts' into trial

# Conflicts:
#	.claude/skills/gameplay-rules/SKILL.md
#	CHANGELOG.md
#	tests/day-steps.test.js
#	tests/route-fuzz.test.js
This commit is contained in:
Frederic Jung 2026-11-10 09:36:11 +00:00
commit e8cbb9b440
No known key found for this signature in database
45 changed files with 1147 additions and 47 deletions

View file

@ -239,6 +239,10 @@ const API_CMD={
/* ---------- customers ---------- */
accept:{args:[['id','entityId']],
doc:'Sign a pending offer. Rejected without a POP in every city it needs, 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.'},
acceptFix:{args:[['id','entityId'],['cost','integer',false]],watch:['pops','biz','offers'],
quote:a=>{const q=S?reqFix(S.offers.find(x=>x.id===a.id)):null;return q?{setup:q.cost,monthly:q.mo}:{setup:0};},
pass:a=>({id:a.id,cost:a.cost??((reqFix(S.offers.find(x=>x.id===a.id))||{}).cost)}),
doc:'Buy what an offer asks for at POPs you already have (backup generator, a second router, a second site), then sign it. Pass the quoted setup as cost; the game checks it still matches.'},
decline:{args:[['id','entityId']],
doc:'Throw an offer away.'},
salesHire:{args:[['id','salesPersona']],
@ -402,6 +406,22 @@ const API_CMD={
quote:a=>{const q=S?utilityKit(a.city):null;return q?{setup:q.cost,monthly:q.mo}:{};},
pass:a=>({city:a.city,cost:a.cost??((utilityKit(a.city)||{}).cost)}),
doc:'Install the POP redundancy kit in one go: generator, second building, a second router, and the cache boxes balanced between sites. Pass the quoted setup as cost; the game checks it still matches. Nothing to do reads as no_effect.'},
utilityKitAll:{args:[['cost','integer',false],['city','cityId',false]],watch:['pops','caches'],
quote:a=>{const q=S?utilityKitAll():null;return q?{setup:q.cost,monthly:q.mo}:{setup:0};},
pass:a=>({city:a.city,cost:a.cost??((utilityKitAll()||{}).cost)}),
doc:'Install the redundancy kit at every POP still missing part of it, at one quoted price. From customer level 2. Pass the quoted setup as cost.'},
utilityKitNew:{args:[['city','cityId',false]],watch:['ops'],
doc:'Put the redundancy kit in the intern\'s new-POP template, or take it out (the same switch as in the Ops sheet).'},
ptSave:{args:[['city','cityId'],['k','popTier']],watch:['popTiers'],
doc:'Save a POP\'s routers (model and count) as one of three POP standards: micro, medium or hub. The POP is marked as that kind. From customer level 2.'},
ptApply:{args:[['city','cityId'],['k','popTier'],['cost','integer',false]],watch:['pops.#city','popTiers'],
quote:a=>{const q=S?ptPlan(a.city,a.k):null;return q?{setup:q.cost,monthly:q.mo,blocked:q.why?[q.why]:[]}:{setup:0};},
pass:a=>({city:a.city,k:a.k,cost:a.cost??((S&&ptPlan(a.city,a.k))||{cost:0}).cost}),
doc:'Mark a POP as one kind and bring its routers up to that standard: add routers, swap to the standard\'s model if it is bigger. Never a step down. Pass the quoted setup as cost.'},
ptAll:{args:[['k','popTier'],['cost','integer',false],['city','cityId',false]],watch:['pops','popTiers'],
quote:a=>{const A=S?ptAll(a.k):null;return A?{setup:A.cost}:{setup:0};},
pass:a=>({k:a.k,city:a.city,cost:a.cost??(ptAll(a.k)||{}).cost}),
doc:'Bring every POP marked as one kind up to that standard, at one quoted price. Pass the quoted setup as cost.'},
utilityCaches:{args:[['city','cityId'],['quote','string',false]],watch:['caches'],
quote:a=>{const q=S?utilityCaches(a.city):null;return q?{key:q.key}:{};},
pass:a=>({city:a.city,quote:a.quote??((utilityCaches(a.city)||{}).key)}),
@ -530,6 +550,9 @@ const API_VIEW={
pniFilter:{args:[['f','pniFilter']],doc:'Filter the PNI list: all, via transit, worth it, already PNI.'},
pniGrp:{args:[['g','string'],['o','boolean',false]],doc:'Fold or unfold one group of the PNI list.'},
pniSort:{args:[],doc:'Flip the PNI list sort between A-Z and worth-it-first.'},
netFind:{args:[['q','string']],doc:'Filter a POP\'s transit, exchange, PNI and cache lists by network name or AS number.'},
netOnly:{args:[],doc:'Show only the networks you are connected to in a POP\'s lists, or all of them again.'},
netClear:{args:[],doc:'Clear the network search and the connected-only switch.'},
puzzleMenu:{args:[],doc:'Open the puzzle list.'},
puzzleDoor:{args:[],doc:'From the title screen: open the puzzle list (keeps the typed name).'},
pzFinish:{args:[],doc:'Puzzles only: run the star count and show the results sheet.'},