@wildshard/engine 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/budgets/shard-size-baseline.json +10 -4
- package/index.html +6 -4
- package/lint/engine-sides.json +14 -0
- package/lint/ratchet.json +0 -68
- package/lint/ratchet.mjs +1 -4
- package/package.json +17 -15
- package/scripts/agent-sync.mjs +27 -8
- package/scripts/app-build/appCook.ts +8 -2
- package/scripts/app-build/catalogue.ts +10 -7
- package/scripts/app-build/gen.ts +22 -2
- package/scripts/app-build/isolation.d.mts +10 -0
- package/scripts/app-build/isolation.mjs +47 -0
- package/scripts/app-build/outputProducts.mjs +4 -0
- package/scripts/app-build/previousDeploy.d.mts +2 -0
- package/scripts/app-build/previousDeploy.mjs +10 -1
- package/scripts/app-build/serviceWorker.ts +10 -3
- package/scripts/app-build/splitOutput.mjs +4 -2
- package/scripts/app-build/standaloneOutput.d.mts +1 -1
- package/scripts/app-build/standaloneOutput.mjs +5 -3
- package/scripts/app-build/titlePreloads.d.mts +8 -0
- package/scripts/app-build/titlePreloads.mjs +69 -0
- package/scripts/app-build/worldMapAtlas.ts +10 -6
- package/scripts/app-build-pipeline.mjs +31 -3
- package/scripts/built-product.mjs +1 -1
- package/scripts/cell-mem-bench.mjs +81 -23
- package/scripts/check-custom-sections-zero.mjs +1 -1
- package/scripts/check-devserver.mjs +2 -0
- package/scripts/check-models.mjs +2 -0
- package/scripts/check-paths.allow.json +0 -115
- package/scripts/check-paths.mjs +2 -2
- package/scripts/check-platform-ratchets.mjs +2 -3
- package/scripts/chromium-keychain.d.mts +1 -1
- package/scripts/ci-static.sh +1 -1
- package/scripts/committed-fast-checks.mjs +0 -2
- package/scripts/content-sw-proof.mjs +2 -1
- package/scripts/cook-worker.mjs +9 -3
- package/scripts/cook.mjs +18 -5
- package/scripts/docs-inputs-proof.mjs +6 -6
- package/scripts/e7-voice-staging-proof.mjs +1 -1
- package/scripts/gate-related-tests.mjs +1 -1
- package/scripts/git-source-view.mjs +1 -1
- package/scripts/goldens/capture.mjs +17 -5
- package/scripts/grid-crossing-nightly.mjs +59 -0
- package/scripts/grid-crossing-qa.mjs +44 -0
- package/scripts/grid-crossing-ratchet.d.mts +6 -0
- package/scripts/grid-crossing-ratchet.mjs +52 -0
- package/scripts/grid-crossing-report.mjs +122 -0
- package/scripts/grid-crossing-stages.mjs +47 -0
- package/scripts/grid-crossing-tour.mjs +277 -0
- package/scripts/grid-crossing-walk-proof.mjs +124 -17
- package/scripts/host-ruler/roots.mjs +2 -2
- package/scripts/host-ruler.d.mts +91 -0
- package/scripts/host-ruler.mjs +565 -0
- package/scripts/live-prepush.py +3 -5
- package/scripts/loading-flow/benchmax.mjs +3 -1
- package/scripts/look-loop/test_look_loop.py +1 -38
- package/scripts/memory-proof.mjs +61 -6
- package/scripts/mmo-bots.mjs +8 -2
- package/scripts/net-lag-proof.mjs +219 -0
- package/scripts/night-market-kit-budget.mjs +2 -2
- package/scripts/offline-proof-rules.d.mts +2 -2
- package/scripts/offline-proof-rules.mjs +15 -4
- package/scripts/offline-proof.mjs +74 -13
- package/scripts/{shard-platform-output.mjs → output-reader.mjs} +1 -1
- package/scripts/page-release/content.d.mts +9 -1
- package/scripts/page-release/content.mjs +131 -17
- package/scripts/page-release/flow.mjs +36 -10
- package/scripts/page-release/stamp-content.mjs +24 -0
- package/scripts/page-release.mjs +28 -6
- package/scripts/page-size.mjs +2 -1
- package/scripts/pin-packs.ts +1 -1
- package/scripts/pins.ts +4 -4
- package/scripts/precommit-checks.mjs +1 -7
- package/scripts/precommit-jobs.mjs +0 -1
- package/scripts/precommit-source.py +1 -9
- package/scripts/program-discovery.mjs +1 -1
- package/scripts/ring-cook.mjs +2 -1
- package/scripts/ring-step.ts +1 -1
- package/scripts/script-scenario-metrics.mjs +1 -1
- package/scripts/shard-output-content.d.mts +1 -1
- package/scripts/shard-output-content.mjs +2 -2
- package/scripts/shard-outputs.mjs +1 -1
- package/scripts/shard-public.mjs +1 -1
- package/scripts/shard-wire-meter.mjs +24 -9
- package/scripts/side-parity.mjs +4 -2
- package/scripts/standalone-smoke.mjs +8 -3
- package/scripts/tier-textures.mjs +22 -4
- package/scripts/tile-bake-report.mjs +1 -1
- package/scripts/tile-bakes.mjs +1 -1
- package/scripts/title-assets.generated.json +2 -0
- package/scripts/tsconfig.json +0 -2
- package/scripts/vendor/basisu/LICENSE +201 -0
- package/scripts/vendor/basisu/basis_encoder.cjs +2 -0
- package/scripts/vendor/basisu/basis_encoder.wasm +0 -0
- package/scripts/vitest-push-guards.config.ts +1 -1
- package/scripts/vps/harden-apply.sh +4 -1
- package/scripts/vps/harden-prometheus.sh +176 -0
- package/scripts/vps/harden.sh +16 -0
- package/scripts/vps/rebuild.sh +18 -0
- package/scripts/vps/wildshard-config +6 -2
- package/scripts/worker-client-play.mjs +6 -2
- package/scripts/worktree-reap.mjs +5 -5
- package/src/.oxlintrc.json +3 -182
- package/src/client/app/entry.ts +10 -2
- package/src/client/engine/boot/bootCache.ts +2 -2
- package/src/client/engine/boot/bootTrace.ts +12 -4
- package/src/client/engine/boot/browserChunkRecovery.ts +4 -0
- package/src/client/engine/boot/clearDownloads.ts +5 -2
- package/src/client/engine/boot/contentRead.ts +11 -0
- package/src/client/engine/boot/gpuFiles.ts +4 -2
- package/src/client/engine/boot/lastEnd.ts +99 -12
- package/src/client/engine/boot/texturePack.ts +2 -2
- package/src/client/engine/net/netPlayer.ts +19 -2
- package/src/client/engine/net/otherPlayers.ts +55 -8
- package/src/client/engine/net/predictor.ts +33 -9
- package/src/client/engine/net/redial.ts +29 -6
- package/src/client/engine/pwa/cacheNames.ts +58 -1
- package/src/client/engine/pwa/sw.js +41 -11
- package/src/client/engine/render/dataLook.ts +152 -40
- package/src/client/engine/render/families/detail.ts +89 -0
- package/src/client/engine/render/families/pbr.ts +7 -1
- package/src/client/engine/render/look.ts +6 -0
- package/src/client/engine/render/lookLight.ts +103 -11
- package/src/client/engine/render/lookRender.ts +105 -0
- package/src/client/engine/saves/indexed.ts +2 -2
- package/src/client/engine/telemetry/browserErrors.ts +24 -3
- package/src/client/engine/telemetry/staleBuildReport.ts +22 -1
- package/src/client/engine/ui/debugOptions.ts +1 -1
- package/src/client/engine/ui/lookLightOption.ts +10 -6
- package/src/client/engine/ui/namePrompt.ts +7 -0
- package/src/client/game/boot/audio.generated.ts +114 -114
- package/src/client/game/boot/bytes.generated.ts +118 -220
- package/src/client/game/boot/placedSpawn.ts +35 -0
- package/src/client/game/boot/spawnDownload.ts +25 -6
- package/src/client/game/boot/versions.generated.ts +7 -5
- package/src/client/game/devScene/hook.ts +291 -0
- package/src/client/game/grid/cellLoading.ts +12 -2
- package/src/client/game/grid/live.ts +112 -16
- package/src/client/game/grid/liveSession.ts +33 -2
- package/src/client/game/grid/mapAtlas.ts +18 -4
- package/src/client/game/grid/minimapBlend.ts +15 -5
- package/src/client/game/grid/oneWayIn.ts +5 -1
- package/src/client/game/grid/placedCells.ts +114 -12
- package/src/client/game/grid/placedContent.ts +85 -0
- package/src/client/game/grid/prefetch.ts +9 -1
- package/src/client/game/grid/productInputs.ts +3 -1
- package/src/client/game/grid/productLeases.ts +4 -1
- package/src/client/game/grid/products.ts +8 -4
- package/src/client/game/grid/roadLook.ts +24 -15
- package/src/client/game/grid/roadLookPlatform.ts +4 -2
- package/src/client/game/grid/roadResources.ts +24 -0
- package/src/client/game/grid/roadSign.worker.ts +4 -3
- package/src/client/game/grid/roadSignPaint.ts +16 -5
- package/src/client/game/grid/roadSignPreparation.ts +4 -3
- package/src/client/game/grid/roadSignScale.ts +8 -0
- package/src/client/game/grid/roadTileCapture.worker.ts +3 -1
- package/src/client/game/grid/roadTileCaptureWorker.ts +2 -1
- package/src/client/game/grid/roadTileWrite.worker.ts +4 -2
- package/src/client/game/grid/roadTileWriter.ts +2 -1
- package/src/client/game/grid/screenReports.ts +39 -0
- package/src/client/game/grid/session.ts +20 -4
- package/src/client/game/grid/softWallLook.ts +25 -8
- package/src/client/game/mainMenu.ts +6 -2
- package/src/client/game/plugin/context.ts +2 -1
- package/src/client/game/plugin/followedMovers.ts +7 -1
- package/src/client/game/quest/figures.ts +2 -0
- package/src/client/game/session/finish.ts +6 -0
- package/src/client/game/shardfile/assetCache.ts +4 -4
- package/src/client/game/shardfile/client.ts +4 -1
- package/src/client/game/shardfile/clientAssets.ts +9 -5
- package/src/client/game/shardfile/clientLibrary.ts +1 -1
- package/src/client/game/shardfile/clientWater.ts +51 -9
- package/src/client/game/shardfile/clientWorker.ts +19 -7
- package/src/client/game/shardfile/look.ts +8 -3
- package/src/client/game/shardfile/product.ts +34 -7
- package/src/client/game/shardfile/productChecks.ts +2 -2
- package/src/client/game/shardfile/productCost.ts +2 -2
- package/src/client/game/shardfile/readAsset.ts +2 -2
- package/src/client/game/shardfile/reflectingWater.ts +73 -0
- package/src/client/game/shardfile/seatGrace.ts +9 -0
- package/src/client/game/shardfile/skinPlayback.ts +1 -1
- package/src/client/game/systems/npc/figureRows.ts +9 -0
- package/src/client/host/online/doctor.ts +2 -0
- package/src/client/host/online/linkScreens.ts +30 -4
- package/src/client/host/standalone/shell.ts +4 -0
- package/src/cook/game/astc6Encode.ts +55 -0
- package/src/cook/game/astc6Wasm.ts +176 -0
- package/src/cook/game/cookJob.ts +30 -6
- package/src/cook/game/cookWorker.ts +38 -11
- package/src/cook/game/entryTotals.ts +51 -24
- package/src/cook/game/shardCook.ts +35 -7
- package/src/cook/game/spawnParts.ts +33 -8
- package/src/cook/game/tierTextures.ts +87 -14
- package/src/server/engine/ai/bossContenders.ts +27 -3
- package/src/server/engine/ai/phases.ts +1 -1
- package/src/server/engine/entities/creatureRefill.ts +9 -2
- package/src/server/engine/net/ledgerBook.ts +2 -0
- package/src/server/engine/net/room.ts +15 -0
- package/src/server/engine/sim/respawn.ts +8 -0
- package/src/server/game/boss/arenaRoomEntry.ts +5 -1
- package/src/server/game/boss/arenaRoomNative.ts +2 -0
- package/src/server/game/boss/native.ts +2 -1
- package/src/server/game/boss/nativeWake.ts +9 -5
- package/src/server/game/boss/openArenaNative.ts +2 -2
- package/src/server/game/boss/openArenaRoom.ts +3 -1
- package/src/server/game/grid/room.ts +44 -3
- package/src/server/game/grid/simulation.ts +23 -0
- package/src/server/game/population/mixedRoster.ts +11 -3
- package/src/server/game/population/nativeBake.ts +8 -3
- package/src/server/game/population/nativeReturns.ts +6 -3
- package/src/server/game/population/roster.ts +5 -3
- package/src/server/game/quest/eliteDrops.ts +15 -4
- package/src/server/game/quest/nativeChapter.ts +1 -1
- package/src/server/game/quest/nativeComposition.ts +5 -1
- package/src/server/game/riding/nativeTaming.ts +10 -6
- package/src/server/game/riding/wildRefill.ts +3 -2
- package/src/server/game/shardfile/bossRow.ts +4 -2
- package/src/server/game/shardfile/homeKeeper.ts +4 -2
- package/src/server/host/bake/headlessWorker.ts +1 -1
- package/src/server/host/dedicated/cellHost.ts +98 -16
- package/src/server/host/dedicated/cellProtocol.ts +16 -1
- package/src/server/host/dedicated/cellWorker.ts +8 -5
- package/src/server/host/dedicated/dedicatedRoom.ts +16 -6
- package/src/server/host/dedicated/gridCells.ts +15 -6
- package/src/server/host/dedicated/loopLag.ts +21 -0
- package/src/server/host/dedicated/main.ts +13 -5
- package/src/server/host/dedicated/packReader.ts +3 -3
- package/src/server/host/dedicated/placementFile.ts +3 -2
- package/src/server/host/dedicated/roadRoom.ts +34 -4
- package/src/server/host/dedicated/serverMetrics.ts +126 -0
- package/src/server/host/dedicated/socketPump.ts +21 -4
- package/src/server/host/dedicated/workerTable.ts +15 -4
- package/src/server/host/dedicated/world.ts +65 -7
- package/src/server/host/headless.ts +1 -1
- package/src/server/host/headlessRuntime.ts +1 -1
- package/src/server/host/standalone/roadWorld.ts +15 -3
- package/src/server/host/standalone/serverHost.ts +4 -1
- package/src/server/host/standalone/serverProduct.ts +41 -11
- package/src/shared/engine/ai/BossBrain.ts +8 -0
- package/src/shared/game/boss/wake.ts +6 -0
- package/src/shared/game/devColliders.ts +47 -0
- package/src/shared/game/eliteSystem.ts +8 -0
- package/src/shared/game/grid/allocator.ts +3 -0
- package/src/shared/game/grid/placementRows.ts +5 -2
- package/src/shared/game/plugin/bossRecord.ts +3 -2
- package/src/shared/game/shardfile/ktx2Targets.ts +23 -3
- package/src/shared/game/shardfile/outputDescriptor.ts +9 -5
- package/src/shared/game/shardfile/packReads.ts +28 -3
- package/src/shared/game/shardfile/serverPack.ts +9 -0
- package/src/shared/game/systems/looks/trampleField.ts +2 -0
- package/src/shared/host/formatJsonSchema.ts +2 -2
- package/src/tsconfig.json +1 -27
- package/lint/host-reviews.json +0 -14
- package/lint/listed-view-code.json +0 -13
- package/lint/platform-pending-users.json +0 -2520
- package/lint/platform-pending-users.md +0 -18
- package/scripts/cell-mem/metrics-preload.mjs +0 -65
- package/scripts/check-closed-components.d.mts +0 -7
- package/scripts/check-closed-components.mjs +0 -87
- package/scripts/g571-hosts.d.mts +0 -3
- package/scripts/g571-hosts.mjs +0 -54
- package/scripts/host-ruler/register-migrate.mjs +0 -242
- package/scripts/listed-view-code.d.mts +0 -7
- package/scripts/listed-view-code.mjs +0 -93
- package/scripts/look-loop/fit-lut.py +0 -142
- package/scripts/look-loop/palette-delta.py +0 -183
- package/scripts/look-loop/regions/driftwood-isle.json +0 -25
- package/scripts/look-loop/regions/far-reach.json +0 -225
- package/scripts/look-loop/regions/open-plot-night-market.json +0 -855
- package/scripts/look-loop/regions/pine-hollow.json +0 -22
- package/scripts/look-loop/regions/sunscar-dunes.json +0 -281
- package/scripts/platform-chargebacks.d.mts +0 -9
- package/scripts/platform-chargebacks.mjs +0 -135
- package/scripts/shard-component-spans.d.mts +0 -15
- package/scripts/shard-component-spans.mjs +0 -18
- package/scripts/shard-components.d.mts +0 -16
- package/scripts/shard-components.mjs +0 -363
- package/scripts/shard-platform-hosts.d.mts +0 -2
- package/scripts/shard-platform-hosts.mjs +0 -93
- package/scripts/shard-platform-sections.d.mts +0 -2
- package/scripts/shard-platform-sections.mjs +0 -9
- package/scripts/shard-platform.d.mts +0 -76
- package/scripts/shard-platform.mjs +0 -1072
- package/src/.oxfmtrc.json +0 -48
- package/src/scripts/ask-new.sh +0 -29
- package/src/scripts/asks.mjs +0 -142
- package/src/scripts/herdr-prompt.sh +0 -34
- package/src/scripts/herdr-question-open.sh +0 -67
- package/src/scripts/md-wrap.mjs +0 -229
- /package/scripts/{shard-platform-format.d.mts → node-format.d.mts} +0 -0
- /package/scripts/{shard-platform-format.mjs → node-format.mjs} +0 -0
- /package/scripts/{shard-platform-output.d.mts → output-reader.d.mts} +0 -0
|
@@ -1,27 +1,69 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// SERVER-CELLS (draft, opus-cellmem): what one dedicated server costs per resident cell, dormant (nobody in it) and with one bot in
|
|
3
3
|
// each. It runs a kept `mmo-bots.mjs replica --keep` folder's release bundle on loopback with production's shape (4 workers), once per
|
|
4
|
-
// cell count, and reads
|
|
5
|
-
//
|
|
4
|
+
// cell count, and reads the server's own `/metrics` (SC1: Prometheus text on 127.0.0.1:METRICS_PORT): RSS, CPU, heap and external per
|
|
5
|
+
// thread, event-loop lag per thread, and the workers' own tick readings. Nothing leaves this Mac but the book GET. A bundle from before
|
|
6
|
+
// SC1 serves no `/metrics`: build the kept run from engine main.
|
|
6
7
|
// node scripts/mmo-bots.mjs replica --bots 1 --seconds 15 --cells grid --keep (once: bundle, bots tree, pack cache)
|
|
7
8
|
// (cd tmp/mmo-bots/<stamp>/src && node scripts/build-server.mjs --build <build> --out ../cmbuild --entry cellMemBots=test/fixtures/dedicated/cellMemBotsEntry.ts)
|
|
8
9
|
// node scripts/cell-mem-bench.mjs --from tmp/mmo-bots/<stamp> [--counts 1,2,8,16,25] [--dormant 30] [--active 40] [--workers 4]
|
|
9
|
-
// The report goes to <from>/cell-mem-w<workers>.json.
|
|
10
|
+
// The report goes to <from>/cell-mem-w<workers>.json (`--remote`: cell-mem-<host>-w<workers>.json).
|
|
11
|
+
// SC7 (`--remote wildshard-agent [--cpus 9-13] [--bot-cpus 14-15]`): the same phases on the box, as `mmo-bots.mjs replica --remote
|
|
12
|
+
// --bots-on-host` runs there: the kept bundle and the bots' build go over ssh into ~/cell-mem/<stamp>, the replica runs pinned to
|
|
13
|
+
// `--cpus` (staging's, so production's players keep theirs) on the box's loopback only, the bots pinned to `--bot-cpus` dial it there,
|
|
14
|
+
// and each scrape is a loopback curl over ssh (the agent account forwards no ports). Memory is RSS (Linux has no `footprint`). The
|
|
15
|
+
// box fetches its own packs from R2 into the run's cache, kept across counts. The directory goes when the run ends, however it ends.
|
|
16
|
+
// SC4: each count also says `arrivalTickMax`, the worst tick in the worker readings heard in the 20 s after the bots arrived.
|
|
10
17
|
import { execFileSync, spawn } from 'node:child_process';
|
|
18
|
+
import { once } from 'node:events';
|
|
11
19
|
import { generateKeyPairSync, randomBytes, sign } from 'node:crypto';
|
|
12
20
|
import { readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
13
21
|
import { join, resolve as absolute } from 'node:path';
|
|
14
22
|
import { pathToFileURL } from 'node:url';
|
|
15
23
|
import { parseArgs } from 'node:util';
|
|
16
24
|
|
|
17
|
-
const ROOT = absolute(import.meta.dirname, '..');
|
|
18
25
|
const { values } = parseArgs({ options: { from: { type: 'string' }, counts: { type: 'string', default: '1,2,8,16,25' }, dormant: { type: 'string', default: '30' }, active: { type: 'string', default: '40' },
|
|
19
|
-
workers: { type: 'string', default: '4' }, port: { type: 'string', default: '18896' }, origin: { type: 'string', default: 'https://packs.wildshard.io' }
|
|
26
|
+
workers: { type: 'string', default: '4' }, port: { type: 'string', default: '18896' }, origin: { type: 'string', default: 'https://packs.wildshard.io' },
|
|
27
|
+
remote: { type: 'string' }, cpus: { type: 'string', default: '9-13' }, 'bot-cpus': { type: 'string', default: '14-15' } } });
|
|
20
28
|
if (values.from === undefined) throw new Error('--from <kept mmo-bots folder>');
|
|
21
29
|
const from = absolute(values.from), server = join(from, 'server'), bots = join(from, 'cmbuild', 'cellMemBots.mjs'), port = Number(values.port), metricsPort = port + 1;
|
|
22
30
|
const signed = JSON.parse(readFileSync(join(from, 'release.json'), 'utf8')), release = JSON.parse(signed.body);
|
|
23
31
|
const sleep = (/** @type {number} */ ms) => new Promise(resolve => { setTimeout(resolve, ms); });
|
|
24
32
|
const note = (/** @type {Record<string, unknown>} */ row) => { console.info(JSON.stringify({ at: 'cell-mem', ...row })); };
|
|
33
|
+
// SC7: every value that reaches the box's shell is a checked host, taskset list, number or fixed path.
|
|
34
|
+
const remote = values.remote;
|
|
35
|
+
if (remote !== undefined && !/^[\w.@-]+$/u.test(remote)) throw new Error('--remote is an ssh host');
|
|
36
|
+
if (!/^https?:\/\/[\w.:/-]+$/u.test(values.origin)) throw new Error('--origin is a plain http(s) URL');
|
|
37
|
+
if (!/^[\d,-]+$/u.test(values.cpus) || !/^[\d,-]+$/u.test(values['bot-cpus']) || !/^\d{1,3}$/u.test(values.workers) || !/^\d{4,5}$/u.test(values.port)) throw new Error('--cpus and --bot-cpus are taskset lists; --workers and --port are numbers');
|
|
38
|
+
const ALIVE = ['-o', 'BatchMode=yes', '-o', 'ServerAliveInterval=15', '-o', 'ServerAliveCountMax=8'];
|
|
39
|
+
const away = `cell-mem/${new Date().toISOString().replaceAll(/[-:]/gu, '').replace(/\..*/u, 'Z')}`;
|
|
40
|
+
/** One command's output text, without blocking the loop (the replica's and bots' pipes keep draining meanwhile). */
|
|
41
|
+
const execAsync = async (/** @type {string} */ file, /** @type {string[]} */ args, /** @type {number} */ timeout) => {
|
|
42
|
+
const child = spawn(file, args, { stdio: ['ignore', 'pipe', 'inherit'], timeout }), chunks = /** @type {Buffer[]} */ ([]);
|
|
43
|
+
child.stdout.on('data', (/** @type {Buffer} */ chunk) => { chunks.push(chunk); });
|
|
44
|
+
const [code] = await once(child, 'close');
|
|
45
|
+
if (code !== 0) throw new Error(`${file} exited ${String(code)}`);
|
|
46
|
+
return Buffer.concat(chunks).toString();
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* One command on the box, its output as text.
|
|
50
|
+
* @param {string} command
|
|
51
|
+
* @param {Buffer | string} [input]
|
|
52
|
+
*/
|
|
53
|
+
const box = (command, input) => {
|
|
54
|
+
if (remote === undefined) throw new Error('Not remote');
|
|
55
|
+
if (input === undefined) return execAsync('ssh', [...ALIVE, remote, command], 120_000);
|
|
56
|
+
return execFileSync('ssh', [...ALIVE, remote, command], { input, maxBuffer: 1 << 26, timeout: 300_000 }).toString();
|
|
57
|
+
};
|
|
58
|
+
/** The box's replica and bots, ended by their own paths, and the run's directory, removed. */
|
|
59
|
+
const boxStop = async () => { if (remote !== undefined) try { await box(`pkill -TERM -f '[/]${away}/' ; sleep 3; pkill -KILL -f '[/]${away}/'; rm -rf ${away}`); } catch { /* already gone */ } };
|
|
60
|
+
if (remote !== undefined) {
|
|
61
|
+
for (const [signal, code] of /** @type {const} */ ([['SIGINT', 130], ['SIGHUP', 129], ['SIGTERM', 143]])) process.once(signal, () => { void boxStop().finally(() => { process.exit(code); }); });
|
|
62
|
+
// The kept bundle and the bots' one file go over once.
|
|
63
|
+
await box(`mkdir -p ${away}/server ${away}/bots && tar -x -C ${away}/server`, execFileSync('tar', ['-c', '-C', server, '.'], { maxBuffer: 1 << 30 }));
|
|
64
|
+
await box(`cat > ${away}/bots/cellMemBots.mjs`, readFileSync(bots));
|
|
65
|
+
note({ step: 'remote', host: remote, cpus: values.cpus, botCpus: values['bot-cpus'], dir: `~/${away}`, node: (await box('node --version')).trim(), nproc: (await box('nproc')).trim() });
|
|
66
|
+
}
|
|
25
67
|
|
|
26
68
|
/** The grid's cells in the order `WORLD_CELLS=grid` opens them, read off the kept run's own log. */
|
|
27
69
|
const order = /** @type {string[]} */ (readFileSync(join(from, 'server.jsonl'), 'utf8').split('\n').map(line => { try { return JSON.parse(line); } catch { return null; } }).find(row => row?.at === 'server.listening')?.cells ?? []);
|
|
@@ -29,12 +71,14 @@ if (order.length === 0) throw new Error('The kept run never listened');
|
|
|
29
71
|
|
|
30
72
|
/** @returns {Promise<Record<string, number>>} The scrape, flattened to `name{labels}` → value. */
|
|
31
73
|
async function scrape() {
|
|
32
|
-
const text = await (await fetch(`http://127.0.0.1:${String(metricsPort)}/metrics`)).text(), rows = /** @type {Record<string, number>} */ ({});
|
|
74
|
+
const text = remote === undefined ? await (await fetch(`http://127.0.0.1:${String(metricsPort)}/metrics`)).text() : await box(`curl -s -m 10 127.0.0.1:${String(metricsPort)}/metrics`), rows = /** @type {Record<string, number>} */ ({});
|
|
33
75
|
for (const line of text.split('\n')) { if (line === '' || line.startsWith('#')) continue; const at = line.lastIndexOf(' '); rows[line.slice(0, at)] = Number(line.slice(at + 1)); }
|
|
34
76
|
return rows;
|
|
35
77
|
}
|
|
36
78
|
const sum = (/** @type {Record<string, number>} */ rows, /** @type {string} */ prefix) => Object.entries(rows).filter(([name]) => name.startsWith(prefix)).reduce((total, [, value]) => total + value, 0);
|
|
37
79
|
const most = (/** @type {Record<string, number>} */ rows, /** @type {RegExp} */ match) => Math.max(0, ...Object.entries(rows).filter(([name]) => match.test(name)).map(([, value]) => value));
|
|
80
|
+
/** One thread-memory kind summed over every thread (the server's `wildshard_thread_memory_bytes{thread,kind}`). */
|
|
81
|
+
const threads = (/** @type {Record<string, number>} */ rows, /** @type {RegExp} */ kind) => Object.entries(rows).filter(([name]) => name.startsWith('wildshard_thread_memory_bytes{') && kind.test(name)).reduce((total, [, value]) => total + value, 0);
|
|
38
82
|
const median = (/** @type {number[]} */ list) => { const sorted = list.slice().sort((a, b) => a - b); return sorted[Math.floor(sorted.length / 2)] ?? 0; };
|
|
39
83
|
|
|
40
84
|
/** macOS RSS drops as the kernel compresses a quiet process's pages; `footprint` counts those too, as Activity Monitor's Memory does. Elsewhere, RSS. */
|
|
@@ -50,19 +94,22 @@ async function phase(/** @type {number} */ seconds, /** @type {string[]} */ work
|
|
|
50
94
|
while (performance.now() - started < seconds * 1000) { await sleep(5_000); samples.push(await scrape()); const mb = footprint(pid); if (mb !== null) footprints.push(mb); }
|
|
51
95
|
const last = samples.at(-1) ?? first, wall = (performance.now() - started) / 1000;
|
|
52
96
|
const ticks = workerLines.slice(linesBefore).map(line => JSON.parse(line));
|
|
97
|
+
// SC4: the readings heard in the 20 s after the phase began cover each worker's first 10 s window after an arrival.
|
|
98
|
+
const arrival = ticks.filter(row => row.heardAt !== undefined && row.heardAt - started <= 20_000);
|
|
53
99
|
const mb = (/** @type {number} */ bytes) => Math.round(bytes / 1048576);
|
|
54
100
|
return {
|
|
55
101
|
footprintMB: footprints.length === 0 ? null : Math.round(median(footprints)), footprintMaxMB: footprints.length === 0 ? null : Math.round(Math.max(...footprints)),
|
|
56
102
|
rssMB: mb(median(samples.map(row => row.process_resident_memory_bytes ?? 0))), rssMaxMB: mb(Math.max(...samples.map(row => row.process_resident_memory_bytes ?? 0))),
|
|
57
|
-
heapMB: mb(median(samples.map(row =>
|
|
103
|
+
heapMB: mb(median(samples.map(row => threads(row, /kind="heap"/u)))), externalMB: mb(median(samples.map(row => threads(row, /kind="external"/u)))), arrayBuffersMB: mb(median(samples.map(row => threads(row, /kind="arrayBuffers"/u)))),
|
|
58
104
|
cpuCores: Number((((last.process_cpu_seconds_total ?? 0) - (first.process_cpu_seconds_total ?? 0)) / wall).toFixed(3)),
|
|
59
|
-
mainLagP50: Number(median(samples.map(row => row['
|
|
60
|
-
mainLagP99: Number(Math.max(...samples.map(row => row['
|
|
61
|
-
workerLagP99: Number(Math.max(...samples.map(row => most(row, /^
|
|
105
|
+
mainLagP50: Number(median(samples.map(row => row['wildshard_eventloop_lag_seconds{thread="main",quantile="0.5"}'] ?? 0)).toFixed(5)) * 1000,
|
|
106
|
+
mainLagP99: Number(Math.max(...samples.map(row => row['wildshard_eventloop_lag_seconds{thread="main",quantile="0.99"}'] ?? 0)).toFixed(5)) * 1000,
|
|
107
|
+
workerLagP99: Number(Math.max(...samples.map(row => most(row, /^wildshard_eventloop_lag_seconds\{thread="worker-\d+",quantile="0.99"\}/u))).toFixed(5)) * 1000,
|
|
108
|
+
arrivalTickMax: Math.max(0, ...arrival.map(row => row.max)),
|
|
62
109
|
tickP50: Math.max(0, ...ticks.map(row => row.p50)), tickP95: Math.max(0, ...ticks.map(row => row.p95)), tickP99: Math.max(0, ...ticks.map(row => row.p99)), tickMax: Math.max(0, ...ticks.map(row => row.max)),
|
|
63
110
|
drops: ticks.reduce((total, row) => total + row.drops, 0), minTicksPerSecond: Math.min(60, ...ticks.map(row => row.ticksPerSecond)),
|
|
64
111
|
awake: Math.max(0, ...samples.map(row => sum(row, 'wildshard_cells_awake'))), players: Math.max(0, ...samples.map(row => sum(row, 'wildshard_players'))),
|
|
65
|
-
perThreadHeapMB: Object.fromEntries(Object.entries(last).filter(([name]) => name.startsWith('
|
|
112
|
+
perThreadHeapMB: Object.fromEntries(Object.entries(last).filter(([name]) => name.startsWith('wildshard_thread_memory_bytes') && name.includes('kind="heap"')).map(([name, value]) => [/thread="([^"]+)"/u.exec(name)?.[1] ?? name, mb(value)])),
|
|
66
113
|
};
|
|
67
114
|
}
|
|
68
115
|
|
|
@@ -71,11 +118,15 @@ async function run(/** @type {number} */ count) {
|
|
|
71
118
|
const cells = order.slice(0, count), { publicKey, privateKey } = generateKeyPairSync('ed25519');
|
|
72
119
|
const body = JSON.stringify({ ...release, serial: 1 }), file = join(from, `cell-mem-release.json`);
|
|
73
120
|
writeFileSync(file, JSON.stringify({ body, signature: sign(null, Buffer.from(body), privateKey).toString('hex') }));
|
|
121
|
+
if (remote !== undefined) await box(`cat > ${away}/release.json`, readFileSync(file));
|
|
74
122
|
const env = { PATH: process.env.PATH ?? '', HOME: process.env.HOME ?? '', PACK_ORIGIN: values.origin, PACK_CACHE: join(from, 'packs'), DATABASE_URL: 'memory:', SEAT_SECRET: randomBytes(32).toString('hex'),
|
|
75
123
|
HOST: '127.0.0.1', PORT: String(port), RELEASE_CHANNEL: 'production', RELEASE_URL: pathToFileURL(file).href, RELEASE_PUBLIC_KEY: publicKey.export({ type: 'spki', format: 'der' }).toString('hex'),
|
|
76
124
|
WORLD_CELLS: cells.join(','), WORLD_WORKERS: values.workers, WORLD_SEATS: '64', TELEMETRY_URL: '', ERRORS_URL: '', SENTRY_DSN: '', RECORD_TAG: '', METRICS_PORT: String(metricsPort) };
|
|
77
125
|
const began = performance.now(), workerLines = /** @type {string[]} */ ([]), booted = /** @type {Record<string, number>} */ ({});
|
|
78
|
-
const
|
|
126
|
+
const there = { ...env, PACK_CACHE: `$HOME/${away}/packs`, RELEASE_URL: `file://$HOME/${away}/release.json` };
|
|
127
|
+
const words = Object.entries(there).filter(([name]) => name !== 'PATH' && name !== 'HOME').map(([name, value]) => `${name}="${value}"`).join(' ');
|
|
128
|
+
const child = remote === undefined ? spawn(process.execPath, [join(server, 'main.mjs')], { cwd: server, env, stdio: ['ignore', 'pipe', 'pipe'] })
|
|
129
|
+
: spawn('ssh', [...ALIVE, remote, `cd ${away}/server && exec env ${words} taskset -c ${values.cpus} node "$HOME/${away}/server/main.mjs"`], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
79
130
|
/** Set by the log reader as lines arrive. */
|
|
80
131
|
const seen = { listening: 0 };
|
|
81
132
|
let buffer = '';
|
|
@@ -83,7 +134,7 @@ async function run(/** @type {number} */ count) {
|
|
|
83
134
|
buffer += chunk.toString();
|
|
84
135
|
for (let end = buffer.indexOf('\n'); end >= 0; end = buffer.indexOf('\n')) {
|
|
85
136
|
const line = buffer.slice(0, end); buffer = buffer.slice(end + 1);
|
|
86
|
-
if (line.startsWith('{"at":"worker"')) workerLines.push(line);
|
|
137
|
+
if (line.startsWith('{"at":"worker"')) workerLines.push(`${line.slice(0, -1)},"heardAt":${String(performance.now())}}`);
|
|
87
138
|
else if (line.startsWith('{"at":"server.listening"')) seen.listening = performance.now() - began;
|
|
88
139
|
else if (line.startsWith('{"at":"cell.booted"')) { const row = JSON.parse(line); booted[row.slug] = Math.round(row.ms); }
|
|
89
140
|
}
|
|
@@ -96,24 +147,29 @@ async function run(/** @type {number} */ count) {
|
|
|
96
147
|
if (seen.listening === 0) throw new Error(`${String(count)} cells never listened`);
|
|
97
148
|
// The first worker readings come 10 s after boot: let the boot's own garbage settle before the dormant read.
|
|
98
149
|
while (workerLines.length === 0 && performance.now() - began < 300_000) await sleep(500);
|
|
99
|
-
const dormant = await phase(Number(values.dormant), workerLines, child.pid);
|
|
150
|
+
const dormant = await phase(Number(values.dormant), workerLines, remote === undefined ? child.pid : undefined);
|
|
100
151
|
note({ count, phase: 'dormant', ...dormant });
|
|
101
152
|
const result = join(from, `cell-mem-bots-${String(count)}.json`);
|
|
102
153
|
rmSync(result, { force: true });
|
|
103
|
-
const
|
|
154
|
+
const botArgs = [`ws://127.0.0.1:${String(port)}/`, release.engineBuild, cells.join(','), String(Number(values.active) + 10), 'cm'];
|
|
155
|
+
const players = remote === undefined ? spawn(process.execPath, [bots, ...botArgs, result], { stdio: ['ignore', 'pipe', 'inherit'] })
|
|
156
|
+
: spawn('ssh', [...ALIVE, remote, `cd ${away}/bots && exec taskset -c ${values['bot-cpus']} node "$HOME/${away}/bots/cellMemBots.mjs" ${botArgs.join(' ')} "$HOME/${away}/bots-${String(count)}.json"`], { stdio: ['ignore', 'pipe', 'inherit'] });
|
|
104
157
|
bot = players;
|
|
105
158
|
const arrival = { at: 0 };
|
|
106
159
|
players.stdout.on('data', (/** @type {Buffer} */ chunk) => { if (chunk.toString().includes('cellmem.arrived')) arrival.at = performance.now(); });
|
|
107
160
|
while (arrival.at === 0 && players.exitCode === null) await sleep(250);
|
|
108
161
|
if (arrival.at === 0) throw new Error(`${String(count)} cells: the bots ended before they were seated`);
|
|
109
|
-
const active = await phase(Number(values.active), workerLines, child.pid);
|
|
162
|
+
const active = await phase(Number(values.active), workerLines, remote === undefined ? child.pid : undefined);
|
|
110
163
|
await new Promise(resolve => { if (players.exitCode !== null) resolve(null); else players.once('exit', resolve); });
|
|
164
|
+
if (remote !== undefined) writeFileSync(result, await box(`cat ${away}/bots-${String(count)}.json`));
|
|
111
165
|
const report = JSON.parse(readFileSync(result, 'utf8')), rtts = report.rows.map((/** @type {{ rttP50: number | null }} */ row) => row.rttP50).filter((/** @type {number | null} */ value) => value !== null);
|
|
112
166
|
const row = { count, cells, bootMs: Math.round(seen.listening), cellBootMs: booted, dormant, active: { ...active, seated: report.seated, inTheirCell: report.inTheirCell, rttP50: median(rtts), rttMax: Math.max(0, ...report.rows.map((/** @type {{ rttMax: number | null }} */ seat) => seat.rttMax ?? 0)), joinMsMax: Math.max(0, ...report.rows.map((/** @type {{ joinedMs: number | null }} */ seat) => seat.joinedMs ?? 0)) } };
|
|
113
167
|
note({ count, phase: 'active', ...row.active });
|
|
114
168
|
return row;
|
|
115
169
|
} finally {
|
|
116
170
|
if (bot !== null && bot.exitCode === null) bot.kill('SIGTERM');
|
|
171
|
+
// On the box the ssh client's signal never reaches the server: it is told there, by its own path.
|
|
172
|
+
if (remote !== undefined) try { await box(`pkill -TERM -f '[/]${away}/bots/' ; pkill -TERM -f '[/]${away}/server/main.mjs'`); } catch { /* already gone */ }
|
|
117
173
|
child.kill('SIGTERM');
|
|
118
174
|
const gone = new Promise(resolve => { if (child.exitCode !== null) resolve(null); else child.once('exit', resolve); });
|
|
119
175
|
await Promise.race([gone, sleep(15_000)]);
|
|
@@ -121,10 +177,12 @@ async function run(/** @type {number} */ count) {
|
|
|
121
177
|
}
|
|
122
178
|
}
|
|
123
179
|
|
|
124
|
-
const rows = [];
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
180
|
+
const rows = [], report = join(from, `cell-mem-${remote === undefined ? '' : `${remote}-`}w${values.workers}.json`);
|
|
181
|
+
try {
|
|
182
|
+
for (const count of values.counts.split(',').map(Number)) {
|
|
183
|
+
if (!Number.isInteger(count) || count < 1 || count > order.length) { note({ count, skipped: `the grid opens ${String(order.length)} cells` }); continue; }
|
|
184
|
+
rows.push(await run(count));
|
|
185
|
+
writeFileSync(report, `${JSON.stringify({ build: release.engineBuild, workers: Number(values.workers), node: process.version, ...(remote === undefined ? {} : { remote, cpus: values.cpus, botCpus: values['bot-cpus'] }), rows }, null, 2)}\n`);
|
|
186
|
+
}
|
|
187
|
+
} finally { await boxStop(); }
|
|
188
|
+
note({ done: report });
|
|
@@ -31,7 +31,7 @@ if(import.meta.url===pathToFileURL(process.argv[1]??'').href){
|
|
|
31
31
|
const root=resolve(process.argv[2]??process.cwd());
|
|
32
32
|
// Enumerate declared canonical projects/products rather than existing out/
|
|
33
33
|
// directories: missing products refuse through the verified reader.
|
|
34
|
-
const {outputSections}=await import('./
|
|
34
|
+
const {outputSections}=await import('./output-reader.mjs');
|
|
35
35
|
const {execFileSync}=await import('node:child_process');
|
|
36
36
|
const names=execFileSync('git',['ls-tree','-r','--name-only','HEAD','--','src/shards'],{cwd:root,encoding:'utf8'})
|
|
37
37
|
.split('\n').flatMap(path=>/^src\/shards\/([^/]+)\/shard.config.ts$/u.exec(path)?.slice(1)??[]);
|
|
@@ -17,6 +17,8 @@ export function assertProductionBuild(directory) {
|
|
|
17
17
|
else if (file.name.endsWith('.js')) {
|
|
18
18
|
const code = readFileSync(full, 'utf8');
|
|
19
19
|
if (code.includes('__DEVSERVER__') || code.includes('__PREPARATION_ONLY__')) throw new Error('Production bundle contains an unsubstituted DEVSERVER or PREPARATION_ONLY define');
|
|
20
|
+
// SHARD-SOURCE AP5 (J347): the dev hook (src/client/game/devScene/hook.ts) and its server half are DEVSERVER-only.
|
|
21
|
+
for (const marker of ['__wildshardDevHook', 'wildshardDevColliders']) if (code.includes(marker)) throw new Error(`Production bundle ${file.name} contains the dev hook (${marker})`);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
};
|
package/scripts/check-models.mjs
CHANGED
|
@@ -77,6 +77,7 @@ export const DONE = {
|
|
|
77
77
|
'shared (src/world, src/player, src/entities, …)': {
|
|
78
78
|
'src/client/engine/render/scatterInstances.ts': { why: '2d917c567c: the existing bounded scatter draw moved from Nalati dressing; authored placements and collision remain data', counts: { InstancedMesh: 1 } },
|
|
79
79
|
'src/client/game/ambient/wingField.ts': { why: '2d917c567c: the former two ambient wing draws share one row-owned allocation site; creatures remain model-owned', counts: { InstancedMesh: 1 } },
|
|
80
|
+
'src/client/game/devScene/hook.ts': { why: 'SHARD-SOURCE AP5 (J347): the DEVSERVER-only dev hook `wildshard watch` drives; it redraws an author\'s three.js parts as the author wrote them, never in a production bundle (check-devserver.mjs)', counts: { InstancedMesh: 1 } },
|
|
80
81
|
'src/client/game/boss/arenaFire.ts': { why: 'f524ad70dc: the existing flame and smoke effect draws moved from stormTitanLook with their original ceiling', counts: { InstancedMesh: 2 } },
|
|
81
82
|
'src/client/game/boss/encounterView.ts': { why: 'Moved from Nalati: a cloud body\'s puffs (one row-sized draw) and an encounter site\'s empty stand-in for a variant no site wears; the sites themselves are placed through place()', counts: { InstancedMesh: 2 } },
|
|
82
83
|
'src/client/game/practice/course.ts': { why: 'The existing riding and grapple practice rooms share one row-owned registration; no shard world content', counts: { 'registry add with object': 1 } },
|
|
@@ -87,6 +88,7 @@ export const DONE = {
|
|
|
87
88
|
'src/client/engine/player/firstPersonArms.ts': { why: "the player's own first-person arms, merged into one geometry: the player, not a thing in the world", counts: { mergeGeometries: 1 } },
|
|
88
89
|
'src/client/engine/render/graph/glslMaterial.ts': { why: "an instanced mesh's outline hull, mirroring the mesh it outlines: a material effect, never a new world thing", counts: { InstancedMesh: 1 } },
|
|
89
90
|
'src/client/engine/render/lookLight.ts': { why: 'look.light pools of light (85944cce, behind Debug): an effect', counts: { InstancedMesh: 1 } },
|
|
91
|
+
'src/client/engine/render/lookRender.ts': { why: 'meta SHARD-SOURCE M4.8 lamp halos: one additive billboard per declared lamp, an effect', counts: { InstancedMesh: 1 } },
|
|
90
92
|
'src/client/game/ambient/crowdDraw.ts': { why: 'the ambient crowd draw from admitted rows: a population, like the flock in posedInstances', counts: { InstancedMesh: 1 } },
|
|
91
93
|
'src/client/game/ambient/foragerDraw.ts': { why: 'the native forager population, one draw over its owner rows: a population, not placed world', counts: { InstancedMesh: 1 } },
|
|
92
94
|
'src/client/game/loot/CoinMotion.ts': { why: 'loot coins in flight to the player: an effect, like CoinBurst', counts: { InstancedMesh: 1 } },
|
|
@@ -299,16 +299,6 @@
|
|
|
299
299
|
"file": "scripts/shard-coupling.mjs",
|
|
300
300
|
"why": "Immutable reviewed weapon transfer bootstrap; the transfer list is empty and its historical destination is retired. The shrink-only comparator still checks any restored transfer against this identity."
|
|
301
301
|
},
|
|
302
|
-
{
|
|
303
|
-
"path": "src/engine/models/glbNodes.ts",
|
|
304
|
-
"file": "scripts/platform-chargebacks.mjs",
|
|
305
|
-
"why": "G520 retired-module identity: an exact comparison prevents an obsolete pending-user ledger row from earning credit. This selector deliberately names the deleted host; no file is loaded."
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
"path": "src/game/shardfile/buildingAssembly.ts",
|
|
309
|
-
"file": "scripts/platform-chargebacks.mjs",
|
|
310
|
-
"why": "G520 retired-module identity: an exact comparison prevents an obsolete pending-user ledger row from earning credit. This selector deliberately names the deleted host; no file is loaded."
|
|
311
|
-
},
|
|
312
302
|
{
|
|
313
303
|
"path": "src/engine/sim.ts",
|
|
314
304
|
"file": "test/sort-sides.test.ts",
|
|
@@ -359,21 +349,6 @@
|
|
|
359
349
|
"file": "scripts/generated-source.mjs",
|
|
360
350
|
"why": "build-sdk.mjs's gitignored package output: the generated-source check names the folder to skip, so it exists only in a tree that built the SDK and never in a clean CI checkout."
|
|
361
351
|
},
|
|
362
|
-
{
|
|
363
|
-
"path": "src/server/game/population/pageGroups.ts",
|
|
364
|
-
"file": "test/platform-chargebacks.test.ts",
|
|
365
|
-
"why": "A retired path kept on purpose: this test feeds it as a synthetic module name, and it must stay unclaimed."
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
"path": "src/server/game/ambient/crowdPage.ts",
|
|
369
|
-
"file": "test/platform-chargebacks.test.ts",
|
|
370
|
-
"why": "A retired path kept on purpose: this test feeds it as a synthetic module name, and it must stay unclaimed."
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
"path": "src/server/game/population/pageGroups.ts",
|
|
374
|
-
"file": "test/shard-component-spans.test.ts",
|
|
375
|
-
"why": "A retired path kept on purpose: this test feeds it as a synthetic module name, and it must stay unclaimed."
|
|
376
|
-
},
|
|
377
352
|
{
|
|
378
353
|
"path": "src/shards/*/bake/**/*.mjs",
|
|
379
354
|
"file": ".oxlintrc.json",
|
|
@@ -409,11 +384,6 @@
|
|
|
409
384
|
"file": "scripts/built-product.mjs",
|
|
410
385
|
"why": "Left with sharddev or a shard at P3"
|
|
411
386
|
},
|
|
412
|
-
{
|
|
413
|
-
"path": "src/shards",
|
|
414
|
-
"file": "scripts/check-closed-components.mjs",
|
|
415
|
-
"why": "Left with sharddev or a shard at P3"
|
|
416
|
-
},
|
|
417
387
|
{
|
|
418
388
|
"path": "src/shards",
|
|
419
389
|
"file": "scripts/check-custom-sections-zero.mjs",
|
|
@@ -504,11 +474,6 @@
|
|
|
504
474
|
"file": "scripts/json-declarations.mjs",
|
|
505
475
|
"why": "Left with sharddev or a shard at P3"
|
|
506
476
|
},
|
|
507
|
-
{
|
|
508
|
-
"path": "src/shards/",
|
|
509
|
-
"file": "scripts/listed-view-code.mjs",
|
|
510
|
-
"why": "Left with sharddev or a shard at P3"
|
|
511
|
-
},
|
|
512
477
|
{
|
|
513
478
|
"path": "test/manifest-declarations.test.ts",
|
|
514
479
|
"file": "scripts/live-prepush.py",
|
|
@@ -584,66 +549,6 @@
|
|
|
584
549
|
"file": "scripts/record-fence-reads.mjs",
|
|
585
550
|
"why": "Left with sharddev or a shard at P3"
|
|
586
551
|
},
|
|
587
|
-
{
|
|
588
|
-
"path": "src/sharddev/crowds.ts",
|
|
589
|
-
"file": "scripts/shard-components.mjs",
|
|
590
|
-
"why": "Left with sharddev or a shard at P3"
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
"path": "src/sharddev/phasedBoss.ts",
|
|
594
|
-
"file": "scripts/shard-components.mjs",
|
|
595
|
-
"why": "Left with sharddev or a shard at P3"
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
"path": "src/sharddev/kit/bakedGeometry.ts",
|
|
599
|
-
"file": "scripts/shard-components.mjs",
|
|
600
|
-
"why": "Left with sharddev or a shard at P3"
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
"path": "src/sharddev/kit/geometryPack.ts",
|
|
604
|
-
"file": "scripts/shard-components.mjs",
|
|
605
|
-
"why": "Left with sharddev or a shard at P3"
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
"path": "src/sharddev/assets.ts",
|
|
609
|
-
"file": "scripts/shard-components.mjs",
|
|
610
|
-
"why": "Left with sharddev or a shard at P3"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
"path": "src/sharddev/buildBehaviour.ts",
|
|
614
|
-
"file": "scripts/shard-components.mjs",
|
|
615
|
-
"why": "Left with sharddev or a shard at P3"
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
"path": "src/sharddev/questGraph.ts",
|
|
619
|
-
"file": "scripts/shard-components.mjs",
|
|
620
|
-
"why": "Left with sharddev or a shard at P3"
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
"path": "src/sharddev/bake/texture.ts",
|
|
624
|
-
"file": "scripts/shard-components.mjs",
|
|
625
|
-
"why": "Left with sharddev or a shard at P3"
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
"path": "src/shards/driftwood-isle/shard.config.ts",
|
|
629
|
-
"file": "scripts/shard-components.mjs",
|
|
630
|
-
"why": "Left with sharddev or a shard at P3"
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
"path": "src/sharddev/bake/rig.ts",
|
|
634
|
-
"file": "scripts/shard-components.mjs",
|
|
635
|
-
"why": "Left with sharddev or a shard at P3"
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
"path": "src/sharddev/phasedBoss.ts#RoamingBossRow",
|
|
639
|
-
"file": "scripts/shard-components.mjs",
|
|
640
|
-
"why": "Left with sharddev or a shard at P3"
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
"path": "src/sharddev/interactions.ts#interactionRules",
|
|
644
|
-
"file": "scripts/shard-components.mjs",
|
|
645
|
-
"why": "Left with sharddev or a shard at P3"
|
|
646
|
-
},
|
|
647
552
|
{
|
|
648
553
|
"path": "src/engine/",
|
|
649
554
|
"file": "scripts/shard-coupling.mjs",
|
|
@@ -659,26 +564,6 @@
|
|
|
659
564
|
"file": "scripts/shard-outputs.mjs",
|
|
660
565
|
"why": "Left with sharddev or a shard at P3"
|
|
661
566
|
},
|
|
662
|
-
{
|
|
663
|
-
"path": "src/shards",
|
|
664
|
-
"file": "scripts/shard-platform.mjs",
|
|
665
|
-
"why": "Left with sharddev or a shard at P3"
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
"path": "test/shard-headless.test.ts",
|
|
669
|
-
"file": "scripts/shard-platform.mjs",
|
|
670
|
-
"why": "Left with sharddev or a shard at P3"
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
"path": "src/server/host/package.json",
|
|
674
|
-
"file": "scripts/shard-platform.mjs",
|
|
675
|
-
"why": "Left with sharddev or a shard at P3"
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
"path": "src/shards/",
|
|
679
|
-
"file": "scripts/shard-platform.mjs",
|
|
680
|
-
"why": "Left with sharddev or a shard at P3"
|
|
681
|
-
},
|
|
682
567
|
{
|
|
683
568
|
"path": "src/shards",
|
|
684
569
|
"file": "scripts/shard-public.mjs",
|
package/scripts/check-paths.mjs
CHANGED
|
@@ -48,8 +48,8 @@ function strings(text) {
|
|
|
48
48
|
/** @param {string} file @param {string} text @param {string} path @param {number} index @param {string} [folder] */
|
|
49
49
|
function check(file, text, path, index, folder = ROOT) {
|
|
50
50
|
if (allowed.has(`${file}\0${path}`)) return;
|
|
51
|
-
//
|
|
52
|
-
const target =
|
|
51
|
+
// Ownership keys may append a declaration name (`path#name`) to an existing module.
|
|
52
|
+
const target = path.split('#')[0] ?? path;
|
|
53
53
|
// Censuses and G571 approvals keep format's logical src/format/x.ts labels (format-package.mjs): check where they live.
|
|
54
54
|
const at = onDisk(folder, target.replace(/^\.\//u, ''));
|
|
55
55
|
const found = GLOB.test(path) ? globSync(at).some((p) => statSync(p).isFile()) : existsSync(at);
|
|
@@ -7,7 +7,6 @@ import { pathToFileURL } from 'node:url';
|
|
|
7
7
|
import { runtimePerformanceSites } from '../lint/runtime-performance.mjs';
|
|
8
8
|
import { compareRuntimeFiles, RUNTIME_FILES_LIST } from '../lint/runtime-files.mjs';
|
|
9
9
|
import { zeroPolicyFailures } from './check-custom-sections-zero.mjs';
|
|
10
|
-
import { compareClosedComponents } from './check-closed-components.mjs';
|
|
11
10
|
import { SIDE_EDGES_LIST, compareSideEdges } from '../lint/engine-sides.mjs';
|
|
12
11
|
|
|
13
12
|
export const PLATFORM_LISTS = ['lint/row-functions.json', 'lint/edge-exemptions.json', 'lint/shard-platform.json', 'lint/ratchet.json', 'lint/sim-closure.json', 'lint/sim-schema-leaves.json', 'lint/shard-coupling.json', WEAPON_TRANSFER_LIST, CLASS_MOVE_LIST, 'lint/runtime-performance.json', RUNTIME_FILES_LIST, SIDE_EDGES_LIST];
|
|
@@ -152,8 +151,8 @@ export function comparePlatformList(list, baselineFile, candidateFile, trees, so
|
|
|
152
151
|
if (list === 'lint/ratchet.json') {
|
|
153
152
|
const read=file=>existsSync(file)?JSON.parse(readFileSync(file,'utf8')):undefined;
|
|
154
153
|
const fromSource=reader=>{const text=reader('lint/ratchet.json');return text===undefined?undefined:JSON.parse(text);};
|
|
155
|
-
const
|
|
156
|
-
return zeroPolicyFailures(after?.budgets??{})
|
|
154
|
+
const after=sources===undefined?read(candidateFile):fromSource(sources.after);
|
|
155
|
+
return zeroPolicyFailures(after?.budgets??{});
|
|
157
156
|
}
|
|
158
157
|
if (list === SIDE_EDGES_LIST) {
|
|
159
158
|
// P1-E2: the engine-side edge counts only fall; the first commit seeds them.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const KEYCHAIN_ARGS: readonly ['--use-mock-keychain', '--password-store=basic'];
|
|
1
|
+
export const KEYCHAIN_ARGS: readonly ['--use-mock-keychain', '--password-store=basic', '--mute-audio'];
|
package/scripts/ci-static.sh
CHANGED
|
@@ -37,7 +37,7 @@ if [ "$mode" = code ]; then
|
|
|
37
37
|
check native-item-frame proof sim-node-loader.mjs test/ci/native-item-frame.proof.mjs
|
|
38
38
|
check declared-input bash -c 'node scripts/pins.ts install nine-dragon-stack && node --import ./scripts/bake-loader.mjs --experimental-transform-types --test test/ci/declared-input.proof.mjs'
|
|
39
39
|
fi
|
|
40
|
-
check asks node
|
|
40
|
+
check asks node kit/scripts/asks.mjs check --all
|
|
41
41
|
if [ "$mode" = docs ]; then
|
|
42
42
|
check parity pnpm check:parity
|
|
43
43
|
# Space-separated repo paths from scripts/ci-selection.mjs. A file the config excludes (lift-pending, quarantine)
|
|
@@ -159,11 +159,9 @@ export async function committedFastChecks(root,base,tip,phase,paths) {
|
|
|
159
159
|
const {deletedReferences}=/** @type {typeof import('./push-checks.mjs')} */(await module('scripts/push-checks.mjs'));
|
|
160
160
|
failures.push(...deletedReferences(root,paths));
|
|
161
161
|
} else if(phase==='guards') {
|
|
162
|
-
const {closedComponentSources}=/** @type {typeof import('./check-closed-components.mjs')} */(await module('scripts/check-closed-components.mjs'));
|
|
163
162
|
const {comparePlatformList,PLATFORM_LISTS}=/** @type {typeof import('./check-platform-ratchets.mjs')} */(await module('scripts/check-platform-ratchets.mjs'));
|
|
164
163
|
const {ratchetApprovalFailures}=/** @type {typeof import('./ratchet-approval.mjs')} */(await module('scripts/ratchet-approval.mjs'));
|
|
165
164
|
const policy=json(view,'lint/ratchet.json');
|
|
166
|
-
failures.push(...closedComponentSources(root,policy.closedComponents));
|
|
167
165
|
if(view.files.has('scripts/check-spelled-paths.mjs')) {
|
|
168
166
|
const {spelledPathFailures}=/** @type {typeof import('./check-spelled-paths.mjs')} */(await module('scripts/check-spelled-paths.mjs'));
|
|
169
167
|
view.prime([...view.files.keys()].filter(path=>/^src\/(?:engine|game)\/isolated-[^/]+\.test\.ts$|^scripts\/.*\.[cm]?[jt]s$|^src\/shards\/[^/]+\/(?:data|look)\/map\.json$/u.test(path)));
|
|
@@ -109,7 +109,8 @@ const booted = page => page.waitForFunction(() => {
|
|
|
109
109
|
return typeof window.__workerClient === 'function' && window.__workerClient().frames > 0 && Array.isArray(timing?.entries) && timing.entries.some(/** @param {{operation: string}} row */ row => row.operation === 'app:loader-complete');
|
|
110
110
|
}, undefined, { timeout });
|
|
111
111
|
/** @param {import('playwright').Page} page */
|
|
112
|
-
|
|
112
|
+
// OFFLINE OF12: the channel sits in the name (`ws-preview-content-v1` on a build with no world; production keeps `ws-content-v1`)
|
|
113
|
+
const contentKeys = page => page.evaluate(async () => { const name = (await caches.keys()).find(key => /^ws-(?:[a-z]+-)?content-v1$/u.test(key)); return name === undefined ? [] : (await (await caches.open(name)).keys()).map(request => request.url); });
|
|
113
114
|
/** @param {import('playwright').Page} page @param {() => Promise<boolean>} test @param {string} what */
|
|
114
115
|
async function until(page, test, what) {
|
|
115
116
|
const end = Date.now() + timeout;
|
package/scripts/cook-worker.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// C4 (J28, J29, J30): the cook worker.
|
|
3
3
|
// node --import ./scripts/bake-loader.mjs scripts/cook-worker.mjs serve notify endpoint; lists the catalogue at boot
|
|
4
|
+
// (production, preview and staging heads: MS2.4, a new author's `upload --channel staging` is a staging head only)
|
|
4
5
|
// node --import ./scripts/bake-loader.mjs scripts/cook-worker.mjs recook every live and preview head, then exit; a deploy's step
|
|
5
6
|
// node --import ./scripts/bake-loader.mjs scripts/cook-worker.mjs bake <dist> <origin> the live heads this build cooked, onto its built client
|
|
6
7
|
// node --import ./scripts/bake-loader.mjs scripts/cook-worker.mjs gc <build>... keep those builds and every build a channel's
|
|
@@ -20,6 +21,7 @@ const { addStoredShards } = await import('./app-build/catalogue.ts');
|
|
|
20
21
|
const { refreshServiceWorker } = await import('./app-build/serviceWorker.ts');
|
|
21
22
|
const { folderStore, r2Store } = await import('../src/cook/game/packStore.ts');
|
|
22
23
|
const { rendererRevision } = await import('./renderer-revision.mjs');
|
|
24
|
+
const { shardfileValidationRevision } = await import('./shardfile-validation-revision.mjs');
|
|
23
25
|
const { liveDeployBuilds } = await import('./app-build/previousDeploy.mjs');
|
|
24
26
|
|
|
25
27
|
const env = process.env;
|
|
@@ -33,9 +35,13 @@ const root = fileURLToPath(new URL('..', import.meta.url));
|
|
|
33
35
|
const maxBytes = Number(env.COOK_MAX_SHARDFILE_BYTES ?? MAX_SHARDFILE_BYTES);
|
|
34
36
|
/** J262: the jobs can't compute it under `--permission`; a host that can't either cooks every preparation as stale. */
|
|
35
37
|
const renderer = (() => { try { return rendererRevision(root); } catch { return undefined; } })();
|
|
38
|
+
/** SA48: the validator each job validates with; an index stamped with it lets a page of the same validator admit the shard. */
|
|
39
|
+
const validator = (() => { try { return shardfileValidationRevision(root); } catch { return undefined; } })();
|
|
40
|
+
if (validator === undefined) console.warn('cook-worker: no shardfile validator revision, so no index carries a verdict and no page enters a placed slug from it (SA48)');
|
|
36
41
|
const worker = () => createCookWorker({
|
|
37
42
|
build: need('WILDSHARD_BUILD'), store, source: apiSource(need('WILDSHARD_API_URL'), fetch, maxBytes), log: line => { console.log(line); },
|
|
38
43
|
serverPacks: resolve(env.COOK_SERVER_PACKS ?? 'tmp/cook/server'), scratch: resolve(env.COOK_SCRATCH ?? 'tmp/cook/scratch'),
|
|
44
|
+
...(validator === undefined ? {} : { validator }),
|
|
39
45
|
launcher: {
|
|
40
46
|
root, execPath: process.execPath, loader: fileURLToPath(new URL('bake-loader.mjs', import.meta.url)), script: fileURLToPath(new URL('cook-job.mjs', import.meta.url)),
|
|
41
47
|
wrap: JSON.parse(env.COOK_JOB_WRAP ?? '[]'), ...(renderer === undefined ? {} : { renderer }),
|
|
@@ -48,12 +54,12 @@ if (command === 'serve') {
|
|
|
48
54
|
const cook = worker(), port = Number(env.COOK_PORT ?? 8792), host = env.COOK_HOST ?? '127.0.0.1';
|
|
49
55
|
notifyServer(cook, need('COOK_NOTIFY_TOKEN')).listen(port, host, () => { console.log(`cook worker on ${host}:${port}`); });
|
|
50
56
|
// J30: what a missed notice left behind. A catalogue that can't be read waits for the next notice.
|
|
51
|
-
try { await cook.recook(['live', 'preview']); } catch (error) { console.error(`boot list failed: ${String(error)}`); }
|
|
57
|
+
try { await cook.recook(['live', 'preview', 'staging']); } catch (error) { console.error(`boot list failed: ${String(error)}`); }
|
|
52
58
|
} else if (command === 'recook') {
|
|
53
|
-
const cook = worker(), rows = await cook.recook(['live']), preview = await cook.recook(['preview']);
|
|
59
|
+
const cook = worker(), rows = await cook.recook(['live']), preview = await cook.recook(['preview', 'staging']);
|
|
54
60
|
console.log(JSON.stringify([...rows, ...preview]));
|
|
55
61
|
// J29: a build takes no traffic with a live shard it couldn't cook. A refused head is already live, so it stops a deploy
|
|
56
|
-
// too. A preview
|
|
62
|
+
// too. A preview or staging head's verdict is the author's and stops nothing (MS2.4: staging is where a new author uploads).
|
|
57
63
|
process.exit(rows.every(row => row.state === 'cooked' || row.state === 'present') ? 0 : 1);
|
|
58
64
|
} else if (command === 'bake') {
|
|
59
65
|
// A deploy's step after `recook`: a page reads each head's packs from the store (J138), with no client rebuild.
|
package/scripts/cook.mjs
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// C1 (J28): `cook <shardfile.tar> <out>`, a shard's packs from its tarball alone: no bundle, no src/shards, no public/.
|
|
3
|
-
// node --import ./scripts/bake-loader.mjs scripts/cook.mjs <shardfile.tar> <out> [--phone-textures]
|
|
3
|
+
// node --import ./scripts/bake-loader.mjs scripts/cook.mjs <shardfile.tar> <out> [--no-phone-tier | --phone-textures | --phone-astc6]
|
|
4
4
|
// `out` receives `assets/spawn/parts/<hash>.pack.br`, one manifest per tier and set, and what no part may hold at its URL.
|
|
5
|
-
//
|
|
5
|
+
// By default (S12d) each phone row of the KTX2 table is cooked from its desktop master as ASTC 6×6 by basisu's
|
|
6
|
+
// WebAssembly build (`wasmAstc6`), cached in $WILDSHARD_ASTC6_CACHE (default ~/.cache/wildshard/gen/astc6-wasm/1).
|
|
7
|
+
// --no-phone-tier: phones read the rows as authored (before S12b). --phone-textures (S12b): trimmed to the phone size only.
|
|
8
|
+
// --phone-astc6 (S12c): the 6×6 encode by the basisu CLI (`basisuAstc6`), cached in ~/.cache/wildshard/gen/astc6/1.
|
|
9
|
+
// The encode counts go to stderr.
|
|
6
10
|
import { readFileSync } from 'node:fs';
|
|
7
11
|
import { homedir } from 'node:os';
|
|
8
12
|
import { resolve } from 'node:path';
|
|
9
13
|
import { BrotliSizeCache } from '../src/cook/game/brotliSizeCache.mjs';
|
|
10
14
|
|
|
11
15
|
const { cookShard, servedAsIs } = await import('../src/cook/game/shardCook.ts');
|
|
12
|
-
const
|
|
16
|
+
const FLAGS = new Set(['--no-phone-tier', '--phone-textures', '--phone-astc6']);
|
|
17
|
+
const flags = process.argv.slice(2).filter(arg => arg.startsWith('--')), unknown = flags.find(flag => !FLAGS.has(flag));
|
|
13
18
|
if (unknown !== undefined) throw new Error(`cook: unknown flag ${unknown}`);
|
|
14
19
|
const [tarball, out] = process.argv.slice(2).filter(arg => !arg.startsWith('--'));
|
|
15
|
-
if (tarball === undefined || out === undefined) throw new Error('usage: cook <shardfile.tar> <out> [--phone-textures]');
|
|
20
|
+
if (tarball === undefined || out === undefined || flags.length > 1) throw new Error('usage: cook <shardfile.tar> <out> [--no-phone-tier | --phone-textures | --phone-astc6]');
|
|
16
21
|
const served = new BrotliSizeCache(process.env.WILDSHARD_WIRE_SIZE_CACHE ?? resolve(homedir(), '.cache/wildshard/gen/served-bytes/1'));
|
|
22
|
+
const wasm = flags.length === 0
|
|
23
|
+
? await (await import('../src/cook/game/astc6Wasm.ts')).wasmAstc6({ cacheDir: process.env.WILDSHARD_ASTC6_CACHE ?? resolve(homedir(), '.cache/wildshard/gen/astc6-wasm/1') })
|
|
24
|
+
: undefined;
|
|
25
|
+
const astc6 = flags.includes('--phone-astc6')
|
|
26
|
+
? (await import('../src/cook/game/astc6Encode.ts')).basisuAstc6(process.env.WILDSHARD_ASTC6_CACHE ?? resolve(homedir(), '.cache/wildshard/gen/astc6/1'))
|
|
27
|
+
: wasm;
|
|
28
|
+
const tiers = flags.includes('--no-phone-tier') ? {} : { phone: true, ...(astc6 === undefined ? {} : { encode: astc6.encode }), ...(wasm === undefined ? {} : { prepare: wasm }) };
|
|
17
29
|
const report = await cookShard(readFileSync(tarball), resolve(out), {
|
|
18
30
|
now: () => performance.now(),
|
|
19
31
|
wireBytes: (url, bytes) => servedAsIs(url, bytes) ? bytes.length : served.bytes(bytes),
|
|
20
32
|
warn: line => { console.warn(`warning: ${line}`); },
|
|
21
|
-
|
|
33
|
+
tiers,
|
|
22
34
|
});
|
|
35
|
+
if (astc6 !== undefined) console.warn(`astc6: ${astc6.stats.encoded} encoded, ${astc6.stats.reused} reused, ${astc6.stats.failed} failed`);
|
|
23
36
|
console.log(JSON.stringify(report));
|
|
@@ -10,18 +10,18 @@ const root=mkdtempSync(join(directory,'run-'));
|
|
|
10
10
|
/** @param {string[]} args */
|
|
11
11
|
const git=args=>execFileSync('git',['-c','user.name=Docs proof','-c','user.email=proof@example.test',...args],{cwd:root,encoding:'utf8'}).trim();
|
|
12
12
|
try{
|
|
13
|
-
git(['init','--quiet','--initial-branch=main']);mkdirSync(join(root,'
|
|
14
|
-
copyFileSync('
|
|
13
|
+
git(['init','--quiet','--initial-branch=main']);mkdirSync(join(root,'kit/scripts'),{recursive:true});mkdirSync(join(root,'docs/tasks/asks'),{recursive:true});mkdirSync(join(root,'docs/plans'),{recursive:true});
|
|
14
|
+
copyFileSync('kit/scripts/asks.mjs',join(root,'kit/scripts/asks.mjs'));
|
|
15
15
|
writeFileSync(join(root,'docs/plans/actual.md'),'# Real plan');
|
|
16
16
|
writeFileSync(join(root,'docs/tasks/asks/A1.md'),'# A1\n\n**Status:** folded into actual\n\n**Ask:** Original recorded request\n');
|
|
17
17
|
git(['add','src','docs']);git(['commit','--quiet','-m','valid docs']);
|
|
18
|
-
assert.equal(spawnSync(process.execPath,['
|
|
18
|
+
assert.equal(spawnSync(process.execPath,['kit/scripts/asks.mjs','check','--all'],{cwd:root}).status,0);
|
|
19
19
|
unlinkSync(join(root,'docs/plans/actual.md'));git(['add','docs/plans/actual.md']);git(['commit','--quiet','-m','remove referenced plan']);
|
|
20
|
-
const invalid=spawnSync(process.execPath,['
|
|
20
|
+
const invalid=spawnSync(process.execPath,['kit/scripts/asks.mjs','check','--all'],{cwd:root,encoding:'utf8'});
|
|
21
21
|
assert.notEqual(invalid.status,0,'An empty Git index must not hide a committed dead ask target');
|
|
22
22
|
assert.match(invalid.stderr,/existing ask|plan/u);
|
|
23
|
-
writeFileSync(join(root,'docs/HOST-BAR.md'),'lint/
|
|
24
|
-
writeFileSync(join(root,'src/read-doc.mjs'),"import assert from 'node:assert/strict';import {readFileSync} from 'node:fs';assert.ok(readFileSync('docs/HOST-BAR.md','utf8').includes('lint/
|
|
23
|
+
writeFileSync(join(root,'docs/HOST-BAR.md'),'lint/host-register.json');
|
|
24
|
+
writeFileSync(join(root,'src/read-doc.mjs'),"import assert from 'node:assert/strict';import {readFileSync} from 'node:fs';assert.ok(readFileSync('docs/HOST-BAR.md','utf8').includes('lint/host-register.json'));");
|
|
25
25
|
git(['add','src/read-doc.mjs','docs/HOST-BAR.md']);git(['commit','--quiet','-m','document consumer']);
|
|
26
26
|
execFileSync(process.execPath,['src/read-doc.mjs'],{cwd:root});const before=git(['rev-parse','HEAD']);
|
|
27
27
|
writeFileSync(join(root,'docs/HOST-BAR.md'),'missing authority');git(['add','docs/HOST-BAR.md']);git(['commit','--quiet','-m','break documented contract']);
|