Skip to content

feat(call-graph): Rust builtins (#4991), Kotlin overloaded imports (#4125), Perl/Zig/Ruby/Shell accuracy - #8815

Merged
squid-protocol merged 2 commits into
mainfrom
feat/callgraph-builtins-kotlin-4991-4125
Nov 21, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/callgraph-builtins-kotlin-4991-4125

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Consolidates Level-2 call-resolution, Kotlin import-graph, and Level-1 call-extraction improvements into a single PR:

  1. Rust untyped-receiver stdlib builtins (Part of Siblings of #3756: untyped-receiver built-in method calls in other languages #4991)
    • Expanded _BUILTIN_INSTANCE_METHODS_RUST in gitgalaxy/core/call_resolver.py with non-colliding core/std methods (classify, is_empty, iter_mut, into_iter, unwrap_or, unwrap_or_else, expect, is_some/is_none/is_ok/is_err, as_str/as_bytes/as_mut, to_string/to_owned/to_vec, chars/lines/starts_with/ends_with/trim).
    • Verified on call_graph_resolution.py rust --ci: confident_external dropped 62 -> 47 (-24%), strict precision jumped 92.0% -> 93.4% (import step 82.8% -> 90.2%), with 0 recall drop (81.5% / 82.1%).
  2. Kotlin overloaded top-level function imports (Fixes Import resolution (kotlin): an import of a function overloaded across files of one package draws no edge #4125)
    • Extracted _resolve_declaration_hits in gitgalaxy/core/network_risk_sensor.py and wired _resolve_edges so Kotlin import a.b.fn links every file in package a.b declaring fn (e.g. com.squareup.kotlinpoet.ksp.toKModifier -> both Modifiers.kt and Visibilities.kt), while keeping test-file filtering for production importers.
  3. Level-1 call-graph accuracy mega-wins (Perl, Zig, Ruby, Shell)
    • Perl (perl.py): added "undef" to _calls_out_ignore (eliminates 154 undef_expression FPs; locally measured 93.9% -> 97.4% prec).
    • Zig (detector.py, zig.py): added "zig": frozenset({"import"}) to _CALLS_OUT_GLOBAL_IGNORE_NOT_KEYWORDS (recovers 62 @import(...) FNs) and "volatile" to _calls_out_ignore (drops 10 FPs; locally measured 99.9% prec / 99.9% rec).
    • Ruby (detector.py): added "ruby": frozenset({"class", "require"}) to _CALLS_OUT_GLOBAL_IGNORE_NOT_KEYWORDS (recovers obj.class and require "x" calls while keeping raise ignored per test_ruby_calls_out_strict).
    • Shell (shell.py): added _blank_shell_heredocs as _calls_out_rewrite to blank heredoc bodies and EOF terminators (drops 58 FPs; locally measured 86.4% -> 88.6% prec).
  4. Agent workflow guardrails (.claude/skills/ci-push-checklist/SKILL.md)
    • Documented QUALIFIED_CALLS_OUT_PATTERNS registration, local tree-sitter verification with cached grammars, batching golden-master PRs, and git diff origin/main verification after rebases.

Golden Crucible Updates

  • Refreshed tests/golden_master_audit and tests/golden_master_zero_dep_audit on top of latest origin/main via crucible_check.py --update --yes.

Verification

  • Added tests/core_engine/test_kotlin_overloaded_imports_4125.py, tests/extraction/languages/test_calls_out_perl_zig_ruby_shell.py, and Rust #4991 tests in tests/core_engine/test_call_resolver.py.
  • Ran 177 unit tests (test_call_resolver.py, test_kotlin_overloaded_imports_4125.py, test_calls_out_perl_zig_ruby_shell.py, test_ruby_strict.py), ruff format --check, tests/ruff_audit.py --ci, tests/doc_refs_audit.py --ci, call_graph_resolution.py rust --ci, and call_graph_resolution.py cpp --ci (all passed).

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit fa90edd into main Nov 21, 2026
71 checks passed
@squid-protocol
squid-protocol deleted the feat/callgraph-builtins-kotlin-4991-4125 branch November 21, 2026 11:45
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.

Import resolution (kotlin): an import of a function overloaded across files of one package draws no edge

1 participant