Skip to content

refactor: validate required command arguments before running - #943

Merged
ivan-aksamentov merged 1 commit into
rustfrom
refactor/config-args-parse-validate
Sep 1, 2026
Merged

refactor: validate required command arguments before running#943
ivan-aksamentov merged 1 commit into
rustfrom
refactor/config-args-parse-validate

Conversation

@ivan-aksamentov

@ivan-aksamentov ivan-aksamentov commented Sep 1, 2026

Copy link
Copy Markdown
Member
  • Split each command's args into a *Raw type and a validated type joined by a TryFrom that enforces required-input presence [src]
  • Build the missing-argument error from clap metadata, with a clap-default fallback for non-clap builds such as the Node bindings [src]
  • Convert raw to validated at every run boundary: CLI dispatch, pipeline runner, server args, Node bindings [src]
  • Remove the .expect crash-guards from the required-input accessors, returning the proven-present values directly [src]
  • Add per-command merge round-trip tests and document the overlay invariants at overlay_config [src]

…d split

- Parse each command's args and the `--config` overlay into a `*Raw` type with `Option` required fields, then convert to a validated type through `TryFrom` that enforces presence, so run code reads required inputs without the `.expect` crash-guards
- Build the missing-argument error from the command's clap metadata so renaming a flag cannot desync the message, with a clap-default fallback for non-clap builds such as the Node bindings
- Pin the merge round-trip invariant per command so an asymmetric serializer or a nested struct missing `#[serde(default)]` fails a test rather than corrupting a config load
@ivan-aksamentov ivan-aksamentov changed the title refactor/config args parse validate refactor: validate required command arguments before running Sep 1, 2026
@ivan-aksamentov
ivan-aksamentov merged commit b2d06fd into rust Sep 1, 2026
9 checks passed
@ivan-aksamentov
ivan-aksamentov deleted the refactor/config-args-parse-validate branch September 1, 2026 01:42
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