Skip to content

Playtest harness (pt) for agents

pt drives real game instances on the test machine: it leases them, deploys a build and a plugin set, launches the game, walks the menus, plays turns, takes evidence and kills the match before it ends. It lives in tools/playtest/ on the playtest branch. Every command prints exactly one JSON object on stdout (logs go to stderr), so a script reads the last line of the output.

This page is for agents (and people) who write game tests. It covers the rules, the commands, the instances, and a scenario template. The design record is validation.md in the batch plan; this page is what you need to run a test.

Call the harness of the shared worktree by absolute path, never a copy in your own feature worktree, so every agent runs the same code:

Terminal window
PT=C:/Users/Jamin/Desktop/melange-wt-playtest/tools/playtest/pt.mjs
node $PT status

pt.cmd exists for cmd.exe, but it mangles | inside Lua code: call node pt.mjs directly (any Node 20+; the portable one is WUMFix/tools/node/node.exe). Use the Bash tool. Write any test code that contains backslashes with a file editor, not a heredoc: a heredoc ate the \ of \d in a regex twice.

Every command takes --timeout <s> (default 300, at most 540). When it runs out it prints {"done": false, ...} and exits 2, and you call it again: no command ever blocks for longer than that.

These are not style advice. Each one comes from a run that went wrong.

  1. Leases are mandatory. Never start, drive or kill a test game without holding a pt lease on its instance. The lease arms a watchdog that kills the game at the deadline, restores the instance’s ini, local.cfg and plugin set, guards the real Steam save, and frees the instance for the next agent.
  2. Never use dist\. The public dist\ build lacks the Automation, TestIso, SaveSandbox and TestInput modules, and copying it over an instance (the old Deploy helper) breaks the harness for everyone. Build into your own output with pt build --out va-<name> and deploy that. pt deploy refuses dist\ unless you pass --allow-dist.
  3. Wait in the foreground only. Never end your turn while a game, a build or a monitor of yours is running. Bound every wait (the --timeout above) and poll again. A lease you walk away from is killed at its deadline, but its instance is lost to everyone until then.
  4. Unique names. Shot, video and run names carry your run id (pt grab names files va-<runId>-<inst>-<label>). Delete only the exact files you created. The instance folders hold thousands of older shots with short names.
  5. A match never reaches its end. The end writes the user’s real Steam save (stats) and the results screen. Kill the match by releasing the lease after your last check. Never press Quit in a match, and never kill one game of a pair yourself: that ends the whole lease (peer-exit) and kills the other game too.
  6. Leave the user’s state alone. The user’s save, Documents\Melange\replays, Documents\Melange\logs and Documents\Melange\oasis_url.txt must be the same after your run as before. The deploy profile isolates all of them (TestIso, SaveSandbox, [Logging] Dir); the lease end checks them and fails the run when one changed.
  7. Instances only, never checkouts. Never touch Desktop\melange-plugins or the Desktop\WUMFix working tree. Work in your own worktree.
  8. At most 4 games at once (maxGames). The slots are part of the lease. --allow-six lifts the cap to 6 for one lease, for load-insensitive checks only (the harness smoke uses it for P1 + P2 + W). Timing-sensitive LocalNet runs (holds, cinematics, clock edges) run with at most one other game.

The instances are game copies under C:\Users\Jamin\Desktop\WUMFix\testenv\<X>.

Pool Instances LocalNet ports Oasis ports Use
P1 A (host, HostA) + B (join, JoinB) 47700-47707 8811, 8812 LocalNet pair
P2 C (host, HostC) + D (join, JoinD) 47800-47807 8813, 8814 LocalNet pair
P3 W (SoloW) 47900-47907, no peer 8815 local (solo) runs

The roles are fixed by the ini: A and C host, B and D join. X is vanilla and is not provisioned. Every launch writes the pool’s [LocalNet] BasePort and the instance’s [Oasis] Port, so two pools never see each other’s lobbies.

Terminal window
node $PT lease --inst A,B --guards on,matchStarted --max-minutes 20 --agent <task> --purpose "<what>" [--wait 60]
node $PT lease --pair | --solo # first free pair (P1, then P2) / first free solo (W first)
node $PT status # every live lease
node $PT status --id <lease> # also the ended record of that lease
node $PT guards --lease <id> --set allowKills # change guard options while the lease runs
node $PT release --id <lease> # kill its games, restore everything, end with "released"
node $PT lease --reclaim <inst> # restore and free a stale lease (dead harness and watchdog)
  • Acquisition is all or nothing (pool, then instances, then slots), so two agents never deadlock. --wait polls, but it is not first come first served: when the box is busy, poll short waits for W and the pairs in turn.
  • Pass --id <lease> to every later command. An ended lease id never falls back to whoever holds the instance now.
  • The lease ends by itself: at its deadline (--max-minutes, default 20, cap 45), 60 s after its last game exited (game-exited), when one game of a pair dies (peer-exit), or when a guard fires (guard-*). Each launch of one test must happen inside one lease: a relaunch after a game-exited end is a new lease.
  • The ended record (testenv/.va/ended/<id>.json) holds endReason, the killed pids, what was restored, and the guardian’s findings (saveTouched, Documents listing differences, failed).

Guards are opt-in: a lease that names any guard option (--guards on is enough) is guarded; a lease with none is not, so agents who drive matches that are meant to lose worms or raise water are not surprised. Pass --guards off to make that explicit. Use guards for every run that does not need those events. The options:

Option Effect
(default, with guards on) kill on rising water (above the match’s starting level, or sudden death), on a side with 1 or fewer living worms, on a decided match (one team left), on the results scene or a [net] ... -> WaitingUnload line, on a frozen sim (30 s), and on the CPU demo match
allowKills worms may die
allowWater or allowWater=<s> water may rise (for N s)
allowEnd the match may be decided; WaitingUnload and results still kill
stopOnDesync a [wormsign] DESYNC line kills (otherwise it is only recorded)
matchStarted the harness starts the match itself: turns off the CPU demo guard
minAlive=<n>, freezeSec=<n> thresholds
Terminal window
node $PT build --worktree C:/Users/Jamin/Desktop/melange-wt-<x> --out va-<name> --timeout 540
node $PT deploy --lease <id> --build <wt>/dist-va-<name> [--profile net|solo] \
[--mods id=<mod folder or worktree>,...] [--only id,id] [--exempt id,...] [--ini Sec.Key=Value]... [--secret Sec.Key=env:VAR]...
  • pt build runs the worktree’s build.ps1 -PrivateDir C:/Users/Jamin/Desktop/melange-private -Out va-<name> and refuses an asi without the markers a test instance needs (the CMakeLists version, LocalNet, Automation, TestIso, SaveSandbox). A build takes 4 to 15 minutes on a loaded box. On a timeout, run the same command again: the build resumes where it stopped. Set _MSPDBSRV_ENDPOINT_ to a unique value when another build may be running (C1902 “PDB manager mismatch”).
  • pt deploy copies melange.asi, Melange.pdb and Melange.exe while the games are closed (the old ones are kept in runs/<id>/<inst>/build-before; they are not put back), installs the plugin set, and writes the ini profile. The lease end restores the ini, local.cfg and plugin set.
  • --mods id=path: a mod folder (with spice.json) or a worktree with plugins/<id>/mod. --only turns every other plugin off. For a pair, deploy refuses when the enabled plugin folders differ between the two instances (the lobby mod hash would split them); --exempt leaves a probe or kit out of that comparison.
  • The profile (net for pairs, solo for a solo lease) turns on Automation (RunInBackground), LocalNet with the pool’s port, Oasis with AutoStart, MirageTest and DocShot, TestIso (replays and the Oasis URL file inside the instance), SaveSandbox (the game’s save calls go to <inst>\Melange\save), TestInput (va.press), [NetSession] FixCameraHold, windowed display, [Rules] Dir=Melange/rules-va, [Logging] Dir=<inst>\Melange\logs-va, Wormsign recording with no retention (and the hash exchange for net), and turns off Update, the store sweep and the Store. --ini adds or overrides keys.
  • A LocalNet pair needs SaveSandbox on: the shared save’s level points at Multi.foldspace_caldera, so also deploy foldspace=C:/Program Files (x86)/Steam/steamapps/common/WormsXHD/Mods/foldspace or the lobby holds the start.
  • The Rules draft persists per instance in Melange\rules-va. When a run needs vanilla rules, point [Rules] Dir at a folder of your own (--ini Rules.Dir=Melange/rules-<task>).
Terminal window
node $PT launch --lease <id> --inst A [--no-ini] # pid, hwnd, session folder; waits for the overlay
node $PT keys --lease <id> --inst A --seq "key RETURN;wait 300;key DOWN"
node $PT verb --lease <id> --inst A "mt.grab name" # one automation verb, waits for its marker
node $PT lua --lease <id> --inst A [--mod <id>] [--target client|match|mod] '<lua>' # Oasis lua.eval
node $PT rpc --lease <id> --inst A <method> '<json>' # any Oasis method
node $PT logs --lease <id> --inst A --mark # then --since <mark> --cat mod --mod <id> --grep <re>
node $PT status --lease <id> --inst A # the game, its last automation status line
  • After pt deploy, pt launch also works without --no-ini; pass --no-ini only when you edited the ini yourself.
  • The Oasis URL comes only from the instance’s own Melange\oasis_url.txt, never from Documents.
  • Automation keys go to DirectInput. They never reach a mod’s text box; posted mouse input does not reach the game on current builds (no clicks fire, the right click opens no panel). Plan keyboard routes, or call the mod’s own functions with pt lua.
Terminal window
node $PT flow localnet --lease <pair> [--host A --join B] --run-id <id> # launch both, boot, host, join, ready, match
node $PT flow boot --lease <id> --inst W # wait for the front end's main menu
node $PT flow quick --lease <id> --inst W # Local Game > Quick Game, 4 human teams
node $PT flow custom --lease <id> --inst W # Local Game > Versus, 2 human teams
node $PT flow net-boot | net-host | net-join | ready | leave | shot --lease <id> --inst X

Each flow checks every step against a log line or the probe’s scene and, on failure, names the step and saves a shot. flow localnet takes about 100 s on a quiet box and about 170 s with five games starting at once. If it fails, release the lease and start over with a new one: killing a peer ends the pair lease anyway.

Terminal window
node $PT turn wait --lease <id> --after <turn> [--team k] [--local X] # next turn in play: turn, team, whose machine
node $PT turn select --lease <id> --inst X --weapon bazooka --via kit|panel|testapi
node $PT turn fire --lease <id> --inst X --via press|drive --aim down:1200 --power 400 [--max-shots 1]
node $PT turn settle --lease <id> --inst X --turn <n> # until that turn has ended
node $PT turn end --lease <id> --inst X [--via match|kit|fire]
node $PT turn state --lease <id>
  • Online (a pair): pick with --via kit (the va-kit mod picks the plan’s weapon on every peer at the same sim tick) and fire on the active machine with --via press (the TestInput module’s va.press Input.Fire, which travels like a key press). A match-console Input.* message is local only and desyncs LocalNet.
  • Offline (W): pick with --via panel (the real weapon panel, opened through the match console, then real arrow keys and RETURN) and fire with --via drive (input.drive).
  • Gate any mouse or panel action on turn wait (phase play): a right click outside the play phase opens the pause menu.
Terminal window
node $PT grab --lease <id> --inst X --label <name> [--via mtgrab|docshot|render]
node $PT video --lease <id> --inst X --label <name> --seconds 10 [--start-on <regex>] [--then "<verb>"]
node $PT audio --lease <id> --inst X --label <name> --seconds 10
node $PT desync --lease <pair> --turns 3 # run it BEFORE the release: it asks both games
node $PT collect --lease <id> --scenario <name> --worktree <wt>... # manifest.json + logs (secrets redacted)
node $PT verdict --lease <id> --scenario <name> --check "name=pass|fail:detail" ... [--finish]

Everything lands in testenv/.va/runs/<leaseId>/: manifest.json (build sha256 and version, plugin hashes, the redacted ini, git heads), verdict.json, shots/, video/, and one folder per instance with its logs.

  • pt grab uses mt.grab (HUD included). It does not show a mod’s screen overlay: use --via docshot for mod UI.
  • pt video records the window with Windows Graphics Capture, so other windows on top do not matter. It starts about 1 s late.
  • pt audio captures one process’s sound only. A running game is never silent (menu music, the CPU demo).
  • pt desync passes when both peers report diverged=0 and enough compared ticks (default 1500), the same mods, no DESYNC line, divergence record or new bundle, no abort or time-sync line, the same turn count and the same sim tick for every turn end.
  • pt verdict after the release adds the lease’s end (reason, guard, guardian findings) to the verdict; --finish also checks that the files it names exist and that no secret pattern is left in the run folder. A touched save or a changed Documents listing fails the verdict.
Terminal window
node $PT doctor # census of every instance: ini keys, asi sha and version, plugins, foreign games
node $PT doctor --baseline # first-ever copy of each instance's ini and state (never overwritten)
node $PT doctor --normalise # fix known drift (D's LocalNet name and port, Record) on idle instances only

A scenario is a script that takes a lease, sets the instances up, plays, checks, and always releases. Keep it to pt commands, so the next agent can rerun it. This is the shape of the harness smoke (one LocalNet pair, four turns):

#!/bin/bash
# <task>: <what this proves>. usage: scenario.sh <tag>
PT=C:/Users/Jamin/Desktop/melange-wt-playtest/tools/playtest/pt.mjs
BUILD=C:/Users/Jamin/Desktop/melange-wt-<x>/dist-va-<name>
PROBE=C:/Users/Jamin/Desktop/melange-private/testmods/va-probe
KIT=C:/Users/Jamin/Desktop/melange-private/testmods/va-kit
FOLD="C:/Program Files (x86)/Steam/steamapps/common/WormsXHD/Mods/foldspace"
j() { node -e "const s=require('fs').readFileSync(0,'utf8').trim().split('\n').pop();const j=JSON.parse(s);console.log(eval(process.argv[1]))" "$1"; }
# 1. lease (guards on; the harness starts the match itself)
L=$(node $PT lease --pair --guards on,matchStarted --max-minutes 20 --agent <task> --purpose "<what>" --wait 60 | j "j.ok?j.lease.id:''")
[ -n "$L" ] || exit 1
trap 'node $PT release --id $L' EXIT # 7. always release: kills the match before its end
# 2. build in, plugin set, ini profile
node $PT deploy --lease $L --build $BUILD --mods "va-probe=$PROBE,va-kit=$KIT,foldspace=$FOLD,<id>=<worktree>" \
--only va-probe,va-kit,foldspace,<id> --ini "Rules.Dir=Melange/rules-<task>" | j "j.ok" | grep -q true || exit 1
# 3. to the match
node $PT flow localnet --lease $L --run-id <task>-<tag> --timeout 520 | j "j.ok" | grep -q true || exit 1
# 4. play: four fired turns
AFTER=0
for n in 1 2 3 4; do
W=$(node $PT turn wait --lease $L --after $AFTER --sec 100 --timeout 120)
X=$(echo "$W" | j "j.local"); T=$(echo "$W" | j "j.turn")
node $PT turn select --lease $L --inst $X --weapon bazooka --via kit
node $PT turn fire --lease $L --inst $X --via press --aim down:1200 --power 400 --max-shots 1
for I in A B; do node $PT turn settle --lease $L --inst $I --turn $T; done # the pair's instances
AFTER=$T
done
# 5. evidence and checks, before the release
node $PT grab --lease $L --inst A --label end; node $PT grab --lease $L --inst B --label end
node $PT video --lease $L --inst A --label turn5 --seconds 10
D=$(node $PT desync --lease $L --turns 3 | j "j.verdict")
# ... the feature's own checks: pt logs --grep, pt lua, the probe's state ...
node $PT collect --lease $L --scenario <task> --worktree C:/Users/Jamin/Desktop/melange-wt-<x>
# 6. release, then the verdict (it picks up the lease's end and the guardian's findings)
node $PT release --id $L; trap - EXIT
node $PT verdict --lease $L --scenario <task> --check "desync=$( [ "$D" = PASS ] && echo pass || echo fail ):$D" \
--check "<feature check>=pass:<detail>" --finish

For a solo run, lease W (--inst W or --solo), deploy with --profile solo, then pt launch, pt flow boot and pt flow quick (or custom), and play turns with --via panel and --via drive.

tools/playtest/scenarios/ holds scenario scripts that do everything above for one feature and write the verdict. Each prints one JSON object (the summary) on stdout and its progress on stderr, and always releases its lease.

  • sandtide-clock.mjs (Sandtide 1.1’s per-team chess clock): --run scaled (W, an Erg Test with a tuning copy teamClockMs=40000 and a Sandworms scheme copy RoundTime=150000), --run real (W, the shipped defaults, ends at the 5:00 water) or --run net (A+B LocalNet: the Sandworms mode through the host’s rules, the only way a LocalNet lobby plays that style). Pass --build <dist> --plugins <melange-plugins worktree>. Team 0 idles, team 1 fires at once; it checks the clock lines against the probe’s turn clock, the curse, the water and, online, pt desync plus identical clock, curse and hold lines. About 6 minutes scaled, 11 real time, 6 LocalNet, plus the wait for a lease. Flag fall: --run flagfall (offline, a tuning copy teamClockMs=20000 flagFall=true; --inst W,A,B takes the first free one) and --run net --flagfall (the rules add flagFall: true) check that team 0’s idle turn stops the moment its glass empties ([sim] end turn: sandtide ... at the empty tick, no “play” after it, the turn clock frozen), that its worms are cursed at that turn end and that the game plays on after the tour; online the end-turn line is compared on both peers too. The engine still settles such a turn before Turn.Ended (120 to 365 ticks measured), as after its own turn timer. About 4 minutes offline, 5 LocalNet. Scenario scripts live in tools/playtest/scenarios/. Each one leases, deploys, plays, checks, releases and writes its verdict.

choam-terminal.mjs (gt-ch-1) tests the CHOAM market terminal locally. Pass --inst solo to take the first free solo instance (W first), and --out <dir> for its log and its JSON. It has these phases:

  • online: the menu, then a hot reload, then the network lobby (W hosts alone). In the menu and the lobby it runs every HELP mnemonic, at least 10 of them typed with keys. Then it holds 4 panels for 5 minutes.
  • perf: only the 4-panel measurement, in the lobby. The open window is bracketed by closed baselines taken before and after it.
  • offline: a cold start with [NetFeeds] Enabled=0.
  • match: Local Game > Versus with 1 human team and 3 CPU teams (route versus4). On the CPU’s turns the terminal is open and real keys are typed. On my turns the terminal collapses, then WASD and a bazooka shot run, then HOUSE is checked. The match is killed at 5:00.
  • brand: the mark grep and a review of user-facing strings. It needs no game.

choam-net.mjs (gt-ch-2) tests CHOAM on a LocalNet pair (P2): --run 1 has CHOAM on C only (D has the folder, the plugin is off, the client-only handshake), --run 2 on both. 4 panels in the lobby, then 12 turns with the va-kit ending the turns: the spectator types real keys (keybd_event) and no worm of the active machine may move, the active machine’s terminal must be collapsed and unfocused, one real WASD walk and one fired bazooka per side, then pt desync --exempt choam. Lessons: CHOAM’s test hooks (open/exec/split) need its debug setting; this box stalls both games for 8 to 15 s at once about every 10 minutes when the disk is nearly full or other agents run games, and a stall of 13 s or more ends the LocalNet session, so keep the match short (a 12 turn run takes 8 minutes) and retry a run that lost its session. pt desync compares the kit lines from each peer’s last kit start (an attract demo before the match starts one).

How the scenario works:

  • Typing into a mod: scenarios/bin/keyin.exe, built from scenarios/native/keyin.cs with csc on first use.

    • post text posts WM_KEYDOWN/WM_KEYUP to the game window. The game’s pump turns them into characters for the mod that holds focus. Posting WM_CHAR as well types every character twice.
    • real text sends keybd_event with the window in front, so DirectInput sees the keys too. This route is used for the input-leak check. Other games steal the foreground, so retry.
  • Reading what a panel drew: the deployed copy appends CHOAM._ns = {...} to its init.lua. The copy is never committed. The scenario wraps SKIN.text to record the text of a panel, then removes the wrapper before it measures.

  • Granting network consent: run pt verb "netfeed.consent choam allow" right after launch. While the consent modal is open, every automation key is swallowed and the idle menu starts the CPU demo. Scripts that run a whole test through pt live in tools/playtest/scenarios/. Run one from anywhere with node (--phase, --ev <dir> for its evidence, --run <tag>); each prints one JSON line and exits 1 when a check failed.

  • landsraad-presets.mjs (gt-ld-2): the Landsraad presets round trip, the replay, the peer UX and the owner change. --phase all runs the LocalNet half first, so the local half can try to replay its recording. --phase net takes P2 by name (landsraad-presets-net.mjs: equal lobby digests after a preset load, the joiner’s write refused, the real-key keyboard check, a real Ctrl+V of an invalid preset, the owner hand-over window when the host leaves, a clean new lobby with the pill drawn, equal applied digests, pt desync, and both recordings carrying the same rules with equal ticks). --phase local plays on W (save a preset, kill, relaunch inside the same lease, change the draft, then a byte-identical reload, delete only the test preset, paste errors, Your settings persist, rules replay with compared == matched, and an attempt to replay the LocalNet recording). The plugin is deployed from a copy of its folder with an appendix that exposes the panel’s namespaces as LANDSRAAD_DBG (the mouse cannot reach the panel on the test box) and a 50 ms watcher of the lobby state and pill (LANDSRAAD_WATCH); the plugin worktree is not changed. Real key presses come from native/inp.cs (compiled with the .NET csc into the evidence folder; set INP to use a built copy). The Ctrl+V step uses the clipboard only when it holds text (or nothing) and puts it back at once.

Traps these runs found:

  • The lease end restores the instance ini, and a mod’s player settings live in the ini ([Mod.<id>]), so a test of “settings persist across a relaunch” must kill and relaunch inside one lease (a solo lease survives a kill and a launch within its 60 s game-exited window).
  • When the host leaves a LocalNet lobby, LocalNet hands the Steam lobby to the first member and the core logs “this machine owns the lobby”, but WUM’s own session ends for every joiner about 1.5 s later (“connection to host lost”). A hand-over that keeps the lobby alive does not happen, so the scenario checks that window with the watcher.
  • Melange 0.18.0 cannot replay a LocalNet recording: ArmRefusal refuses the agreed online sim fixes (drum) and online matches, and the replay player needs a Quick Game with the recorded setup. The scenario’s net.replay-localnet-recording check fails with the core’s reason until the core supports it.
  • Before a7288f3 an acquire took over another process’s teardown claim after 120 s, so a slow teardown could restore its old ini and plugins under the next lease (seen as a half-copied kindjal and a crash at the first turn). tools/playtest/scenarios/*.mjs are feature tests written as Node scripts over pt (they call pt.mjs and read the games through lib/game.mjs). Each prints one JSON line (ok, failed, out) and writes its checks into the run’s verdict.json.

landsraad-prompt.mjs (gt-ai: the Landsraad MCP tools and the in-lobby prompt)

Section titled “landsraad-prompt.mjs (gt-ai: the Landsraad MCP tools and the in-lobby prompt)”
Terminal window
node tools/playtest/scenarios/landsraad-prompt.mjs net --landsraad <plugins worktree> [--pair A,B] [--steps mcp,sec,lobby,ext,match] [--reuse <lease> --keep]
node tools/playtest/scenarios/landsraad-prompt.mjs local --landsraad <plugins worktree> [--inst W,A,B]
node tools/playtest/scenarios/landsraad-prompt.mjs api --landsraad <plugins worktree> [--inst W,A,B] [--with-local]

--landsraad takes a melange-plugins worktree or the plugin’s mod folder; the scenario makes the test copy itself (below). --inst lists solo instances to try in turn while W is busy; --wait-min bounds the wait for a lease (30). api --with-local runs the local steps first in the same lease and then forces the API backend (one lease for both). Evidence goes to --ev <dir> (or GTAI_EV), one folder per part and --tag.

  • net (P1): Melange.exe --mcp over stdio with no LLM (initialize, tools/list against Landsraad’s manifest plus the test_* tools, a proposal patch read back through MCP and through the mod); the guest’s propose and proposal_patch answer not-host; [AI] ToolMods="" lists no mod tool; the in-lobby prompt on the host (claude-code backend) with Ask, Reject, Refine, Accept (the guest sees the rules) and Undo; an external claude -p with a throwaway --mcp-config (never claude mcp add) and the example prompt, the proposal card, Accept, equal hash16 on both; then the match, played with the test_* tools on the machine whose turn it is, with the active inventory per turn, the turn-start digests of both peers and pt desync.
  • local (W, the Local Game menu): the same in-lobby prompt sequence without a peer.
  • api (W): tries to hide Claude Code from the game (Path without .local\bin, USERPROFILE set to an empty folder for that launch) so that [AI] Backend=auto picks the API. On this box that did not work (the game still found C:\Users\Jamin\.local\bin\claude.exe; cause unknown), so the scenario then sets [AI] Backend=api live and goes on: [AI] DevApiBase pointing at a Messages API replay inside the scenario (private builds only), a dummy key from the environment (pt deploy --secret), then an invalid key against the real API (the auth error, no crash). It also checks that ini.get shows ********, that no sk-ant or dpapi: text is in the game’s logs, events, a savelogs export or the evidence, and that the instance ini has no key after the lease ends.
  • The test copy: the plugin’s mod folder with scenarios/landsraad-dbg.lua appended to client/init.lua, made in the evidence folder (never in the plugin). It exposes the panel’s namespaces as LANDSRAAD_DBG and, while D.gest is set, claims a small region under the frontend cursor whose click runs D.onClick. Text goes in through the text box’s own handler (W.textKey(box, {kind = "char"}), what a melange.input.char event does), because automation keys never reach a mod’s text box; Ask is a posted automation click on that region, which is a real click delivered to the mod (the gesture wum.ai.ask needs) and runs the panel’s own Ask. Accept, Reject, Refine and Undo call the panel’s functions.
  • “3 turns” is per team: a weapon delay counts the team’s own turns, so with two teams team turn 4 is match turn 7 or 8.
  • The net and local parts run real Claude jobs (about $0.05 to $0.30 each, Opus 5.5) on the user’s Claude Code login.

The harness smoke (2026-11-26) ran P1, P2 and W at the same time on a release-0.18.0 private build (va-smoke), through pt only: two LocalNet pairs and one local quick match, four fired turns each. All three verdicts passed: pt desync PASS on both pairs (diverged=0, about 5800 compared ticks, identical turn-end ticks), every game killed by the release before any end, and the save, the Documents replays and logs listings and the Documents oasis_url.txt unchanged. Times with five games running: launch to main menu about 85 s, flow localnet 170 s, a fired online turn about 30 s from turn wait to the settled next turn, the whole run 335 s.

The old-peer build for 0.17 tests (va-017: v0.17.0 plus the private modules, dist-va-017 in the playtest worktree, whose source is v0.17.0 plus tools/playtest) is deployed to D and reports Melange 0.17.0 starting. Deploy it to D for any “0.17 peer joins a 0.18 host” test.

scenarios/holo-queue.mjs (gt-ho-2) runs a 4-peer LocalNet lobby and match. What it needed beyond a pair:

  • The lease. pt lease --inst A,B,C,D is all or nothing over both pair pools, and on a busy box the pools are re-leased within seconds of a release, so it almost never succeeds. scenarios/lease-quad.mjs holds each pair as it frees (idle, no game), then frees both holds’ files and takes the 4-instance lease in the same process.
  • The ini. Deploy with --ini LocalNet.BasePort=47700 (C and D otherwise use P2’s 47800) and --ini LocalNet.MemberLobbyData=1 (3-4 player lobbies need members’ lobby data). --ini LocalNet.PeerTimeoutMs=30000 keeps a peer that stalls for 10-30 s on the loaded box in the lobby instead of being dropped (see below).
  • The host route. pt flow net-host creates a Max Players 2 match (the pair route); a 4-player lobby is Create Match with Max Players left at 4 (the screen opens at 4): DOWN x3, RETURN, UP x4, DOWN x4, RETURN. The scenario’s host4 checks LocalNet: created lobby ... max 4. Joiners use pt flow net-join in order (the first joiner inherits the lobby when the owner leaves).
  • Judging the match. pt desync compares two peers; --peers A,X picks a pair inside a larger lease (run it for A-B, A-C and A-D), and --exempt holo leaves a plugin whose versions differ on purpose out of the mods check.
  • Traps seen. Twice the host (A) hung 12-30 s inside Melange’s present path while four games decoded a Holo video party, then crashed at WormsMayhem.exe+0x238a6a (a null read in a Steam lobby callback) after the members’ 5 s LocalNet timeout made D claim the lobby; dumps are in testenv\A\Melange\dumps. A failed net-boot team step can leave a joiner in Local Game > Quick Game (ESC twice, then net-boot again). When the owner of a 4-player lobby leaves, the members stay in the lobby under the first joiner (with two players, the joiner’s session ends instead); a RETURN sent to “dismiss” a dialog that is not there can start a match among the rest.
  • A Melange.log line carries a thread id padded to 5 characters ([ 9492]). Strip the prefix with G.logMsg (fixed for padded ids), never with a pattern of your own, or two peers’ identical lines differ.
  • The first turn of an Erg Test Quick Game can run no turn clock at all (turnMsLeft 0 from the start, play then settle, over after 20 s). Scenarios that measure turn time must not assume every turn ran its TurnTime.
  • The main menu, left alone for about a minute, starts a CPU demo match by itself. Act within a minute of boot, or keep the demo guard on (leave out matchStarted until you start the match).
  • One pt lua call can take up to about 20 s on a loaded box. Each frame hang of 8 s or more is logged as HANG; a LocalNet member that stalls for about 15 s times out of the lobby.
  • Killing one game of a pair, or pressing ESC at the main menu to “recover” a failed net-boot, ends the whole lease. Rerun pt flow net-boot instead.
  • pt deploy --ini cannot remove a key, only set it.
  • A build that desyncs on LocalNet writes desync-*.zip into Documents\Melange\replays despite TestIso (0.17, and 0.18.0 before fix-rules-owner caf3034), which fails the Documents guard of every lease running then. Move your own pid-named bundles out. From caf3034 the bundles go to the instance’s Melange\replays-va.
  • A scenario that kills its game (taskkill) to test a relaunch: the guards skip a dead pid, and pt launch refuses a lease whose teardown has begun or whose guard fired (“is ending”): take a new lease then. A game that still comes up during a teardown is killed by it (its pid is in killed), never left running as a survivor.
  • A build that has a dev media manifest makes the game delete other media pack versions from Documents\Melange\media. Back up the whole folder before any pack test.
  • Instance windows open at their configured position on the second monitor, but some open at (0,0). Proof comes from GL readback and window capture, so overlap does not matter.
  • pt lua hands back the JSON-decoded value of the result, so tostring(true) comes back as the boolean true, not the string "true". Compare with String(v) === "true". gt-ch-1 lost two leases to this bug.
  • A mod’s hot reload is recorded in the session’s events.jsonl (cat: "sandbox", msg: "reloaded", data.mod), not in Melange.log.
  • Do not grep a scenario log for a bare ERROR: CHOAM’s SRC table draws the column title “LAST ERROR”.