Repository navigation
fix(det): refuse accepted-but-ignored CICS options and swallowed parse errors (#4411) - #4432
Merged
Merged
Conversation
…e errors (#4411) The det translator now refuses, by name, what it used to accept and ignore: - det/cics.OPTIONS lists the options each modelled EXEC CICS command honours; any other option is a hole ("<verb> <opt>: option not modelled"): RETURN IMMEDIATE, READ GTEQ / GENERIC, STARTBR / READNEXT / ENDBR GENERIC / REQID, LINK SYNCONRETURN / DATALENGTH / SYSID, ASSIGN beyond its five, FORMATTIME forms it does not write, RECEIVE MAP ASIS, READQ TS SET, a TD option read as TS, SEND TEXT CURSOR(value) ... - KEYLENGTH only as the file's full key, a known value on a known file; READ / READNEXT / READPREV LENGTH only as the INTO area's own length. - det/stmt.parse: an ERROR / MISSING node outside the PROCEDURE DIVISION node refuses the program (it had dropped whole paragraphs: ENTRY ... USING in DBUNLDGS / PAUDBLOD / PAUDBUNL); one nested in a statement is a hole, in an IF / EVALUATE / WHEN header an unparsed condition. - det/layout.parse: an ERROR / MISSING inside a data entry, and an unquoted VALUE word that is no number, refuse instead of being read as text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…their own refusal (#4411) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
||
| raise Untranslatable(f"{ref.name}: varies") | ||
|
|
||
| self.gp = GP() |
| def constant_int(self, text: str) -> int | None: | ||
| """An option's value when the translator knows it: an integer literal, LENGTH OF an item, or a data item | ||
| with a numeric VALUE the program never changes; else None.""" | ||
| from gitgalaxy.tools.cobol_to_java.det.gen import Untranslatable |
Contributor
Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-protocol
marked this pull request as ready for review
October 5, 2026 11:50
… tests) Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-protocol
added a commit
that referenced
this pull request
Oct 5, 2026
Imports: union of #4412's as_fixed_rows/unwrap and #4430's cobol_parser. Error lines keep #4412's line_of row map. Tests: keep both blocks. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
This was referenced Oct 5, 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 #4411.
The det translator no longer accepts input and then ignores it. Each such path now refuses by name: a statement hole, or a refusal of the whole program when there is no statement to hang the hole on.
Refusals added (4 kinds)
det/cics.OPTIONS,check_options). Each modelled EXEC CICS command lists the options it honours. Any other option is a hole:<verb> <opt>: option not modelled. The check runs before any operand work. The table gives the reason for every option it accepts that has no code of its own:NODUMP;MAIN/AUXILIARY/NOSUSPENDon TS;EQUALon READ;GTEQon STARTBR, which is its default;NOHANDLEwhere no condition is raised. Newly refused:RETURN IMMEDIATE;READ GTEQ/GENERIC/TOKEN;STARTBR/READNEXT/ENDBRGENERIC/REQID;LINK SYNCONRETURN/DATALENGTH/SYSID;ASSIGNbeyond APPLID, SYSID, ABCODE, PROGRAM and INVOKINGPROG; FORMATTIME forms it does not write (DAYOFMONTH,YYDDD,MILLISECONDS…);RECEIVE MAP ASIS/TERMINAL;READQ TS SET;INQUIRE PROGRAM STATUS;SEND TEXT CURSOR(value)/CTLCHAR(value); aTDoption afterWRITEQ, which used to be read as TS; RESP on ASKTIME, FORMATTIME and HANDLE ABEND, whose area was never written.KEYLENGTHis accepted only when it is the file's full key: a known value (a literal,LENGTH OF x, or a VALUE never written) on a file the generated project maps. A shorter key would be generic; any other mismatch is INVREQ.READ/READNEXT/READPREVLENGTHis accepted only when it equals the INTO area's own length. LENGERR and the returned length are not modelled.det/stmt.parse.procedure_divisionnode now refuses the program (the PROCEDURE DIVISION does not parse at line N). On main this dropped code silently:ENTRY 'DLITCBL' USING PAUTBPCB(DBUNLDGS, PAUDBLOD, PAUDBUNL) translated to zero statements;PERFORM P2 THRU.,CALL 'X' USING BY REFERENCE.andSET A TO.each lost every statement after them.MOVE ALL TO A.used to be a MOVE).det/layout.parse. An ERROR or MISSING inside a data entry is a LayoutError; before, it was skipped because the walk stopped atdata_description. An unquoted VALUE word that is not a number (VALUE NULL) is refused instead of being stored as its text.Tests (
tests/cobol_mainframe/test_det_translate.py, 68 pass):OPTIONSor refused, and every accepted option is either read by the code or stated;Ported programs: 51 of 55 cases translate byte-identically
det_port.py checkagainst origin/main (--typed) gives 51/55 ports unchanged. That covers every carddemo, cbsa and mortgage case and 7 of 11 genapp cases, so none of these needs a re-proof. That includes the committed port_invariance ports (DBCRFUN, INQACC, UPDCUST, LGAPVS01 …).Now refusing (previously proven). These two programs show up in 4 cases:
READ … LENGTH(WS-Commarea-Len), set from EIBCALEN: an EIBCALEN shorter than the record is LENGERR in CICS; the port returned NORMALI re-ran all four with
det_port.py run. Each now stops at the hole as intended (Hole: line 69: EXEC CICS: READ LENGTH(WS-Commarea-Len): not INTO's length …), so their proofs no longer hold. Modelling READ LENGTH (LENGERR plus the length returned), and the oracle side to match, would get them back. That is a follow-up if wanted.Left open, needs direction. RESP/RESP2 on
SYNCPOINT ROLLBACKis still accepted and still never written. It is used by CBSA DBCRFUN, INQACC and XFRFUN, and DBCRFUN and INQACC are committed port_invariance ports. Fixing it, whether by modelling it or refusing it, changes their translation, so I did not change it. The table marks it.Corpora beyond the ports (#4378 bake-off set, current front end):
Gates:
pr_gates.py --fast5/5 pass. The mainframe det, cics and port tests pass.🤖 Generated with Claude Code