Repository navigation
CICS transactions + COMMAREA / channels -> REST endpoints and DTOs (#3615) - #3636
Merged
Merged
Conversation
…3615) A CICS program's controller is now built from the verified skeleton (06_skeleton, #3614), replacing the generic per-program controller: - each CSD transaction entering the program -> POST /transactions/<transid> - a LINK / XCTL target, or a program no transaction enters -> POST /link - GET / PUT CONTAINERs -> POST /channel, or the transaction body when the program has no COMMAREA Engine side, GalaxyIR.program_interfaces() resolves each program's COMMAREA layout, in this order: - the record its resolved LINK / XCTL / RETURN TRANSID callers pass it (the most-passed wins; the rest are listed as alternatives); - else its own fixed-length DFHCOMMAREA; - else a stated gap. It also resolves every GET / PUT CONTAINER with its INTO / FROM layout. The skeleton carries this as a new `interface` section. Java side, the COMMAREA and container records become DTOs in dto.cics. - One class serves every program passed the same copybook record. A program that extends the copied record gets its own class. - Every field comment gives the PIC, offset, width and source file, and every class and endpoint names the CSD line or call site it came from, plus the field-testing status. - Where no layout resolved, the endpoint takes no body and a TODO says why. - Services gain the handleTransaction / handleLink / handleChannel methods the endpoints call. - The DTO renderer is factored out of generate_java_dto (output unchanged) so the lombok / plain / record styles apply to the new DTOs. java_target_matrix.py gains --scan. The java-compile workflow runs every corpus both ways. Locally, all 13 configs compile via --scan on CardDemo, CBSA, GENAPP and zECS; zOE and DSF have no CICS programs and pass on the generic path. Without a skeleton, output is unchanged: the refraction snapshot shows 0 differ on 6 corpora. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Contributor
CodeQL flagged a duplicate '9' in _EDITED's character class ([^9SVP()0-9]). The class also had a real bug. The (n) repeat counts are stripped before the check, so its 0-9 range only let editing digits through: PIC 9990, whose 0 is an insertion zero (display text), was typed as a number. The class is now [^9SVP], and tests pin 9990 / 9(3)0 as String and S9(10) as Long. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
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 #3615 (epic #3625). This is the first generator that builds from the verified skeleton (#3614, PR #3631).
What changes
For a program with CICS evidence, the controller is built from the skeleton instead of the generic per-program controller. CICS evidence means an entry transaction, an EXEC CICS resource, a COMMAREA contract or a container.
TRANSACTION(x) PROGRAM(p)(entry_transactions)POST /api/v1/<p>/transactions/<x>→service.handleTransaction("x", body)LINK/XCTLinto p (commarea_contracts), or no transaction enters pPOST /link→service.handleLink(body)GET/PUT CONTAINER(interface.containers)<P>ChannelIn/<P>ChannelOutDTOs; the transaction body when p has no COMMAREA, elsePOST /channelinterface.commarea)dto.cicsHow the COMMAREA layout is resolved (engine side, new
GalaxyIR.program_interfaces()):LINK/XCTL/RETURN TRANSIDcallers pass it. If callers pass different records, the one most sites pass wins and the others become a TODO listing each alternative.DFHCOMMAREA.OCCURS … DEPENDING ON EIBCALENarea no caller pairs with, or no DFHCOMMAREA at all.Traceability:
CARDDEMO-COMMAREAis 160, 194 or 218 bytes depending on the program.Example (CardDemo):
Coverage on the pinned corpora
Compile
java_target_matrix.py --scanrefactors against an engine scan, so the skeleton path gets compiled.java-compile.ymlnow runs each corpus's configs twice: the generic path, then--scan.--scanon CardDemo, CBSA, GENAPP and zECS. zOE and DSF have no CICS programs and pass on the generic path.Unchanged without a skeleton
generate_service_skeletonandgenerate_java_dtooutput is byte-identical; the DTO renderer is only factored out.refraction_snapshot.py check: 0 differ on all 6 corpora.ruff_audit.py --ci: clean.Tests
tests/cobol_mainframe/test_cics_endpoints.pyruns a real scan of a small CICS estate: a transaction, a LINK with a copybook COMMAREA, a channel program with a dotted container name, and a batch program. It covers:Not in this PR
🤖 Generated with Claude Code
https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g