cli: pin the frozen argv grammar as one table #206

Merged
natsukium merged 1 commit from test/argv-matrix-185 into main 2026-09-07 23:11:11 +09:00
Owner

Fixes #185.

The argv grammar the CLI surface has already frozen was pinned only by scattered individual assertions, or not asserted at all: a refactor that loosened one rule could land unnoticed. This adds one table-driven test per rule in crates/felis-cli/src/tests.rs, each stating the argv line and its outcome class, including the exit code a usage error owes its caller.

Rules covered: a program for sessions spawn only after --; the removed profiling and framing flags staying unknown arguments; a framing outside the verb's class; --raw without a payload; no frontend pass-through outside frontend.

Doc cascade: none — the change is test-only and documents no new behavior; the visible surface is already covered by docs/reference/cli.md and the help snapshots from #187.

Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high

Deferred

  • Folding the pre-existing scattered assertions (the_removed_trace_perf_flag_is_an_unknown_argument, the_retired_json_flag_is_an_unknown_argument, each_verb_accepts_only_its_own_classs_format, felis_ssh_is_not_a_verb) into the new table — the plan makes deletion optional, and those tests assert extra structure (the frontend pass-through payload, per-verb exhaustiveness of the point/stream classification) that the outcome-class table does not carry, so removing them would lose coverage.
  • Extending the matrix to felis-client and felis-daemon serve argv — the accepted triage plan re-scoped this issue to the felis-cli parser matrix only; the public help surface of those binaries is covered by the help snapshot from #187.
Fixes #185. The argv grammar the CLI surface has already frozen was pinned only by scattered individual assertions, or not asserted at all: a refactor that loosened one rule could land unnoticed. This adds one table-driven test per rule in `crates/felis-cli/src/tests.rs`, each stating the argv line and its outcome class, including the exit code a usage error owes its caller. Rules covered: a program for `sessions spawn` only after `--`; the removed profiling and framing flags staying unknown arguments; a framing outside the verb's class; `--raw` without a payload; no frontend pass-through outside `frontend`. Doc cascade: none — the change is test-only and documents no new behavior; the visible surface is already covered by `docs/reference/cli.md` and the help snapshots from #187. Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high ## Deferred - Folding the pre-existing scattered assertions (`the_removed_trace_perf_flag_is_an_unknown_argument`, `the_retired_json_flag_is_an_unknown_argument`, `each_verb_accepts_only_its_own_classs_format`, `felis_ssh_is_not_a_verb`) into the new table — the plan makes deletion optional, and those tests assert extra structure (the frontend pass-through payload, per-verb exhaustiveness of the point/stream classification) that the outcome-class table does not carry, so removing them would lose coverage. - Extending the matrix to `felis-client` and `felis-daemon serve` argv — the accepted triage plan re-scoped this issue to the felis-cli parser matrix only; the public help surface of those binaries is covered by the help snapshot from #187.
cli: pin the frozen argv grammar as one table
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
bench / Criterion full-suite snapshot (pull_request) Has been skipped
bench / Criterion regression gate (pull_request) Successful in 1m58s
darwin / detect relevant changes (pull_request) Successful in 3s
darwin / darwin docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 50s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m6s
pr / nix flake check (pull_request) Successful in 30s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m35s
pr / wire schema is compatible with the base (pull_request) Successful in 12s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 50s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 3s
windows / windows docs-only no-op (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Successful in 17s
windows / cargo nextest (Windows) (pull_request) Successful in 7m48s
windows / frontend smoke (Windows) (pull_request) Successful in 1m45s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
8d45ea6f8c
The grammar decisions the surface has already frozen — a program for
`sessions spawn` only after `--`, the removed profiling and framing
flags staying unknown, a framing outside the verb's class, `--raw`
without a payload, no pass-through outside `frontend` — were spread
across individual assertions or not asserted at all, so a refactor that
loosened one could land unnoticed. One table per rule states the argv
line and the outcome class, including the exit code a usage error owes
its caller.

Refs #185
natsukium deleted branch test/argv-matrix-185 2026-09-07 23:11:11 +09:00
Sign in to join this conversation.
No description provided.