@wildshard/engine 0.1.20 → 0.1.21
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/lint/engine-sides.json +1 -0
- package/package.json +2 -1
- package/scripts/chaos-proxy-core.mjs +14 -1
- package/scripts/chaos-proxy-proof.mjs +22 -0
- package/scripts/failmode-cases.d.mts +8 -0
- package/scripts/failmode-cases.mjs +97 -0
- package/scripts/failmode-proof.mjs +532 -0
- package/scripts/grid-crossing-nightly.mjs +5 -4
- package/scripts/grid-crossing-report.mjs +5 -2
- package/scripts/grid-crossing-tour.mjs +25 -8
- package/scripts/hover-speed-probe.mjs +136 -0
- package/scripts/net-lag-proof.mjs +3 -2
- package/scripts/online-rig.mjs +9 -7
- package/scripts/release-cook.mjs +109 -0
- package/scripts/vps/rebuild.sh +35 -9
- package/scripts/vps/wildshard-apply.mjs +5 -1
- package/scripts/vps/wildshard-config +117 -1
- package/src/client/engine/boot/contentRead.ts +54 -5
- package/src/client/engine/boot/gpuFiles.ts +3 -3
- package/src/client/engine/boot/leaveAfterPaint.ts +4 -1
- package/src/client/engine/core/shadowLayer.ts +18 -0
- package/src/client/engine/explore/pick.ts +13 -1
- package/src/client/engine/net/predictor.ts +12 -4
- package/src/client/engine/player/TouchControls.ts +3 -2
- package/src/client/engine/render/families/sceneSurface.ts +3 -1
- package/src/client/engine/telemetry/browserErrors.ts +3 -1
- package/src/client/engine/ui/ErrorModal.ts +1 -1
- package/src/client/engine/ui/Loading.ts +14 -2
- package/src/client/engine/ui/errorScreen.ts +51 -9
- package/src/client/engine/ui/hoverBoost.ts +31 -4
- package/src/client/engine/ui/styles/touch.css +6 -0
- package/src/client/game/boot/spawnDownload.ts +44 -6
- package/src/client/game/grid/live.ts +2 -2
- package/src/client/game/grid/liveSession.ts +2 -2
- package/src/client/game/grid/session.ts +2 -0
- package/src/client/game/grid/shardfileFar.ts +13 -2
- package/src/client/game/shardfile/clientSource.ts +7 -3
- package/src/client/game/shardfile/clientWorker.ts +4 -4
- package/src/client/game/shardfile/groundMerge.ts +5 -3
- package/src/client/host/online/linkScreens.ts +12 -6
- package/src/client/host/online/reconnectStrip.ts +3 -2
- package/src/client/host/online/release.ts +87 -16
- package/src/client/host/online/releaseScreens.ts +108 -0
- package/src/client/host/online/shell.ts +11 -1
- package/src/client/host/online/voice.ts +45 -1
- package/src/client/host/online/voiceUi.ts +24 -6
- package/src/server/engine/sim/playerSim.ts +1 -1
- package/src/server/game/grid/simulation.ts +12 -6
- package/src/server/host/dedicated/cellHost.ts +7 -0
- package/src/server/host/dedicated/cellWorker.ts +1 -1
- package/src/server/host/dedicated/dedicatedRoom.ts +14 -1
- package/src/server/host/dedicated/roadRoom.ts +3 -0
- package/src/server/host/standalone/gridServer.ts +1 -1
- package/src/shared/engine/boot/loadingWaits.ts +10 -2
- package/src/shared/engine/core/config.ts +3 -0
- package/src/shared/engine/player/hoverSpeed.ts +3 -3
- package/src/shared/engine/strings.ts +12 -1
- package/src/shared/game/grid/rules.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,14 @@ run `../repo-kit/release.sh vX.Y.Z --prepare` and `--finish` as before (the help
|
|
|
9
9
|
`scripts/changelog.mjs` checks the format; the pre-push hook and CI refuse a push whose `package.json` version has no
|
|
10
10
|
valid section, and a `vX.Y.Z` tag whose commit has none.
|
|
11
11
|
|
|
12
|
+
## v0.1.21 (2026-11-15)
|
|
13
|
+
|
|
14
|
+
- The hoverboard is faster online too: 14 m/s in a shard and 30 on the road, and boost is four times that (56 and 120).
|
|
15
|
+
- The HOVER tab says BOOST while boost is on.
|
|
16
|
+
- When something fails, the game says why and retries by itself: release reads, paused downloads and voice, which has Try again.
|
|
17
|
+
- Moving between shards is steadier on phones, and the grid waits for room before it loads a neighbour.
|
|
18
|
+
- Behind the scenes: agents now move the server's cook to each new release themselves, so a release needs no hands from Jake.
|
|
19
|
+
|
|
12
20
|
## v0.1.20 (2026-11-14)
|
|
13
21
|
|
|
14
22
|
- Big desktop screens stay smoother: the game drops its render sharpness a step when frames run slow and raises it again when there is room.
|
package/lint/engine-sides.json
CHANGED
|
@@ -1099,6 +1099,7 @@
|
|
|
1099
1099
|
"src/client/host/online/doctorPage.ts": "client",
|
|
1100
1100
|
"src/client/host/online/doctorView.ts": "client",
|
|
1101
1101
|
"src/client/host/online/linkScreens.ts": "client",
|
|
1102
|
+
"src/client/host/online/releaseScreens.ts": "client",
|
|
1102
1103
|
"src/client/host/online/reconnectStrip.ts": "client",
|
|
1103
1104
|
"src/client/host/online/release.ts": "client",
|
|
1104
1105
|
"src/client/host/online/shell.ts": "client",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "The Wildshard engine: one repo with shared, client, server and cook code and three build targets (client, dedicated server, standalone listen server), shaped like Unreal or Source.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -893,6 +893,7 @@
|
|
|
893
893
|
"./game/grid/gridCollision": "./src/shared/game/grid/gridCollision.ts",
|
|
894
894
|
"./game/grid/voidFloor": "./src/shared/game/grid/voidFloor.ts",
|
|
895
895
|
"./game/grid/assembly": "./src/shared/game/grid/assembly.ts",
|
|
896
|
+
"./game/grid/rules": "./src/shared/game/grid/rules.ts",
|
|
896
897
|
"./game/devColliders": "./src/shared/game/devColliders.ts",
|
|
897
898
|
"./game/devGameplay": "./src/shared/game/devGameplay.ts",
|
|
898
899
|
"./game/grid/catalogueSlot": "./src/shared/game/grid/catalogueSlot.ts",
|
|
@@ -195,6 +195,8 @@ export async function openChaosProxy(options) {
|
|
|
195
195
|
droppedBytes: 0,
|
|
196
196
|
forwardedMessages: 0,
|
|
197
197
|
droppedMessages: 0,
|
|
198
|
+
/** FM3: socket upgrades the proxy carried on to the world (a refused one is a `socket` match instead) */
|
|
199
|
+
upgrades: 0,
|
|
198
200
|
metadataOverflow: 0,
|
|
199
201
|
queueOverflow: 0,
|
|
200
202
|
}
|
|
@@ -749,7 +751,16 @@ export async function openChaosProxy(options) {
|
|
|
749
751
|
socket.destroy()
|
|
750
752
|
return
|
|
751
753
|
}
|
|
752
|
-
|
|
754
|
+
// FM3: the world door is `/`; a page Shard select sent to a grid cell names it (`/?chunk=<cell>`, shell.ts gotoSocket), and
|
|
755
|
+
// only that one bounded query passes on to the upstream
|
|
756
|
+
const asked = new URL(request.url ?? '', 'http://127.0.0.1'),
|
|
757
|
+
cell = asked.searchParams.get('chunk')
|
|
758
|
+
if (
|
|
759
|
+
asked.pathname !== '/' ||
|
|
760
|
+
[...asked.searchParams.keys()].some(name => name !== 'chunk') ||
|
|
761
|
+
asked.searchParams.getAll('chunk').length > 1 ||
|
|
762
|
+
(cell !== null && !/^[a-z0-9][a-z0-9-]{0,63}$/u.test(cell))
|
|
763
|
+
) {
|
|
753
764
|
socket.end(
|
|
754
765
|
'HTTP/1.1 404 Not Found\r\nConnection: close\r\nContent-Length: 0\r\n\r\n',
|
|
755
766
|
)
|
|
@@ -778,8 +789,10 @@ export async function openChaosProxy(options) {
|
|
|
778
789
|
)
|
|
779
790
|
return
|
|
780
791
|
}
|
|
792
|
+
counters.upgrades++
|
|
781
793
|
const address = new URL(worldTarget)
|
|
782
794
|
address.protocol = 'ws:'
|
|
795
|
+
if (cell !== null) address.searchParams.set('chunk', cell)
|
|
783
796
|
const offered = request.headers['sec-websocket-protocol']
|
|
784
797
|
/** @type {WebSocket} */
|
|
785
798
|
let remote
|
|
@@ -955,6 +955,28 @@ await test('shared pressure heals both native sending directions', async () => {
|
|
|
955
955
|
await fixture.close()
|
|
956
956
|
}
|
|
957
957
|
})
|
|
958
|
+
await test('a grid cell query reaches the world door, and nothing else does', async () => {
|
|
959
|
+
const fixture = await nativeFixture()
|
|
960
|
+
/** @type {string[]} */ const seen = []
|
|
961
|
+
fixture.wss.on('connection', (_peer, request) => {
|
|
962
|
+
seen.push(request.url ?? '')
|
|
963
|
+
})
|
|
964
|
+
try {
|
|
965
|
+
const world = fixture.proxy.ready.worldOrigin
|
|
966
|
+
const cell = new WebSocket(`${world.replace('http:', 'ws:')}/?chunk=driftwood-isle`)
|
|
967
|
+
await once(cell, 'open')
|
|
968
|
+
cell.close()
|
|
969
|
+
await once(cell, 'close')
|
|
970
|
+
assert.deepEqual(seen, ['/?chunk=driftwood-isle'])
|
|
971
|
+
const state = await (await fixture.proxy.control()).json()
|
|
972
|
+
assert.equal(state.counters.upgrades, 1)
|
|
973
|
+
for (const path of ['/?chunk=a&other=1', '/?chunk=a&chunk=b', '/?chunk=..%2F', '/x?chunk=a', '/?other=1'])
|
|
974
|
+
assert.equal((/** @type {{status:number}} */ (await rawRequest(world, path, { connection: 'Upgrade', upgrade: 'websocket', 'sec-websocket-key': 'YWJjZGVmZ2hpamtsbW5vcA==', 'sec-websocket-version': '13' }))).status, 404, path)
|
|
975
|
+
assert.equal(seen.length, 1)
|
|
976
|
+
} finally {
|
|
977
|
+
await fixture.close()
|
|
978
|
+
}
|
|
979
|
+
})
|
|
958
980
|
await test('zero-length delayed messages have a count bound', async () => {
|
|
959
981
|
const fixture = await nativeFixture(),
|
|
960
982
|
client = await socket(fixture.proxy.ready.worldOrigin)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type Phase = 'boot' | 'load' | 'play' | 'title' | 'doctor';
|
|
2
|
+
export type Outcome = 'pass' | 'ui-fail' | 'blocked-dependency' | 'unsupported' | 'harness-fail';
|
|
3
|
+
export interface Case { mode: string; id: string; owner: string; phase: Phase; screen: string; inject: string; recover: string; run?: string; blocked?: string; chromiumOnly?: boolean; parent?: string }
|
|
4
|
+
export const CASES: readonly Case[];
|
|
5
|
+
export function selectCases(asked: string): Case[];
|
|
6
|
+
export function verdict(rows: readonly { outcome: Outcome }[]): 0 | 1 | 2;
|
|
7
|
+
export function names(attribute: string | null, id: string): boolean;
|
|
8
|
+
export function rawLeak(text: string): string | null;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// FM3 (meta docs/plans/MMO-FAILURE-MODES-PLAN.md): the case manifest of the failure proof. Every one of the catalogue's 46 modes has a
|
|
2
|
+
// stable scenario name, its runtime owner row, the phase it happens in, how failmode-proof.mjs injects it, the screen a player must see
|
|
3
|
+
// (`data-failmode`, which may carry several ids: `drop reset`) and how it recovers. A `b` hold card and too-old's banner/page variant sit
|
|
4
|
+
// under their parent; they are not new numeric modes. `run` names the proof's runner; a case with no runner records why (`blocked`:
|
|
5
|
+
// its runtime row or contract isn't built; `unsupported`: this engine or harness can't produce the fault honestly). Neither is a pass.
|
|
6
|
+
|
|
7
|
+
/** @typedef {'boot' | 'load' | 'play' | 'title' | 'doctor'} Phase */
|
|
8
|
+
/** @typedef {'pass' | 'ui-fail' | 'blocked-dependency' | 'unsupported' | 'harness-fail'} Outcome */
|
|
9
|
+
/** @typedef {{ mode: string, id: string, owner: string, phase: Phase, screen: string, inject: string, recover: string, run?: string,
|
|
10
|
+
* blocked?: string, chromiumOnly?: boolean, parent?: string }} Case */
|
|
11
|
+
|
|
12
|
+
/** @type {readonly Case[]} */
|
|
13
|
+
export const CASES = Object.freeze([
|
|
14
|
+
// J298 amends mode 1: a world build holding a cached world loads it from cache and shows mode 2's card; mode 1's page is only for a page
|
|
15
|
+
// with nothing cached, which can't render its own screen (the browser's offline page). So a warmed world must show `offline-play`.
|
|
16
|
+
{ mode: '1', id: 'offline-launch', owner: 'FM5', phase: 'boot', screen: 'offline-play', inject: 'warm the service worker in the world, then setOffline and reload', recover: 'online: a frame, no card', run: 'offlineLaunch' },
|
|
17
|
+
{ mode: '2', id: 'offline-play', owner: 'FM4b', phase: 'play', screen: 'offline-play', inject: 'context.setOffline(true) in the world', recover: 'online: a frame, no card', run: 'offlinePlay' },
|
|
18
|
+
{ mode: '3', id: 'background-short', owner: 'FM4', phase: 'play', screen: 'background-short', inject: 'CDP freeze 4 s (server stalls the socket at 3 s)', recover: 'first frame: reconnected', run: 'freeze', chromiumOnly: true },
|
|
19
|
+
{ mode: '3b', id: 'background-short/blocked', parent: 'background-short', owner: 'FM4', phase: 'play', screen: 'background-short-blocked', inject: 'Interact while 3 shows', recover: 'closes on the first frame', blocked: 'the harness drives no in-world tap under a banner yet (test/net-strip-browser.test.ts covers the tap on a real room)' },
|
|
20
|
+
{ mode: '4', id: 'background-long', owner: 'FM4b', phase: 'play', screen: 'background-long', inject: 'CDP hidden 35 s (visibility changes)', recover: 'seated again: no card', run: 'freeze', chromiumOnly: true },
|
|
21
|
+
{ mode: '5', id: 'unreachable', owner: 'FM4b', phase: 'play', screen: 'unreachable', inject: 'refuse-upgrade 503 from the first dial', recover: 'heal: seated', blocked: 'mode 5 waits on a design call (FM4b: no readable /health; limit to a link that never heard a frame, or a public /health)' },
|
|
22
|
+
{ mode: '6', id: 'dns', owner: 'FM4b', phase: 'play', screen: 'unreachable', inject: '.invalid socket', recover: 'as 5', blocked: 'shares mode 5\'s screen (design call)' },
|
|
23
|
+
{ mode: '7', id: 'tls', owner: 'FM4b', phase: 'play', screen: 'unreachable', inject: 'self-signed 18793 listener', recover: 'as 5', blocked: 'shares mode 5\'s screen (design call)' },
|
|
24
|
+
{ mode: '8', id: 'upgrade-refused', owner: 'FM4b', phase: 'play', screen: 'unreachable', inject: 'refuse-upgrade 502', recover: 'as 5', blocked: 'shares mode 5\'s screen (design call)' },
|
|
25
|
+
{ mode: '9', id: 'restart', owner: 'FM4', phase: 'play', screen: 'restart', inject: 'socket close 4005 on every connection for 4 s', recover: 'heal: reconnected', run: 'socketDown' },
|
|
26
|
+
{ mode: '9b', id: 'restart/blocked', parent: 'restart', owner: 'FM4', phase: 'title', screen: 'restart-blocked', inject: 'Play on the title while 9 shows', recover: 'joins by itself', blocked: 'FM4 left: no link exists on the title yet' },
|
|
27
|
+
{ mode: '10', id: 'deploy', owner: 'FM4', phase: 'play', screen: 'deploy', inject: 'a newer signed release (needs a second build)', recover: 'the move lands', blocked: 'needs a second build of the same stamp; online-proof.mjs --next proves the countdown' },
|
|
28
|
+
{ mode: '10b', id: 'deploy/blocked', parent: 'deploy', owner: 'FM4', phase: 'title', screen: 'deploy-blocked', inject: 'Enter world in the last 15 s', recover: 'joins after the move', blocked: 'FM4 left: no link exists on the title yet' },
|
|
29
|
+
{ mode: '11', id: 'release-5xx', owner: 'FM5', phase: 'boot', screen: 'release-5xx', inject: 'release status 503 before navigation', recover: 'heal: the world loads by itself', run: 'releaseFault' },
|
|
30
|
+
{ mode: '12', id: 'release-429', owner: 'FM5', phase: 'boot', screen: 'release-429', inject: 'release status 429, Retry-After 3', recover: 'heal: the world loads after Retry-After', run: 'releaseFault' },
|
|
31
|
+
{ mode: '13', id: 'version-http', owner: 'FM5', phase: 'play', screen: 'version-http', inject: 'version.json status 503 (Developer on)', recover: 'heal: the next poll clears it', blocked: 'the next poll comes at the next foreground, at most every 5 min: the harness has no honest trigger yet' },
|
|
32
|
+
{ mode: '14', id: 'doctor-http', owner: 'FM8', phase: 'doctor', screen: 'doctor-http', inject: 'doctor status 503, then Check connection in the world', recover: 'heal, Try again: the doctor opens', run: 'doctorHttp' },
|
|
33
|
+
{ mode: '15', id: 'drop', owner: 'FM4', phase: 'play', screen: 'drop', inject: 'socket drop-after 0 (terminated: 1006), then refuse-upgrade for 2 s', recover: 'heal: reconnected chip', run: 'socketDown' },
|
|
34
|
+
{ mode: '15b', id: 'drop/blocked', parent: 'drop', owner: 'FM4', phase: 'play', screen: 'drop-blocked', inject: 'Talk while 15 shows', recover: 'closes on the first frame', blocked: 'the harness drives no in-world tap under a banner yet (test/net-strip-browser.test.ts covers the tap on a real room)' },
|
|
35
|
+
{ mode: '16', id: 'reset', owner: 'FM4', phase: 'play', screen: 'drop', inject: 'socket drop-after 0 (a reset is a 1006 to the page)', recover: 'heal: reconnected chip', run: 'socketDown' },
|
|
36
|
+
{ mode: '16b', id: 'reset/blocked', parent: 'reset', owner: 'FM4', phase: 'play', screen: 'reset-blocked', inject: 'Send in chat while 16 shows', recover: 'the held line sends once', run: 'heldChat' },
|
|
37
|
+
{ mode: '17', id: 'half-open', owner: 'FM4', phase: 'play', screen: 'half-open', inject: 'socket half-open (no downstream frames or pongs)', recover: 'heal: reconnected chip', run: 'socketDown' },
|
|
38
|
+
{ mode: '17b', id: 'half-open/blocked', parent: 'half-open', owner: 'FM4', phase: 'play', screen: 'half-open-blocked', inject: 'Pick up while 17 shows', recover: 'closes on the first frame', blocked: 'the harness drives no in-world tap under a banner yet' },
|
|
39
|
+
{ mode: '18', id: 'reconnected', owner: 'FM4', phase: 'play', screen: 'reconnected', inject: 'a 2 s drop', recover: 'the chip goes by itself', run: 'socketDown' },
|
|
40
|
+
{ mode: '19', id: 'resuming', owner: 'FM4', phase: 'play', screen: 'resuming', inject: 'drop, then refuse-upgrade 503 for 37 s', recover: 'heal: reconnected', run: 'socketDown' },
|
|
41
|
+
{ mode: '19b', id: 'resuming/blocked', parent: 'resuming', owner: 'FM4', phase: 'play', screen: 'resuming-blocked', inject: 'an action after 35 s down', recover: 'closes on the first frame', blocked: 'the harness drives no in-world tap under a banner yet' },
|
|
42
|
+
{ mode: '20', id: 'lost', owner: 'FM4', phase: 'play', screen: 'lost', inject: 'drop, then refuse-upgrade 503 for 122 s', recover: 'heal, Try again: seated', run: 'socketDown' },
|
|
43
|
+
{ mode: '21', id: 'slow', owner: 'FM4b', phase: 'play', screen: 'slow', inject: 'delay-frames 160 ms both ways (RTT over 250 ms)', recover: 'heal: clears after 10 good seconds', run: 'linkQuality' },
|
|
44
|
+
{ mode: '22', id: 'lossy', owner: 'FM4b', phase: 'play', screen: 'lossy', inject: 'delay-frames 20 ms ± 200 ms jitter downstream', recover: 'heal: clears after 10 good seconds', run: 'linkQuality' },
|
|
45
|
+
{ mode: '23', id: 'version-skew', owner: 'FM5', phase: 'play', screen: 'version-skew', inject: 'socket close 4000 (reload) on every connection', recover: 'one reload, then the page', run: 'socketDown' },
|
|
46
|
+
{ mode: '24', id: 'too-old', owner: 'FM5b', phase: 'play', screen: 'too-old-warning', inject: 'verified retention metadata excluding this build', recover: 'next load: too-old page', blocked: 'FM7 retention metadata not built' },
|
|
47
|
+
{ mode: '25', id: 'full', owner: 'FM4', phase: 'play', screen: 'full', inject: 'socket close 4002 on every connection for 3 s (FM7b queue numbers not built)', recover: 'heal: seated on the next 30 s retry', run: 'socketDown' },
|
|
48
|
+
{ mode: '26', id: 'replaced', owner: 'FM4', phase: 'play', screen: 'replaced', inject: 'a second tab of the same device takes the seat', recover: 'Play here: seated', run: 'replaced' },
|
|
49
|
+
{ mode: '27', id: 'auth-expired', owner: 'FM8b', phase: 'play', screen: 'auth-expired', inject: 'local provider expiry', recover: 'sign in: rejoins', blocked: 'FM8b / MP2.2 login contract not built' },
|
|
50
|
+
{ mode: '28', id: 'auth-failed', owner: 'FM8b', phase: 'title', screen: 'auth-failed', inject: 'provider callback error', recover: 'other ways to sign in', blocked: 'FM8b / MP2.2 login contract not built' },
|
|
51
|
+
{ mode: '29', id: 'api-5xx', owner: 'FM8b', phase: 'title', screen: 'api-5xx', inject: 'api status 503', recover: 'retry', blocked: 'FM8b / MP2.2 login contract not built' },
|
|
52
|
+
{ mode: '30', id: 'save-slow', owner: 'FM8s', phase: 'play', screen: 'save-slow', inject: 'owned persistence delay', recover: 'durable ack', blocked: 'FM7b live save status not built' },
|
|
53
|
+
{ mode: '30b', id: 'save-slow/blocked', parent: 'save-slow', owner: 'FM8s', phase: 'play', screen: 'save-slow-blocked', inject: 'Leave while 30 shows', recover: 'leave on the ack', blocked: 'FM7b live save status not built' },
|
|
54
|
+
{ mode: '31', id: 'save-failed', owner: 'FM8s', phase: 'play', screen: 'save-failed', inject: 'owned persistence failure', recover: 'durable ack', blocked: 'FM7b live save status not built' },
|
|
55
|
+
{ mode: '32', id: 'voice-failed', owner: 'FM8', phase: 'play', screen: 'voice-failed', inject: 'two peers, exhausted ICE', recover: 'linked or voice off', blocked: 'screen built (chat-corner.test.ts); the rig has no two-peer voice harness' },
|
|
56
|
+
{ mode: '32b', id: 'voice-failed/blocked', parent: 'voice-failed', owner: 'FM8', phase: 'play', screen: 'voice-failed-blocked', inject: 'talk while 32 shows', recover: 'Try again', blocked: 'screen built (chat-corner.test.ts); the rig has no two-peer voice harness' },
|
|
57
|
+
{ mode: '33', id: 'packs-5xx', owner: 'FM6', phase: 'load', screen: 'packs-5xx', inject: 'packs status 503 before navigation, healed after 6 s', recover: 'the world loads', run: 'packsFault' },
|
|
58
|
+
{ mode: '34', id: 'packs-429', owner: 'FM6', phase: 'load', screen: 'packs-429', inject: 'packs status 429, Retry-After 3, healed after 6 s', recover: 'the world loads', run: 'packsFault' },
|
|
59
|
+
{ mode: '35', id: 'book-5xx', owner: 'FM6', phase: 'load', screen: 'book-5xx', inject: 'book status 503 before navigation, healed after 6 s', recover: 'the world loads', run: 'packsFault' },
|
|
60
|
+
{ mode: '36', id: 'download-failed', owner: 'FM6', phase: 'load', screen: 'download-failed', inject: 'packs status 503 until the operation refuses', recover: 'heal, Retry: the world loads', run: 'packsFault' },
|
|
61
|
+
{ mode: '37', id: 'release-404', owner: 'FM5', phase: 'boot', screen: 'release-404', inject: 'release status 404', recover: 'heal, Try again: the world loads', run: 'releaseFault' },
|
|
62
|
+
{ mode: '38', id: 'captive-portal', owner: 'FM5', phase: 'boot', screen: 'captive-portal', inject: 'release body: an HTML sign-in page', recover: 'heal, Try again: the world loads', run: 'releaseFault' },
|
|
63
|
+
{ mode: '39', id: 'release-unsigned', owner: 'FM5', phase: 'boot', screen: 'release-unsigned', inject: 'release body: a file with a bad signature', recover: 'heal, Try again: the world loads; no dial while bad', run: 'releaseFault' },
|
|
64
|
+
{ mode: '40', id: 'refused', owner: 'FM4', phase: 'play', screen: 'refused', inject: 'socket close 4001 on every connection', recover: 'heal, Play again: seated', run: 'socketDown' },
|
|
65
|
+
{ mode: '41', id: 'banned', owner: 'FM8m', phase: 'play', screen: 'banned', inject: 'coded terminal close', recover: 'none: no redial', blocked: 'FM7b terminal-reason contract not built' },
|
|
66
|
+
{ mode: '42', id: 'clock-skew', owner: 'FM4b', phase: 'doctor', screen: 'clock-skew', inject: 'the page clock 2 min ahead, socket refused', recover: 'Run again with the clock right', run: 'clockSkew' },
|
|
67
|
+
{ mode: '43', id: 'storage-full', owner: 'FM6', phase: 'load', screen: 'storage-full', inject: 'Cache API put throws QuotaExceededError (labelled injection)', recover: 'plays on from memory', run: 'storageFull' },
|
|
68
|
+
{ mode: '44', id: 'pack-broken', owner: 'FM6', phase: 'load', screen: 'packs-5xx', inject: 'packs truncate 64 bytes, healed after 6 s', recover: 'the world loads with verified bytes', run: 'packsFault' },
|
|
69
|
+
{ mode: '45', id: 'sleep-wake', owner: 'FM4b', phase: 'play', screen: 'background-long', inject: 'CDP freeze 35 s with no visibility change', recover: 'seated again: no card', run: 'freeze', chromiumOnly: true },
|
|
70
|
+
{ mode: '46', id: 'staging', owner: 'FM5', phase: 'boot', screen: 'staging', inject: 'the fixture release signed with channel staging (loopback only)', recover: 'stays for the session', run: 'staging' },
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
/** The cases a `--scenario=` asks for: `all`, or a comma list of ids (a parent id brings its `b` case too). Unknown ids throw. @param {string} asked */
|
|
74
|
+
export function selectCases(asked) {
|
|
75
|
+
if (asked === 'all') return [...CASES];
|
|
76
|
+
const ids = asked.split(',').map(word => word.trim()).filter(word => word !== '');
|
|
77
|
+
const unknown = ids.filter(id => !CASES.some(item => item.id === id));
|
|
78
|
+
if (ids.length === 0 || unknown.length > 0) throw new Error(`--scenario names no case: ${unknown.join(', ') || '(empty)'}`);
|
|
79
|
+
return CASES.filter(item => ids.includes(item.id) || (item.parent !== undefined && ids.includes(item.parent)));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** The proof's exit: 0 when every selected case passed; 2 when the harness itself failed (an injection with no match, setup, cleanup or a
|
|
83
|
+
* guard), whatever else happened; else 1 (a screen missing, a dependency blocked, an engine that can't produce the fault). `--baseline`
|
|
84
|
+
* collects every case either way; it never changes this verdict. @param {readonly { outcome: Outcome }[]} rows */
|
|
85
|
+
export function verdict(rows) {
|
|
86
|
+
if (rows.some(row => row.outcome === 'harness-fail')) return 2;
|
|
87
|
+
return rows.length > 0 && rows.every(row => row.outcome === 'pass') ? 0 : 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Whether a `data-failmode` attribute (space-separated ids) names `id`. @param {string | null} attribute @param {string} id */
|
|
91
|
+
export const names = (attribute, id) => attribute !== null && attribute.split(/\s+/u).includes(id);
|
|
92
|
+
|
|
93
|
+
/** Primary copy a player reads may not carry a raw exception, a status line or an address: those belong in Details. @param {string} text */
|
|
94
|
+
export function rawLeak(text) {
|
|
95
|
+
const found = /\b(?:TypeError|Error:|Failed to fetch|NetworkError|undefined|null)\b|https?:\/\/|\bws:\/\/|\b[45]\d\d\b(?!\s*ms)/u.exec(text);
|
|
96
|
+
return found === null ? null : found[0];
|
|
97
|
+
}
|