Skip to content

fix: classify invalid state paths as usage - #102

Open
jsugg wants to merge 1 commit into
mainfrom
fix/state-dir-exit
Open

jsugg wants to merge 1 commit into
mainfrom
fix/state-dir-exit

Conversation

@jsugg

@jsugg jsugg commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Changes

Relative --state-dir is invalid input, not a permission failure. Keep the concrete PathError at the CLI boundary and return usage exit 2 with INVALID_ARGUMENT for its two syntax variants. Other path failures keep permission exit 12 and their existing messages.

The mapping is shared by management, doctor, service and scheduling routes. It does not create state for invalid input or change successful commands.

Checks

  • The real CLI regression first returned 12 instead of 2.
  • A table covers all seven path-error variants in human/JSON modes.
  • Eight real CLI cases cover the four path-resolution routes and pin exit, message, JSON envelope, empty stdout and no state creation.
  • An owned fresh Cargo target passes quick, actual Rust 1.85 and clean scripts/check.sh full, including 554 application tests and package dry run.
  • The reused default target ran an old binary despite Cargo reporting it fresh. That failure is retained, not used as new-source evidence or hidden with an xfail.

This is independent of PR #101. Its obsolete CodeQL comparison decision is still pending; no configuration deletion, accepted limitation, publication or settings change is inferred.

This branch has not been deployed

No deployments
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.

1 participant