fix: forward -- args through devbox scripts, fail serve loudly (#84)

devbox 0.17.2 runs .devbox/gen/scripts/<name>.sh with the args as positional
parameters but does not append "$@", so tools/serve.sh (and seed, bench,
mutation, import-scale, fogbench) saw an empty argv and a documented
`serve -- --image=...` silently served the default 4096 scene. End every
argument-taking script body with "$@".

serve: --dry-run parses and prints the options without building; unknown
options, non-numeric ports/tile sizes and --tile-size without --image fail
loudly; a no-image start prints the current map read from state.db; NixOS
gets security.pki.certificateFiles instead of the Debian trust steps.

Guard the faults import in worldmap/vision/markers with
`when defined(leakfault)` (it is only used inside those blocks), removing
the three UnusedImport warnings; leakfault builds still compile.

tools/devboxargs.test.mjs goes through `devbox run <script> -- <args>` for
serve (dry-run, unknown flag, tile-size without image) and seed (--help,
unknown flag), the seam the direct-tool tests missed.
This commit is contained in:
2026-11-21 21:35:39 +01:00
parent c8b5289a3d
commit 30b35592c7
9 changed files with 190 additions and 15 deletions
+9 -1
View File
@@ -34,7 +34,9 @@ in front of the server (the server itself stays on `127.0.0.1`), and prints:
- the `https://<lan-ip>:8443` URL to open on the phone and the laptop, - the `https://<lan-ip>:8443` URL to open on the phone and the laptop,
- the GM key (created on first run; an existing key is printed, never replaced), - the GM key (created on first run; an existing key is printed, never replaced),
- the certificate-trust steps for Android Chrome and for a laptop (Linux/macOS/Firefox). - the certificate-trust steps for Android Chrome and for a laptop (Linux/macOS/Firefox; on NixOS it
prints the `security.pki.certificateFiles` option instead of the Debian `update-ca-certificates`
steps).
To import a map on the same first start, pass `--image` (an offline import runs before the server; To import a map on the same first start, pass `--image` (an offline import runs before the server;
a fresh state dir is created and migrated first): a fresh state dir is created and migrated first):
@@ -43,6 +45,10 @@ a fresh state dir is created and migrated first):
devbox run serve -- --image=run/map16384.png --tile-size=64 devbox run serve -- --image=run/map16384.png --tile-size=64
``` ```
Everything after `--` reaches the script (#84: devbox 0.17.2 needs the `"$@"` suffix in
`devbox.json`); an unknown or unusable flag fails loudly instead of being ignored. To check the
parsed options without building anything: `devbox run serve -- --dry-run`.
Ctrl-C stops nginx and the server and releases the port; the next start works. State (`state.db`, Ctrl-C stops nginx and the server and releases the port; the next start works. State (`state.db`,
`tiles/`), the GM key and the certificate live under `run/lan` and are **not** wiped, so a session `tiles/`), the GM key and the certificate live under `run/lan` and are **not** wiped, so a session
survives a restart and a phone that trusted the certificate does not have to trust it again. survives a restart and a phone that trusted the certificate does not have to trust it again.
@@ -320,6 +326,8 @@ panel); it needs USB debugging, the overlay does not.
| command | what it does | | command | what it does |
|---|---| |---|---|
| `devbox run test` | the server gate: Nim in-process tests (`nimble test`), then the Node black-box harnesses in `tools/*.test.mjs`, then a check that every registered evidence test actually ran and passed | | `devbox run test` | the server gate: Nim in-process tests (`nimble test`), then the Node black-box harnesses in `tools/*.test.mjs`, then a check that every registered evidence test actually ran and passed |
| `devbox run serve` | the LAN playtest stack: server + client build behind TLS/HTTP2 nginx, persistent state under `run/lan`; `-- --image=<file> [--tile-size=<px>]` imports first, `-- --dry-run` prints the parsed options and exits |
| `devbox run seed` | 49 deterministic NPC tokens over the real WebSocket; `-- --url=<origin> --tokens=49 --vision=1` |
| `devbox run client-test` | client unit tests (Vitest): the pure reducer, protocol client and envelope; no DOM, no GPU | | `devbox run client-test` | client unit tests (Vitest): the pure reducer, protocol client and envelope; no DOM, no GPU |
| `devbox run e2e` | builds `client/dist`, then drives headless Chromium against the real server through the TLS/HTTP2 test nginx | | `devbox run e2e` | builds `client/dist`, then drives headless Chromium against the real server through the TLS/HTTP2 test nginx |
| `devbox run mutation` | mutation suite on a temp copy of `server/`, `tests/`, `tools/`: every seeded mutation must fail at least one test | | `devbox run mutation` | mutation suite on a temp copy of `server/`, `tests/`, `tools/`: every seeded mutation must fail at least one test |
+6 -6
View File
@@ -33,22 +33,22 @@
"client/run-tests.sh" "client/run-tests.sh"
], ],
"serve": [ "serve": [
"tools/serve.sh" "tools/serve.sh \"$@\""
], ],
"seed": [ "seed": [
"node tools/seed.mjs" "node tools/seed.mjs \"$@\""
], ],
"mutation": [ "mutation": [
"tools/mutation.sh" "tools/mutation.sh \"$@\""
], ],
"bench": [ "bench": [
"mkdir -p results; nim c -d:release --hints:off -r tools/bench.nim > results/bench.log 2>&1; rc=$?; cat results/bench.log; exit $rc" "mkdir -p results; nim c -d:release --hints:off -r tools/bench.nim \"$@\" > results/bench.log 2>&1; rc=$?; cat results/bench.log; exit $rc"
], ],
"import-scale": [ "import-scale": [
"mkdir -p results; IMPORT_SCALE=1 node --test --test-concurrency=1 --test-reporter=spec tools/importscale.test.mjs > results/import-scale.log 2>&1; rc=$?; cat results/import-scale.log; exit $rc" "mkdir -p results; IMPORT_SCALE=1 node --test --test-concurrency=1 --test-reporter=spec tools/importscale.test.mjs \"$@\" > results/import-scale.log 2>&1; rc=$?; cat results/import-scale.log; exit $rc"
], ],
"fogbench": [ "fogbench": [
"mkdir -p results; nim c -d:release --hints:off -o:run/test/fogbench tools/fogbench.nim > results/m4-fog-bench.log 2>&1 && ./run/test/fogbench >> results/m4-fog-bench.log 2>&1; rc=$?; cat results/m4-fog-bench.log; exit $rc" "mkdir -p results; nim c -d:release --hints:off -o:run/test/fogbench tools/fogbench.nim > results/m4-fog-bench.log 2>&1 && ./run/test/fogbench \"$@\" >> results/m4-fog-bench.log 2>&1; rc=$?; cat results/m4-fog-bench.log; exit $rc"
] ]
} }
}, },
+4 -1
View File
@@ -30,7 +30,10 @@ what exists, what is proven, what is deliberately still open.
- **Playtest tooling (#82, closed with this note):** `?perf=1` in-app fps/frame/JS/token/zoom - **Playtest tooling (#82, closed with this note):** `?perf=1` in-app fps/frame/JS/token/zoom
overlay (off by default), `fff-vtt import` on a fresh/empty state dir, `devbox run serve -- overlay (off by default), `fff-vtt import` on a fresh/empty state dir, `devbox run serve --
--image=<file>`, `devbox run seed -- --url=...` for the 50 tokens, and the GM token form's X/Y --image=<file>`, `devbox run seed -- --url=...` for the 50 tokens, and the GM token form's X/Y
default to the viewport centre. default to the viewport centre. #84 fixed the seam that made those `--` arguments invisible:
devbox 0.17.2 scripts must end with `"$@"` in `devbox.json`, `serve` now fails on an unknown or
unusable flag, and `devbox run serve -- --dry-run` prints the parsed options. On NixOS the serve
output prints `security.pki.certificateFiles`, not the Debian `update-ca-certificates` steps.
- **M5** - concurrency, bounded outbox/coalescing, lag tracking, SIGTERM, metrics, nginx dead-peer - **M5** - concurrency, bounded outbox/coalescing, lag tracking, SIGTERM, metrics, nginx dead-peer
timeout, stats outside the lock. `#34` heartbeat is M5. timeout, stats outside the lock. `#34` heartbeat is M5.
- **Deferred:** `db_connector` -> thin sqlite3 binding (build item 13); per-token polygon cache and - **Deferred:** `db_connector` -> thin sqlite3 binding (build item 13); per-token polygon cache and
+3 -1
View File
@@ -26,7 +26,9 @@
## No DB transaction control here: the caller owns it, exactly like explored.nim. ## No DB transaction control here: the caller owns it, exactly like explored.nim.
import std/[math, options, strutils, tables] import std/[math, options, strutils, tables]
import db_connector/db_sqlite import db_connector/db_sqlite
import faults, geometry, tokens, vision, world import geometry, tokens, vision, world
when defined(leakfault):
import faults # faultActive() is only referenced inside the leakfault blocks below (#84)
proc anchorOf*(w: WallRec): (int, int) = proc anchorOf*(w: WallRec): (int, int) =
## The wall's drawn midpoint, rounded once to integer px and fixed for the wall (5.8, 6.1). ## The wall's drawn midpoint, rounded once to integer px and fixed for the wall (5.8, 6.1).
+3 -1
View File
@@ -28,7 +28,9 @@
## moves; a re-earn gets a fresh id. `markerFresh`/`markerDead` hold the markers minted/retracted by ## moves; a re-earn gets a fresh id. `markerFresh`/`markerDead` hold the markers minted/retracted by
## the current refresh so the mutation's transaction can persist them (server/markers.nim). ## the current refresh so the mutation's transaction can persist them (server/markers.nim).
import std/[algorithm, math, sets, tables] import std/[algorithm, math, sets, tables]
import tokens, worldmap, geometry, world, faults import tokens, worldmap, geometry, world
when defined(leakfault):
import faults # faultActive() is only referenced inside the leakfault block below (#84)
type type
Poly* = object Poly* = object
+3 -1
View File
@@ -15,7 +15,9 @@
## copies a token record before it applies an outcome, and a Nim seq assignment shares its buffer, so ## copies a token record before it applies an outcome, and a Nim seq assignment shares its buffer, so
## in-place edits would reach the authoritative list before the transaction commits (4.2 step 6). ## in-place edits would reach the authoritative list before the transaction commits (4.2 step 6).
import std/options import std/options
import geometry, moverules, tokens, world, faults import geometry, moverules, tokens, world
when defined(leakfault):
import faults # faultActive() is only referenced inside the leakfault blocks below (#84)
proc geometryWalls*(sc: SceneRec, forSight = false): seq[Wall] = proc geometryWalls*(sc: SceneRec, forSight = false): seq[Wall] =
## The scene's walls as the vision and move code see them. Each wall carries its stored switches: ## The scene's walls as the vision and move code see them. Each wall carries its stored switches:
+61
View File
@@ -0,0 +1,61 @@
// #84: the devbox seam. Every other harness calls tools/*.mjs directly, which hides the fact that
// `devbox run <script> -- <args>` never delivered the args: devbox 0.17.2 runs the generated
// .devbox/gen/scripts/<name>.sh with the args as positional parameters but does not append "$@",
// so the script body has to. These tests go through `devbox run` on purpose: a direct
// `node tools/serve.mjs --dry-run` would pass even with the broken devbox.json.
import test from 'node:test'
import assert from 'node:assert/strict'
import path from 'node:path'
import { spawnSync } from 'node:child_process'
import { projectRoot } from './lib.mjs'
const devbox = spawnSync('devbox', ['version'], { encoding: 'utf8' })
function devboxRun(script, args) {
const r = spawnSync('devbox', ['run', script, '--', ...args], {
cwd: projectRoot,
encoding: 'utf8',
timeout: 120000,
env: process.env,
})
return { status: r.status, signal: r.signal, stdout: r.stdout ?? '', stderr: r.stderr ?? '' }
}
// `devbox run test` itself runs inside the devbox shell; nested `devbox run` still works there.
// Skip only if the binary is genuinely absent (a bare `node --test` outside devbox).
const skip = devbox.status !== 0
test('devbox run serve -- --dry-run: the args reach serve.mjs', { timeout: 150000, skip }, () => {
const r = devboxRun('serve', ['--dry-run', '--host=127.0.0.1', '--port=9555',
'--tile-size=64', '--image=maps/demo.png'])
assert.equal(r.status, 0, r.stderr)
assert.match(r.stdout, /serve: dry-run/)
assert.match(r.stdout, /host:\s+127\.0\.0\.1/)
assert.match(r.stdout, /port:\s+9555/)
assert.match(r.stdout, /tile-size:\s+64/)
assert.match(r.stdout, /image:\s+.*maps\/demo\.png/)
})
test('devbox run serve -- --dry-run --bogus: an unknown flag fails loudly, no build', { timeout: 60000, skip }, () => {
const r = devboxRun('serve', ['--dry-run', '--bogus'])
assert.notEqual(r.status, 0, 'an ignored flag must not exit 0')
assert.match(r.stderr, /unknown option --bogus/)
})
test('devbox run serve -- --dry-run --tile-size=64: --tile-size without --image fails', { timeout: 60000, skip }, () => {
const r = devboxRun('serve', ['--dry-run', '--tile-size=64'])
assert.notEqual(r.status, 0)
assert.match(r.stderr, /--tile-size requires --image/)
})
test('devbox run seed -- --help: the args reach seed.mjs (usage from the real devbox path)', { timeout: 120000, skip }, () => {
const r = devboxRun('seed', ['--help'])
assert.equal(r.status, 0, r.stderr)
assert.match(r.stdout, /usage: devbox run seed -- --url=<origin>/)
})
test('devbox run seed -- --bogus: an unknown flag fails instead of seeding', { timeout: 120000, skip }, () => {
const r = devboxRun('seed', ['--bogus'])
assert.notEqual(r.status, 0)
assert.match(r.stderr, /unknown option --bogus/)
})
+87 -4
View File
@@ -16,11 +16,12 @@
import { spawnSync } from 'node:child_process' import { spawnSync } from 'node:child_process'
import fs from 'node:fs' import fs from 'node:fs'
import path from 'node:path' import path from 'node:path'
import { DatabaseSync } from 'node:sqlite'
import { DEFAULT_DIST, DEFAULT_LAN_PORT, DEFAULT_SERVER_BIN, DEFAULT_STATE_DIR, import { DEFAULT_DIST, DEFAULT_LAN_PORT, DEFAULT_SERVER_BIN, DEFAULT_STATE_DIR,
detectLanIp, startLanServe } from './lanserve.mjs' detectLanIp, startLanServe } from './lanserve.mjs'
const USAGE = `usage: devbox run serve [-- --host=<ip>] [-- --port=<n>] [-- --state-dir=<path>] const USAGE = `usage: devbox run serve [-- --host=<ip>] [-- --port=<n>] [-- --state-dir=<path>]
[-- --image=<file> [-- --tile-size=<px>]] [-- --image=<file> [-- --tile-size=<px>]] [-- --dry-run]
Starts the FFF_vtt server behind a TLS/HTTP2 nginx on the LAN. State, GM key and certificate Starts the FFF_vtt server behind a TLS/HTTP2 nginx on the LAN. State, GM key and certificate
persist under the state dir (default ${DEFAULT_STATE_DIR}), so a session (and a trusted phone) persist under the state dir (default ${DEFAULT_STATE_DIR}), so a session (and a trusted phone)
@@ -29,6 +30,10 @@ FFF_VTT_STATE_DIR.
--image imports a PNG/WebP map before starting (a fresh state dir is created and migrated first) --image imports a PNG/WebP map before starting (a fresh state dir is created and migrated first)
and then serves the imported scene; a server already holding the state-dir lock is refused (exit 3). and then serves the imported scene; a server already holding the state-dir lock is refused (exit 3).
--dry-run parses and prints the effective options, then exits without building or starting anything.
Unknown options, a non-numeric port/tile size, and --tile-size without --image fail loudly (exit 1)
instead of being ignored: a silently dropped --image used to serve the default 4096 scene (#84).
` `
const VALUE_OPTIONS = new Set( const VALUE_OPTIONS = new Set(
@@ -43,6 +48,11 @@ function parseArgs(argv) {
const m = /^--([a-z-]+)(?:=(.*))?$/.exec(arg) const m = /^--([a-z-]+)(?:=(.*))?$/.exec(arg)
if (!m) throw new Error(`unexpected argument ${JSON.stringify(arg)} (see --help)`) if (!m) throw new Error(`unexpected argument ${JSON.stringify(arg)} (see --help)`)
const key = m[1] const key = m[1]
if (key === 'dry-run') {
if (m[2] !== undefined) throw new Error('--dry-run takes no value (see --help)')
opts.dryRun = true
continue
}
if (!VALUE_OPTIONS.has(key)) throw new Error(`unknown option --${key} (see --help)`) if (!VALUE_OPTIONS.has(key)) throw new Error(`unknown option --${key} (see --help)`)
let value = m[2] let value = m[2]
if (value === undefined) { if (value === undefined) {
@@ -61,6 +71,25 @@ function parseArgs(argv) {
return opts return opts
} }
/** Flags that only make sense with an image, or that need numbers, fail instead of being ignored. */
function validate(opts) {
for (const [key, env] of [['port', 'FFF_VTT_LAN_PORT'], ['serverPort', 'FFF_VTT_SERVER_PORT'],
['tileSize', 'FFF_VTT_LAN_TILE']]) {
if (opts[key] === undefined) continue
if (!Number.isInteger(opts[key]) || opts[key] < 1) {
throw new Error(`${key}: expected a whole number >= 1, got ${JSON.stringify(opts[key])} ` +
`(--${key === 'serverPort' ? 'server-port' : key === 'tileSize' ? 'tile-size' : key} / ${env})`)
}
}
if (opts.tileSize !== undefined && !opts.image) {
throw new Error('--tile-size requires --image (it is the import tile size); ' +
'drop --tile-size or pass --image=<file>')
}
if (opts.image !== undefined && opts.image.trim() === '') {
throw new Error('--image: empty path (see --help)')
}
}
function envOptions() { function envOptions() {
const env = process.env const env = process.env
const opts = {} const opts = {}
@@ -98,6 +127,40 @@ function importImage(opts, stateDir) {
} }
} }
/** The map a no-image start will serve, read from the state db without starting anything. */
function describeScene(stateDir) {
const dbFile = path.join(stateDir, 'state.db')
if (!fs.existsSync(dbFile)) return 'fresh state: default 4096x4096, tile 32, art v1'
let db
try {
db = new DatabaseSync(dbFile, { readOnly: true })
const row = db.prepare('SELECT w, h, tile_size, art_version FROM scene WHERE id = 1').get()
if (!row) return `no scene row in ${dbFile}`
return `${row.w}x${row.h}, tile ${row.tile_size}, art v${row.art_version}`
} catch (e) {
return `unreadable ${dbFile} (${e.message})`
} finally {
db?.close()
}
}
/** `--dry-run`: prove the `--` arguments reached this script, then exit without side effects. */
function printDryRun(opts, stateDir) {
const lines = [
'serve: dry-run (nothing built, imported or started)',
` host: ${opts.host ?? '<detected>'}${opts.host ? '' : ` (${detectLanIp() ?? 'none'})`}`,
` port: ${opts.port ?? DEFAULT_LAN_PORT}`,
` state-dir: ${stateDir}`,
` dist: ${path.resolve(opts.distDir ?? DEFAULT_DIST)}`,
` server-bin: ${path.resolve(opts.bin ?? DEFAULT_SERVER_BIN)}`,
` server-port: ${opts.serverPort ?? '<auto>'}`,
` image: ${opts.image ? path.resolve(opts.image) : '<none, keeping current map>'}`,
` tile-size: ${opts.tileSize ?? '<none>'}`,
]
if (!opts.image) lines.push(` current map: ${describeScene(stateDir)}`)
process.stdout.write(lines.join('\n') + '\n')
}
function printStartup(handle) { function printStartup(handle) {
const { origin, gmKey, stateDir, certPath, distDir, serverPort, certRegenerated } = handle const { origin, gmKey, stateDir, certPath, distDir, serverPort, certRegenerated } = handle
const ip = handle.host const ip = handle.host
@@ -121,14 +184,29 @@ function printStartup(handle) {
' Only the "Proceed" tap is required; installing the CA just silences the warning.', ' Only the "Proceed" tap is required; installing the CA just silences the warning.',
'', '',
'Laptop, one-time per certificate:', 'Laptop, one-time per certificate:',
` Linux: sudo cp ${certPath} /usr/local/share/ca-certificates/fff-vtt-lan.crt`, ]
' sudo update-ca-certificates', // The Debian steps are wrong on NixOS (no /usr/local/share/ca-certificates, no imperative
// update-ca-certificates): point at the declarative option instead. #84.
if (fs.existsSync('/etc/NIXOS')) {
lines.push(
` NixOS: security.pki.certificateFiles = [ "${certPath}" ];`,
' sudo nixos-rebuild switch (or home-manager switch)',
` Chrome: "Advanced" -> "Proceed to ${ip} (unsafe)" is enough for the playtest;`,
' the option above only silences the warning for every app.',
)
} else {
lines.push(
` Linux: sudo cp ${certPath} /usr/local/share/ca-certificates/fff-vtt-lan.crt`,
' sudo update-ca-certificates',
)
}
lines.push(
` macOS: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ${certPath}`, ` macOS: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ${certPath}`,
' Firefox: Settings > Privacy & Security > Certificates > View Certificates >', ' Firefox: Settings > Privacy & Security > Certificates > View Certificates >',
' Authorities > Import > select cert.pem > "Trust this CA to identify websites".', ' Authorities > Import > select cert.pem > "Trust this CA to identify websites".',
' (Chrome/Edge on the laptop read the system store; Firefox keeps its own.)', ' (Chrome/Edge on the laptop read the system store; Firefox keeps its own.)',
'', '',
] )
if (certRegenerated) { if (certRegenerated) {
lines.push(`NOTE: the LAN address is new (${ip}); the certificate was regenerated. Trust it again.`, '') lines.push(`NOTE: the LAN address is new (${ip}); the certificate was regenerated. Trust it again.`, '')
} }
@@ -142,12 +220,17 @@ function printStartup(handle) {
async function main() { async function main() {
const opts = { ...envOptions(), ...parseArgs(process.argv.slice(2)) } const opts = { ...envOptions(), ...parseArgs(process.argv.slice(2)) }
validate(opts)
if (!opts.host) { if (!opts.host) {
const detected = detectLanIp() const detected = detectLanIp()
if (detected) opts.host = detected if (detected) opts.host = detected
} }
const stateDir = path.resolve(opts.stateDir ?? DEFAULT_STATE_DIR) const stateDir = path.resolve(opts.stateDir ?? DEFAULT_STATE_DIR)
if (opts.dryRun) { printDryRun(opts, stateDir); return }
if (opts.image) importImage(opts, stateDir) if (opts.image) importImage(opts, stateDir)
else {
process.stdout.write(`serve: no --image given, keeping current map (${describeScene(stateDir)})\n`)
}
const handle = await startLanServe({ const handle = await startLanServe({
stateDir, stateDir,
host: opts.host, host: opts.host,
+14
View File
@@ -7,12 +7,26 @@
# reused by the next run. # reused by the next run.
# #
# devbox run serve # detected LAN IP, port 8443, state run/lan # devbox run serve # detected LAN IP, port 8443, state run/lan
# devbox run serve -- --image=run/map.png --tile-size=64
# devbox run serve -- --dry-run # print the parsed options, build nothing
# FFF_VTT_LAN_PORT=9443 devbox run serve # FFF_VTT_LAN_PORT=9443 devbox run serve
# FFF_VTT_STATE_DIR=run/lan2 devbox run serve # FFF_VTT_STATE_DIR=run/lan2 devbox run serve
# FFF_VTT_LAN_HOST=192.168.1.50 devbox run serve # override the detected address # FFF_VTT_LAN_HOST=192.168.1.50 devbox run serve # override the detected address
#
# `-- args` reach this script only because devbox.json appends "$@" to the script body (#84):
# devbox 0.17.2 runs the generated .devbox/gen/scripts/serve.sh with the args as positional
# parameters, but does not add "$@" itself. Keep that suffix in devbox.json.
set -euo pipefail set -euo pipefail
cd "$(dirname "$0")/.." || exit 1 cd "$(dirname "$0")/.." || exit 1
# Parsing/validation and --help/--dry-run need no build. Run them before the expensive steps so a
# bad flag fails in milliseconds instead of after a Nim+client build.
for arg in "$@"; do
case "$arg" in
-h|--help|--dry-run) exec node tools/serve.mjs "$@" ;;
esac
done
STATE_DIR="${FFF_VTT_STATE_DIR:-run/lan}" STATE_DIR="${FFF_VTT_STATE_DIR:-run/lan}"
mkdir -p "$STATE_DIR" run mkdir -p "$STATE_DIR" run