Repository navigation
engine: fix param parsing in rename detection (ENGINE-04, ENGINE-05) - #30
Merged
Merged
Conversation
kridaydave
force-pushed
the
fix/pr-09-engine-param-parsing
branch
from
November 8, 2026 18:14
dee92a2 to
5328c3c
Compare
ENGINE-04: `strip_param_names` split parameter segments on commas at any
paren depth of 0, but ignored `<>{}[]` nesting. Commas inside generic
type args (e.g. `Foo<A, B>`), brace literals, or brackets were treated
as top-level param separators, so the type fragment after such a comma
could be erased as a bare name and distinct types could falsely score 80.
Track all bracket depths when splitting segments so commas only split at
the true top level of the parameter list.
ENGINE-05: `strip_param_names` searched for the first `(` in the whole
signature to locate the param list. For decorated Python definitions
(e.g. `@register(1) def f(a):`) and similar cases, that hit a
decorator/attribute paren and stripped the wrong arguments, leaving real
param names untouched and preventing rename pairing.
Rename signatures blank the function name to `\0`; search for the param
list `(` after that marker so decorator/attribute parens are skipped.
kridaydave
force-pushed
the
fix/pr-09-engine-param-parsing
branch
from
November 8, 2026 18:54
5c86e60 to
49c6cd4
Compare
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.
Bugs
(in a signature taken as the param list when it belongs to a decorator/attributeWhat was wrong
src/engine/mod.rs,strip_param_names): segment splitting tracked only()depth, so commas inside<A, B>,{a, b}, or[...]were treated as top-level parameter separators. In an untyped split fragment (e.g.B>fromFoo<A, B>),strip_segmenterased identifiers, letting distinct generic type arguments collapse andrename_scorereturn 80.src/engine/mod.rs,strip_param_names): param list location usedsquashed.find('(')over the whole signature. For decorated Python definitions (@register(1) def f(a):) and similar attribute/decorator forms, the first(can belong to the decorator, so stripping operated on decorator args and left real parameter names intact, breaking rename pairing.Fix
(),<>,{}, and[]nesting depths when splitting parameter segments; only split on commas when all depths are zero.\0; locate the parameter list(after that marker (falling back to the first(only when no marker is present) so earlier decorator/attribute parens are skipped.Verification
CI green (fmt, clippy, tests, release build, adjudication) + regression tests
test_rename_score_tiers(ENGINE-04/05 cases) andtest_decorated_python_param_rename_detected(ENGINE-05 integration).