Repository navigation
Reject refinement arguments in native C API module insertion - #302
Merged
Merged
Conversation
284km
commented
Nov 25, 2026
284km
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed 442d14b. No Critical / Major / Minor findings. The C API mixin up-call now refuses a refinement module with ArgumentError: refinement module is not allowed, after the frozen check, as CRuby's ensure_includable does (rb_class_modify_check, then the refinement test). I ran corpus 1025 (extended with the refinement cases) on the author's build at this head, on the evaluator and MERE_RUBY_VM=1, against ruby 4.0.10: identical. The description has corpus --both 953/953, VM 953 / 0 fallback / 0 differences, the 8 gates, hygiene, bracket depth and headers_check. git merge-tree against main: clean. No mere-pr-review-watch inline comments. Merging.
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.
Native include/prepend/extend accepted a Refinement argument after #292, leaking refined methods into ordinary ancestors. Reject that argument with
ArgumentError: refinement module is not allowed, preserving frozen-target priority. Ordinary modules can still be inserted into a refinement target. This repairs the post-merge Major on #292. The runtime change is six lines in request 36; API fixtures and corpus 1025 cover all three operations, no ancestry/leak mutation, frozen receivers and valid refinement targets.Runtime c15756b, comparison main 0369440, ordinary O2 compiler 9dec2ff6. Clean Ruby 4.0.10 through
tools/ref_ruby.sh, revision a704b7cd95a42cc0cf5f307137bf3aac0285b915, zero extra gems, Prism 1.8.2.Local validation:
check(A.errinfo_now.nil?)failure as fresh comparison main. All 30 targeted insertion checks pass on reference, evaluator/VM and GC stress with newly built fixture libraries. No full VM API all-pass claim.Peak family RSS, KiB:
Ranges vary; no stable memory improvement is claimed. Evidence:
loop/2026-11-26-codex-capi-native-refinement-arguments.mdandcapi/check/records/codex-capi-native-refinement-arguments.json.