fix(with-watch): address merged PR review feedback#367
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8b1a83ac5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let should_rerun = if plan.metadata.side_effect_profile | ||
| == SideEffectProfile::WritesWatchedInputs | ||
| { | ||
| pending_rerun || additional_change_after_suppression |
There was a problem hiding this comment.
Avoid rerun when only self-mutations occurred
In run, self-mutating commands now rerun whenever pending_rerun is set, even if all observed in-run changes were produced by the delegated command itself. Because pending_rerun is set after the second meaningful snapshot delta, commands that legitimately mutate watched inputs multiple times in one execution (for example, a shell command chaining two sed -i edits) will enqueue another run without any external file edit, creating unnecessary reruns and possible loops.
Useful? React with 👍 / 👎.
| starbase_args::Argument::Option(option, Some(value)) => { | ||
| shell_command | ||
| .argv | ||
| .push(format!("{option}={}", value.as_str())); | ||
| shell_command.argv.push(option); | ||
| shell_command.argv.push(value.as_str().to_string()); |
There was a problem hiding this comment.
Preserve option-value pairing for shell analysis
Splitting Argument::Option(option, Some(value)) into two argv tokens causes downstream analyzers to reinterpret option values as positional arguments when they don't explicitly model that option. A concrete regression is --shell "grep --color=auto foo": --color=auto becomes --color auto, auto is treated as the consumed pattern, and foo is incorrectly inferred as a watch input instead of returning NoWatchInputs, so shell mode can silently watch bogus paths.
Useful? React with 👍 / 👎.
Summary
-fflags, andfind -D/-OoptionsTesting