You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
COBOL engine: copybook resolution in the wild (REPLACING-generated names, search-path order, same-named members) #4265
core-engineModifications to the central physics and parsing engineenhancementNew feature, sensor, or structural signatureera:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)legacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingpriority: highCore feature broken, but workarounds existscope:sweepCompletes a class the burned estates already touch (siblings); blocks no program
Engine facts do not follow COPY ... REPLACING, and member lookup is by bare name/file stem with no library (SYSLIB) ordering or collision handling.
Evidence (file:line, origin/main)
gitgalaxy/core/data_moves.py:53-55: names a COPY ... REPLACING would produce "are not resolved by the reader (record_data keeps the copybook's own names)"; the ingestion checklist records this as an engine limit.
gitgalaxy/tools/cobol_to_java/det/source.py:~113-117: the translator expands REPLACING (_replacing, _replace), but resolves a member as the first dir x extension match by name only; no library qualifier ordering, no collision report. So the two sides already disagree on REPLACING.
gitgalaxy/core/mainframe_boundary.py:~1064: copy members are recorded by name only (copy_members).
Impact on a real estate
Production estates generate record names via REPLACING (prefix tags) and keep several libraries with same-named members (test vs prod, per-application). Facts then carry the wrong names, or silently bind to the wrong member.
Acceptance criteria
Engine record/data-move facts resolve REPLACING-generated names (or flag them unresolved explicitly)
Configurable library search order (SYSLIB-style) and COPY x OF/IN lib honoured
Same-named members in different libraries are reported as a collision, not silently first-wins
Tests for each of the three
Out of scope
The translator's own expansion (works today); copybook formats other than COBOL.
Found during: 2026-10-03 COBOL engine/translator audit
Two more shapes of this issue (estate-crucible horrors H-0016 and H-0034):
H-0016 (D004 / Forge copybook fallback: follow EXEC SQL INCLUDE and COPY … IN <library> #3414), COPY REPLACING.01 WS-EMP. COPY PAYTPL REPLACING ==:TAG:== BY ==EMP==. The engine layout has bytes: None, and its first field is WS-EMP with 0 bytes. The key has EMP-ID / EMP-NAME / EMP-RATE, 40 bytes. record_layout does not apply REPLACING to the copied entries; the copybook's :TAG:-ID entries are not data-names until it does.
H-0034 also cascades into 6 other checks (the layouts that use WS-SHARED-DATE).
Found by estate-crucible v0.2.0 (#4317); planted in squid-protocol/estate-crucible, scored by tests/tools/estate_crucible.py on main (#4337 has the full scorecard). The horror flips to pass when this is fixed.
Another shape for this issue, found while fixing #4303 (PR #4350): the import resolver's language guard (_narrow_ambiguous) only restricts a source-member import to the importer's own language when there are several candidates. A single candidate in another language is still taken, so a COBOL COPY A resolves to A.hlasm.
Fix: apply the same language guard to the unique-candidate path. This is the same class as the cross-language edge fixed in #3001 (Python import base64 → C base64.c).
core-engineModifications to the central physics and parsing engineenhancementNew feature, sensor, or structural signatureera:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)legacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingpriority: highCore feature broken, but workarounds existscope:sweepCompletes a class the burned estates already touch (siblings); blocks no program
Activity
squid-protocol commentedon Oct 4, 2026
Two more shapes of this issue (estate-crucible horrors H-0016 and H-0034):
01 WS-EMP. COPY PAYTPL REPLACING ==:TAG:== BY ==EMP==.The engine layout hasbytes: None, and its first field isWS-EMPwith 0 bytes. The key has EMP-ID / EMP-NAME / EMP-RATE, 40 bytes.record_layoutdoes not apply REPLACING to the copied entries; the copybook's:TAG:-IDentries are not data-names until it does.COPY DATEWSin ACCT and CUST programs resolves to PAYR'sDATEWS.cpy, another application's library, instead of the shared copylib in their SYSLIB.COPY DATEWS IN SHRCPYin PAYMAIN resolves to PAYR's too: the library-name is ignored, and the layout is 18 bytes, not 16.H-0034 also cascades into 6 other checks (the layouts that use
WS-SHARED-DATE).Found by estate-crucible v0.2.0 (#4317); planted in squid-protocol/estate-crucible, scored by
tests/tools/estate_crucible.pyon main (#4337 has the full scorecard). The horror flips to pass when this is fixed.squid-protocol commentedon Oct 4, 2026
Another shape for this issue, found while fixing #4303 (PR #4350): the import resolver's language guard (
_narrow_ambiguous) only restricts a source-member import to the importer's own language when there are several candidates. A single candidate in another language is still taken, so a COBOLCOPY Aresolves toA.hlasm.testing_A.cpyCOPY B→B.hlasm.TEST.CBL→A.hlasm,B.hlasm.Fix: apply the same language guard to the unique-candidate path. This is the same class as the cross-language edge fixed in #3001 (Python
import base64→ Cbase64.c).Import resolver: a unique COPY / %INCLUDE candidate must be in the im…
Import resolver: a unique COPY / %INCLUDE candidate must be in the im…
#4265: allowlist the --copy-libraries declaration read in the #3813 s…
#4265: REPLACING single-pass, kept parallel through section-level COP…
#4265: a program is never a REPLACING template; bless goldens
COBOL engine: COPY library resolution (--copy-libraries: SYSLIB order…