Skip to content

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

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

squid-protocol wants to merge 1 commit into
mainfrom
experiment-b-4991

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

A/B experiment arm B for #4479 (protocol docs/agents/self-scan-ab-protocol.md); not intended for merge as-is. Part of #4991.

Fills the per-language built-in instance-method lists (and global namespaces) in gitgalaxy/core/call_resolver.py for Kotlin, C# and Ruby. The generic untyped-receiver fallback in _resolve_one (added in #4990) already demotes a file/import link to the ambiguous receiver step when the callee name is in _BUILTIN_INSTANCE_METHODS[lang], and returns none for Math.max-style globals in _BUILTIN_NAMESPACES[lang]; those dicts were filled only for TS/JS/Java.

  • Kotlin: java.lang/java.util list plus kotlin.collections/text/sequences members.
  • C#: BCL (string, StringBuilder, List/Dictionary, LINQ, Task) instance members; namespaces Math, Convert, Console, ...
  • Ruby: core Object/Enumerable/Array/Hash/String methods (incl. include?, empty?); namespaces File, Hash, Math, ...

Tests (tests/core_engine/test_call_resolver.py): the whole input class per language (one case per built-in family), plus the negative side (non-built-in name stays file, this stays class, repo class receiver stays qualified, repo class named like a global wins). The old "ruby stays file" test now uses PHP. 122 call-resolver tests pass; ruff check clean on the source, ruff format applied.

Class / Sibling gaps

Class: an untyped non-this receiver whose method name is a language built-in links confidently to a same-named repo method.
Done here: Kotlin, C#, Ruby (plus TS/JS #4990, Java earlier). Not measured against a Level 2 reference (none exists for these three); lists are from the language docs.
Sibling gaps left (not in this PR): Python (check calls_out_qualifiers coverage first), PHP (confirm nothing reaches the fallback), Go (stdlib-type methods; confirm untyped receivers reach it), and any other language in _PACKAGE_DIR_LANGS/others such as Scala, Groovy, Swift, Dart, Rust.

Not run (experiment cost cap)

Golden bless, crucible_check.py and the full pr_gates were NOT run. Golden-master drift for Kotlin/C#/Ruby fixtures is therefore unverified.

🤖 Generated with Claude Code

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