Skip to content

fix(cli): error when --side-csv is named but missing (don't silently stub)#22

Merged
bamdadd merged 1 commit into
bamdadd:mainfrom
dchaudhari7177:fix/side-csv-missing
Jul 20, 2026
Merged

fix(cli): error when --side-csv is named but missing (don't silently stub)#22
bamdadd merged 1 commit into
bamdadd:mainfrom
dchaudhari7177:fix/side-csv-missing

Conversation

@dchaudhari7177

Copy link
Copy Markdown
Contributor

Problem

_ensure_side_csv synthesises a header-only stub when the side-effects CSV is absent. That's right when --side-csv is 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-csv unspecified → stub as before (empty Side-effects table)
  • --side-csv PATH with missing PATH → parser.error("side-effects CSV not found: PATH"), non-zero exit

_ensure_side_csv itself is unchanged, so the stub path behaves exactly as today.

Tests

New test passes --side-csv <tmp>/typo.csv with the real artifact dose/layer CSVs and asserts SystemExit with 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.py passes (the -X utf8 is only for my Windows console; unrelated tests print ).

Fixes #19

_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
@bamdadd
bamdadd merged commit 6c5d21a into bamdadd:main Jul 20, 2026
1 check passed
@bamdadd

bamdadd commented Jul 20, 2026

Copy link
Copy Markdown
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 --side-csv that's missing is a user typo and should fail loudly, while an unspecified one still falls back to the stub), it reuses the existing parser.error style so the message reads consistently with --dose-csv/--layer-csv, and the test pins both the non-zero exit and the message. Nice work closing #19.

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.

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.

Error when --side-csv is named but missing (don't silently stub)

3 participants