Repository navigation
Description
Finding
PR #3785 added strict argument validation to the id-mail deploy script (#3281): only deploy.mjs [--dry-run] is accepted, anything else aborts with exit 2 before any config/bws/wrangler work. The guard is correct and fails closed, but two residuals shipped with it and are still on main:
- The duplicate case is mislabeled. With
--dry-run --dry-run,unknownArgsis empty (every arg IS--dry-run), so the error falls back to reporting all args as unrecognized:unrecognized argument(s): --dry-run --dry-run— naming the one recognized argument as unrecognized. The exit code is right; the message teaches the operator the wrong fact about a script whose whole guard exists because a typo'd flag once entered the real deploy sequence. - The claimed cases are unpinned. The PR body says an
extra-positionalcase was verified, but the committeddeploy.test.mjspins only--dry-run,--dry-rnu,--bogus-flag, and no-args. No test covers a stray positional, a duplicate--dry-run, or--dry-run+ bogus flag — the exact shapes an operator typo produces. (Related: ci(id-mail): deploy.test.mjs (4 tests pinning the #3281 typo'd-flag deploy guard) run by no workflow — the deploy script can force-delete the live Worker #6082 already tracks that this test file is run by no workflow; this issue is about the missing cases and the message, not the CI wiring.)
Evidence
- Source PR: fix(id-mail): deploy.mjs strict arg validation — unknown args abort before any external call (#3281) #3785
fix(id-mail): deploy.mjs strict arg validation — unknown args abort before any external call (#3281), commitsac09e82a7566ca61286cfb779fc288a7119ff135,c0c5a85f8f34b826c65d8e6833fb118115d74e35; merge9bfaa0d27ff744232b0c1a7106f87d1b6ae8bc92(verified an ancestor of main by the compare API). - Current main (verified 2026-11-08, two independent reads via the contents API at ref=main):
nixos/services/id-mail/worker/deploy.mjs—const unknownArgs = args.filter((arg) => arg !== "--dry-run");if (args.length > 1 || unknownArgs.length > 0) { const offenders = unknownArgs.length > 0 ? unknownArgs : args; console.error(\unrecognized argument(s): ${offenders.join(" ")}\nusage: deploy.mjs [--dry-run]`); process.exit(2); }`- The
offenders = argsfallback is reachable only whenunknownArgsis empty andargs.length > 1, i.e. exactly the duplicate--dry-runcase.
- Current main
nixos/services/id-mail/worker/deploy.test.mjstest list:--dry-run validates only,--dry-rnu (typo) aborts,--bogus-flag aborts, two config-validation tests (id-mail(deploy): validate() crashes on null config entries instead of reporting them, and a config without retire passes validation then crashes the real deploy #6947),no args runs the real deploy sequence. No positional, duplicate, or mixed case.
Why it matters
This script retires and redeploys the live id-mail Worker and resets its secrets; #3281 exists because unrecognized arguments were silently treated as a request for the real deploy. The guard's error message is the operator's only signal at the moment of a typo — a message that calls the valid flag "unrecognized" invites the operator to retry variations against a destructive script. The unpinned shapes are the ones most likely to regress silently, because the file already has a history of argument-handling surprises (#3252/#3264 class in sibling deploy scripts).
Acceptance criteria
deploy.test.mjsgains cases pinning, each with exit 2 and zero external calls (the existing stub harness): a stray positional (e.g.deploy.mjs deploy), duplicate--dry-run --dry-run, and--dry-run --bogus-flag.- The duplicate case's error message no longer labels
--dry-runas unrecognized (e.g. a distinct "duplicate argument" wording, or listing only genuinely unknown offenders plus a separate duplicate note); the typo/unknown-flag messages are unchanged. - All pre-existing deploy.test.mjs cases keep passing.
Filed by pr-diff-review-b (LANE B PR diff review, run 2026-11-08 17:18 CST) from PR #3785. Not #6082 (CI wiring of the same test file) and not #3281 (the original silent-ignore bug, closed by #3785).
Activity
developing-today commentedon Nov 8, 2026
CODE-2333
dezren39 commentedon Nov 8, 2026
Agent: pr-diff-review-b
State: filed
Source PR: #3785 (MERGED; merge 9bfaa0d verified an ancestor of main via the compare API)
Action requested: triage per the acceptance criteria in the issue body. A repo-task/v1 packet (kind triage) is being enqueued to repo-health-code-pilot in the same run.
dezren39 commentedon Nov 9, 2026
🤖 Agent note · handed off
opencode36 remaining items
dezren39 commentedon Nov 9, 2026
agent-note:v1 — task 14124 picked up by lane code-p (2026-11-09), assigned execution lane opencode (lane row 5554); checkpointed handed_off and parked 1200s for the opencode claimant to launch the bound session. Issue #7855 revalidated OPEN, no hard-stop labels.
dezren39 commentedon Nov 9, 2026
agent-note:v1 lane=code-f task 14124 stage=handed_off: revalidated fresh — issue #7855 OPEN, no hard-stop labels. Handed off to opencode claimant (lane row 5554, session_id None); parking task 14124 for claimant launch.
dezren39 commentedon Nov 9, 2026
Agent note: handed off - task 14124 (lane code-j, repo-worker-code) claimed and revalidated 2026-11-09T23:15:45Z: issue #7855 OPEN, no hard-stop labels. Execution lane opencode (row 5554); handed off to opencode claimant. Full agent-note:v1 note file in goal hidden_files lane-j-20261109-1710.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 10, 2026
🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-j — Session/ID: task 14124, repo-queue-worker-shift-j 2026-11-09 run. Task 14124 (triage) for issue #7855: id-mail deploy.mjs duplicate --dry-run mislabeled + unpinned arg cases; attempts 3/3 AT CAP on this claim. Fresh check: issue #7855 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels. Execution lane row 5554 = opencode (repeat handoff). Checkpointed handed_off; parking task 14124 for 20 minutes for the claimant window.
dezren39 commentedon Nov 10, 2026
🤖 Agent note · done (triaged)
triage; issue id-mail(deploy): duplicate --dry-run is mislabeled 'unrecognized' by #3785's strict-arg guard, and the positional/duplicate/mixed cases are unpinned in deploy.test.mjs #7855 no longer carriesstatus/needs-triage.status/needs-triageis completed with outcometriaged— bookkeeping only; the fix packet is the triage step's separate enqueue. Gap recorded honestly: a full comment search finds no dedicated triage-step agent note on this issue; the nearest record is the pr-diff-review-bfiledagent note (2026-11-08T23:37:59Z) that created this packet after verifying source PR fix(id-mail): deploy.mjs strict arg validation — unknown args abort before any external call (#3281) #3785 merged. Issue id-mail(deploy): duplicate --dry-run is mislabeled 'unrecognized' by #3785's strict-arg guard, and the positional/duplicate/mixed cases are unpinned in deploy.test.mjs #7855 remains OPEN for the fix work (duplicate--dry-runmislabel + unpinned arg cases in the id-mail deploy script).Merge pull request #8106 from developing-today/queue/14484-7855-deplo…
dezren39 commentedon Nov 10, 2026
🤖 Agent note · done — Agent: queue worker (repo-worker-code), lane code-j — Session/ID: task 14484, repo-queue-worker-shift-j 2026-11-09 run. Task 14484 (small_fix, direct lane) fixed issue #7855 and it is merged: PR #8106 (merge commit 7951fb1). deploy.mjs's duplicate case now reports "duplicate argument(s): --dry-run" instead of mislabeling it unrecognized (typo/unknown messages byte-identical; exit 2 and fail-closed ordering unchanged), and deploy.test.mjs pins the stray-positional, duplicate, and mixed (--dry-run + bogus flag) shapes — each exit 2 with zero external calls. Oracle: the issue's acceptance criteria; node --test deploy.test.mjs on the laptop passed 9/9 (6 pre-existing + 3 new). Issue auto-closed by the merge.