Repository navigation
CICS facades: answer the own COMMAREA DTO where returned() converts by layout without loss (#4449 part 2) - #4529
Merged
Conversation
…y layout losslessly (#4449 part 2) A facade whose task can RETURN another program's record keeps the program's own DTO as its answer when every such record cuts the bytes exactly as its own does (same width, offsets, PICTUREs, USAGEs); CicsTask.returned converts by layout through generated toCommarea / fromCommarea codecs. Any other crossing keeps Object (#4427): a typed answer would truncate, pad or misdecode it. pc-wizard (PCWIZ, PCCONF) and pc-aid-menu (PCMENU) facades become typed; ports resurfaced and re-proven. CardDemo / CBSA / GenApp unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
…4449) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
3 tasks
Comment on lines
+214
to
+215
| "refused: the task RETURNed a java.lang.StringBuilder, not a com.acme.dto.contract.PcconfWsState " | ||
| "(no layout converts one into the other)", |
Comment on lines
+216
to
+217
| "refused: the task RETURNed a com.acme.dto.contract.PcwizWsState, not a com.acme.dto.contract.PcconfWsState: " | ||
| "20 bytes do not fill PcconfWsState's 30-byte record", |
Contributor
… records (#4449) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
squid-protocol
marked this pull request as ready for review
October 6, 2026 04:25
This was referenced Oct 6, 2026
Merged
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.
Part of #4449. Still open there: the comment's EC-BOUND-SUBSCRIPT suggestion (compile the COBOL side with
-fec=EC-BOUND-SUBSCRIPT), not attempted here.Draft. Part 2 of #4449 (part 1, the java-facade side, landed in #4455). Builds on main after #4490 (#4465) and #4524 (#4464).
Problem
#4427 made a CICS facade answer
Objectwherever a RETURN TRANSID its task can end in passes another class: COBOL passes bytes, and each program reads them through its own record. A deployment caller of those facades got an untyped answer. #4449 asks for the typed alternative: convert by layout inreturned().The design call
Converting by layout is lossless only when both records cut the bytes the same way. In every other case a typed answer would lose or invent data:
CarddemoCommareaagainst COACTUPC's 1,033-byte COMMAREA) would be truncated. The caller would then pass the next transaction a COMMAREA missing the program's state.Conservative version (this PR): a facade answers the program's own DTO only where every other record its task can RETURN has the same partition: the same width, and each item at the same offset, width, PICTURE, USAGE, SIGN and OCCURS, with names ignored. In other words, the same COMMAREA under another program's names. Everywhere else the answer stays
Object, as #4427 left it.Generator (
cobol_to_java_transaction_forge.py)commarea_codecwritestoCommarea()/static fromCommarea(byte[])throughCobolRecords, in the record charset. It writes them only into the DTOs that a facade converts between, so no other DTO changes. It writes none for a layout it cannot lay out exactly: unknown width, OCCURS, PL/I, COMP-1/COMP-2, or overlapping items (REDEFINES). An unset number is written as spaces and read back as null._plan_conversationskeepstxn_response= own DTO when_reads_throughholds, and recordstxn_converts. The facade Javadoc names the converted records.txn_requestis unchanged: the in side staysObjectwhere it was.Runtime (
CicsTask.returned)LENGTHis honoured.Harness (
equivalence_cics.py)The java-facade check accepts a converted answer when it has the same
toCommareabytes astask.returned(type). Before, it accepted only the identical object.Effect on the estates
COPY PCSTATEinto their own WS-STATE, soPcwizWsStateandPcconfWsStatehave the same partition.PcmenuWsCa, converting fromPcdetlWsCa.port_surface.py crucible, with aresurfacedprovenance event, and re-proven withevidence.py prove. All 4 pc-wizard and pc-aid-menu records are proven (PCWIZ 6/6, PCCONF 5/5, PCMENU 4/4, PCDETL 3/3), including the java-facade runs:back-and-fix: PCCONF XCTLs to PCWIZ, whose RETURN passes aPcwizWsState, so PCCONF's facade converts.Object. The equivalence ports,facade_baseline.jsonanddet_sweep_baseline.jsonare untouched.The alternative (not implemented)
A typed bytes value:
handleTransactionanswers a generatedCommarea(the bytes passed plus EIBCALEN), with<T> T as(Class<T>)converting by layout on demand.Commareaon to whichever transaction the RETURN names.runTaskwould have to readtask.commarea(..)through it. It changes the facade signature of every crossing program, so all 14 CardDemo façade ports would need re-proving.Two narrower variants:
handleTransaction(String, Own)takes any record with the same partition.Either is a follow-up if the 4th-estate API wants it.
Found along the way (not changed here)
On main,
port_surface.py equivalence --checkalready reports drift:handleTransactionthat the generator no longer writes, since train: #4464 opaque DFHCOMMAREA + #3804 generated inputs #4524.Resurfacing them means re-proving 14 cases, so it is left to its own PR.
Checks
tests/cobol_mainframe/test_facade_layout_4449.py:test_cics_conversation_4427.py(its fixtures now cut the records differently, to keep testingObject) and the refusal text intest_cics_runtimes.py.EQUIVALENCE_E2E=1) pass.pr_gates.py: all 7 gates pass (lint, audits, secrets, xray, gauntlet, golden, suite).pr_gates.py --ratchets: all 5 pass (ports, estate, fact-crosscheck, completeness, ground-truth).proof_sweep.py --det-only --skip-db2): as expected, withdet_sweep_baseline.jsonunchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR