Repository navigation
#578 [tools] Bash の書き方の拒否で、workspace 相対 path での再実行を求めないようにする - #650
Merged
Merged
Conversation
Issue #578: a rejection whose operation refuses the command's form (ANSI-C / locale quoting, env -S / --split-string, an unresolved command prefix, a mixed glob/brace write target, unreadable shell text, or a backtick command substitution) holds a spelling in its `path` field, not a path. It no longer appends "use workspace-relative path ..."; only the reason, which already names the alternative spelling, is shown. Path rejections keep their message byte for byte. The `nearest_relative` and `guidance` fields keep their values, so the recorded event and its schema are unchanged, and the reject/allow decision is untouched. 判断: the issue table lists four form kinds ("など"); the design rule is "operation が path ではないもの", so the two other fail-closed operations (unreadable shell text, unverifiable backtick command substitution) are included too — their `path` is a sentinel, so the path guidance was equally wrong for them. The form/path operation partition, the short message, and the unchanged field values are frozen in tests/issue578_bash_rejection_guidance.rs. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Bash が「書き方」を理由にコマンドを拒否したとき、エラー文が workspace 相対の path での再実行を求めないようにします。書き方の拒否は path を直しても通らないので、この案内は誤解を招きます。path が workspace の外にあることによる拒否の文は変えません。
変更
src/tools/bash.rspath_confinement_rejectionの文の組み立てだけを分けました。is_command_form_operation(operation)を使います。書き方の拒否のとき、文はbash_path_confinement_error: {reason}だけになります。ANSI-C / locale quoting・env -S / --split-string・unresolved command prefix・unreadable shell text・unverifiable backtick command substitution・unverifiable glob write target。bash_path_confinement_rejected)と schema、path・nearest_relative・guidanceなどの field の値。tests/issue578_bash_rejection_guidance.rs(新規)schema_version1・blocked・operation・nearest_relative・guidance)を確かめます。検証
commandmate verifyの 15 ゲート(fmt・clippy-D warnings・cargo testの全体を含む)は、developc98bdc7cの上の HEADcdebe287で 15/15 pass でした。c98bdc7cのコードに新しいテストのファイルだけを置いて実行しました。form_rejection_message_is_only_the_reason・form_rejection_event_keeps_the_existing_schema)。今のコードの文が再実行の案内を含むためです。runner.rs・loop_run.rs・baseline)も変えていません。確かめてほしい点
unreadable shell textとunverifiable backtick command substitutionは、Issue の表にない 2 種類です。どちらの場合も、path に入るのは番兵の値(<shell text>など)なので、path を直す案内は意味を持ちません。レビュー
文とテストの変更なので、merge 前レビューは行いません(利用者承認済み)。
Refs #578
🤖 Generated with Claude Code