Evidence
On origin/main (87e0133554, 2026-11-15), bin/openchamber-start.sh declares/uses only a single positional argument (the OpenChamber serve script path, passed by the home-manager unit shim):
serve="$1" (line 23)
- empty check:
if [ -z "$serve" ]; then ... exit 1; fi (lines 24-27)
- it then reads the standing OpenCode server state/password from
~/.local/state/opencode/service-prod.json, exports credentials, and exec "$serve" (lines 29-41)
There is no $#/extra-argument validation, so any additional positional arguments after the required serve script are silently ignored before sensitive startup work.
Repro (safe, no service started)
Using a throwaway executable that exits immediately as the serve script argument:
tmp=$(mktemp /home/user/.local/share/opencode/tmp/opencode/oc-serve.XXXXXX.sh)
printf '#!/bin/sh\nexit 0\n' > "$tmp" && chmod +x "$tmp"
bash bin/openchamber-start.sh "$tmp" extra-bogus-arg; echo "rc=$?"
rm -f "$tmp"
Observed on this host (with ~/.local/state/opencode/service-prod.json readable): exit code 0 and the dummy serve script was exec'd, proving extra-bogus-arg was ignored and the script proceeded through state/password handling and exec.
Why it matters
bin/openchamber-start.sh is an operator/startup wrapper that reads a local password/state file and exports OPENCODE_PASSWORD before attaching/starting OpenChamber. Ignoring unaccounted CLI arguments violates the operator-script argument contract (#3352): a mis-invocation (extra/typoed argument, wrong argument order, or stale caller assumptions) is silently accepted instead of failing fast, which can lead to starting the service under unintended assumptions.
Acceptance criteria
-
bin/openchamber-start.sh rejects any unaccounted CLI arguments (including extra positional arguments after the required serve-script argument) before reading state, exporting credentials, or exec'ing the serve script.
- Rejection prints a clear usage/error to stderr and exits non-zero (usage-error exit code consistent with repo operator-script conventions).
- Existing valid invocation with exactly the expected serve-script argument preserves current behavior.
- Add/update a regression test (or test harness coverage, as appropriate for this wrapper) covering: missing argument, valid single argument path, and extra/unaccounted argument rejection.
Suggested fix shape
Validate the full command line up front (e.g. require exactly 1 argument, or explicit --/option parsing if expanded later) and emit usage: openchamber-start.sh <serve-script> on violation; keep the current state-file/password checks and exec behavior unchanged for valid input.