fix(discover): rewrite dotnet test/restore/format, not just build#2142
Open
maxmilian wants to merge 1 commit into
Open
fix(discover): rewrite dotnet test/restore/format, not just build#2142maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
`rtk dotnet test`, `rtk dotnet restore`, and `rtk dotnet format` proxies already exist and route to dedicated handlers, but the rewrite rule only matched `dotnet build`, so the Claude Code hook silently passed the other three through unfiltered. Extend the rule's subcommand set; the output filters already handle all four — this is purely a routing fix. Fixes rtk-ai#1830
b67f390 to
c702065
Compare
Author
|
Ran a fresh-context independent review (skeptical, diff + issue only). Verdict: no blockers. Two points addressed / noted:
Follow-up (intentionally out of scope here): the rule's flat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk dotnet test,rtk dotnet restore, andrtk dotnet formatproxies already exist and route to dedicated handlers, butrtk rewriteonly matcheddotnet build— so the Claude Code hook silently passed the other three through unfiltered. Fixes [rewrite] dotnet test|restore|format should auto-rewrite to rtk dotnet #1830.Root cause
The
dotnetrewrite rule insrc/discover/rules.rsusedpattern: r"^dotnet\s+build\b", covering onlybuild.DotnetCommands::Test/Restore/Formatall dispatch to real handlers (src/main.rs:1709-1711), so the proxies work when invoked directly — only the rewrite registry was missing them.Fix
Widen the rule's pattern to
^dotnet\s+(build|test|restore|format)\b. The output filters already handle all four; this is purely a routing fix (one regex).Tests
test_rewrite_dotnet_subcommands— all four rewrite tortk dotnet <sub>;dotnet publish/dotnet run(no proxy) are left untouched.cargo fmt --checkclean.Manual verification
Scope
Only the four subcommands with existing proxies.
dotnet buildand the three new subcommands now share one rule and behave identically (same permission verdict / exit code). The exit-code (ask vs auto-allow) is governed by a separate permission layer and is unchanged by this routing fix.