fix(compat): method-param reorder severity follows passing style#76
Merged
Conversation
Method parameter `sensitivity.order` was being sourced from `policy.constructorOrderMatters`, which conflates constructor positional semantics with method call-site semantics. For Ruby/Python/Elixir (`constructorOrderMatters: true`), this flagged kwarg-only method reorders as breaking even though callers literally cannot observe parameter declaration order. Method param reorder severity is now decided by the param's `passing` style: positional → breaking, named → soft-risk, keyword/options_object → not reported. Constructor handling is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Method parameter
sensitivity.orderwas being sourced frompolicy.constructorOrderMatters, conflating constructor positional semantics with method call-site semantics. For Ruby/Python/Elixir (which haveconstructorOrderMatters: true), this caused kwarg-only method reorders to be flagged as breaking even though callers literally cannot observe parameter declaration order.Concretely, on workos/openapi-spec#23 the Ruby diff reported
Authorization.list_resources: request_options moved 9→8as breaking. But the method signature isdef list_resources(before:, after:, ..., request_options:)— every param is a keyword arg. The only real break in that method issearch:being removed.Changes
src/compat/ir.ts— method-paramsensitivity.ordernow derives frompassingstyle (only'positional'), notpolicy.constructorOrderMatters.src/compat/classify.ts— position-change handler now branches onpassing:keyword(Ruby/Python/Elixir) → no change emittedoptions_object(Node) → no change emittednamed(PHP/Kotlin/C#) →constructor_reordered_named_friendly(soft-risk)positional(Go/Rust) →parameter_position_changed_order_sensitive(breaking)policy.constructorOrderMatterssemantics — unchanged.language-matrix.test.tscovering each passing style.Test plan
npm test— 1417 pass (6 new)npm run typecheckcleannpm run lint/formatcleanAuthorization.list_resourcesno longer flagsrequest_options moved 9→8as breaking🤖 Generated with Claude Code