Repository navigation
Fix #4039: generate CobolRecords / CobolEdit for every program to port - #4041
Merged
Merged
Conversation
Every port ticket's rules send the porter through CobolRecords (numval, zoned / packed / binary, sortKey, width / fit) and CobolEdit.format, but the two runtimes were generated only beside a VSAM entity or (#3989) when some program had CICS evidence. A batch-only estate over sequential datasets, or a CICS program whose only command is SEND TEXT, got rules naming classes it did not have: the port did not compile, or hand-wrote the parser the rules forbid (#3831's Unicode digits, #3827's decimal comma, #3985's SO/SI truncation). They are now generated whenever there is a program to port. They stay in entity.vsam, where committed ports and agent-returned code already import them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
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 #4039.
Problem
Every port ticket's rules send the porter through
CobolRecords(numval, zoned / packed / binary,sortKey,width/fit) andCobolEdit.format. But the two runtimes were generated only in two cases: beside a VSAM entity, or (#3989) when some program had CICS evidence, meaning a transaction, an EXEC CICS resource, a COMMAREA, a container, or a LINK/XCTL into it.Anything else got rules naming classes it didn't have. That includes:
SEND TEXT.Reproduced with such a program on main:
The porter then either calls a missing class (the port doesn't compile) or hand-writes the parser or formatter the rules forbid. The second path quietly brings back #3831 (Unicode digits), #3827 (decimal comma) and #3985 (SO/SI truncation).
Change
SkeletonForges.sources(): both runtimes are now generated whenever there is a program to port (bool(self.skeletons)), not only when there's a CICS program. #3989'sneededflag carries it, so the change is one condition plus comments.They stay in
entity.vsam. The issue suggested moving them toutil/, but six places in the repo import them fromentity.vsam: three committed ports (CardDemo POSTTRAN and INTCALC, and the CICS crucible's CAXB), the cultural gauntlet and two tests. Any port an agent has already returned in someone's project would break too. The package name is slightly misleading, but not worth a breaking move.Verification
test_runtimes_always.pyruns a real scan → refractor → cobol-to-java on a batch-only estate (a sequential file, no VSAM, no CICS) plus a SEND-TEXT-only CICS program, and checks three things:entity/vsam/holds exactlyCobolEditandCobolRecords, with no entity or repository;javac; I ran it with JDK 21).Against main's forge, the first two fail.
tests/cobol_mainframe+tests/cics_crucible+tests/equivalence: 1173 passed, 22 skipped.Ruff, mypy and dead-key audits: nothing new.
Refraction snapshots: I re-ran the snapshot update for the excerpts and all 6 full corpora, and it left no changes. The snapshot pipeline generates no skeletons, so this condition is never reached there.
No parsing logic is touched.
🤖 Generated with Claude Code