fix(cli): error when --side-csv is named but missing (don't silently stub)#22
Merged
Merged
Conversation
_ensure_side_csv synthesised a header-only stub whenever the file was absent — including when the user explicitly passed a path with a typo, masking the mistake. Now only an unspecified --side-csv stubs; a named missing path gets parser.error, matching --dose-csv/--layer-csv. Fixes bamdadd#19
Owner
|
Merged — thank you, and welcome to steerbench. This is a clean first contribution: it draws the exact line the CLI needed (an explicitly named If steerbench is useful to you, a star helps others find it and Watch will keep you posted on new issues — and I'd love more contributions whenever you're up for it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
_ensure_side_csvsynthesises a header-only stub when the side-effects CSV is absent. That's right when--side-csvis unspecified, but it also fired when a user explicitly passed a path that doesn't exist (e.g. a typo), silently masking the mistake — inconsistent with--dose-csv/--layer-csv, which both error.Fix
In
main, after the dose/layer existence checks:--side-csvunspecified → stub as before (empty Side-effects table)--side-csv PATHwith missing PATH →parser.error("side-effects CSV not found: PATH"), non-zero exit_ensure_side_csvitself is unchanged, so the stub path behaves exactly as today.Tests
New test passes
--side-csv <tmp>/typo.csvwith the real artifact dose/layer CSVs and assertsSystemExitwith a non-zero code and the clear message on stderr. The existing render test already pins the unspecified-stub behaviour.python -X utf8 -m pytest tests/test_cli.pypasses (the-X utf8is only for my Windows console; unrelated tests print‖).Fixes #19