Merge upstream: POP standards, latency contracts, device transfer, typed links and NOC downgrades (3.4.0, 3.5.0)
Some checks are pending
CI / plan (push) Waiting to run
CI / part (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / translations (push) Waiting to run
CI / test (push) Blocked by required conditions
CI / timings (push) Blocked by required conditions
Container image / gate (push) Waiting to run
Container image / test (push) Blocked by required conditions
Container image / publish (push) Blocked by required conditions
Some checks are pending
CI / plan (push) Waiting to run
CI / part (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / translations (push) Waiting to run
CI / test (push) Blocked by required conditions
CI / timings (push) Blocked by required conditions
Container image / gate (push) Waiting to run
Container image / test (push) Blocked by required conditions
Container image / publish (push) Blocked by required conditions
Conflicts, file by file:
- CHANGELOG.md: the fork's Unreleased bullets on top; 3.5.0 and 3.4.0 exactly as upstream has them.
- src/i18n/en.js, site/i18n/{de,es,fr,it,pt}.js: merged label by label, sorted; the labels each side dropped stay dropped.
- src/agent/10-domains.js, 30-docs.js, 40-read.js: both sides' enums, state docs and tables (popStd as the build standard, popTiers, ip4, mp).
- src/agent/20-commands.js: the fork's wording on accept and upRouter, upstream's acceptFix, utilityKitAll/New and pt*; theme, session and transfer acts in the local table.
- src/game/60-features/80-new-game.js: ip4, rgen and mp next to popTiers.
- src/game/80-simulation/29-route-core.js, 30-compute.js: the route core takes both SATN and the spill tiers (TT).
- src/game/80-simulation/40-billing.js: upstream's gulfPair and borderShut; linkCut() is built on borderShut, linkDown() keeps express and satellite.
- src/game/80-simulation/50-sanitize.js: PNI bundles up to PNI_LAG_MAX next to the fork's link kinds; popStdSanitize then ptSanitize; mpSanitize then lcSanitize.
- src/game/80-simulation/75-customer-lifecycle.js: clGrow() stops at a type's most (#137) and at an IPv4 block that is not free (#150).
- src/game/90-actions/60-links.js: rmLink keeps the express guard and moves on to the next parallel link (#119).
- src/game/90-actions/85-routing-and-routers.js: rmRouter checks the PNIs on its routers (#323), upRouter keeps own().
- src/game/90-actions/89-game-and-settings.js: the menu keeps the build standard and session tiles and gains Send to another device.
- src/game/93-ui/40-hud-and-panels.js, 70-link-panels.js: offers show both the IPv4 note and Buy and sign; link headers name their cities, the closed-border section reads in dark mode; the express count stays.
- src/game/93-ui/50-city-panel.js: the teleport section and Link to a city.
- src/game/94-dashboard/40-connections.js: upstream's per-table next port size replaces the fork's own 400G guard.
- src/game/94-dashboard/90-noc-window.js, 96-map/95-clicks.js, 99-loop.js: both sides' acts and boot steps.
- src/styles/40-modal.css: the dark-mode tag tokens and the transfer textarea.
- tests/mcp-commands.test.js: both sides' sample args.
Interaction fixes:
- POP standards and the build standard: a POP marked as a kind keeps its kind's routers (ptKind). The build
standard's router jobs and the intern's model swaps leave it alone; every other target still applies. Both sheets say so.
- Spill tiers: pathMs() fills a path's ground latency and satellite edges too, so a tier's detour costs users its
latency (it went uncharged before).
- Send to another device: a session network goes by the session's own #mp= link; its save file is called a copy.
- Buy and sign (#241) does not buy for an offer whose IPv4 block does not fit.
- Dark mode: the closed-border title and the renewal ticks use the dark-aware red (upstream's #292 test follows).
- Server-run tables: the new acts classified (pt*, acceptFix and utilityKitAll quote their cost); mp-sim fixtures
written again with tests/lib/mp-sim-fixtures.js.
Review fixes:
- POP standards: ptSave, ptApply, ptPlan, ptAll and popStdSet find a POP with own(), so 'toString' is no POP (also
decomToggle, decomGo, dkStay).
- Server-run envelope: an arg value that names anything on Object.prototype is refused, in args, drafts and
ctx.win.ui.
- Decommissioning a POP drops its POP-standard mark, so live state stays what a reload makes of it (the T2 gate
refused later pt* acts).
- acceptFix, ptApply, ptAll and utilityKitAll take a quote within 1% (quoteNear), like utilityKit and bstdApply:
router prices drift daily.
- The transfer paste box reads in dark mode (--text, as input.t).
- A session's #mp= link pasted under From another device opens it (saved, then loaded again with it), in MP builds.
- The express and satellite circuit panels name their cities as links (#196); a circuit shows the closed-border
section (#329).
- CHANGELOG: the fork's 400G connections bullet goes (3.5.0 ships it); bullets for POP kinds, the session link and Buy
and sign's IPv4 check.
This commit is contained in:
commit
08eb349d87
113 changed files with 2674 additions and 161 deletions
|
|
@ -12,6 +12,7 @@
|
|||
// Acts that change the game: the page sends them, the server runs them as a click (ACT[act](args)).
|
||||
const SEND = [
|
||||
'accept',
|
||||
'acceptFix',
|
||||
'ad',
|
||||
'addCh',
|
||||
'addGen',
|
||||
|
|
@ -127,6 +128,9 @@ const SEND = [
|
|||
'pniChase',
|
||||
'popStdClear',
|
||||
'popStdSet',
|
||||
'ptAll',
|
||||
'ptApply',
|
||||
'ptSave',
|
||||
'regen',
|
||||
'renameGo',
|
||||
'renewLet',
|
||||
|
|
@ -183,6 +187,8 @@ const SEND = [
|
|||
'upVxc',
|
||||
'utilityCaches',
|
||||
'utilityKit',
|
||||
'utilityKitAll',
|
||||
'utilityKitNew',
|
||||
'utilityPeers',
|
||||
'utilityRouteServers',
|
||||
'xpBuild',
|
||||
|
|
@ -228,6 +234,7 @@ const LOCAL = [
|
|||
'dfSys',
|
||||
'exportSave',
|
||||
'findGo',
|
||||
'findLink',
|
||||
'findOpen',
|
||||
'focusCity',
|
||||
'goConn',
|
||||
|
|
@ -244,6 +251,7 @@ const LOCAL = [
|
|||
'langSet',
|
||||
'leaseSwap',
|
||||
'leftTab',
|
||||
'linkTo',
|
||||
'listMore',
|
||||
'logAll',
|
||||
'logOpen',
|
||||
|
|
@ -266,8 +274,11 @@ const LOCAL = [
|
|||
'mpShare',
|
||||
'mpStart',
|
||||
'mute',
|
||||
'netClear',
|
||||
'netFilter',
|
||||
'netFind',
|
||||
'netFocus',
|
||||
'netOnly',
|
||||
'newgame',
|
||||
'nocWindow',
|
||||
'offerStep',
|
||||
|
|
@ -355,6 +366,12 @@ const LOCAL = [
|
|||
'vpSet',
|
||||
'whatsNewShow',
|
||||
'wsShare',
|
||||
'xfer',
|
||||
'xferFile',
|
||||
'xferLink',
|
||||
'xferPaste',
|
||||
'xferRecv',
|
||||
'xferShare',
|
||||
'xpOpen',
|
||||
'zoomStep',
|
||||
];
|
||||
|
|
@ -466,12 +483,17 @@ const TEXT = {
|
|||
showed. The game refuses a different one ("The quote changed"); the server also refuses a request without it.
|
||||
'quote' is the plan's key (a string), any other name the total (a number). pniAll: the exact total (fixed prices, so
|
||||
the total names the plan). bstdApply: the plan's key, plus its total q, which may drift 1% (hardware prices move
|
||||
daily under the market rule). utilityKit: the total, within 1%. utilityCaches: the list of boxes. */
|
||||
daily under the market rule). utilityKit, utilityKitAll, acceptFix, ptApply, ptAll: the total, within 1% (each prices
|
||||
routers, so a day's drift moves it; ptApply's "Mark it" sends 0). utilityCaches: the list of boxes. */
|
||||
const QUOTE = {
|
||||
acceptFix: 'cost',
|
||||
bstdApply: 'quote',
|
||||
pniAll: 'q',
|
||||
ptAll: 'cost',
|
||||
ptApply: 'cost',
|
||||
utilityCaches: 'quote',
|
||||
utilityKit: 'cost',
|
||||
utilityKitAll: 'cost',
|
||||
};
|
||||
|
||||
/* The windows a request's ctx.win may name: the one the page has open when the click came from inside it. The game asks
|
||||
|
|
@ -499,9 +521,10 @@ const own = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
|
|||
const plain = (o) => !!o && typeof o === 'object' && !Array.isArray(o) && (Object.getPrototypeOf(o) === Object.prototype || Object.getPrototypeOf(o) === null);
|
||||
const prim = (v, cap) => v === null || typeof v === 'boolean' || (typeof v === 'number' && Number.isFinite(v)) || (typeof v === 'string' && v.length <= cap);
|
||||
// Keys a request object may never carry, whatever the regex says; nor values, where a value names something: written
|
||||
// through as a key (S.pops[city]), they reach a prototype. Free text (TEXT) may say them.
|
||||
// through as a key (S.pops[city]), they reach a prototype, and any name Object.prototype has ('toString', 'valueOf')
|
||||
// reads as something there. Free text (TEXT) may say them.
|
||||
const BAD_KEY = new Set(['__proto__', 'constructor', 'prototype']);
|
||||
const badVal = (v) => (typeof v === 'string' ? BAD_KEY.has(v) : Array.isArray(v) ? v.some(badVal) : !!v && typeof v === 'object' && Object.keys(v).some((k) => BAD_KEY.has(k) || badVal(v[k])));
|
||||
const badVal = (v) => (typeof v === 'string' ? BAD_KEY.has(v) || v in Object.prototype : Array.isArray(v) ? v.some(badVal) : !!v && typeof v === 'object' && Object.keys(v).some((k) => BAD_KEY.has(k) || badVal(v[k])));
|
||||
|
||||
function bad(error, code = 400, extra = {}) { return { ok: false, code, error, ...extra }; }
|
||||
|
||||
|
|
@ -546,7 +569,7 @@ function checkCtx(c) {
|
|||
else if (k === 'win') {
|
||||
const W = plain(v) && typeof v.k === 'string' && own(WINDOWS, v.k) ? WINDOWS[v.k] : null;
|
||||
if (!W || !Object.keys(v).every((x) => x === 'k' || x === 'ui')) return 'bad ctx.win';
|
||||
if (v.ui !== undefined && !(plain(v.ui) && Object.keys(v.ui).every((u) => (W.ui || []).includes(u) && (v.ui[u] === null || (typeof v.ui[u] === 'string' && SHORT_RE.test(v.ui[u]) && !BAD_KEY.has(v.ui[u])))))) return 'bad ctx.win.ui';
|
||||
if (v.ui !== undefined && !(plain(v.ui) && Object.keys(v.ui).every((u) => (W.ui || []).includes(u) && (v.ui[u] === null || (typeof v.ui[u] === 'string' && SHORT_RE.test(v.ui[u]) && !badVal(v.ui[u])))))) return 'bad ctx.win.ui';
|
||||
}
|
||||
else return `unknown ctx.${String(k).slice(0, 20)}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue