[v0.1/SSH Review] --ssh-arg のトークン分割 UX と ControlMaster 委譲 #38
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#38
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?
現状
--ssh-arg <TOKEN>はsshに verbatim で一トークンずつ spliced される。ssh -p 2222は--ssh-arg=-p --ssh-arg=2222と二回に分けて書く必要がある(cli.md"Ad-hoc VMs and extra ssh flags")。sshの文法を解釈しない("which of them take values is ssh's grammar, not felis's")。shadow parser を持たないことが principle 4 として意図的に選ばれている。--ssh-arg="-p 2222"は一トークンとしてsshに渡り、ssh側で不正引数になるが、felis は気づかない。ユーザは「なぜ繋がらないのか」をsshの stderr から推測する必要がある。window retarget/switch/sessions系の SSH 接続は毎回sshchild を respawn する。connect_carrierはCarrier::Sshごとに新しいCommand::new("ssh")を作る。pull_paced = falseで eager-push にしているが、コネクション自体は毎回張り直し。how-to/attach-over-ssh.mdは「ControlMaster を自分の ssh config で有効化して」と委譲している。felis は multiplexing を管理しないと明記(explanation/architecture/ipc.mdcarrier choices)。問い(1.0 でしか変えられない)
--ssh-argのトークン分割 UX をこのまま凍結するか? シェル経由の一括文字列や--ssh-optionへの改名を含めて再設計するか?-o ControlMaster=auto -o ControlPath=...を自動付与するか?破壊的変更案
--ssh-argを維持しつつ、UX を改善。--ssh-arg一回で"-p 2222"のような空白を含む値を受けたら felis 側で分割してから splice する(shadow parser ではないが最小の分割)。同時にDialError::SshStdioでssh終了コードを構造化して返す。--ssh-argを--ssh-optにリネームし、値はssh -o形式のみに限定。 自由なトークン splice をやめ、-o ControlMaster=...のような key=value だけを許可。原理的にはクリーンだが ad-hoc VM の-i/-pが書けなくなる。Carrier::Ssh接続時にControlPath=${XDG_RUNTIME_DIR}/felis/ssh-%r@%h:%pを自動付与し、初回以外は既存 master を再利用。sshに委譲していたパフォーマンス対策を felis が持つ。~/.ssh/configの既存設定と衝突した場合はユーザ設定を優先。--ssh-argの repeat-per-token 契約と ControlMaster 委譲をreference/cli.mdに normative として明記し、explanation/architecture/control-surfaces.mdに「なぜ felis が ssh multiplexing を持たないか」の rationale を追記。判定基準
felis --host vm --ssh-arg=-p --ssh-arg=2222 sessions listとfelis ssh vm --ssh-arg=-p --ssh-arg=2222が同一のrelay_commandを作ることがテストで保証されること(現行relay_command_splices_ssh_args_before_the_destination)。~/.ssh/configを持たない VM に一発で繋げるまでの打鍵数と失敗時の診断の明確さ。対象ファイル
crates/felis-client-core/src/connector.rs(relay_command),crates/felis-cli/src/main.rs/conn.rs,crates/felis-client/src/main.rs,crates/felis-protocol/src/messages.rs(RetargetCarrier::Ssh { ssh_args }),docs/reference/cli.md,docs/how-to/attach-over-ssh.md,docs/explanation/architecture/ipc.mdcc @natsukium
Triaged as resolved with no code change. The current contract is deliberate and already recorded in
docs/explanation/architecture/ipc.md: each--ssh-argis one verbatim argv token, while connection multiplexing belongs to OpenSSH configuration. Splitting a shell-like string would add the parser this boundary avoids, and automatic ControlMaster management has no observed consumer that OpenSSH itself does not already serve. Reopen only with a concrete workflow that the token form plus~/.ssh/configcannot express.