Skip to content

fix(discover): normalize tab separators before classification and rewriting - #4104

Open
jacobshaw01-del wants to merge 1 commit into
rtk-ai:developfrom
jacobshaw01-del:fix/discover-tab-command-boundaries
Open

jacobshaw01-del wants to merge 1 commit into
rtk-ai:developfrom
jacobshaw01-del:fix/discover-tab-command-boundaries

Conversation

@jacobshaw01-del

Copy link
Copy Markdown

Summary

Tab-separated commands such as git\tstatus were classified as supported but produced no rewrite. Normalize unquoted, unescaped tabs through a shared helper before classification and rewriting, so both paths and their existing guards use the same separator spelling. Quoted and escaped tabs remain unchanged.

Fixes #4100.

Test plan

  • Added regressions for the reported git/cargo/npm/pnpm commands, pnpm and git global options, multiword prefixes, exclusions, protected commands, and literal tabs in arguments. Observed the new rewrite tests fail before the fix and pass afterward.
  • Added end-to-end coverage of rtk rewrite and rtk hook claude, retaining the default permission exit code of 3.
  • cargo fmt --all --check, cargo clippy --locked --all-targets, and cargo test --locked --all pass on macOS arm64 with Rust 1.91.0: 3,813 tests passed, 0 failed, 8 ignored.
  • Manually inspected the built CLI's rewrites for all four commands in the report.

This changes command rewriting, not filter output or compression ratios. Targets develop.

@CLAassistant

CLAassistant commented Sep 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@jacobshaw01-del
jacobshaw01-del marked this pull request as ready for review September 18, 2026 05:46
@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working discover rewrite labels Sep 18, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟡 Risk medium

Summary

This PR fixes a bug where tab-separated commands (e.g. git\tstatus) were classified as supported but failed to produce a rewrite because classification and rewriting handled tabs inconsistently. It adds a shared normalize_command_tabs helper that converts unquoted, unescaped tabs to spaces before both classification and rewriting, preserving tabs inside quotes or escaped.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4100


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working discover rewrite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(discover): a tab between command and subcommand classifies as Supported but never rewrites

2 participants