@wildshard/engine 0.1.17 → 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 +16 -0
- package/budgets/shard-size-baseline.json +10 -4
- package/index.html +6 -4
- package/lint/engine-sides.json +21 -0
- package/lint/host-callback-syntax.mjs +2 -1
- package/lint/host-callbacks.mjs +3 -3
- package/lint/host-files.mjs +5 -4
- package/lint/no-base64.mjs +3 -1
- package/lint/ratchet.json +0 -68
- package/lint/ratchet.mjs +1 -4
- package/lint/shard-imports.mjs +6 -7
- package/lint/shard-source.d.mts +9 -0
- package/lint/shard-source.mjs +91 -0
- package/lint/shardfile-boundaries.mjs +10 -8
- package/lint/sim-closure.mjs +6 -3
- package/lint/wildshard-plugin.d.ts +4 -0
- package/lint/wildshard-plugin.js +22 -23
- package/package.json +25 -16
- 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.d.mts +3 -0
- package/scripts/app-build/outputProducts.mjs +35 -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 +34 -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 +3 -1
- 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-check.mjs +4 -2
- package/scripts/chromium-keychain.d.mts +1 -1
- package/scripts/chromium-keychain.mjs +3 -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 +20 -3
- package/scripts/devices.d.mts +4 -0
- package/scripts/devices.mjs +39 -0
- package/scripts/devserver-client.d.mts +4 -2
- package/scripts/devserver-client.mjs +25 -8
- package/scripts/docs-inputs-proof.mjs +6 -6
- package/scripts/doctor-proof.mjs +1 -1
- package/scripts/e2e-faults.mjs +159 -0
- 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 +136 -18
- 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 +213 -0
- 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 +5 -3
- package/scripts/offline-proof-rules.mjs +34 -7
- package/scripts/offline-proof.mjs +88 -18
- 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-proof.mjs +101 -0
- package/scripts/tier-textures.mjs +78 -0
- 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 +1 -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 +84 -24
- package/scripts/worker-client-play.mjs +7 -2
- package/scripts/worker-client-proof.mjs +1 -1
- package/scripts/worker-client-slug.mjs +44 -0
- package/scripts/worktree-reap.mjs +5 -5
- package/src/.oxlintrc.json +3 -182
- package/src/client/app/entry.ts +47 -12
- 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/parsedPages.ts +127 -58
- package/src/client/engine/boot/texturePack.ts +2 -2
- package/src/client/engine/build.d.ts +2 -0
- package/src/client/engine/core/Game.ts +18 -0
- package/src/client/engine/core/bootstrap.ts +4 -1
- package/src/client/engine/debug/probe.ts +18 -1
- package/src/client/engine/fx/LightPool.ts +41 -1
- 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 +53 -14
- 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/render/precompile.ts +20 -14
- package/src/client/engine/saves/indexed.ts +2 -2
- package/src/client/engine/telemetry/browserErrors.ts +28 -4
- package/src/client/engine/telemetry/deviceSnapshot.ts +155 -0
- 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 -216
- package/src/client/game/boot/bytes.generated.ts +118 -238
- 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 -7
- package/src/client/game/devScene/hook.ts +291 -0
- package/src/client/game/grid/area.ts +38 -0
- package/src/client/game/grid/cellLoading.ts +12 -2
- package/src/client/game/grid/live.ts +134 -12
- package/src/client/game/grid/liveSession.ts +47 -5
- package/src/client/game/grid/mapAtlas.ts +18 -4
- package/src/client/game/grid/menu.ts +4 -0
- package/src/client/game/grid/minimapBlend.ts +15 -5
- package/src/client/game/grid/neighbourPanels.ts +10 -1
- package/src/client/game/grid/oneWayIn.ts +5 -1
- package/src/client/game/grid/placedCards.ts +55 -0
- package/src/client/game/grid/placedCells.ts +233 -0
- 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/regionalRuntime.ts +6 -0
- package/src/client/game/grid/regionalWorld.ts +15 -2
- package/src/client/game/grid/roadCull.ts +44 -14
- 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/roadTileBacking.ts +13 -3
- 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 +29 -4
- package/src/client/game/grid/shardfileFar.ts +9 -3
- 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 +11 -1
- package/src/client/game/shard/titleList.ts +6 -2
- 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 +21 -8
- 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/game/titleDeck.ts +4 -3
- package/src/client/host/online/doctor.ts +2 -0
- package/src/client/host/online/linkScreens.ts +30 -4
- package/src/client/host/online/shell.ts +14 -0
- 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 +67 -9
- package/src/cook/game/spawnParts.ts +33 -8
- package/src/cook/game/tierTextures.ts +349 -0
- package/src/e2e/smoke/game.ts +19 -14
- package/src/e2e/smoke/page-globals.d.ts +9 -8
- package/src/e2e/smoke/template2.spec.ts +8 -7
- 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 +4 -19
- 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/socketTransport.ts +2 -1
- package/src/server/host/dedicated/workerTable.ts +15 -4
- package/src/server/host/dedicated/world.ts +95 -8
- 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/engine/net/deviceWord.ts +138 -0
- package/src/shared/engine/net/socketFrames.ts +7 -4
- 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/catalogueSlot.ts +7 -0
- package/src/shared/game/grid/placementRows.ts +36 -0
- 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,22 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/python3 -I
|
|
2
2
|
# MMO-SERVER-PLAN MS3.5 (J266): the agents' one way to change a game server's settings, through sudo with no password.
|
|
3
3
|
# wildshard-config show <channel> print the channel's settings file
|
|
4
|
-
# wildshard-config set <channel> <KEY> <value> [--production]
|
|
5
|
-
#
|
|
4
|
+
# wildshard-config set <channel> <KEY> <value> [<KEY> <value>]... [--production]
|
|
5
|
+
# write the settings, restart the channel once, roll back if
|
|
6
|
+
# it does not come up healthy
|
|
6
7
|
# wildshard-config split <channel> setup.sh's: move the settings out of <channel>.env, once
|
|
7
8
|
# Settings live in /etc/wildshard/<channel>.settings (640 root:wildshard-<channel>), which the units read after <channel>.env.
|
|
8
|
-
# Secrets stay in the root-only .env, and this never
|
|
9
|
+
# Secrets stay in the root-only .env, and this never prints one or writes one (it reads only the placement rows there, for
|
|
10
|
+
# the pair check below): only the keys in SETTINGS below, each
|
|
9
11
|
# checked by its own rule. A production change needs --production, so no one changes the live world by a slip.
|
|
12
|
+
# The two placement keys (SA33, GC33) go together: the server throws at boot on one without the other, so a `set` that would
|
|
13
|
+
# leave the channel with one is refused before anything is written; set both in one call.
|
|
10
14
|
# Installed root-owned as /usr/local/sbin/wildshard-config by harden.sh; the sudo allowlist names that path only.
|
|
11
15
|
import os, re, subprocess, sys, tempfile, time, urllib.request
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
# 'metrics' is the channel's METRICS_PORT (SC1's /metrics on 127.0.0.1), the one harden-prometheus.sh scrapes (SC2).
|
|
18
|
+
CHANNELS = {'production': {'port': 8790, 'cpus': 9, 'host': 0, 'metrics': 9790}, 'staging': {'port': 8791, 'cpus': 4, 'host': 1, 'metrics': 9791}}
|
|
14
19
|
# The pages that open the game (engine doorTrust DEFAULT_ALLOWED_ORIGINS); each channel's own is at its 'host' index.
|
|
15
20
|
GAME_HOSTS = ('https://play.wildshard.io', 'https://staging.wildshard.io', 'https://preview.wildshard.io')
|
|
16
21
|
CELL = r'[a-z0-9][a-z0-9-]{0,63}'
|
|
22
|
+
# SA33a: the API's placement key, public half as SPKI DER hex; equal to engine scripts/preview-grid.ts PLACEMENT_PUBLIC_KEY (the
|
|
23
|
+
# engine's test holds them equal). Pinned, so an agent can point a channel at the API's own signed file and nothing else.
|
|
24
|
+
PLACEMENT_PUBLIC_KEY = '302a300506032b65700321004afd39342aac6a4de6066cb72e9df54cbd3d4eb522e5e6e175a17954ab98f25e'
|
|
25
|
+
PLACEMENT_PAIR = ('PLACEMENT_URL', 'PLACEMENT_PUBLIC_KEY')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def placements(channel):
|
|
29
|
+
"""The one signed placement file a channel reads: the API writes only releases/<channel>-placements.json (SA33a)."""
|
|
30
|
+
return f'https://packs.wildshard.io/releases/{channel}-placements.json'
|
|
31
|
+
|
|
17
32
|
# Each allowed key and its rule. Anything else is refused: secrets (SEAT_SECRET, SENTRY_DSN, DATABASE_URL), the trust roots
|
|
18
33
|
# (RELEASE_URL, RELEASE_PUBLIC_KEY, BUNDLE_ORIGIN, PACK_ORIGIN, TELEMETRY_URL, ERRORS_URL) and exposure (HOST, PORT,
|
|
19
|
-
# TRUST_PROXY) are root's, by hand or by a reviewed script.
|
|
34
|
+
# TRUST_PROXY) are root's, by hand or by a reviewed script. The placement pair is a trust root too, so each takes one
|
|
35
|
+
# exact value (the channel's own file, the API's pinned key) or blank, which the server reads as unset (Jake, 2026-11-13). ALLOWED_ORIGINS may only narrow (MS3.4): a set of the game's three
|
|
20
36
|
# hosts that keeps the channel's own, so an agent can drop a page but never add one or lock its own players out.
|
|
21
37
|
SETTINGS = {
|
|
22
38
|
'WORLD_CELLS': lambda value, channel: value == 'grid' or (re.fullmatch(f'{CELL}(,{CELL}){{0,63}}', value) is not None
|
|
@@ -26,12 +42,21 @@ SETTINGS = {
|
|
|
26
42
|
'RECORD_TAG': lambda value, channel: re.fullmatch(r'[A-Za-z0-9._-]{0,64}', value) is not None,
|
|
27
43
|
'ALLOWED_ORIGINS': lambda value, channel: (set(value.split(',')) <= set(GAME_HOSTS) and len(set(value.split(','))) == len(value.split(','))
|
|
28
44
|
and GAME_HOSTS[CHANNELS[channel]['host']] in value.split(',')),
|
|
45
|
+
'WORLD_CROSSING': lambda value, channel: value in ('off', 'worker'),
|
|
46
|
+
'PLACEMENT_URL': lambda value, channel: value in ('', placements(channel)),
|
|
47
|
+
'PLACEMENT_PUBLIC_KEY': lambda value, channel: value in ('', PLACEMENT_PUBLIC_KEY),
|
|
48
|
+
# SC2: the channel's own port, which the box's Prometheus scrapes, or blank (off). The server binds it on 127.0.0.1 only.
|
|
49
|
+
'METRICS_PORT': lambda value, channel: value in ('', str(CHANNELS[channel]['metrics'])),
|
|
29
50
|
}
|
|
30
51
|
RULES = {'WORLD_CELLS': "'grid' or comma-separated cell names (a-z, 0-9, -), none twice",
|
|
31
52
|
'WORLD_WORKERS': 'a whole number from 1 to the channel\'s pinned CPUs (production 9, staging 4)',
|
|
32
53
|
'WORLD_SEATS': 'a whole number from 1 to 2000', 'RECORD_TAG': 'up to 64 of A-Z a-z 0-9 . _ -',
|
|
33
54
|
'ALLOWED_ORIGINS': "comma-separated, none twice, from https://play.wildshard.io, https://staging.wildshard.io and "
|
|
34
|
-
"https://preview.wildshard.io, keeping the channel's own (production play, staging staging)"
|
|
55
|
+
"https://preview.wildshard.io, keeping the channel's own (production play, staging staging)",
|
|
56
|
+
'WORLD_CROSSING': 'off or worker',
|
|
57
|
+
'PLACEMENT_URL': "https://packs.wildshard.io/releases/<channel>-placements.json for this channel, or blank",
|
|
58
|
+
'PLACEMENT_PUBLIC_KEY': f'the API placement key {PLACEMENT_PUBLIC_KEY}, or blank',
|
|
59
|
+
'METRICS_PORT': "the channel's own metrics port (production 9790, staging 9791), or blank (off)"}
|
|
35
60
|
|
|
36
61
|
# The engine's tests hand it a made-up /etc and no systemctl; never as root, so sudo (which drops the environment anyway) cannot.
|
|
37
62
|
TEST = os.geteuid() != 0 and os.environ.get('WILDSHARD_CONFIG_TEST_ROOT')
|
|
@@ -60,6 +85,31 @@ def key_of(row):
|
|
|
60
85
|
return match.group(1) if match else None
|
|
61
86
|
|
|
62
87
|
|
|
88
|
+
def plain(row):
|
|
89
|
+
"""A row's value as systemd reads it: one pair of matching quotes stripped."""
|
|
90
|
+
value = row.split('=', 1)[1].strip()
|
|
91
|
+
if len(value) >= 2 and value[0] == value[-1] and value[0] in '"\'':
|
|
92
|
+
value = value[1:-1]
|
|
93
|
+
return value
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def effective(rows, keys):
|
|
97
|
+
"""What the server reads for these keys: the last assignment wins, as systemd reads it (spaces around the key and =)."""
|
|
98
|
+
seen = {}
|
|
99
|
+
for row in rows:
|
|
100
|
+
match = re.match(r'^\s*([A-Z_][A-Z0-9_]*)\s*=', row)
|
|
101
|
+
if match and match.group(1) in keys:
|
|
102
|
+
seen[match.group(1)] = plain(row[match.end() - 1:])
|
|
103
|
+
return seen
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def pair_broken(env_rows, settings_rows):
|
|
107
|
+
"""True when the server would start with one placement key and not the other (main.ts throws). The settings file is
|
|
108
|
+
read after the .env, and a blank value is unset. Only these two keys are read from the .env."""
|
|
109
|
+
seen = effective(env_rows + settings_rows, PLACEMENT_PAIR)
|
|
110
|
+
return (seen.get('PLACEMENT_URL', '') == '') != (seen.get('PLACEMENT_PUBLIC_KEY', '') == '')
|
|
111
|
+
|
|
112
|
+
|
|
63
113
|
def write_rows(path, rows, channel):
|
|
64
114
|
"""Atomic, never through a link, 640 root:wildshard-<channel>."""
|
|
65
115
|
folder = os.path.dirname(path)
|
|
@@ -121,7 +171,7 @@ def main(argv):
|
|
|
121
171
|
production = '--production' in argv
|
|
122
172
|
args = [arg for arg in argv if arg != '--production']
|
|
123
173
|
if not args or args[0] not in ('show', 'set', 'split'):
|
|
124
|
-
stop('usage: wildshard-config show <channel> | set <channel> <KEY> <value> [--production] | split <channel>')
|
|
174
|
+
stop('usage: wildshard-config show <channel> | set <channel> <KEY> <value> [<KEY> <value>]... [--production] | split <channel>')
|
|
125
175
|
verb = args[0]
|
|
126
176
|
if len(args) < 2 or args[1] not in CHANNELS:
|
|
127
177
|
stop('the channel is production or staging')
|
|
@@ -148,11 +198,6 @@ def main(argv):
|
|
|
148
198
|
stop('usage: wildshard-config split <channel>')
|
|
149
199
|
env_rows = read_rows(env_path)
|
|
150
200
|
# systemd strips one pair of matching quotes; a value that still fails its rule stays in the .env, never dropped.
|
|
151
|
-
def plain(row):
|
|
152
|
-
value = row.split('=', 1)[1].strip()
|
|
153
|
-
if len(value) >= 2 and value[0] == value[-1] and value[0] in '"\'':
|
|
154
|
-
value = value[1:-1]
|
|
155
|
-
return value
|
|
156
201
|
# The last assignment of a key is the one systemd uses; a key moves only if that one passes its rule, and then all of
|
|
157
202
|
# its rows move, so the precedence never changes (Codex J206).
|
|
158
203
|
last = {key_of(row): row for row in env_rows if key_of(row) in SETTINGS}
|
|
@@ -170,30 +215,45 @@ def main(argv):
|
|
|
170
215
|
print(f'doing move {", ".join(sorted(keys))} from {channel}.env to {channel}.settings')
|
|
171
216
|
return 0
|
|
172
217
|
|
|
173
|
-
if len(args) !=
|
|
174
|
-
stop('usage: wildshard-config set <channel> <KEY> <value> [--production]')
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
218
|
+
if len(args) < 4 or len(args) % 2 != 0:
|
|
219
|
+
stop('usage: wildshard-config set <channel> <KEY> <value> [<KEY> <value>]... [--production]')
|
|
220
|
+
pairs = list(zip(args[2::2], args[3::2]))
|
|
221
|
+
keys = [key for key, _ in pairs]
|
|
222
|
+
if len(set(keys)) != len(keys):
|
|
223
|
+
stop('each key once per set')
|
|
224
|
+
for key, value in pairs:
|
|
225
|
+
if key not in SETTINGS:
|
|
226
|
+
stop(f'{key} is not a setting an agent may change; allowed: {", ".join(SETTINGS)}')
|
|
227
|
+
if not SETTINGS[key](value, channel):
|
|
228
|
+
stop(f'{key} must be {RULES[key]}')
|
|
180
229
|
if channel == 'production' and not production:
|
|
181
230
|
stop('a production change needs --production')
|
|
182
231
|
before = read_rows(settings_path)
|
|
183
232
|
rows = list(before) or list(HEADER)
|
|
184
|
-
rows = [row for row in rows if key_of(row)
|
|
233
|
+
rows = [row for row in rows if key_of(row) not in keys] + [f'{key}={value}' for key, value in pairs]
|
|
234
|
+
change = ' '.join(f'{key}={value}' for key, value in pairs)
|
|
185
235
|
if rows == before:
|
|
186
|
-
print(f'ok {channel}
|
|
236
|
+
print(f'ok {channel} already has {change}')
|
|
187
237
|
return 0
|
|
238
|
+
# Checked against what the server would read, the .env included, so no restart can boot into main.ts's throw.
|
|
239
|
+
env_rows = read_rows(env_path)
|
|
240
|
+
if pair_broken(env_rows, rows):
|
|
241
|
+
if pair_broken(env_rows, before):
|
|
242
|
+
stop(f'{channel} already holds only one of PLACEMENT_URL and PLACEMENT_PUBLIC_KEY (in its .env or .settings), so '
|
|
243
|
+
'its server cannot start; set both in one call, both set or both blank')
|
|
244
|
+
stop('PLACEMENT_URL and PLACEMENT_PUBLIC_KEY go together: set both in one call, both set or both blank')
|
|
245
|
+
placing = effective(env_rows + rows, PLACEMENT_PAIR + ('WORLD_CELLS',))
|
|
246
|
+
if any(key in PLACEMENT_PAIR for key in keys) and placing.get('PLACEMENT_URL', '') != '' and placing.get('WORLD_CELLS', '').strip() != 'grid':
|
|
247
|
+
print(f'note {channel} WORLD_CELLS is not grid, so the server reads no placement file (main.ts)')
|
|
188
248
|
was_running = running(channel)
|
|
189
249
|
write_rows(settings_path, rows, channel)
|
|
190
|
-
print(f'doing {channel} {
|
|
250
|
+
print(f'doing {channel} {change}')
|
|
191
251
|
if not was_running:
|
|
192
252
|
# A channel still waiting for its first release keeps its health stub; the setting takes effect when it starts.
|
|
193
|
-
print(f'skip wildshard-server@{channel} is not running; {
|
|
253
|
+
print(f'skip wildshard-server@{channel} is not running; {change} takes effect when it starts')
|
|
194
254
|
return 0
|
|
195
255
|
if restart(channel):
|
|
196
|
-
print(f'ok {channel} is healthy with {
|
|
256
|
+
print(f'ok {channel} is healthy with {change}')
|
|
197
257
|
return 0
|
|
198
258
|
# It did not come back: put the old file back and start the old settings, so a bad value never leaves a channel down.
|
|
199
259
|
if before:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// J130: the row played through, as the flip's real checklist. Each step stands alone: one that fails is listed and the next still runs.
|
|
2
2
|
// Driftwood's opening quest, a fight and its coins; a ride on Nalati; a grapple; the other shards; a crossing; save, reload, resume.
|
|
3
|
-
import { saveFixture } from './debug-settings.mjs';
|
|
3
|
+
import { NAME_ASKED, saveFixture } from './debug-settings.mjs';
|
|
4
4
|
import { floorGridBenchmarkUrl, FLOOR_GRID_ENTER } from './frame-floor-navigation.mjs';
|
|
5
5
|
|
|
6
6
|
/** Open one page with the row on. */
|
|
@@ -9,6 +9,9 @@ async function open(browser, phone, base, path) {
|
|
|
9
9
|
page.on('pageerror', error => { errors.push(error.message.slice(0, 300)); });
|
|
10
10
|
page.on('console', line => { if (line.type() === 'error') errors.push(line.text().slice(0, 300)); });
|
|
11
11
|
await saveFixture(context, { scope: 'device', key: 'devMode', data: true });
|
|
12
|
+
// MP2.4: a device's first world entry asks for the Name, and on a world build (staging) nothing here answers it; mark it
|
|
13
|
+
// asked, as scripts/goldens/capture.mjs does
|
|
14
|
+
await saveFixture(context, NAME_ASKED);
|
|
12
15
|
await page.goto(new URL(path, base).href, { waitUntil: 'load' });
|
|
13
16
|
return { context, page, errors };
|
|
14
17
|
}
|
|
@@ -116,6 +119,7 @@ export async function play(browser, phone, base, only = '') {
|
|
|
116
119
|
if (runs('hurt')) { const { hurt } = await import('./worker-client-hurt.mjs'); await hurt(browser, phone, base, step); }
|
|
117
120
|
if (runs('windup')) { const { windup } = await import('./worker-client-windup.mjs'); await windup(browser, phone, base, step); }
|
|
118
121
|
if (runs('grid-entry')) { const { gridEntry } = await import('./worker-client-grid-entry.mjs'); await gridEntry(browser, phone, base, step); }
|
|
122
|
+
if (runs('slug')) { const { slugEntry } = await import('./worker-client-slug.mjs'); await slugEntry(browser, phone, base, step, process.argv.find(value => value.startsWith('--slug='))?.slice(7)); }
|
|
119
123
|
if (runs('recovery-menu')) { const { recoveryMenu } = await import('./worker-client-grid-entry.mjs'); await recoveryMenu(browser, phone, base, step); }
|
|
120
124
|
if (runs('death-order')) { const { deathOrder } = await import('./worker-client-death-return.mjs'); await deathOrder(browser, phone, base, step); }
|
|
121
125
|
if (runs('death')) { const { driftwoodDeath } = await import('./worker-client-death.mjs'); await driftwoodDeath(browser, phone, base, step); }
|
|
@@ -467,7 +471,8 @@ export async function play(browser, phone, base, only = '') {
|
|
|
467
471
|
|
|
468
472
|
// Every other shard boots on the row, its sky and fights on rows, with no page error
|
|
469
473
|
if (runs('shards')) for (const slug of ['pine-hollow', 'sunscar-dunes', 'far-reach', 'driftwood-isle', 'nalati-grasslands', 'nine-dragon-stack']) {
|
|
470
|
-
|
|
474
|
+
// a world build (staging) sends a bare `?chunk=` link to the title first (bootRoute.ts onlineTitleFirst); `skipintro` enters
|
|
475
|
+
const shard = await open(browser, phone, base, `/?chunk=${slug}&mute=1&nolock=1&skipintro`);
|
|
471
476
|
await step(`${slug} plays on the row`, async () => {
|
|
472
477
|
await entered(shard.page);
|
|
473
478
|
await shard.page.evaluate(() => { const { player } = window.__wildshard.world; player.touchMove.y = 1; });
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Then it reloads on the cache that walk left (Chromium refuses a whole-cache query that size), and with the link cut. --chunk= proves a one-shard page.
|
|
5
5
|
// --play is the flip's checklist: one playthrough on the row, a line for every step, and it fails on any step that didn't work.
|
|
6
6
|
// --hook on a chunk with a grapple proves the claw: LOCK and JUMP pressed on the page, and the server's bite and zip carrying the body.
|
|
7
|
-
// scripts/browser-lane.sh node scripts/worker-client-proof.mjs --base=http://127.0.0.1:4401/ [--seconds=150] [--crossings=2] [--route=x,z;x,z] [--chunk=slug] [--play [--only=movers|sky-trails|data-shard|driftwood|nalati|riding|nine|shards|grid|fights|roc|rocfall|rooms|elite|sky|sunscar|farreach|isle|pine|lantern|rig|sweep]] [--hook]
|
|
7
|
+
// scripts/browser-lane.sh node scripts/worker-client-proof.mjs --base=http://127.0.0.1:4401/ [--seconds=150] [--crossings=2] [--route=x,z;x,z] [--chunk=slug] [--play [--only=slug [--slug=<slug>]|movers|sky-trails|data-shard|driftwood|nalati|riding|nine|shards|grid|fights|roc|rocfall|rooms|elite|sky|sunscar|farreach|isle|pine|lantern|rig|sweep]] [--hook]
|
|
8
8
|
import { chromium, webkit, devices } from 'playwright';
|
|
9
9
|
import { saveFixture } from './debug-settings.mjs';
|
|
10
10
|
import { floorGridBenchmarkUrl, FLOOR_GRID_ENTER } from './frame-floor-navigation.mjs';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SA37 (meta SHARD-AUTHORING-PLAN): the `/slug/<slug>` link an author shares, on a world build. The page is the shard's one card;
|
|
2
|
+
// its PLAY leaves for `/?chunk=<slug>`, and that page enters the world's grid at the shard's cell, as a Shard select tap does.
|
|
3
|
+
// Passes when the server seats the body in that cell, the page stands inside it and plays, with no page error.
|
|
4
|
+
// scripts/browser-lane.sh node scripts/worker-client-proof.mjs --base=<a world build> --play --only=slug [--slug=driftwood-isle]
|
|
5
|
+
/** @typedef {import('./types/worker-page').WorkerWindow} WorkerWindow */
|
|
6
|
+
import { saveFixture } from './debug-settings.mjs';
|
|
7
|
+
import { entered, settled } from './worker-client-grid-entry.mjs';
|
|
8
|
+
|
|
9
|
+
/** @param {import('playwright').Browser} browser @param {import('playwright').BrowserContextOptions} phone @param {string} base
|
|
10
|
+
* @param {import('./types/worker-page').ProofStep} step @param {string} [slug] */
|
|
11
|
+
export async function slugEntry(browser, phone, base, step, slug = 'driftwood-isle') {
|
|
12
|
+
const context = await browser.newContext(phone), page = await context.newPage(), errors = /** @type {string[]} */ ([]);
|
|
13
|
+
page.on('pageerror', error => { errors.push(error.message.slice(0, 300)); });
|
|
14
|
+
await saveFixture(context, { scope: 'device', key: 'devMode', data: true });
|
|
15
|
+
try {
|
|
16
|
+
await step(`slug: /slug/${slug} shows the shard's one card with PLAY`, async () => {
|
|
17
|
+
await page.goto(new URL(`/slug/${slug}?mute=1&nolock=1`, base).href, { waitUntil: 'load' });
|
|
18
|
+
const play = page.locator('.ws-slug .ws-menu-play');
|
|
19
|
+
await play.waitFor({ timeout: 60_000 });
|
|
20
|
+
const card = await page.evaluate(() => {
|
|
21
|
+
const root = /** @type {HTMLElement | null} */ (document.querySelector('.ws-slug'));
|
|
22
|
+
return { slug: root?.dataset.slug, placed: root?.dataset.placed,
|
|
23
|
+
name: document.querySelector('.ws-slug .ws-menu-card b')?.textContent, play: document.querySelector('.ws-slug .ws-menu-play b')?.textContent, path: location.pathname };
|
|
24
|
+
});
|
|
25
|
+
return { ok: card.slug === slug && card.placed === 'true' && card.play === 'Play', ...card };
|
|
26
|
+
});
|
|
27
|
+
await step(`slug: PLAY enters the world's grid at ${slug}'s cell`, async () => {
|
|
28
|
+
await Promise.all([page.waitForEvent('domcontentloaded', { timeout: 60_000 }).catch(() => undefined), (async () => {
|
|
29
|
+
await page.locator('.ws-slug .ws-menu-play').click();
|
|
30
|
+
// a device's first PLAY asks for the Name once (MP2.4)
|
|
31
|
+
const name = page.locator('#ws-name-box input');
|
|
32
|
+
if (await name.waitFor({ timeout: 5000 }).then(() => true, () => false)) {
|
|
33
|
+
await name.fill('Slug');
|
|
34
|
+
await page.locator('#ws-name-box button[type=submit]').click();
|
|
35
|
+
}
|
|
36
|
+
})()]);
|
|
37
|
+
await entered(page);
|
|
38
|
+
const out = await settled(page, slug);
|
|
39
|
+
const url = new URL(page.url());
|
|
40
|
+
// the grid page keeps `/` once it is in (its address is the grid, not the shard), so the cell is read from the server's seat
|
|
41
|
+
return { ok: out.server === slug && out.current === slug && out.inside === slug && out.ready === true && !url.pathname.startsWith('/slug/') && errors.length === 0, path: url.pathname, server: out.server, inside: out.inside, home: out.home, ready: out.ready, frames: out.frames, closed: out.closed, errors: errors.slice(0, 4) };
|
|
42
|
+
});
|
|
43
|
+
} finally { await context.close(); }
|
|
44
|
+
}
|
|
@@ -103,21 +103,21 @@ export function stopWorktreeProcesses(tree,options={}){
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/** Newest change in the worktree's own Git state, in ms. @param {string} tree @param {string} gitDir */
|
|
106
|
-
function lastActivity(tree,gitDir){
|
|
106
|
+
export function lastActivity(tree,gitDir){
|
|
107
107
|
let newest=Number(git(tree,['log','-1','--format=%ct','HEAD']).trim())*1000;
|
|
108
108
|
for(const file of ['index','HEAD','logs/HEAD'])try{newest=Math.max(newest,statSync(join(gitDir,file)).mtimeMs);}catch{/* Not there. */}
|
|
109
109
|
return newest;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/** Is `sha` on origin/main itself? @param {string} canonical @param {string} sha */
|
|
113
|
-
const onMain=(canonical,sha)=>sha!==''&&tryGit(canonical,['merge-base','--is-ancestor',sha,'origin/main']).status===0;
|
|
113
|
+
export const onMain=(canonical,sha)=>sha!==''&&tryGit(canonical,['merge-base','--is-ancestor',sha,'origin/main']).status===0;
|
|
114
114
|
/** Commits of `sha` that origin/main lacks. @param {string} canonical @param {string} sha */
|
|
115
115
|
const aheadOfMain=(canonical,sha)=>Number(tryGit(canonical,['rev-list','--count',`origin/main..${sha}`]).stdout.trim()||'0');
|
|
116
116
|
|
|
117
117
|
/** @typedef {{path:string,head:string,branch:string}} Worktree */
|
|
118
118
|
|
|
119
119
|
/** Linked worktrees of the repo from `git worktree list --porcelain -z`. @param {string} canonical @returns {Worktree[]} */
|
|
120
|
-
function linkedWorktrees(canonical){
|
|
120
|
+
export function linkedWorktrees(canonical){
|
|
121
121
|
/** @type {Worktree[]} */const trees=[];
|
|
122
122
|
/** @type {Partial<Worktree>} */let current={};
|
|
123
123
|
for(const field of [...git(canonical,['worktree','list','--porcelain','-z']).split('\0'),'']){
|
|
@@ -157,7 +157,7 @@ export function reap(canonical,options,env,say){
|
|
|
157
157
|
if(!existsSync(tree.path)){keep('its folder is gone; `git worktree prune` clears it');continue;}
|
|
158
158
|
// Landed means the tip is on main itself (land fast-forwards): \`git cherry\` would miss a merge's own changes.
|
|
159
159
|
if(!onMain(canonical,tree.head)){keep(`${String(aheadOfMain(canonical,tree.head))} commit(s) not on main`);continue;}
|
|
160
|
-
const dirty=git(tree.path,['status','--porcelain','--untracked-files=all']).split('\n').filter(Boolean);
|
|
160
|
+
const dirty=git(tree.path,['--no-optional-locks','status','--porcelain','--untracked-files=all']).split('\n').filter(Boolean);
|
|
161
161
|
if(dirty.length>0){keep(`${String(dirty.length)} uncommitted path(s), first ${dirty[0]?.slice(3)}`);continue;}
|
|
162
162
|
const gitDir=git(tree.path,['rev-parse','--absolute-git-dir']).trim();
|
|
163
163
|
const busy=(/** @type {Map<number,string>|undefined} */ seen)=>seen===undefined?'cannot list process working directories'
|
|
@@ -180,7 +180,7 @@ export function reap(canonical,options,env,say){
|
|
|
180
180
|
if(stopped.length>0)say(`${options.dryRun?'would stop':'stopped '} ${slug}: orphaned pid ${stopped.join(', ')}`);
|
|
181
181
|
}
|
|
182
182
|
const head=tryGit(tree.path,['rev-parse','HEAD']).stdout.trim();
|
|
183
|
-
const now2=git(tree.path,['status','--porcelain','--untracked-files=all']).trim();
|
|
183
|
+
const now2=git(tree.path,['--no-optional-locks','status','--porcelain','--untracked-files=all']).trim();
|
|
184
184
|
const seen2=processDirectories();
|
|
185
185
|
const using2=busy(seen2===undefined||!options.dryRun?seen2:new Map([...seen2].filter(([pid])=>!orphans.has(pid))));
|
|
186
186
|
const why=head!==tree.head?`HEAD moved to ${head.slice(0,10)} during the check`:now2!==''?'edited during the check':using2!==''?`in use during the check (${using2})`
|
package/src/.oxlintrc.json
CHANGED
|
@@ -1,190 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
"unicorn",
|
|
6
|
-
"oxc",
|
|
7
|
-
"import",
|
|
8
|
-
"promise",
|
|
9
|
-
"node",
|
|
10
|
-
"react",
|
|
11
|
-
"react-perf",
|
|
12
|
-
"jsx-a11y"
|
|
13
|
-
],
|
|
14
|
-
// Strictest of greenroom (every category denied) and wildshard-singleplayer
|
|
15
|
-
// (these options, and import/no-nodejs-modules outside Node-side folders).
|
|
16
|
-
"options": {
|
|
17
|
-
"typeAware": true,
|
|
18
|
-
"denyWarnings": true,
|
|
19
|
-
"reportUnusedDisableDirectives": "error"
|
|
20
|
-
},
|
|
21
|
-
"categories": {
|
|
22
|
-
"correctness": "deny",
|
|
23
|
-
"suspicious": "deny",
|
|
24
|
-
"pedantic": "deny",
|
|
25
|
-
"perf": "deny",
|
|
26
|
-
"style": "deny",
|
|
27
|
-
"restriction": "deny",
|
|
28
|
-
"nursery": "deny"
|
|
29
|
-
},
|
|
2
|
+
"$schema": "../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"extends": ["../kit/.oxlintrc.json"],
|
|
4
|
+
// oxlint does not inherit ignorePatterns through extends (K11, J329).
|
|
30
5
|
"ignorePatterns": [
|
|
31
|
-
// Plain-JS repo scripts, outside the TS project; covered by
|
|
32
|
-
// `pnpm test:hooks` instead. (.githooks/ sits outside src/.)
|
|
33
6
|
"scripts/**",
|
|
34
7
|
"dist/**",
|
|
35
|
-
"node_modules/**",
|
|
36
8
|
"test-results/**",
|
|
37
9
|
"playwright-report/**"
|
|
38
|
-
],
|
|
39
|
-
"rules": {
|
|
40
|
-
"typescript/explicit-function-return-type": [
|
|
41
|
-
"deny",
|
|
42
|
-
{
|
|
43
|
-
"allowExpressions": false,
|
|
44
|
-
"allowTypedFunctionExpressions": false,
|
|
45
|
-
"allowHigherOrderFunctions": false,
|
|
46
|
-
"allowDirectConstAssertionInArrowFunctions": false,
|
|
47
|
-
"allowConciseArrowFunctionExpressionsStartingWithVoid": false,
|
|
48
|
-
"allowFunctionsWithoutTypeParameters": false,
|
|
49
|
-
"allowIIFEs": false
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"typescript/explicit-module-boundary-types": [
|
|
53
|
-
"deny",
|
|
54
|
-
{
|
|
55
|
-
"allowArgumentsExplicitlyTypedAsAny": false,
|
|
56
|
-
"allowDirectConstAssertionInArrowFunctions": false,
|
|
57
|
-
"allowHigherOrderFunctions": false,
|
|
58
|
-
"allowTypedFunctionExpressions": false
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"typescript/no-floating-promises": [
|
|
62
|
-
"deny",
|
|
63
|
-
{
|
|
64
|
-
"allowForKnownSafeCalls": [
|
|
65
|
-
{
|
|
66
|
-
"from": "package",
|
|
67
|
-
"package": "node:test",
|
|
68
|
-
"name": ["describe", "it", "suite", "test"]
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
],
|
|
73
|
-
"typescript/prefer-readonly-parameter-types": [
|
|
74
|
-
"deny",
|
|
75
|
-
{
|
|
76
|
-
"treatMethodsAsReadonly": true,
|
|
77
|
-
// Framework objects that are mutable by design and only ever passed in.
|
|
78
|
-
"allow": [
|
|
79
|
-
{ "from": "package", "package": "hono", "name": "Context" },
|
|
80
|
-
{ "from": "package", "package": "node:test", "name": "TestContext" },
|
|
81
|
-
{
|
|
82
|
-
"from": "package",
|
|
83
|
-
"package": "http",
|
|
84
|
-
"name": ["IncomingMessage", "ServerResponse"]
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
// A test drives one page through its own handle (src/e2e/smoke/).
|
|
88
|
-
"from": "package",
|
|
89
|
-
"package": "playwright-core",
|
|
90
|
-
"name": ["Page", "Route", "ConsoleMessage"]
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"from": "package",
|
|
94
|
-
"package": "playwright",
|
|
95
|
-
"name": [
|
|
96
|
-
"PlaywrightTestArgs",
|
|
97
|
-
"PlaywrightTestOptions",
|
|
98
|
-
"PlaywrightWorkerArgs",
|
|
99
|
-
"PlaywrightWorkerOptions"
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
"eslint/func-style": [
|
|
106
|
-
"deny",
|
|
107
|
-
"declaration",
|
|
108
|
-
{ "allowArrowFunctions": true }
|
|
109
|
-
],
|
|
110
|
-
"eslint/no-duplicate-imports": [
|
|
111
|
-
"deny",
|
|
112
|
-
{ "allowSeparateTypeImports": true }
|
|
113
|
-
],
|
|
114
|
-
// `return await` everywhere keeps stack traces and squares require-await with promise-function-async.
|
|
115
|
-
"typescript/return-await": ["deny", "always"],
|
|
116
|
-
// `void promise` is the marker no-floating-promises asks for.
|
|
117
|
-
"eslint/no-void": ["deny", { "allowAsStatement": true }],
|
|
118
|
-
// Continuation lines of a multi-line comment start mid-sentence.
|
|
119
|
-
"eslint/capitalized-comments": [
|
|
120
|
-
"deny",
|
|
121
|
-
"always",
|
|
122
|
-
{ "ignoreConsecutiveComments": true }
|
|
123
|
-
],
|
|
124
|
-
"react/jsx-filename-extension": ["deny", { "extensions": [".tsx"] }],
|
|
125
|
-
|
|
126
|
-
// Disabled: each contradicts another rule or fights the stack.
|
|
127
|
-
"eslint/sort-imports": "off", // oxfmt's sortImports owns import order; two sorters fight
|
|
128
|
-
"eslint/sort-keys": "off", // key order carries meaning (schemas, options); not autofixable
|
|
129
|
-
"eslint/one-var": "off", // one binding per declaration is how oxfmt lays code out
|
|
130
|
-
"eslint/no-undef": "off", // tsc reports undefined names; this misreads type-only globals
|
|
131
|
-
"eslint/no-undefined": "off", // contradicts unicorn/no-null; undefined is the absent value
|
|
132
|
-
"eslint/no-ternary": "off", // JSX conditional rendering needs it; no-nested-ternary stays on
|
|
133
|
-
"import/no-named-export": "off", // contradicts import/no-default-export; named exports win
|
|
134
|
-
"import/prefer-default-export": "off", // contradicts import/no-default-export
|
|
135
|
-
"import/no-relative-parent-imports": "off", // #subpath imports break the tsc build's extension rewrite
|
|
136
|
-
"node/no-top-level-await": "off", // contradicts unicorn/prefer-top-level-await; ESM-only, never require()d
|
|
137
|
-
"oxc/no-async-await": "off", // contradicts typescript/promise-function-async and require-await
|
|
138
|
-
"oxc/no-optional-chaining": "off", // contradicts typescript/prefer-optional-chain
|
|
139
|
-
"oxc/no-rest-spread-properties": "off", // ES5-compat ban; target is es2024
|
|
140
|
-
"react/react-in-jsx-scope": "off", // contradicts the react-jsx automatic runtime
|
|
141
|
-
"react/jsx-no-literals": "off" // i18n-only rule; no translations yet
|
|
142
|
-
},
|
|
143
|
-
"overrides": [
|
|
144
|
-
{
|
|
145
|
-
// Node programs may import node: modules; everything else (shared, client,
|
|
146
|
-
// web code) may not, as in wildshard-singleplayer.
|
|
147
|
-
"files": [
|
|
148
|
-
"cli/**",
|
|
149
|
-
"server/**",
|
|
150
|
-
"tools/**",
|
|
151
|
-
"test/**",
|
|
152
|
-
"e2e/**",
|
|
153
|
-
"cook/**",
|
|
154
|
-
"**/*.test.ts",
|
|
155
|
-
"*.config.ts",
|
|
156
|
-
"**/*.config.ts"
|
|
157
|
-
],
|
|
158
|
-
"rules": {
|
|
159
|
-
"import/no-nodejs-modules": "off"
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"files": ["*.config.ts", "**/*.config.ts"],
|
|
164
|
-
"rules": {
|
|
165
|
-
"import/no-default-export": "off", // playwright loads the default export
|
|
166
|
-
"node/no-process-env": "off" // config reads CI from the environment
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
// A journey spec is one story in test.step blocks, and it reads the page's own double-underscore globals.
|
|
171
|
-
"files": ["e2e/smoke/**"],
|
|
172
|
-
"rules": {
|
|
173
|
-
"eslint/max-statements": "off",
|
|
174
|
-
"eslint/max-lines-per-function": "off",
|
|
175
|
-
"eslint/no-underscore-dangle": [
|
|
176
|
-
"error",
|
|
177
|
-
{ "allow": ["__wildshard", "__workerClientRow", "__workerClient"] }
|
|
178
|
-
]
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"files": ["**/*.test.ts", "test/**", "e2e/**"],
|
|
183
|
-
"rules": {
|
|
184
|
-
"eslint/no-magic-numbers": "off", // assertions compare against literal expected values
|
|
185
|
-
"node/no-sync": "off", // test fixtures set up git repos synchronously
|
|
186
|
-
"node/no-process-env": "off" // the git helper isolates git from the developer's env
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
10
|
]
|
|
190
11
|
}
|