bug: devbox scripts drop -- arguments (serve --image ignored)
#84
Notifications
Due Date
No due date set.
Blocks
#77 M4: real-phone playtest gate (Note 10, 60 fps)
SirStone/FFF_vtt_frozen
Reference: SirStone/FFF_vtt_frozen#84
Reference in New Issue
Block a user
Part of #63
What happens
devbox.jsonscripts are defined as command arrays ("serve": ["tools/serve.sh"]). Devbox 0.17.2 generates.devbox/gen/scripts/serve.shas the bare command without"$@", sodevbox run serve -- --image=run/map16384.png --tile-size=64runstools/serve.shwith no arguments.tools/serve.mjstherefore sees an empty argv, silently skips the import, and serves the default 4096 scene./proc/<pid>/cmdlineof the node process confirmed the empty argv.The same gap affects every script documented with
-- args:seed,import-scale,mutation,bench, and anything else (README, the #77 checklist comment,docs/HANDOFF-M4.md).What to build
--args as positional parameters to the generated script, so the generated body must end with"$@"(append it to the last command in each script entry, and append"$@"to the final array element).servefails loudly on unknown/unused flags (unknown option,--tile-sizewithout--image, non-numeric values) and printsserve: importing <file> …andserve: no --image given, keeping current map (<w>x<h>, tile <t>, art v<N>j)so a silent skip cannot recur.devbox run <script> -- <args>(not the tool directly) forserve(--help/--dry-run) andseed(--help) - the seam the earlier direct-tool tests missed.serve's laptop certificate-trust text: detect NixOS (/etc/NIXOS) and printsecurity.pki.certificateFiles = [ <path> ];+ rebuild (orChrome: tap Proceed is enough) instead of the Debianupdate-ca-certificatessteps; keep Debian/macOS/Firefox text.UnusedImportwarnings forfaultsinserver/worldmap.nim,server/vision.nim,server/markers.nim: the import is only used insidewhen defined(leakfault), so guard it withwhen defined(leakfault): import faults(fault builds must still compile and fault tests pass).docs/HANDOFF-M4.mdand the #77 checklist so every documented command matches what works.Acceptance
devbox run serve -- --dry-runshows the parsed options from the--args (through devbox, notnode tools/serve.mjs).devbox run serve -- --bogusfails loudly and does not start a server.devbox run seed -- --helpprints usage;devbox run seed -- --bogusfails.devbox run serve -- --image=<png> --tile-size=64imports before serving (observable in the log line).devbox run test,client-test,e2egreen.Related: #77 (blocked by this), #82, #80, #83.
Fixed in
30b3559(pushed tomain).Root cause: devbox 0.17.2 runs
.devbox/gen/scripts/<name>.shwith the--args as positional parameters but does not append"$@"; the generated script body was the bare command, soserve/seed/bench/mutation/import-scale/fogbenchsaw an empty argv.Fix: every argument-taking script body ends with
"$@"indevbox.json(array entries join with newlines, so the suffix goes on the last command).Serve hardening:
--dry-runparses and prints the effective options without building; unknown options, non-numeric ports/tile sizes and--tile-sizewithout--imageexit non-zero; a no-image start printsserve: no --image given, keeping current map (16384x16384, tile 64, art vN); a bad--imageimport aborts before the server starts. On NixOS the cert text issecurity.pki.certificateFiles = [ ... ];+ rebuild (Chrome Proceed is enough), Debian/macOS/Firefox kept.Seam test:
tools/devboxargs.test.mjsruns throughdevbox run serve -- ...anddevbox run seed -- ..., not the tools directly.Faults warnings: the
faultsimport inworldmap.nim,vision.nim,markers.nimis nowwhen defined(leakfault); the normal build is warning-free and-d:leakfaultstill compiles.Verified working commands:
devbox run serve -- --image=/tmp/does-not-exist.pngnow printsserve: importing ...and exits 1 (server not started) instead of silently serving the default 4096 scene.Gates:
devbox run testgreen (evidence 20/20),client-testgreen,e2egreen (29/29). Kernel watch clean. README,docs/HANDOFF-M4.mdand the #77 checklist updated; #77 is unblocked.