Skip to content

Next Release - #1383

Merged
aeppling merged 14 commits into
masterfrom
develop
Apr 20, 2026
Merged

aeppling merged 14 commits into
masterfrom
develop

Conversation

@aeppling

@aeppling aeppling commented Apr 18, 2026 •

Copy link
Copy Markdown
Contributor

@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier labels Apr 18, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes the discover module's savings rate calculation to use a weighted average across all sub-commands in a bucket instead of using the first-seen sub-command's rate. Also fixes the 'Already using RTK' percentage to use floating-point division instead of integer division, preventing small percentages from being truncated to 0%.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

JBF1991 and others added 10 commits April 18, 2026 09:51
Strip env prefix (sudo, VAR=val) before exclude check so PGPASSWORD=x psql matches ["psql"]. Match against full command instead of first token so ["git push"] matches "git push origin main".

Compile exclude entries as regex so ["^curl"] works as pattern.

Invalid regex falls back to prefix match with eprintln warning.
Non-regex patterns auto-anchor with ^ and \b to prevent substring matches (e.g. "go" won't exclude "golangci-lint").
Replace \b with ($|\s) to only match end-of-string or whitespace.

Empty string and bare "^" patterns produce regexes that match all commands, silently disabling all rewrites on a config typo. Skip
  trivial patterns with an eprintln warning.
Removing old guards, windows can now just use the binary hook engine from 0.37

Related issues:
- Fixes #502 : rtk init --global falls back to --claude-md on Windows
- Fixes #1353 : Feature request: hook-based mode on Windows
- Partially addresses #330 : Add hooks support for Windows
- Partially addresses #913 :  Persistent "No hook installed" warning on Windows
- Partially addresses #1373 : Suppress "No hook installed" warning on Windows
- Partially addresses #682 : Config to suppress hook warning
- Related to #1248 : Windows PowerShell compatibility gaps

Supersedes community PRs:
- #1123 fix(init): enable hook installation on Windows
- #1027 fix(init): enable hook-based mode on Windows
- #809 feat: enable hook-based mode on Windows
- #452 feat: add Windows hook support for rtk init --global
- #551 feat: native cross-platform hook for Windows support
- #150 feat(hook): native cross-platform hook-rewrite command
- #1063 Feat/windows hooks
fix(discover): exclude_commands bypass for env-prefix, sub cmd + regex
fix(hooks): windows use 'rtk hook claude' no fallback

@pszymkowiak pszymkowiak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — good batch release.

Strong points:

  • Every fix is tied to an open issue, tests added for each regression
  • regex::escape + ($|\s) anchoring nicely prevents substring false positives (golangci vs go)
  • UTF-8 safe curl truncation via is_char_boundary
  • Weighted savings average fix is correct and well-commented
  • Windows support unified cleanly with RTK_CLAUDE_DIR override for tests

Minor non-blockers:

  • curl: when force_tee_hint returns None and output >= 500 bytes, the full response passes through untruncated. Intentional? If a user disables tee, large JSON payloads will hit the context window.
  • hooks/init.rs tests use std::env::set_var which is only safe here because of CLAUDE_DIR_LOCK. Fine for this module, but worth flagging if other tests in the crate ever touch the same var.
  • Nit: title "Next Release" is generic; something like "release: windows support + discover fixes + curl simplification" reads better in the master changelog.

Approving.

@aeppling

Copy link
Copy Markdown
Contributor Author

Pre release review

Layer: L1: Build gate
Status: PASS
Details: fmt + clippy + 1606 tests + release build (7.8MB)
────────────────────────────────────────
Layer: L2: Core features
Status: PASS
Details: 13 command types tested, 74% avg savings, hook system, proxy, gain
────────────────────────────────────────
Layer: L3: New features
Status: PASS
Details: 22 targeted tests (curl, exclude_commands, weighted savings, Windows hooks)
────────────────────────────────────────
Layer: L4: Install/uninstall
Status: PASS
Details: Full artifact download → install → use → uninstall cycle
────────────────────────────────────────
Layer: L5: Smoke tests
Status: PASS
Details: 95/115 pass, 9 skipped (missing tools), 11 failures all pre-existing or expected

RELEASE READY

All 1606 unit tests pass, all 6 integration tests pass, all new features work correctly, install/uninstall cycle works cleanly. The only new smoke test failure is the expected curl behavior change. The 5 rewrite test failures are a pre-existing test script bug (it checks exit code before checking content, and rtk rewrite intentionally uses exit 3).

@aeppling
aeppling merged commit 638b0d4 into master Apr 20, 2026
33 of 34 checks passed
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working effort-small Quelques heures, 1 fichier

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants