The build standard owns the router model and the line system; one owner per fiber

The routers order reads its model from the build standard (bstd().g, 'keep'
is the old next-model-up rule) and the optical upgrade order its line system
(bstd().sys). The Ops sheet shows "From the build standard: X" with a button
to the sheet. Old saves move a model or line system from an order that was
running into the standard when it has none of its own; a paused order's or
an unhired intern's setting is dropped. opsParam refuses model/sys and points
at bstdSet.

The build standard's order is a generator now: every first job that takes a
fiber dark goes through the optical order's routing test (opsDark, in the
route worker in play), under one shared budget of dark swaps a night (two for
Kevin) and the week-long memory for a failed fiber. A fiber one order worked
on is the other's no more that shift, and decom keeps waves the standard just
upgraded. The plan is checked at every job, since the shift rests between
them: a POP gone or changed by hand meanwhile is skipped. The button still
runs the whole plan at once on the page.
This commit is contained in:
jvanvik 2026-11-07 06:55:01 +01:00
parent 032470f486
commit fbae6fc3ed
22 changed files with 573 additions and 138 deletions

View file

@ -343,6 +343,33 @@ test('a list in a sheet sends its own arguments with the value picked: the build
assert.deepEqual(s.errors(), []);
});
test('the router model and the line system are set in the build standard only: the orders\' old settings point there', () => {
const { s, T, ev } = sandbox({ pops: [] });
act(T, 'opsHire', { id: 'annie' });
ev('closeModal()');
for (const k of ['routers', 'optup']) act(T, 'opsToggle', { k });
ev('closeModal()');
assert.throws(() => act(T, 'opsParam', { k: 'routers', p: 'model', v: '1' }), /routers order takes its router model from the build standard: set it with bstdSet \(k "g"\)/);
assert.throws(() => act(T, 'opsParam', { k: 'optup', p: 'sys' }), /optup order takes its line system from the build standard: set it with bstdSet \(k "sys"\)/);
assert.equal(ev("JSON.stringify([S.ops.p.routers||{},S.ops.p.optup||{},S.popStd])"), '[{},{},null]', 'nothing changed');
act(T, 'opsParam', { k: 'routers', p: 'how' });
assert.equal(ev("opsP('routers','how')"), 'add', 'its other settings still step');
ev('closeModal()');
// The catalog of orders has no such settings; the docs say where they went.
const O = T('catalog', { name: 'OPSK' });
const ps = JSON.stringify(O);
assert.doesNotMatch(ps, /"model"|"sys"/);
assert.match(T('schema', { section: 'commands' }).opsParam.doc, /bstdSet k "g" and k "sys"/);
// Set there, both orders use it; the Ops sheet says so, with the way to the sheet.
act(T, 'bstdSet', { k: 'sys', v: '2' });
assert.equal(ev('bstd().sys'), 'cl');
act(T, 'opsOpen');
const sc = T('screen');
assert.match(sc.text, /From the build standard: ROADMaster 9000 C\+L/);
assert.ok(sc.buttons.some((b) => b.act === 'bstdOpen'), 'a button to the build standard');
assert.deepEqual(s.errors(), []);
});
test('new_game takes your own ASN and the sandbox chaos dial', () => {
const s = createSession(), T = tools(s), ev = (x) => s.game.ev(x);
assert.equal(T('new_game', { city: 'ams', asn: 213337, seed: 2 }).asn, 213337);