Skip to content

Next Release#1439

Merged
aeppling merged 42 commits intomasterfrom
develop
Apr 29, 2026
Merged

Next Release#1439
aeppling merged 42 commits intomasterfrom
develop

Conversation

@aeppling
Copy link
Copy Markdown
Contributor

@aeppling aeppling commented Apr 21, 2026

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

claude and others added 18 commits April 2, 2026 19:19
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
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 21, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
10 out of 11 committers have signed the CLA.

✅ vzwjustin
✅ aeppling
✅ binsee
✅ BadassBison
✅ tnucera
✅ xdm67x
✅ pszymkowiak
✅ niklasmarderx
✅ KuSh
✅ tmchow
❌ claude
You have signed the CLA already but the status is still pending? Let us recheck it.

aeppling and others added 3 commits April 21, 2026 19:59
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
@aeppling
Copy link
Copy Markdown
Contributor Author

Benchmark below threshold from multiple benchmark test failing, need to investigate before release

@aeppling
Copy link
Copy Markdown
Contributor Author

Filters quality : Benchmark 79% lower than 80% threshold

master (84%) → develop (79%) : 3 compression regressions from code changes :

Test: rewrite npm exec
master: pass
develop: empty output
Root Cause: npm rule regex added trailing \s+ — bare npm exec (no tool name) no longer matches
Commit/PR: 45938b2
────────────────────────────────────────
Test: curl json
master: 63% savings
develop: 0% savings
Root Cause: JSON schema compression removed, replaced with truncation + tee hint
Commit/PR: #1310
────────────────────────────────────────
Test: grep --max 20
master: 7% savings
develop: -12%
Root Cause: Output format changed from grouped to flat file:line:content + --no-ignore-vcs adds matches
Commit/PR: #791

Cannot merge as it is, need some work on those filters.

aeppling and others added 9 commits April 25, 2026 10:32
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.
Restores src/core/runner.rs to the develop state. After a5e6bf5 moved
npx execution into npm_cmd::exec (routing through runner::run_filtered),
nothing calls run_passthrough_cmd anymore.

Addresses review feedback on PR #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
@aeppling
Copy link
Copy Markdown
Contributor Author

Layer 1: Compile and Full Test Suite

All passed

Layer 2: Install/Uninstall

All passed

Layer 3: Binary Integration Smoke Tests

All smoke tests pass on the release binary.

LGTM

@aeppling
Copy link
Copy Markdown
Contributor Author

Previous filter quality review has been addressed by 137af04

@aeppling aeppling merged commit 705ea23 into master Apr 29, 2026
30 of 31 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.

rtk discover: default project filter fails when cwd contains a dot (e.g. /Users/first.last)