Skip to content

feat: add with-watch watch-mode CLI scaffold#360

Merged
kdy1 merged 2 commits intomainfrom
kdy1/with-watch-cli-scaffold
Apr 10, 2026
Merged

feat: add with-watch watch-mode CLI scaffold#360
kdy1 merged 2 commits intomainfrom
kdy1/with-watch-cli-scaffold

Conversation

@kdy1
Copy link
Copy Markdown
Contributor

@kdy1 kdy1 commented Apr 10, 2026

Summary

  • add the new with-watch Rust workspace crate with passthrough, --shell, and exec --input modes
  • implement generic watch-input inference, snapshot-based rerun filtering, and a notify-driven watch loop
  • document and register the new project in docs/ and AGENTS.md

Testing

  • cargo test -p with-watch
  • cargo test

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@kdy1 kdy1 changed the title crates: add with-watch watch-mode CLI scaffold feat: add with-watch watch-mode CLI scaffold Apr 10, 2026
@kdy1 kdy1 merged commit e5d517f into main Apr 10, 2026
16 checks passed
@kdy1 kdy1 deleted the kdy1/with-watch-cli-scaffold branch April 10, 2026 17:42
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +69 to +71
starbase_args::Argument::EnvVar(_, value, _) => {
input_candidates.push(value.as_str().to_string());
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant