Skip to content

fix: a CALL to a sibling program in the same source member resolves to that member (#4447) - #4451

Merged
squid-protocol merged 5 commits into
mainfrom
fix/4447-sibling-call
Oct 5, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
fix/4447-sibling-call

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

What was broken

A multi-program member (PAYMAIN.cbl: PAYMAIN, PAYCALC, and literal-ID 'PAYRPT') calling CALL 'PAYCALC' / CALL 'PAYRPT' produced dst_file_id NULL. Reproduced with a minimal member (MULTI calling plain-ID sibling PLAINSIB and literal-ID sibling LITSIB): both failed, so it is not specific to literal PROGRAM-IDs (H-0029).

Fix

resolve_invocations treated any CALL resolving to the caller's own file as recursion and set resolved_path to None. Siblings declared in the same member resolve to that same file, so they were dropped. Now a member declaring more than one program keeps the resolution (the key's resolves_to is the member); the self-pair still draws no edge. A single-program self-CALL is still recursion/None. _pick_program (#4419 member-name preference) is untouched. Side effect: a recursive CALL of its own program inside a multi-program member also resolves to the member (call sites carry no enclosing-program span to tell it from a sibling), still with no edge.

Before -> after

Minimal member: all 3 call sites dst_file_id NULL -> 1. Tests: tests/cobol_mainframe/test_sibling_call_same_member_4447.py (plain + literal sibling, single-program recursion negative, #4419 preference kept).

Golden masters

Both legs blessed via the kit (crucible_check PASS after update). Moved: 7. Mainframe Skeleton Completeness (Channels, Missing Inputs, Score) and 12. LLM Brief, 0 scanned files moved. All from the same cause: program calls Resolved 359 -> 376, missing program 206 -> 189 (sibling calls in the corpora's multi-program members now resolve); mean channel ratio 65.3% -> 65.9%. (scope_check lists these as unattributed repo-wide rollups.)

Ground-truth ledger

No change; check PASS.

Estate-crucible

Horrors 60/60 -> 60/60; call_sites 47 pass/2 fail -> 49/0 (PAYMAIN L42 PAYCALC, L43 PAYRPT now resolve to the member). Scored at v0.4.0.
Gate #4446 has merged (3900fc3): merged origin/main and ran estate_crucible_gate.py --update-baseline. The baseline.json diff is only the two PAYMAIN call-site improvements (call_sites 47/2 -> 49/0, two not_passing entries removed); the gate passes (horrors 60/60, 0 regressions).

Known side effect: a recursive CALL of its own program inside a multi-program member now also resolves to the member (call sites carry no enclosing-program span), still with no edge.

Closes #4447

🤖 Generated with Claude Code

https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz

squid-protocol and others added 4 commits October 5, 2026 09:35
…o that member (#4447)

The resolver dropped any CALL that resolved to the caller's own file as recursion, so a
program calling a program declared later in the same member (plain or literal
PROGRAM-ID) resolved to nothing. A member declaring several programs now keeps the
resolution; the self-pair still draws no edge.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 14:14
@squid-protocol
squid-protocol merged commit 1085f74 into main Oct 5, 2026
35 of 66 checks passed
@squid-protocol
squid-protocol deleted the fix/4447-sibling-call branch October 5, 2026 14:14
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 engine: CALL to a sibling program in the same member (PAYMAIN → PAYCALC / literal-ID PAYRPT) resolves to nothing

1 participant