Repository navigation
Fix #4246: an unnamed data description entry is an implicit FILLER - #4284
Merged
Merged
Conversation
`2 PIC X(40) USAGE DISPLAY VALUE '...'` (IBM DBB EPSCSMRD L24/27/30) has no name: COBOL makes it an implicit FILLER. Both the engine and the answer key took the clause keyword in the name's place for the name and read the entry's clauses from after it, so the item was named PIC and lost its PICTURE (and, in the key's layouts, its storage -- every field after it moved up). - mainframe_boundary._cobol_records: a first word that is a clause keyword (PIC / PICTURE / USAGE / VALUE(S) / OCCURS / SIGN / JUSTIFIED / BLANK / SYNC / EXTERNAL / GLOBAL / a usage) names the entry FILLER, and its clauses are read from that word. _cobol_value_map gives such an entry's VALUE to no name. - cobol_answer_key._data_items: the same rule, implemented on its own. - Golden masters re-blessed: 41 record-layout entries in 3 crucible files (special_schema.cbl, CBL_OC_DUMP.cob, xfhfcd3.cpy) move from a PIC-named, PIC-less item to FILLER with its PIC (one unnamed OCCURS 16 group gains its count). Nothing else moves. - field_testing.json: defect D042 (record fields, DBB round 7). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
This was referenced Oct 3, 2026
squid-protocol
added a commit
that referenced
this pull request
Oct 3, 2026
…4108) Generated files taken from main and regenerated on the v1.7.0 crucible. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8
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.
Resolves #4246.
What was broken
2 PIC X(40) USAGE DISPLAY VALUE '...'(IBM DBB MortgageApplication EPSCSMRD, lines 24 / 27 / 30) has no name, and COBOL makes such an entry an implicit FILLER. Both readers took the clause keyword sitting where the name goes for the name, then read the entry's clauses starting after it:record_data):item_name='PIC', no PIC._data_items):name='PIC',pic=None. The key's layout arithmetic sizes an item from its PIC, so the item took no storage and every field after it moved up.Changes
mainframe_boundary._cobol_records: when the first word after the level number is a clause keyword, the entry is named FILLER and its clauses are read starting at that word. The keywords are PIC / PICTURE / USAGE / VALUE(S) / OCCURS / SIGN / LEADING / TRAILING / JUST(IFIED) / BLANK / SYNC(HRONIZED) / EXTERNAL / GLOBAL and the usages (COMP…, BINARY, PACKED-DECIMAL, DISPLAY(-1), NATIONAL, INDEX, the POINTERs). These are reserved words, so none of them can be a data name._cobol_value_map: such an entry's VALUE is assigned to no name, soPICcan never resolve as a CALL target.cobol_answer_key._data_items: the same rule, implemented separately (_DD_UNNAMED).cobol_schema_forge.data_entries) already handled this through its_CLAUSE_WORDS, so it is not touched.field_testing.json: defect D042 (record fields, DBB round 7); report regenerated. The COBOL engine: no PROGRAM-ID recorded forPROGRAM-ID. 'EPSCSMRD'.(quoted name, column 9) #4242 PR uses D041, so whichever PR merges second rebases that file and re-runsfield_testing.py report --write.Golden masters (why the output changed)
Re-blessed with
crucible_check.py --update --yes. Only10_mainframe_system_facts/record_layout.jsonmoved, and the full-precision and zero-dependency fixtures are byte-identical. I diffed every entry against HEAD: 41 entries in 3 crucible files, and all of them are this fix.che-che4z_lsp_project_fixtures/special_schema.cbl,gnucobol/CBL_OC_DUMP.cobandgnucobol/xfhfcd3.cpy.xx,x, …).OCCURS 16group becomes FILLER and gains its count.Not done
05 .with no name and no clause) are not handled. None turned up on the corpora.Verification
test_data_division.pyadds three (named vs unnamed entries in the EPSCSMRD shape, value map, and names that only start with a clause word such asPIC-CODE,VALUE-DATE,COMP-RATE,INDEX-NO). The key test checks the items and thatcopybook_record_unitslays out after the FILLERs. The three tests that exercise the bug fail on origin/main.epscsmrd.cbl@ ce2c1be5 now reads lines 24 / 27 / 30 as FILLERX(40)/X(35)/X(31)USAGE DISPLAY in both the engine and the key. No item namedPICis left.tests/cobol_mainframe,tests/core_engine,tests/extraction: 13001 passed, 452 skipped, 9 xfailed, 3 xpassed.mainframe_corpus.py fetch, thenground_truth_ledger.py check): clean, with 0 of 10 mismatches open (all the deliberate orphaned_logic reports 100% dead code for five languages whose invocation model never names the callee — the family #2727 closed without covering #2806 cause).ruff formatis clean.🤖 Generated with Claude Code