feat: add with-watch watch-mode CLI scaffold#360
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7aba7e7745
ℹ️ 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".
|
|
||
| #[cfg(unix)] | ||
| { | ||
| info!(expression, "Spawning delegated shell command"); |
There was a problem hiding this comment.
Stop logging full shell expressions
This info! call logs the raw --shell expression, so commands like with-watch --shell 'TOKEN=secret cmd file' will leak the secret into operational logs/CI output. That violates the crate’s own security contract to avoid exposing delegated command environment values, so this log should capture only non-sensitive metadata (for example source/mode and input counts) rather than the full expression text.
Useful? React with 👍 / 👎.
| }; | ||
| push_unique_input(&mut inputs, input); | ||
| } | ||
| Ok(inputs) |
There was a problem hiding this comment.
Reject blank explicit watch inputs
explicit_watch_inputs skips whitespace-only --input values but then returns success even when every provided input was blank. In that case (e.g., with-watch exec --input '' -- echo hi), the runner starts with zero watch anchors, executes once, and then waits forever with no possible rerun trigger. Treat the post-trim empty set as WithWatchError::NoWatchInputs to fail fast.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5841b82638
ℹ️ 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".
| .collect::<Vec<_>>() | ||
| .join(" "); | ||
|
|
||
| info!(command = display_name, "Spawning delegated argv command"); |
There was a problem hiding this comment.
Stop logging delegated argv contents
spawn_argv logs the full delegated command string, which includes raw argument values. In passthrough/exec flows this can expose secrets (for example env TOKEN=secret ...) into operational logs and CI output, violating the crate security contract that delegated environment values must not be exposed. Please log only non-sensitive metadata (source/mode/counts) or redact argument values.
Useful? React with 👍 / 👎.
| starbase_args::Argument::EnvVar(_, value, _) => { | ||
| input_candidates.push(value.as_str().to_string()); | ||
| } |
There was a problem hiding this comment.
Exclude shell env assignments from input inference
Shell parsing currently treats environment assignment values as watch-input candidates. For expressions like --shell 'TOKEN=secret cmd', this makes planning succeed with a bogus filesystem input (secret) instead of returning NoWatchInputs, so the process can sit waiting on unrelated paths. Environment assignment values are not filesystem inputs and should not be fed into watch-input inference.
Useful? React with 👍 / 👎.
Summary
with-watchRust workspace crate with passthrough,--shell, andexec --inputmodesnotify-driven watch loopdocs/andAGENTS.mdTesting