Severity: P1
Command: winml
Category: Exit-Code Contract — exit codes must be documented and consistent so CI/scripts can branch on them.
Repro: Run several failure modes and observe the exit codes.
uv run winml export # missing required option
uv run winml inspect -m bogus/x # bogus model id
uv run winml exprt # typo
uv run winml --version # success
uv run winml perf -m model.onnx --module NoSuchClass --iterations 3 --warmup 1
uv run winml quantize -m model.onnx --precision banana -o bad.onnx
Actual: 4 distinct exit codes observed across the CLI with no documented meaning:
winml export (no args) → 2 (Click usage error).
winml inspect -m bogus/x → 1 (generic).
winml exprt → 2.
winml --version → 0.
winml perf --module NoSuchClass → 3 (undocumented; only path that emits 3).
winml quantize --precision banana → 1 but stdout reads Success! Model quantized (contradiction).
Expected: A documented exit-code table in CONTRIBUTING.md and winml --help, e.g.:
0 success
1 negative result (e.g. eval below threshold)
2 usage error (bad flag, conflicting flags, missing input)
3 hardware/EP unavailable
4 network / Hub failure
5 I/O failure
70+ internal error
Replace every sys.exit(N) in command modules with raise click.ClickException(...) or a typed ModelKitError. Never combine Success! stdout with non-zero exit.
Why it matters: CI pipelines and shell scripts use exit codes to decide whether to publish, retry, alert, or block a release. With four distinct codes and no contract, every consumer has to read the source.
Severity: P1
Command:
winmlCategory: Exit-Code Contract — exit codes must be documented and consistent so CI/scripts can branch on them.
Repro: Run several failure modes and observe the exit codes.
Actual: 4 distinct exit codes observed across the CLI with no documented meaning:
winml export(no args) → 2 (Click usage error).winml inspect -m bogus/x→ 1 (generic).winml exprt→ 2.winml --version→ 0.winml perf --module NoSuchClass→ 3 (undocumented; only path that emits 3).winml quantize --precision banana→ 1 but stdout readsSuccess! Model quantized(contradiction).Expected: A documented exit-code table in
CONTRIBUTING.mdandwinml --help, e.g.:Replace every
sys.exit(N)in command modules withraise click.ClickException(...)or a typedModelKitError. Never combineSuccess!stdout with non-zero exit.Why it matters: CI pipelines and shell scripts use exit codes to decide whether to publish, retry, alert, or block a release. With four distinct codes and no contract, every consumer has to read the source.