Skip to content

skills: generalize --tail to numeric line counts with k/w shorthand and remove time-window tails - #22

Merged
mouxinqq merged 1 commit into
developfrom
codex/update-stat-cache-hitratio-for-line-input
Apr 13, 2026
Merged

mouxinqq merged 1 commit into
developfrom
codex/update-stat-cache-hitratio-for-line-input

Conversation

@mouxinqq

Copy link
Copy Markdown
Owner

Motivation

  • Unify --tail semantics across skills so it only represents a line-count and avoid ambiguous minute/hour/day tail syntax.
  • Make shorthand parsing generic (e.g. 1k/1w) instead of special-casing particular values like 2k.
  • Keep time-based filtering explicit via --start/--end to avoid implicit time-window tail behavior.

Description

  • Reworked --tail parsing in stat_cache_hitrate.py to use a single regex ^(\d+)([kw])?$ and convert k→1000 and w→10000, returning an integer line count and removing minute/hour/day parsing paths.
  • Applied the same generic --tail parsing in troubleshoot.py, added the missing import re, and made the parser return { "type": "lines", "value": <int> } for downstream use.
  • Removed/streamlined time-window branches: deleted minute-based tail filtering code and adjusted read_lines, grep_and_parse, and grep_count to always treat --tail as a line count when present.
  • Updated CLI help text and both SKILL.md files to document that --tail is line-count only (examples include 5000, 1k, 1w) and that time filtering must use --start/--end.

Testing

  • Ran python3 -m py_compile on both scripts (stat_cache_hitrate.py and troubleshoot.py) and compilation succeeded.
  • Executed module-level smoke checks that call the new parse_tail_arg with inputs 2000, 1k, and 1w for both scripts, and they returned [2000, 1000, 10000] (tests passed).
  • An initial import smoke test failed due to cross-module import ordering, which was diagnosed and resolved before the final successful tests.

Codex Task

@mouxinqq
mouxinqq merged commit a928338 into develop Apr 13, 2026
20 of 25 checks passed

This branch had an error being deployed

1 failed deployment
Metax_ci 984a925e Deployed Apr 13, 2026 by mouxinqq via Trigger Jenkins for PR #32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant