Repository navigation
Engine: COBOL CALL 'LITERAL' reaches calls_out_to (#3393) - #3440
Merged
Merged
Conversation
In `CALL 'SUBPROG'` the literal is the callee, but the literal shield blanked it before calls_out ran, so COBOL program-to-program calls never reached calls_out_to, the #3328 resolver or the #3333 file graph. Only `CALL WS-PGM` and PERFORM did. A registry may now declare `_calls_out_literal_callee`, a verb regex that ends at the opening quote. calls_out then scans a view where every literal's contents are blanked except the one right after that verb (detector._blank_literals_except_callee; offsets and call order preserved). `DISPLAY 'CALL X'` still cannot match. COBOL declares `CALL\s+$`; HELPER_KEYS describes it. Golden masters re-blessed: 7 substantive differences. CardDemo CSUTLDTC.cbl's Popularity Rank 0 -> 3 and its downstream blast radius (the three programs that CALL 'CSUTLDTC' now join the file graph), plus two composition z-scores and network_macro ripples. keyword-rosetta cobol passes; ground-truth ledger unchanged (call targets come from call_site_data). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Contributor
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.
Closes #3393.
Problem
In
CALL 'SUBPROG'the quoted literal is the callee, as JCL'sPGM=is. The detector applies_apply_literal_shieldbeforecalls_out, so the literal was blanked and COBOL'sCALL\s+['"]?(name)never matched. OnlyCALL WS-PGM(an identifier) and PERFORM reachedcalls_out_to, which left COBOL program-to-program calls out of the #3328 resolver and the #3333 file graph. The #3200 mainframe resolver reads CALL sites separately, socall_site_dataand the answer-key call targets were unaffected.Reproduced through prism, exactly as galaxyscope runs it:
MAIN-PARA→['WS-PGM', 'SUB-PARA'], withPROG2andPROG3missing.Fix
_calls_out_literal_callee: a verb regex that ends at the opening quote.calls_outscans a different view when a language declares it. In that view every literal's contents are blanked except the one right after the verb (detector._blank_literals_except_callee). Offsets, and so call order, are preserved, andDISPLAY 'CALL X'still can't match.CALL\s+$. The key is described insignal_contracts.HELPER_KEYS.Result:
MAIN-PARA→['PROG2', 'PROG3', 'WS-PGM', 'SUB-PARA'].Checks
CSUTLDTC.cbl's Popularity Rank goes 0 → 3, and its downstream blast radius rises. The three CardDemo programs thatCALL 'CSUTLDTC'now join the file graph.network_macroripples follow from that.call_site_data.Test plan
tests/core_engine/test_cobol_call_literal_3393.py: through prism, literal callees in source order with comments and DISPLAY literals ignored; the view helper keeps only the verb's literal and preserves length; the registry declares the keypytest tests/: 11,109 passed🤖 Generated with Claude Code
https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g