Repository navigation
record_layout: expand EXEC SQL INCLUDE, place a COPY that closes a nested group, report unresolved members (#4278, #4279) - #4340
Merged
Conversation
…sted group, report unresolved members (#4278, #4279) #4278: `EXEC SQL INCLUDE member END-EXEC` inside a record is now recorded as a copy member (mainframe_boundary._COPY_IN_ENTRY) and expands in record_layout like COPY. A member that does not resolve is reported in `unexpanded` (bytes unknown) instead of being skipped while the fields after it silently sit early; a runtime member (SQLCA, DFH...) after an entry is its own record and closes the one above it. #4279 (same mechanism): _expanded_children only looked for a COPY on an elementary direct child. A COPY recorded on the LAST entry deep inside a group child (a 15 FILLER under 05/10, an 88 under a 05) whose roots are no deeper than that child now closes it, and its roots land at the level that holds them. Before, the entries after it were threaded under the open group AND handed to the copied record -- counted twice. Against the det translator on the det-port estates: COTRTLIC WS-MISC-STORAGE +817 bytes, COTRN02C CSUTLDTC-PARM 158 -> 100, COUSR02C/03C WS-VARIABLES 144 -> 110, COPAUS0C WS-SWITCHES 227 -> 7, GenApp DFHCOMMAREA unknown -> 32,500 (7 programs). Golden masters regenerated in both legs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
Contributor
…nted (#4278) carddemo 173 -> 176, CBSA 88 -> 99, GenApp 29 -> 40 copybooks; every new member resolves (resolved == total), an engine improvement. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
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.
Fixes #4278
Fixes #4279
Both issues come from one mechanism in
galaxy_ir.record_layout's COPY expansion, so they ship together (decided with the coordinator).What was broken
record_layout, silently #4278:EXEC SQL INCLUDE member END-EXECinside a record was never recorded as a copy member, sorecord_layoutdidn't expand it and nothing reported it.01 DFHCOMMAREA.+EXEC SQL INCLUDE LGCMAREAcame back with size unknown._expanded_childrenonly looked for a COPY recorded on an elementary direct child. A COPY recorded on the last entry deep inside a group child was missed. That covers an88under a05(COUSR02C:COPY COCOM01Y.after88 USR-MODIFIED-NO) and a15 FILLERunder05/10(COTRTLIC)._copy_extension), so they were counted twice.The fix
mainframe_boundary._COPY_IN_ENTRYalso matchesEXEC SQL INCLUDE member, so the member is recorded incopy_memberson the entry it follows, exactly like COPY._expanded_children:unexpanded, sobytescomes back None instead of shifting the fields after it;SQLCA,DFH…, the existing_SYSTEM_COPYBOOKlist) counts as its own 01 record and closes the one above it. A program'sEXEC SQL INCLUDE SQLCAtherefore doesn't make every record before it unknown.Evidence: engine vs the det translator (
det.layout, tree-sitter)Measured on full scans of the four det-port estates, comparing main with this branch,
record_layoutof every COBOL 01. All 2,035 records were compared.PIC X(1)flags = 7)Those 12 records are the only ones that changed. CBSA (959 records) and DBB mortgage (59) are unchanged.
New tests in
tests/cobol_mainframe/test_record_layout_copy_placement_4278.py: 6 tests, 5 of which fail on main. One real scan backs them. They cover:05roots after a15 FILLER, and the same shape through COPY;01 DFHCOMMAREA.+EXEC SQL INCLUDE;EXEC SQL INCLUDE SQLCAclosing the record above it;EXEC SQL INCLUDE NOSUCHreported inunexpandedwithbytesNone.Golden-master diff (both legs regenerated: 28 diffs each)
Copy Membersfor the INCLUDEd member. Members include SQLCA ×20, LGCMAREA ×7, PROCDB2 ×6, ACCDB2 ×4, LGPOLICY ×3, SQLDA ×1, ACCTCTRL/CONTDB2 ×1. No other field of any item changed.pytest -m golden_cruciblepasses in both venvs.Completeness pins (
tests/cobol_mainframe/test_completeness.py)Re-pinned on the pinned corpora because the copybooks channel now counts the INCLUDE members, and every one of them resolves:
Ground-truth ledger
ground_truth_ledger.py checkis clean after merging main, including #4341's ratchet. The keyedcopybook layoutsfield scores copybooks on their own and does not go through the program-record path changed here.Local checks
tests/extraction,tests/core_engine,tests/cobol_mainframe: 13,169 passed (test_commarea_contractsincluded)mypy_audit --ci,ruff_audit --ci(0.16.0),dead_key_audit --ci: nothing new🤖 Generated with Claude Code