Skip to content

[experiment A] untyped-receiver built-in method calls (Part of #4479) - #6388

Closed
squid-protocol wants to merge 1 commit into
mainfrom
expA-4991
Closed

squid-protocol wants to merge 1 commit into
mainfrom
expA-4991

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

This PR is one arm (A) of the paired A/B agent experiment in #4479 (protocol docs/agents/self-scan-ab-protocol.md). Part of #4991.

What

A call through an untyped, non-this receiver whose method name is a language built-in (items.add(x), d.TryGetValue(k), list.each) linked confidently (file/import) to a same-named repo method. #4990 fixed this for TS/JS (and Java) with per-language _BUILTIN_INSTANCE_METHODS / _BUILTIN_NAMESPACES in gitgalaxy/core/call_resolver.py; the fallback in _resolve_one is language-generic, so it only needed lists. This adds them for Kotlin (JDK lists plus kotlin.collections/text/scope-function names), C# (BCL, LINQ) and Ruby (core Object/Enumerable/Array/Hash/String), each with global static namespaces.

Class / Sibling gaps

Class: any language that reaches the untyped-receiver fallback with a stdlib method name. Done here: Kotlin, C#, Ruby (Java, TS, JS were already done). Not done, still sibling gaps: Python (needs a check of calls_out_qualifiers coverage; pyan Level 2 flags no lib targets, so it needs another measurement), PHP (methods only; confirm whether anything reaches the fallback), Go (ownerless-method language; stdlib type methods like strings.Builder.WriteString unconfirmed), and other languages with the same fallback (Scala, Groovy, Swift, Dart, Rust, C++) which have no list. The lists are unmeasured: no Level 2 reference exists for C# or Ruby, and Kotlin's was not run.

Tests

tests/core_engine/test_call_resolver.py: for Kotlin, C#, Ruby, a built-in name on an untyped receiver is receiver (not confident), a repo-only name stays file, this stays class, a repo class receiver stays qualified, and a global namespace static is none. The old "other languages keep the rule" test now pins Python/PHP. Result: 81 passed in that file.

Not run (experiment cost cap)

Golden bless, crucible_check.py, the full pr_gates, and the Level 2 measurement were NOT run. Parsing logic is untouched but the call resolver feeds file-graph edges, so a golden diff is possible.

🤖 Generated with Claude Code

)

An untyped-receiver call named like a stdlib method no longer links
confidently to a same-named repo method.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant