You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pm-stack(pad/deploy): reject unaccounted CLI arguments before render/restart/deploy work #10484
pm-stack/pad/deploy.sh is an operator script (renders SOPS-backed .env, pulls/recreates the Pad container, waits for health) and declares its command line as [deploy|render|restart]:
pm-stack/pad/deploy.sh:69-95 dispatches only on ${1:-deploy} and rejects unknown commands, but never checks for extra arguments after a recognized command.
render (lines 70-72) runs render and exits success even when extra args are present (e.g. ./deploy.sh render --oops).
restart (lines 73-75) runs docker compose restart and ignores extra args.
deploy (lines 76-90) renders, pulls, force-recreates, and runs the health gate loop while ignoring extra args.
Repro (static): invoking any recognized subcommand with trailing arguments performs the full operation instead of failing with usage, so typos/extra flags are silently accepted.
Why it matters
Per AGENTS.md "Operator script argument contract (#3352)" / doc/agents/operator-script-argument-contract.md, every operator script must declare its whole command line and parse strictly before any subprocess, network, file write, lock, or deploy step; anything unaccounted for must be a usage error with non-zero exit. Accepting unaccounted arguments here can trigger unintended deploy/restart/render work.
Acceptance criteria
pm-stack/pad/deploy.sh rejects any argument beyond the single optional subcommand it declares (deploy|render|restart) with a usage error to stderr and non-zero exit (2), before rendering, running docker compose, or performing health checks.
Add/update coverage (or a documented check) showing extra args are rejected and valid forms still work.
Suggested fix
Add an argument-count/position check after parsing the subcommand (e.g. [[ $# -le 1 ]] || { usage >&2; exit 2; }) or enforce per-branch arity, matching the strict pattern used by covered siblings (see recent pm-stack arg-contract fixes such as #10441/#10442).
Work kind: task/small-fix · Priority: priority/normal · Effort: effort/s
Fresh evidence: issue pm-stack(pad/deploy): reject unaccounted CLI arguments before render/restart/deploy work #10484 is CLOSED (2026-11-17T02:18Z, label status:done). Verified in code on current main this shift: pm-stack/pad/deploy.sh now enforces the Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 argument contract at lines 31–36 — a case "$#:${1-deploy}" guard rejects anything beyond the single optional subcommand with unexpected arguments '<args>'; usage: $0 [deploy|render|restart] to stderr and exit 2, before any render, docker compose, or health-check work; the dispatch below (line ~101) also usage-errors on unknown commands. The issue's repro (e.g. ./deploy.sh render --oops silently running the full render) is closed out, and the four valid invocations keep their behavior (the guard's accepted patterns are exactly no-arg/deploy/render/restart).
Routing: no follow-on packet; the bulk-intake triage dedupes against the already-landed fix.
Activity
developing-today commentedon Nov 15, 2026
CODE-3797
dezren39 commentedon Nov 17, 2026
🤖 Agent note · already done — task 19300 (lane code-c)
pm-stack/pad/deploy.shnow enforces the Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 argument contract at lines 31–36 — acase "$#:${1-deploy}"guard rejects anything beyond the single optional subcommand withunexpected arguments '<args>'; usage: $0 [deploy|render|restart]to stderr and exit 2, before any render, docker compose, or health-check work; the dispatch below (line ~101) also usage-errors on unknown commands. The issue's repro (e.g../deploy.sh render --oopssilently running the full render) is closed out, and the four valid invocations keep their behavior (the guard's accepted patterns are exactly no-arg/deploy/render/restart).