Skip to content

Engine: COBOL CALL 'LITERAL' reaches calls_out_to (#3393) - #3440

Merged
squid-protocol merged 1 commit into
mainfrom
fix/cobol-call-literal-3393
Sep 24, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/cobol-call-literal-3393

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3393.

Problem

In CALL 'SUBPROG' the quoted literal is the callee, as JCL's PGM= is. The detector applies _apply_literal_shield before calls_out, so the literal was blanked and COBOL's CALL\s+['"]?(name) never matched. Only CALL WS-PGM (an identifier) and PERFORM reached calls_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, so call_site_data and the answer-key call targets were unaffected.

Reproduced through prism, exactly as galaxyscope runs it: MAIN-PARA → ['WS-PGM', 'SUB-PARA'], with PROG2 and PROG3 missing.

Fix

  • New registry helper key _calls_out_literal_callee: a verb regex that ends at the opening quote.
  • calls_out scans 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, and DISPLAY 'CALL X' still can't match.
  • COBOL declares CALL\s+$. The key is described in signal_contracts.HELPER_KEYS.

Result: MAIN-PARA → ['PROG2', 'PROG3', 'WS-PGM', 'SUB-PARA'].

Checks

  • Golden masters re-blessed: 7 substantive differences, no parsed/excluded moves.
    • CardDemo CSUTLDTC.cbl's Popularity Rank goes 0 → 3, and its downstream blast radius rises. The three CardDemo programs that CALL 'CSUTLDTC' now join the file graph.
    • Two composition z-scores and the network_macro ripples follow from that.
  • keyword-rosetta: cobol passes, 93 assertions.
  • Ground-truth ledger: unchanged. Call targets come from 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 key
  • pytest tests/: 11,109 passed
  • ruff / mypy / signal-contract audits clean

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

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
@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 a66f5f9 into main Sep 24, 2026
35 checks passed
@squid-protocol
squid-protocol deleted the fix/cobol-call-literal-3393 branch September 24, 2026 01:59
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.

cobol calls_out never sees CALL 'LITERAL': the literal shield blanks the program name first

1 participant