[v0.1/CLI Args Review] Snapshot the visible help and pin the valid/invalid argv matrix #185
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#185
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
現状
#55 の完了条件に「全 visible command の help snapshot と valid/invalid argv matrix がテストされる」があるが、子 issue がなく追跡されていない。現行の
crates/felis-cli/src/tests.rsは個別 assertion の散在 (the_launch_verbs_help_says_where_the_globals_go、the_retired_json_flag_is_an_unknown_argument、felis_ssh_is_not_a_verb等) であり、以下を固定していない。--help全文。grammar 変更 (文言・語彙・配置) が意図せず help を変えても検出されない。spawnの-- <CMD>...要求 — #53、--trace-perf除去 — #54、send --rawのrequires = "text"、frontendの opaque pass-through 例外) が将来のリファクタで崩れても検出されない。publish freeze 後に help/completion/man は生成物として固定される (#29)。その直前に、grammar の現在形をテストで錨止めする。
提案
felis-client/felis-daemon serveの公開面) の long help を snapshot するテストを追加する。全文 golden か、語彙・配置の要点を押さえた assertion 群かは実装時に選ぶ。全文 golden を選ぶなら #184 (CLI 有限語彙の公開) の着地後に生成する。sessions spawn htop/spawn --jsonが usage error (exit2) — #53 の回帰防止spawn --format json -- htop --format jsonで前者のみ felis が消費 — #53--trace-perfが unknown argument — #54--format jsonl/ stream verb +--format jsonが exit2felis ssh …が解決しない、frontend以外の opaque pass-through がないsend --raw単独 (payload なし) が usage errorPrinciple check
いずれも capability を増やさない test-only の変更。principles 1–4 はすべて Pass (ないし非該当)。
Acceptance criteria
just checkで落ちる。対象
crates/felis-cli/src/tests.rs(新規テスト)crates/felis-client/src/tests.rs、crates/felis-daemonの CLI test (公開面のみ)docs/reference/cli.mdの grammar 記述との突合せParent review: #55. Release tracker: #12.
Triage plan (2026-09-07)
Re-scoped. The help-snapshot half of this issue is delivered by #187 (an insta snapshot of
Cli::command().render_long_help()for the root and every visible subcommand). What remains here is the valid/invalid argv matrix.Approach
One test module in
crates/felis-cli/src/tests.rs(parser layer, no daemon) that drivesCli::try_parse_fromover a table of argv rows and asserts the outcome class: parses, or a clap error whosekindand exit code (2) are pinned. Rows, at minimum:sessions spawn htopandsessions spawn --json→ usage error (#53: bare program without--is refused)sessions spawn --format json -- htop --format json→ only the first--formatis felis's; the rest is the command (#53)--trace-perfanywhere → unknown argument (#54)--format jsonland a Stream verb with--format json→ invalid value, exit 2 (after #187 the error lists the possible values)felis ssh …→ no such verb; no opaque pass-through outsidefrontendsessions send --rawwith no payload → usage error (requires = "text")Existing scattered assertions that a row now covers may stay or be folded into the table; deleting them is not required. Where #29's goldens already freeze a generated surface (help/completion/man/schema), a one-line comment at the top of the module states the split: this module pins the parser layer, #29's goldens freeze the published artifacts.
Tests
The table itself. Each row is one acceptance item; a row that passes with the guarded change reverted (e.g.
--requirement removed) does not belong.Cascade
None expected: test-only.
docs/reference/cli.mdis consulted for the grammar the rows assert, not edited, unless a row exposes a doc falsehood.Dependencies
After #187 merges (the invalid-value rows assert the ValueEnum error shape).