Repository navigation
COBOL engine: a group's USAGE applies to its elementary items (#4525) - #4531
Merged
Merged
Conversation
IBM Enterprise COBOL / COBOL 2002: a USAGE on a group applies to every item under it with none of its own. The extractor now records the nearest enclosing group's usage on such items (widening #3816's NATIONAL / DISPLAY-1 rule; an inherited DISPLAY is not recorded but still stops an outer usage; 66/88 keep their old shape). GalaxyIR.record_layout and the storage spans thread the enclosing usage down, so COPY-expanded members learn it too, and a picless usage (POINTER) on a group no longer makes the group elementary. The schema forge's own reader inherits likewise. CardDemo CBSTM03A: COMP-VARIABLES 16 -> 8 bytes, WS-TOTAL-AMT 11 -> 6. The 14 engine-group-usage-not-inherited fact cross-check disagreements are gone (fact_crosscheck.py update); the translator adapter's usage channel now reads the effective usage, as the engine records it. Golden masters: 2 NIST CCVS85 record layouts (COMPUTATIONAL groups), attributed via scope_check --expect cobol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Contributor
squid-protocol
marked this pull request as ready for review
October 6, 2026 04:09
This was referenced Oct 6, 2026
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 #4525
Problem
A USAGE on a group (
01 COMP-VARIABLES COMP.) was not applied to the elementary items under it. The engine sized them as DISPLAY, so their sizes and every offset after them were wrong. CardDemo CBSTM03A: COMP-VARIABLES came out at 16 bytes (should be 8) and WS-TOTAL-AMT at 11 bytes (should be 6).Fix (IBM Enterprise COBOL rule: an item with no USAGE takes the USAGE of the nearest enclosing group)
mainframe_boundary):record_data.usagenow holds the inherited usage. This extends the Mainframe byte level: raw EBCDIC code pages (037/1047/277/278/930/939, FB80 splitting) and DBCS COBOL (PIC N/G, SO/SI) #3816 NATIONAL / DISPLAY-1 rule to every usage. A nested group's own USAGE overrides an outer one. An inherited DISPLAY is not recorded, but it still blocks an outer usage. 66/88 entries keep their Mainframe byte level: raw EBCDIC code pages (037/1047/277/278/930/939, FB80 splitting) and DBCS COBOL (PIC N/G, SO/SI) #3816 shape (no storage). A 77 belongs to no group.record_layout,_storage_spans): the enclosing usage is passed down the walk, so COPY-expanded members also pick up the usage of the group they are COPYed under. A picless usage (POINTER/INDEX/COMP-1/2) on a group no longer makes that group elementary.data_entries) now inherits too. Without this, the refraction differential flagged CBSTM03A's WS_TOTAL_AMT._pli_record_layout/pli_mapping), and PL/I data attributes are not inherited from a structure.Ratchets
fact_crosscheck.py update, unscoped): all 14engine-group-usage-not-inheriteddisagreements are gone, the cause is dropped, and 0 are untriaged. The translator adapter'susagechannel now reads the translator's effective usage, which is what the engine now records. The old as-written snapshot wrapper is removed.crucible_check.py --update --yeson both legs. The drift is 2 NIST CCVS85 record layouts (NC1354.2, NC2454.2, COMPUTATIONAL groups).scope_check.py --expect cobolpasses on both modes. No timeouts.Tests
tests/cobol_mainframe/test_group_usage_4525.pycovers:test_dbcs_itemshad pinned the old "not inherited" behaviour and now asserts the inheritance.🤖 Generated with Claude Code
https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR