Skip to content

🎨 Palette: Add friendly CLI input validation#73

Open
EiJackGH wants to merge 4 commits intomainfrom
palette-cli-validation-13703821438057530297
Open

🎨 Palette: Add friendly CLI input validation#73
EiJackGH wants to merge 4 commits intomainfrom
palette-cli-validation-13703821438057530297

Conversation

@EiJackGH
Copy link
Owner

This PR adds input validation to the bitcoin_trading_simulation.py CLI.

Previously, passing negative values for days or cash would result in confusing output or crashes. Now, the CLI validates these inputs upfront and provides friendly, accessible error messages (e.g., "Error: Days must be a positive integer") before exiting cleanly.

The changes include:

  • Validation logic in bitcoin_trading_simulation.py.
  • A new test suite test_cli_args.py covering invalid input scenarios.
  • A journal entry in .Jules/palette.md documenting the UX improvement.

PR created automatically by Jules for task 13703821438057530297 started by @EiJackGH

google-labs-jules bot and others added 2 commits February 21, 2026 13:19
- Validate `days`, `initial_cash`, `initial_price`, and `volatility`
- Ensure numeric arguments are positive/non-negative
- Print clear, color-coded error messages on failure
- Remove accidentally committed `__pycache__` files

This improves the CLI UX by preventing invalid simulations and providing helpful feedback to the user.

Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com>
- Validates `days`, `initial_cash`, `initial_price`, and `volatility` arguments.
- Prints color-coded error messages to stderr instead of crashing or allowing invalid simulation.
- Exits with status code 1 on validation failure.
- Adds `test_cli_args.py` to verify validation behavior.
- Updates UX journal in `.Jules/palette.md`.

Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 2 commits February 25, 2026 13:29
- Deleted `.github/workflows/rust.yml` which was causing CI failures as this is a Python-only project.
- The `rust.yml` workflow attempted to run `cargo build`, which failed because no `Cargo.toml` exists.
- The existing `python-package.yml` workflow correctly handles testing and linting for this repository.

Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com>
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.

2 participants