* Add test demonstrating validateQueryArgs race condition
Add concurrent test that demonstrates the thread-safety issue with
validateQueryArgs() using global viper state. The test fails with
data races when run with -race flag.
Issue #4706🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix validateQueryArgs thread-safety by passing config struct
Replace global viper state access with a queryConfig struct parameter
in validateQueryArgs(). This eliminates race conditions by reading
configuration once in the caller and passing immutable values.
Changes:
- Add queryConfig struct to hold validation parameters
- Update validateQueryArgs to accept config parameter
- Modify runQueryCmd to read viper once and create config
- Update all tests to pass config struct instead of using viper
This makes validateQueryArgs thread-safe and easier to test.
Fixes#4706🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>