Repository navigation
fix: CALL/LINK/XCTL/EXEC PGM prefer the member named for the program (#4419) - #4426
Merged
Merged
Conversation
…am among shared PROGRAM-IDs (#4419) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
Contributor
squid-protocol
marked this pull request as ready for review
October 5, 2026 10:32
…name # Conflicts: # gitgalaxy/galaxyscope.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
Forks of a program (
ORDV#OLD) keep the originalPROGRAM-ID. ORDVAL. The invocation resolver indexed by PROGRAM-ID and broke ties by path proximity only, so ORDMAIN'sCALL 'ORDVAL'resolved to the dead forkORDV#OLD.cbl(H-0050), drawing the call edge, fan-in and reachability there.Fix
invocation_resolver._pick_program, the one tie-break behind CALL, CICS LINK/XCTL, JCLEXEC PGM=(and CSD transaction PROGRAM): when several members declare the PROGRAM-ID, the member whose stem equals the target wins (nearest among them). If none is named for it, today's nearest rule stays and the pick is reported:resolve_invocations(..., ambiguities=...)collects{src_path, target, chosen, candidates}, surfaced asprogram_id_ambiguitiesin the scan summary (present only when non-empty). A single declarer is never ambiguous.Before -> after
tests/cobol_mainframe/test_call_member_name_4419.py(new, 8 tests): fork shape for CALL, LINK, XCTL (fork nearer than the live member, so proximity alone picks the fork), JCL EXEC PGM, CSD transaction; no-matching-member case (nearest kept + ambiguity reported); single declarer; case/extension-insensitive stem match. Real scan of estate-crucible v0.4.0: ORDMAINCALL ORDVAL->ORDVAL.cbl, H-0050 FAIL (4 not passing) -> PASS.Golden masters
Both legs unchanged; scope check: 0 differences vs origin/main (goldens contain no shared-PROGRAM-ID case, summary key absent when empty).
Ground-truth ledger
No change.
Estate-crucible
Horrors passing 58/60 -> 59/60 (H-0050). Checks: pass 1369->1372, fail 13->11, missing 1->0, phantom 4->3. call_sites 46/3 -> 47/2, dead 10/1 -> 11/0, file_edges 23/0/1/1 -> 24/0/0/0. Audits: mypy, ruff, dead_key PASS.
Fixes #4419
🤖 Generated with Claude Code
https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo