Conversation
Adds `rtk gain --reset` to clear all token savings stats back to zero. Implements `Tracker::reset_all()` in tracking.rs and wires the flag through the Gain command args and gain::run(). https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
- reset_all() now clears both `commands` and `parse_failures` atomically via execute_batch (fixes incomplete reset reported by reviewer) - Add [y/N] confirmation prompt before --reset; mirrors init.rs pattern - Add --yes flag to skip prompt in scripts/CI - Add unit test: test_reset_all_clears_both_tables verifies both tables are empty after reset https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Avoids raw ANSI codes when stdout is piped, consistent with all other output in gain.rs. https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Tracker::new() uses a shared on-disk SQLite DB. Running reset_all() in a parallel test suite wipes records inserted by other concurrent tests, causing intermittent failures. Add Tracker::new_in_memory() (cfg(test) only) backed by an isolated Connection::open_in_memory(), and switch test_reset_all_clears_both_tables to use it. Extracted init_schema() helper to avoid duplicating DDL. https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Adds reset flag documentation to the upstream file path: - Quick Reference: reset usage examples with and without --yes - Command Options: Reset Flag table with --reset and --yes descriptions - Warning note about irreversibility and non-interactive behaviour https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
Upstream moved this to docs/usage/AUDIT_GUIDE.md in deda44f. Removing the old path so git resolves the rename correctly on merge. https://claude.ai/code/session_015WXbDdxEU3pXPBtheDkXcd
- semgrep for sast check by yml rules - dependabot for package detection - update CICD doc - clippy -D unsafe_code hard fail
Only one allow use in the codebase
- grep: use --no-ignore-vcs so .gitignore'd files aren't silently skipped (matches grep -r behavior, avoids false negatives in large monorepos) - grep: passthrough raw output for <=50 matches so AI agents can parse standard file:line:content format without retry loops - filter: replace smart_truncate heuristic with clean first-N-lines truncation and a single [X more lines] suffix (eliminates synthetic // ... markers that AI agents misread as code, causing parsing confusion and retries)
The installer failed with "Failed to get latest version" when the GitHub REST API returned 403 due to the anonymous rate limit (60 req/hour, shared across NAT/CI). Switch the primary lookup to the `/releases/latest` 302 redirect, which doesn't count against the API quota. Keep the API call as a fallback, and add a RTK_VERSION escape hatch for pinning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add token-optimized filters for glab CLI commands: - mr list/view/create/merge/approve/diff/note/update - issue list/view - ci list/status/trace (strip ANSI, section markers, runner boilerplate) - release list/view (strip SOURCES block, markdown noise) - api passthrough - Markdown body filtering (HTML comments, badges, blank lines) - Graceful JSON/plain-text fallback for empty results - -R/--repo and -g/--group flag forwarding at clap level - resolved_command() for Windows compat - has_output_flag() / should_passthrough_view() guards - Rewrite rules and classify/rewrite tests for rtk discover Adapted to post-refactoring src/cmds/git/ module structure. Token savings: mr 87%, ci 82%, issue 80% (avg 82%) Closes #851
Branch names containing '/' (e.g. feature/user-auth, main...feature/auth) were incorrectly treated as file paths by the string heuristic in normalize_diff_args, causing '--' to be injected before them and making git treat them as pathspecs — resulting in silent empty output (exit 0). Replace looks_like_path() with a three-tier detection strategy: - Explicit path prefixes (. ~) → always a path, no filesystem check needed - Contains path separator (/ \) → use filesystem existence to distinguish branch names (feature/auth, not on disk) from real paths (src/main.rs) - Bare word with no separator → never inject '--', regardless of filesystem state (avoids misfire when a file shares a name with a branch/ref) Introduce normalize_diff_args_impl with injectable path-checker for testability. Update all existing tests to use mock existence checks. Add three regression tests: branch-with-slash, range-with-slash, and bare-word-that-exists-on-disk. Fixes: #1431 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat(cicd): enforce cicd sast & package check
docs(contributing): coding practices v1
feat(gains): add --reset flag
|
|
feat(glab): add GitLab CLI (glab) command support
fix(git): fix empty output when branch name contains '/' in git diff
…-truncation-annotations fix: grep false negatives, output mangling, and truncation annotations
|
Benchmark below threshold from multiple benchmark test failing, need to investigate before release |
Filters quality : Benchmark 79% lower than 80% thresholdmaster (84%) → develop (79%) : 3 compression regressions from code changes :Test: rewrite npm exec Cannot merge as it is, need some work on those filters. |
fix(install): resolve version via redirect to avoid GitHub API rate limits
fix(filters): benchmark ci update + fix stream + filter quality
The generic fallback arm of `Commands::Npx` called `npm_cmd::run`, which executes `npm` instead of `npx`. This broke every non-routed npx invocation. `rtk npx cowsay hello` failed with `npm error Missing script: "cowsay"` because the rewrite hook sends `npx ...` through as `rtk npx ...`, and `rtk npx` was then running npm. Mirror the existing prisma generic-subcommand passthrough pattern: resolve npx, forward all args, record a tracked passthrough, and propagate the exit status. Fixes #815
Per @KuSh's review on #1458, the generic npx passthrough arm built its own Command + tracking::TimedExecution inline, duplicating the logic already covered by core::runner::run_passthrough. The sticking point was `SKIP_ENV_VALIDATION`: the existing helper takes tool + args and builds the Command itself, so there was no seam for a caller-supplied env var. Add a `run_passthrough_cmd` variant that accepts a pre-built Command and refactor the existing `run_passthrough` to delegate to it. The npx arm now builds a Command, sets SKIP_ENV_VALIDATION when requested, and hands it to the shared helper. This also upgrades the npx passthrough from a raw `cmd.status()` to the shared streaming + tracking path that pnpm_cmd already uses, so verbose logging and telemetry stay consistent across tools.
Add `npm_cmd::exec` for npx and an internal `run_filtered` helper that both `run` (npm) and `exec` (npx) share. The helper resolves the command, applies args, honors SKIP_ENV_VALIDATION, and routes through runner::run_filtered with the npm output filter. The npx fallback in main.rs collapses to `npm_cmd::exec(&args, cli.verbose, cli.skip_env)?`. Per @KuSh review on #1458.
Claude Code replaces both '/' and '.' with '-' when deriving a projects-directory name from the working-directory path. rtk only replaced '/'. For users whose path contains a dot (e.g. /Users/first.last) the computed slug didn't match Claude's directory name, so rtk discover found zero sessions. Fixes #1457
…ath slug Per claude-code#24067, underscore is replaced with '-'. Per claude-code#40946, non-ASCII characters are each replaced with '-'. Windows backslashes follow the same rule. Refactored encode_project_path to use chars().map() instead of chained replace() calls for clarity. Closes #1457
Layer 1: Compile and Full Test SuiteAll passed Layer 2: Install/UninstallAll passed Layer 3: Binary Integration Smoke TestsAll smoke tests pass on the release binary. LGTM |
|
Previous filter quality review has been addressed by 137af04 |
fix(stream): route to respective fd
fix(stream): add semgrep flag for sh tests
Summary
Features
feat(cicd): enforce cicd sast & package check #1147
feat(gains): add --reset flag #1056
feat(glab): add GitLab CLI (glab) command support #314
Fix
fix(git): fix empty output when branch name contains '/' in git diff #1437
fix: grep false negatives, output mangling, and truncation annotations #791
fix(install): resolve version via redirect to avoid GitHub API rate limits #1414
fix(filters): benchmark ci update + fix stream + filter quality #1501
fix(discover): encode '.' as '-' in project path slug #1472 close #1457
Others
docs(contributing): coding practices v1 #1384