Skip to content

fix: validate stack admit arguments before locking or mutating state - #65

Merged
HaoZeke merged 1 commit into
mainfrom
fix/admit-validate-before-mutate
Nov 21, 2026
Merged

HaoZeke merged 1 commit into
mainfrom
fix/admit-validate-before-mutate

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

fix: validate stack admit arguments before locking or mutating state

run_stack_admit validated the ts option only after it had opened the
lock file and moved an existing forecast reservation to waiting, and
after any quota or scheduler command had already run. The timestamp
helper also reported a malformed value under the generated-at option
instead of ts. Direct callers that passed a missing or conflicting
quota source likewise opened the lock and rewrote forecast records
before failing, and LockKind::parse returned a plain error instead of
a usage error.

A timestamp_for helper in src/site_commands.rs reports the name of the
caller's option, and validate_admit_request runs at the entry of
run_stack_admit before the lock is taken or a shell command runs.
LockKind::parse failures are wrapped in cli_parse::usage so an invalid
lock kind exits with status 2.

run_stack_admit validated the ts option only after it had opened the
lock file and moved an existing forecast reservation to waiting, and
after any quota or scheduler command had already run. The timestamp
helper also reported a malformed value under the generated-at option
instead of ts. Direct callers that passed a missing or conflicting
quota source likewise opened the lock and rewrote forecast records
before failing, and LockKind::parse returned a plain error instead of
a usage error.

A timestamp_for helper in src/site_commands.rs reports the name of the
caller's option, and validate_admit_request runs at the entry of
run_stack_admit before the lock is taken or a shell command runs.
LockKind::parse failures are wrapped in cli_parse::usage so an invalid
lock kind exits with status 2.
@HaoZeke
HaoZeke merged commit ae5c42e into main Nov 21, 2026
22 checks passed
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