tools: the details group, the leak scenario's props and three fault classes (#22)

tools/details.test.mjs is the slice's WS acceptance: the five intents and
their codes, a grow push clear of a wall, a squeeze in a corridor too narrow
for the grown token, stuck from a wall and from a GM placement cleared by a
removal and by a shrink, the GM source of a status, the caps and who reads
which bucket, and a restart that brings size, props and statuses back. Waits
use a cursor taken before the intent, so a repeated state cannot be matched
by an older frame.

The leak scenario gains a token in view with props in all three buckets, a
GM-sourced status, a resize, a wall over it and the clears; leakcheck refuses
the `gm` bucket (GM_PROP), the `owner` bucket on a non-controller
(OWNER_PROP) and any `source` on a player status entry (STATUS_SOURCE), so
`fault.test.mjs` now asserts all twelve classes. The schema-version fixtures
in smoke/persistence move to 6, and mutation.sh gains am-au plus the renames.
This commit is contained in:
2026-11-15 11:02:43 +01:00
parent 20575f2147
commit e103c3ed5c
9 changed files with 530 additions and 25 deletions
+42
View File
@@ -19,6 +19,9 @@
// - a wall added and removed while the subject watches (its polygon shrinks and grows)
// - a door closing on a token, which the server pushes aside (5.5)
// - a token that is never within range at all (M4)
// - slice 7 (#22): props written into all three buckets on a token the subject can see, a
// GM-sourced status, a walls-sourced stuck from a new wall, a resize, and a prop.unset — every
// frame of the group is checked for the bucket and the `source` it must not carry
import fs from 'node:fs'
import path from 'node:path'
import { spawnSync } from 'node:child_process'
@@ -233,6 +236,45 @@ export async function runLeak({ origin, gmKey, stateDir, transcript, keepOpen =
const ack = await gm.ws.request({ t: 'door.set', scene, id: wallIds[1], open: false })
if (ack.ok !== true) throw new Error(`door.set refused: ${JSON.stringify(ack)}`)
})
// Slice 7 (#22): a token the subject can see, in every bucket and with a status. N2 sits 60 px
// north-east of A, so every frame of these groups is one the subject receives.
await group('GM creates N2 in view', async () => {
await createToken('N2', { kind: 'item', pos: [660, 600], descriptive_name: 'a rune',
actual_name: 'The Rune' })
})
await group('GM writes props into all three buckets on N2', async () => {
for (const [bucket, value] of [['public', 'cold'], ['owner', 3], ['gm', 'the duke']]) {
const ack = await gm.ws.request({ t: 'prop.set', target: 'token', id: ids.N2, bucket,
key: 'aura', value })
if (ack.ok !== true) throw new Error(`prop.set refused: ${JSON.stringify(ack)}`)
}
})
await group('GM sets a GM-sourced status on N2', async () => {
const ack = await gm.ws.request({ t: 'status.set', id: ids.N2, status: 'squeezed' })
if (ack.ok !== true) throw new Error(`status.set refused: ${JSON.stringify(ack)}`)
})
await group('GM resizes N2', async () => {
const resized = await gm.ws.request({ t: 'token.resize', id: ids.N2, radius: 45 })
if (resized.ok !== true) throw new Error(`token.resize refused: ${JSON.stringify(resized)}`)
})
await group('GM adds a wall over N2 (stuck, source walls)', async () => {
await addWall({ a: [700, 560], b: [700, 660], kind: 'wall' })
})
await group('GM unsets the public prop of N2', async () => {
const unset = await gm.ws.request({ t: 'prop.unset', target: 'token', id: ids.N2,
bucket: 'public', key: 'aura' })
if (unset.ok !== true) throw new Error(`prop.unset refused: ${JSON.stringify(unset)}`)
})
await group('GM clears the GM-sourced status of N2', async () => {
const cleared = await gm.ws.request({ t: 'status.clear', id: ids.N2, status: 'squeezed',
source: 'GM' })
if (cleared.ok !== true) throw new Error(`status.clear refused: ${JSON.stringify(cleared)}`)
})
await group('GM removes the wall over N2', async () => {
const ack = await gm.ws.request({ t: 'wall.remove', scene,
id: wallIds[wallIds.length - 1] })
if (ack.ok !== true) throw new Error(`wall.remove refused: ${JSON.stringify(ack)}`)
})
await group('A walks away from the door', async () => {
expectAck(await move(A, ids.A, [560, 950]), true)
})