Skip to content

fix(cli): reject non-positive --last windows#302

Merged
upsetbit merged 1 commit into
masterfrom
codex/reject-nonpositive-last
Jun 27, 2026
Merged

fix(cli): reject non-positive --last windows#302
upsetbit merged 1 commit into
masterfrom
codex/reject-nonpositive-last

Conversation

@upsetbit

Copy link
Copy Markdown
Contributor

Summary

Fixes #292.

Rejects zero and negative rolling windows before local or remote queries so invalid input does not silently produce empty results or inverted windows.

What changed

  • ParseLast now rejects <= 0 durations for both day shorthand and time.ParseDuration forms.
  • Added parser tests for valid windows and invalid zero/negative inputs.

Validation

  • go test ./internal/cli -run 'TestParseLast|TestResolveWindow' -count=1
  • go test ./internal/cli/... -race
  • go build -o ./bin/prosa ./cmd/prosa
  • Manual checks for --last -1d, --last -24h, --last 0d, --last 0s

@upsetbit upsetbit added bug Something isn't working area:cli prosa CLI scope:cli prosa CLI commands, flags, rendering, setup, and scheduled sync severity:medium Latent bug, inconsistent contract, brittle pattern priority:P1 Important reliability, usability, workflow, or audit follow-up source:audit Created from an audit report or validation pass labels Jun 27, 2026
@upsetbit upsetbit merged commit ce13bfc into master Jun 27, 2026
5 checks passed
@upsetbit upsetbit deleted the codex/reject-nonpositive-last branch June 27, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli prosa CLI bug Something isn't working priority:P1 Important reliability, usability, workflow, or audit follow-up scope:cli prosa CLI commands, flags, rendering, setup, and scheduled sync severity:medium Latent bug, inconsistent contract, brittle pattern source:audit Created from an audit report or validation pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject non-positive --last durations

1 participant