Skip to content

Call resolver: untyped receiver's JS/TS built-in method is ambiguous, not a confident link (#3756) - #4990

Merged
squid-protocol merged 4 commits into
mainfrom
churn/3756-builtin-receiver
Oct 12, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
churn/3756-builtin-receiver

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3756

What

In the resolver's untyped-receiver fallback (_resolve_one, last step), for TS/JS:

  • a callee that is a method of a built-in class (String/Array/Map/Set/WeakMap/Promise/Object/Number/Date/RegExp/Function; _BUILTIN_INSTANCE_METHODS) reached through an untyped, non-this receiver and landing on file/import is now the ambiguous receiver step (a row, never an edge);
  • a global namespace static (Number.isFinite, JSON.parse, Object.keys; _BUILTIN_NAMESPACES) with no repo class of that name is none (external).
    this/super, typed, class, qualified, alias and import-stem steps are untouched.

Class

Untyped-receiver built-in method calls (the whole built-in-method class, not only trim/get/has/add). Mechanism check: the fallback is language-generic, but the built-in lists are per language and only JS/TS is measured; other languages are unchanged (guard test).

Level 2 (call_graph_resolution.py typescript, zod@2bf7b0630d53)

before after
confident_external 52 1
confident strict precision 96.8% 99.9%
confident precision 99.9% (1627 judged) 99.9% (1617 judged)
recall 61.1% 60.7%
resolution recall 78.6% 78.1%
ambiguous precision 32.1% 34.8%
Confident agree 1626 -> 1616: 10 true links to repo methods that share a built-in name (reached via untyped receivers) became receiver; 51 external and 7 unconfirmed confident links left. Recall drop is within the 0.5-pt gate. The remaining external (handleMapResult -> util.ts has@696) is a Map.has with a repo has in util.ts reached by a step not covered here (not examined further).

Golden

Blessed both legs via crucible_check.py --update --yes; scope_check.py --expect typescript,javascript: 197 diffs = 108 TS/JS plus PageRank last-digit (1e-6) ripple in other languages (the function PageRank is corpus-wide, so removing confident TS fcall edges re-normalises) and the LLM brief; no non-PageRank non-TS/JS field moved.

Gates

pr_gates --fast 5/5; --ratchets 7 pass, 0 skipped; call_graph_resolution typescript --ci OK (baseline regenerated); new tests in tests/core_engine/test_call_resolver.py.

Cross-repo

None.

🤖 Generated with Claude Code

squid-protocol and others added 3 commits October 12, 2026 09:47
…guous receiver, a global's static no edge (#3756)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…call edges; last-digit PageRank ripple elsewhere)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 12, 2026 14:09
@squid-protocol
squid-protocol enabled auto-merge (squash) October 12, 2026 14:09
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

PR #4990 @ 91869aa: 1 failed check(s)

== full-suite part 3/3 (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/38259753790/job/114849335019
repro: python -m pytest -q tests/tools/test_call_graph_accuracy.py::test_c3_go_conversion_is_a_call tests/tools/test_call_graph_accuracy.py::test_c8_anonymous_function_calls_belong_to_the_enclosing_unit tests/tools/test_call_graph_accuracy.py::test_c8_nested_named_function_keeps_its_own_calls tests/tools/test_call_graph_accuracy.py::test_cause_labels_inner_function_calls_and_non_calls tests/tools/test_call_graph_accuracy.py::test_cpp_qualified_unit_drops_its_own_leaf_recursion_only tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[csharp-'class tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[java-'class tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[rust-fn tests/tools/test_call_graph_accuracy.py::test_java_constructor_and_method tests/tools/test_call_graph_accuracy.py::test_python_callees_rightmost_and_nested_attribution tests/tools/test_call_graph_accuracy.py::test_rust_scoped_constructor_and_macro tests/tools/test_cics_case_ports.py::test_overlays_and_summary tests/tools/test_det_unmask.py::test_the_cut_literal_what_if_reaches_the_parsers tests/tools/test_graph_ledger.py::test_scala_import_is_not_a_declaration tests/tools/test_graph_ledger.py::test_scala_member_imports_never_cut_into_the_package tests/tools/test_graph_ledger.py::test_scala_package_wildcard_is_its_package_object_only tests/tools/test_graph_ledger.py::test_scala_packaging_block_and_scala3_package_file_are_indexed tests/tools/test_graph_ledger.py::test_scala_self_import_nested_wildcard_and_backquotes tests/tools/test_html_embedded_ts_funcs.py::test_explicit_javascript_type_is_parsed tests/tools/test_html_embedded_ts_funcs.py::test_mathtex_type_with_params_is_skipped tests/tools/test_html_embedded_ts_funcs.py::test_module_script_is_parsed tests/tools/test_html_embedded_ts_funcs.py::test_plain_script_is_parsed tests/tools/test_html_embedded_ts_funcs.py::test_shader_type_is_skipped tests/tools/test_html_embedded_ts_funcs.py::test_src_script_is_skipped tests/tools/test_html_embedded_ts_funcs.py::test_text_template_is_skipped tests/tools/test_import_graph_accuracy.py::test_c_quoted_include_prefers_the_including_directory tests/tools/test_import_graph_accuracy.py::test_dart_package_uris_resolve_through_pubspec tests/tools/test_import_graph_accuracy.py::test_go_uses_the_module_path_from_go_mod tests/tools/test_import_graph_accuracy.py::test_haskell_shell_and_solidity_rules tests/tools/test_import_graph_accuracy.py::test_java_nested_class_import_lives_in_the_outer_class_file tests/tools/test_import_graph_accuracy.py::test_kotlin_and_scala_resolve_by_package_and_declared_name tests/tools/test_import_graph_accuracy.py::test_php_resolves_use_and_trait_use_through_psr4 tests/tools/test_import_graph_accuracy.py::test_rust_mod_declaration_follows_the_module_tree tests/tools/test_import_graph_accuracy.py::test_rust_use_paths_follow_the_module_tree_and_cargo tests/tools/test_import_graph_accuracy.py::test_typescript_esm_js_spelling_resolves_to_the_ts_source
failing tests: tests/tools/test_call_graph_accuracy.py::test_c3_go_conversion_is_a_call tests/tools/test_call_graph_accuracy.py::test_c8_anonymous_function_calls_belong_to_the_enclosing_unit tests/tools/test_call_graph_accuracy.py::test_c8_nested_named_function_keeps_its_own_calls tests/tools/test_call_graph_accuracy.py::test_cause_labels_inner_function_calls_and_non_calls tests/tools/test_call_graph_accuracy.py::test_cpp_qualified_unit_drops_its_own_leaf_recursion_only tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[csharp-'class tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[java-'class tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[rust-fn tests/tools/test_call_graph_accuracy.py::test_java_constructor_and_method tests/tools/test_call_graph_accuracy.py::test_python_callees_rightmost_and_nested_attribution tests/tools/test_call_graph_accuracy.py::test_rust_scoped_constructor_and_macro tests/tools/test_cics_case_ports.py::test_overlays_and_summary tests/tools/test_det_unmask.py::test_the_cut_literal_what_if_reaches_the_parsers tests/tools/test_graph_ledger.py::test_scala_import_is_not_a_declaration tests/tools/test_graph_ledger.py::test_scala_member_imports_never_cut_into_the_package tests/tools/test_graph_ledger.py::test_scala_package_wildcard_is_its_package_object_only tests/tools/test_graph_ledger.py::test_scala_packaging_block_and_scala3_package_file_are_indexed tests/tools/test_graph_ledger.py::test_scala_self_import_nested_wildcard_and_backquotes tests/tools/test_html_embedded_ts_funcs.py::test_explicit_javascript_type_is_parsed tests/tools/test_html_embedded_ts_funcs.py::test_mathtex_type_with_params_is_skipped tests/tools/test_html_embedded_ts_funcs.py::test_module_script_is_parsed tests/tools/test_html_embedded_ts_funcs.py::test_plain_script_is_parsed tests/tools/test_html_embedded_ts_funcs.py::test_shader_type_is_skipped tests/tools/test_html_embedded_ts_funcs.py::test_src_script_is_skipped tests/tools/test_html_embedded_ts_funcs.py::test_text_template_is_skipped tests/tools/test_import_graph_accuracy.py::test_c_quoted_include_prefers_the_including_directory tests/tools/test_import_graph_accuracy.py::test_dart_package_uris_resolve_through_pubspec tests/tools/test_import_graph_accuracy.py::test_go_uses_the_module_path_from_go_mod tests/tools/test_import_graph_accuracy.py::test_haskell_shell_and_solidity_rules tests/tools/test_import_graph_accuracy.py::test_java_nested_class_import_lives_in_the_outer_class_file tests/tools/test_import_graph_accuracy.py::test_kotlin_and_scala_resolve_by_package_and_declared_name tests/tools/test_import_graph_accuracy.py::test_php_resolves_use_and_trait_use_through_psr4 tests/tools/test_import_graph_accuracy.py::test_rust_mod_declaration_follows_the_module_tree tests/tools/test_import_graph_accuracy.py::test_rust_use_paths_follow_the_module_tree_and_cargo tests/tools/test_import_graph_accuracy.py::test_typescript_esm_js_spelling_resolves_to_the_ts_source
errors:
fail-on-cache-miss: false
E tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download/v1.21.0/parsers.json: http status: 504
FAILED tests/tools/test_call_graph_accuracy.py::test_python_callees_rightmost_and_nested_attribution - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-p
FAILED tests/tools/test_cics_case_ports.py::test_overlays_and_summary - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download/v1.21.0/p
FAILED tests/tools/test_call_graph_accuracy.py::test_rust_scoped_constructor_and_macro - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/d
FAILED tests/tools/test_call_graph_accuracy.py::test_java_constructor_and_method - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/downloa
FAILED tests/tools/test_call_graph_accuracy.py::test_cause_labels_inner_function_calls_and_non_calls - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-p
FAILED tests/tools/test_call_graph_accuracy.py::test_c8_anonymous_function_calls_belong_to_the_enclosing_unit - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-l
FAILED tests/tools/test_call_graph_accuracy.py::test_c8_nested_named_function_keeps_its_own_calls - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack
FAILED tests/tools/test_call_graph_accuracy.py::test_c3_go_conversion_is_a_call - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download
FAILED tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[rust-fn run(xs: I) {\n let v = xs.collect::<Vec>();\n}\n-run-collect] - tree_sitter_language_pack.DownloadError: Download error:
FAILED tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[csharp-'class A {\n void Run(object[] xs) {\n '...len69-06845153-Run-OfType] - tree_sitter_language_pack.DownloadError: Download e
FAILED tests/tools/test_call_graph_accuracy.py::test_generic_callee_is_the_function_not_its_type_argument[java-'class A {\n void run() {\n Map m = new'...len74-42677176-run-HashMap] - tree_sitter_language_pack.DownloadError: Download er
FAILED tests/tools/test_call_graph_accuracy.py::test_cpp_qualified_unit_drops_its_own_leaf_recursion_only - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-langu
FAILED tests/tools/test_det_unmask.py::test_the_cut_literal_what_if_reaches_the_parsers - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/
FAILED tests/tools/test_graph_ledger.py::test_scala_import_is_not_a_declaration - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download
FAILED tests/tools/test_graph_ledger.py::test_scala_package_wildcard_is_its_package_object_only - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/r
FAILED tests/tools/test_graph_ledger.py::test_scala_member_imports_never_cut_into_the_package - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/rel
FAILED tests/tools/test_graph_ledger.py::test_scala_packaging_block_and_scala3_package_file_are_indexed - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-languag
FAILED tests/tools/test_graph_ledger.py::test_scala_self_import_nested_wildcard_and_backquotes - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/re
FAILED tests/tools/test_html_embedded_ts_funcs.py::test_plain_script_is_parsed - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download/
FAILED tests/tools/test_html_embedded_ts_funcs.py::test_module_script_is_parsed - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download
FAILED tests/tools/test_html_embedded_ts_funcs.py::test_explicit_javascript_type_is_parsed - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releas
FAILED tests/tools/test_html_embedded_ts_funcs.py::test_text_template_is_skipped - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/downloa
FAILED tests/tools/test_html_embedded_ts_funcs.py::test_shader_type_is_skipped - tree_sitter_language_pack.DownloadError: Download error: Failed to fetch manifest from https://github.com/xberg-io/tree-sitter-language-pack/releases/download/
... 13 more
log tail:
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
##[group]Run {
{
echo "## CICS spec status page (advisory)"
if python tests/tools/cics_spec_status.py render --check 2>&1; then :; else
echo "The evidence-refresh bot re-renders docs/language_status/cics_spec_status.md on main after merge; do not commit it here."
fi
} >> "$GITHUB_STEP_SUMMARY"
shell: /usr/bin/bash -e {0}
env:
PYTHONUTF8: 1
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
OMP_NUM_THREADS: 1
EVIDENCE_REPORT_ADVISORY: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/2f189f30-aa05-4ff1-b1a1-c6bf801a5b03' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-protocol squid-protocol added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 12, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call resolver: an untyped receiver's built-in method call (str.trim(), map.get()) links confidently to a same-named repo method via file/import

1 participant