Refuse a value typed where an `env set` flag goes before effect/cli can print it back, and test the claims 414's tests left open
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Review of 414 against its issue (Spec) and AGENTS.md (Standards); the fixes, each test-first through program(argv): - effect/cli parses before any command runs, so a value typed as an argument that starts with a dash leaked: `env set KEY -Xs3cr3t…` printed one "Unrecognized flag" line per letter, `--s3cr3t…` printed it whole, and a dash-led value holding a `v` or `h` printed the version or help and exited 0 storing nothing. env-set.ts now exports `refuseStrangeFlags(argv)`: after `env set` and before any `--`, a word that reads as a flag `env set` does not take is a usage error (exit 2) in one line that repeats none of it. `program` runs it before parsing; that is one import and one line in apps/cli/src/main.ts, outside the territory (414's Comments #12 tell the integrator to keep it first in 404's `program`). - The screen's spellings are one list (env set's flags, effect/cli's built-ins, `--no-` forms); a test holds it to the flags `env set --help` names, so a global flag added later fails that test until it is listed (checked by dropping `--wizard`: red by assertion). - Tests added to env-set.test.ts: four dash-led values refused with exit 2, nothing on stdout, one stderr line and no call (red by assertion before the screen: exit 0 or 1); its own flags and effect/cli's still pass (`--project=`, `--log-level`, `-h`, `--no-json`); only one trailing newline stripped and a CRLF counted as one; an empty value (nothing piped, or an empty line) is a usage error; --dry-run's envelope on stdout. - Tests added to why.test.ts: from `src/`, `week.ts:3` reports `src/week.ts`; without --project it asks about the project the repo's platform remote names; with neither it exits 2 asking for --project and calls nothing. - Left as judgement calls in the Comments (#14): why.ts' git runner repeats repo-context.ts' private one and its Assisted-by text repeats @repo/git/trailers' private agentOf (both owners outside the territory; hoist with #2's helpers); a secret typed in the <key> slot reads as a key name. - bun run fix && bun run verify green: cli 88 tests.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+248 added−3 removed
- tests:+185 added−0 removed
- other:+63 added−3 removed