Skip to content

fix(crawlctl): reject malformed log tail counts - #249

Closed
vincentkoc wants to merge 1 commit into
mainfrom
fix/log-tail-integer-validation
Closed

vincentkoc wants to merge 1 commit into
mainfrom
fix/log-tail-integer-validation

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

crawlctl logs --tail=10oops silently requests 10 lines; fractional values such as 1.5 similarly become 1. The parser previously accepted only the initial integer prefix.

User Impact

Malformed counts now produce a usage error before configuration or log files are read. Positive decimal counts, including +10 and 0010, remain valid in both flag forms.

Why This Change Was Made

Require complete integer parsing while retaining the existing positive-count and overflow checks. The default count and log output are unchanged.

Evidence

  • Regressions reproduced prefix acceptance for junk, fractions, scientific notation, and extra tokens in both --tail N and --tail=N; all pass after the fix.
  • Full uncached Go tests, vet, module tidiness, formatting, and diff checks passed with GOWORK=off.
  • Native independent P0–P3 review of 5c01daa0c5ed703b8610b70e26821fcf5e4ac584 against 7c8666e99bb62cd03767d7dd79e368f6dfd23ac3 found no actionable issues. Static review covered the complete candidate and unchanged flag/config/output paths; runtime validation was performed separately.

@vincentkoc
vincentkoc marked this pull request as ready for review November 16, 2026 04:46
@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc

Copy link
Copy Markdown
Member Author

Superseded by #248, opened concurrently during review. Its production change is identical and its CLI regressions cover the malformed counts and valid output paths. Closing this duplicate in favor of the earlier reviewed candidate.

@vincentkoc vincentkoc closed this Nov 16, 2026
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