Skip to content

call graph: a bare f( in a method f reaches the free f (Python, JS/TS, PHP, Rust) (Part of #5699) - #5855

Merged
squid-protocol merged 1 commit into
mainfrom
churn/5699-20261021T1144Z
Oct 21, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/5699-20261021T1144Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5699 (bare-named units; items 1 and 2 of its checklist already landed in #5788 and #5826).

Checklist: partial [c:e0c4a6a2] -- Python, JS/TS, PHP, Rust done; Go, Kotlin, Swift, Java, Ruby, C# decided below
Checklist: done [c:b534f2ec] -- landed by #5788 (class rung re-resolves a bare f to the free f); this PR extends the same rule to bare-named methods
Checklist: done [c:00b961e5] -- landed by #5826 (cross-file free f); this PR's resolver path uses it

What

A method f and a free function f share the bare name, so the detector's recursion filter (c != self_name) dropped the method's call to the free f. In languages where a bare f( inside a method is never the method (it needs self.f / this.f / $this->f) the call now survives: the detector keeps it for a unit that has an enclosing class and has a bare f( after its own header (not a nested declaration header), and the resolver reaches the free f, or prunes the call as recursion when only the unit itself resolves (BARE_CALL_SKIPS_METHODS: python, javascript, typescript, php, rust). Free-function recursion and self.f( / this.f( / $this->f( stay dropped in the detector (#3327 contract tests untouched).

Files (4 hand-written): gitgalaxy/core/detector.py, gitgalaxy/core/call_resolver.py, docs/calls_out_rule_contract.md (one sentence), tests/core_engine/test_call_resolver_bare_named_5699.py.

Class table

member status
Python / JS / TS / PHP / Rust method f -> free f fixed, test each
bare recursion in a free function (same 5) still dropped and pruned, test
self.f( / this.f( / $this->f( still dropped, test
nested declaration f inside method f (PHP anon class, Python inner def) not a call, test (caught as a false edge in the first golden run)
Kotlin, Swift, Ruby member shadows the free fn: recursion, kept dropped, test
Java, C# same (C# explicit-interface case: #5788)
Go not done: a method has no enclosing class in the scan, detector cannot tell it from a free function
ObjC++ not touched

Evidence

  • Real golden run on the language-crucible corpus: the differences are all new edges from a method to the same-named free function, e.g. airflow dag.py DAG.get_last_dagrun -> module get_last_dagrun and get_asset_triggered_next_run_info; vscode ipc.ts dispose -> imported dispose; wasmtime lookup_vmdef method -> free lookup_vmdef (all verified in source). PageRank / network_macro / brief digests move in the last digits from the added edges.
  • A first run also produced a false PHP edge (BladeCompiler::render -> the anonymous class's own render): fixed by excluding declaration headers, pinned by test_nested_declaration_of_the_same_name_is_not_a_call.
  • Goldens re-blessed via golden-lock (both legs). pr_gates --fast 7/7, --ratchets 8/8 (0 skipped), tree-wide guards + 18 new tests + the 5628 tests: 212 passed.

Sibling gaps

Go methods (needs the receiver in the header), ObjC++ unverified, Kotlin/Swift bare call inside a top-level-only shadow-free context (not distinguishable).

Cross-repo: none.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 21, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 21, 2026 12:17
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol enabled auto-merge (squash) October 21, 2026 12:24
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol

Copy link
Copy Markdown
Owner Author

PR #5855 @ 3c5fa93: 1 failed check(s)

== shard 4 (1666524 LOC) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/39598481909/job/119220428258
repro: python tests/tools/pr_gates.py --fast
failing tests: tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[helion]
errors:
fail-on-cache-miss: false
E AssertionError:
tests/doom_rosetta/test_doom_rosetta.py:40: AssertionError
FAILED tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[helion] - AssertionError:
##[error]Process completed with exit code 1.
log tail:
file Tests/Unit/GameAction/Physics/Physics_Missile.cs: functions 15 -> 16, func_hash '63fb1953345d4acf' -> 'ab0449a22c0c5501'
file Tests/Unit/GameAction/Util/GameAction_Player.cs: functions 7 -> 9, func_hash 'e083523f533b132f' -> '6110616e13bc1aa8'
file Tests/Unit/GameAction/Util/InventoryUtil.cs: functions 10 -> 11, func_hash '618655e059ab7f12' -> 'bff66d6382432df6'
file Tests/Unit/GameAction/Vanilla/VanillaThingFlags.cs: functions 5 -> 6, func_hash '9703f2dc97589529' -> '7363a7dcf8ca648c'
(bless an intended change with tests/tools/doom_rosetta_check.py --update --yes)
assert not "helion: 7 difference(s) from the golden\n summary.files_func_mismatch: 373 -> 377\n summary.functions: 9813 -> 9818...sts/Unit/GameAction/Vanilla/VanillaThingFlags.cs: functions 5 -> 6, func_hash '9703f2dc97589529' -> '7363a7d
1 failed, 11 passed, 6 deselected in 179.15s (0:02:59)
##[error]Process completed with exit code 1.
##[group]Run s=$(( $(date +%s) - T0 ))
s=$(( $(date +%s) - T0 ))
echo "shard 4 (1666524 LOC): ${s}s" >> "$GITHUB_STEP_SUMMARY"
shell: /usr/bin/bash -e {0}
env:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
DOOM_SPEEDRUN_WORK: /home/runner/work/gitgalaxy/gitgalaxy/../doom-work
DOOM_ROSETTA_PORTS: agentic-cobol-doom-cc,crispy-doom,doo-cr,doomf77,fastdoom,helion,inter-doom,kocoa-doom,managed-doom,prboom-plus,sqldoom,srb2
T0: 1792585819
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/bb9a2514-e8e5-465b-8bb9-65195ea3e724' 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/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 21, 2026
@squid-protocol
squid-protocol merged commit 74dadd1 into main Oct 21, 2026
102 of 103 checks passed
@squid-protocol
squid-protocol deleted the churn/5699-20261021T1144Z branch October 21, 2026 12:57
squid-protocol added a commit that referenced this pull request Oct 22, 2026
…5699) (#5970)

Go has no enclosing class in the scan, so the receiver in the unit header
(`func (s *S) f(`) marks the method. Same detector/resolver path as #5855.

Co-authored-by: Joe Esquibel <[email protected]>
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

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant