feat: support --validate-only mode in rickshaw-run - #877
Conversation
Add `--validate-only` flag to `rickshaw-run.py` to perform deep validation of run files, benchmark parameters, tool parameters, and utility parameters without attempting live endpoint connectivity, image sourcing, or engine deployment. Output VALID on successful validation and suppress routine startup INFO logs when validating at default log level. Also catch `json.JSONDecodeError` in `blockbreaker.py` to prevent NameError tracebacks when decoding malformed JSON run files, and document validation mode in `CLAUDE.md`.
Move canonical agent instructions to AGENTS.md and update CLAUDE.md to import AGENTS.md following the crucible agent instructions standard.
PR Review: rickshaw#877 — feat: support --validate-only mode in rickshaw-runSummary: Adds a Changed files: 4 Issues
File Coverage
Limitations
VerdictApprove with comments — no blocking issues; the two findings are a documentation/robustness nit on an unreachable edge case and a test-coverage gap the author can address at their discretion. 🤖 Generated with Claude Code |
…rage Support boolean argument parsing (--validate-only=true/false) in rickshaw-run.py via parse_bool_arg(), and add unit tests covering argument parsing, execution flow, early exit contract, and log level suppression in tests/test_validate_only.py.
|
Thanks for the review! Addressed both findings in commit
|
|
I found two actionable issues:
The early exit at
Similarly, |
When rickshaw-run was ported from Perl to Python 3 (de1b5af), self.bench_params_schema_file and self.tool_params_schema_file were initialized on RunState, but the validate_schema() calls were inadvertently omitted from load_bench_params() and load_tool_params(). This pre-existing omission was discovered during the --validate-only work, where early termination after parameter loading allowed malformed parameter files (such as an empty object or non-array tool params) to bypass downstream execution checks and falsely report validation success. - Call validate_schema(param_sets, self.bench_params_schema_file) in load_bench_params(). - Call validate_schema(json_ref, self.tool_params_schema_file) in load_tool_params(). - Add unit test coverage in tests/test_validate_only.py for valid and invalid bench-params and tool-params structures.
|
Good catch! This was indeed a pre-existing omission dating back to the Perl-to-Python3 port ( Resolved in commit
|
The rickshaw-run-tests workflow job did not install jsonschema into its test virtualenv, causing schema validation tests in test_validate_only.py to fail on the runner. - Add jsonschema to pip install in .github/workflows/unittest.yaml. - Add structural validation fallback in test_validate_only.py if jsonschema is unavailable.
|
Follow-up in commit
|
|
|
Add static schema validation for run-file and endpoint configurations via RunState.validate_endpoint_schemas(). This ensures that run-file structure and type-specific endpoint configurations (remotehosts.json, kube.json, etc.) are validated against their JSON schemas in --validate-only mode as well as during normal execution before live endpoint checks.
|
Added static run-file and endpoint schema validation in commit
|
Summary
Adds
--validate-onlysupport torickshaw-run.pyto enable deep static validation of run files, endpoint definitions, benchmark integration schemas, tool schemas, and utility configurations without requiring endpoint connectivity, container image sourcing, or engine deployment.Also addresses an unhandled
JSONDecodeErrorexception inblockbreaker.pyand aligns agent instruction files with theAGENTS.mdstandard.Changes
rickshaw-run.py:--validate-onlyCLI parameter.validate_endpoints()(live node/host connectivity checks), image sourcing, engine deployment, and execution phases.--validate-onlyat default (normal) log level.VALIDand terminates cleanly with exit code0upon successful validation.sys.exit(1)).util/blockbreaker.py:except JSONDecodeError as err:toexcept json.JSONDecodeError as err:inload_json_file()to preventNameErrortracebacks when decoding malformed JSON run files.AGENTS.md/CLAUDE.md:AGENTS.mdand updatedCLAUDE.mdto@AGENTS.mdfollowing the crucible agent instruction guidelines.Verification
VALIDwith rc 0.--log-level=verbosestill displays detailed progress logs when requested.