Skip to content

det: LINK RESP2; RETURN/LINK COMMAREA LENGTH past the DTO passes the bytes; opaque bytes passed on (#4679) - #4694

Merged
squid-protocol merged 6 commits into
mainfrom
fix/4679-link-return-commarea
Oct 8, 2026
Merged

squid-protocol merged 6 commits into
mainfrom
fix/4679-link-return-commarea

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #4678 -- merge that first (once it merges, a rebase drops its commit). Fixes #4679. Part of #4270.

Decisions (IBM refs)

  • (a) LINK RESP2. A failed LINK stored RESP2 0. It now stores DetCics.linkResp2(condition): LENGERR 11 (COMMAREA length < 0 or > 32763), PGMIDERR 1 (no installed definition, autoinstall off). IBM EXEC CICS LINK conditions. These are the only two CicsTask.link and the stub's GGCLINK (ggcics.c) raise, with the same RESP2. The region never raises IBM's other LINK conditions (PGMIDERR 2/3, NOTAUTH 101, INVREQ, ROLLEDBACK, SYSIDERR, TERMERR), so they are not mapped. The XCTL mapping from det: XCTL COMMAREA LENGTH past the DTO passes those bytes; failed XCTL sets RESP2 (#4501) #4678 is reused, not duplicated.
  • (b) RETURN TRANSID COMMAREA LENGTH past the DTO passes the LENGTH bytes (DetCics.commareaOut), as det: XCTL COMMAREA LENGTH past the DTO passes those bytes; failed XCTL sets RESP2 (#4501) #4678's XCTL does. IBM EXEC CICS RETURN: the next program's EIBCALEN is LENGTH. On the harness side, equivalence_cics.java_commarea reads a byte[] COMMAREA (Jackson base64, CCSID 037) the way it reads the stub's RETURN area: in the case's data page, by the case's COMMAREA layout (decode_record). Bytes past the layout are compared on neither side. This is what broke the CardDemo ports in det: XCTL COMMAREA LENGTH past the DTO passes those bytes; failed XCTL sets RESP2 (#4501) #4678 (from_java cannot read a byte[]).
  • LINK LENGTH past the target's DTO lays that many bytes over the caller's storage (Cobol.commarea, capped at 32763), not just the DTO's size. IBM EXEC CICS LINK: LENGTH is the COMMAREA length, passed by reference. Example: GenApp's LGxxVS01 LINK ERROR-MSG LENGTH 101 to LGSTSQ, whose DTO is 99 bytes.
  • LINK to a target no DTO types (cics-crucible ca-link-lengths undefined-program: CALINK -> CAGONE, not in the CSD) is no longer a hole. The COMMAREA travels as its bytes (DetCics.commareaBytes), so the case now proves PGMIDERR RESP2 1 end to end.
  • (c) Opaque bytes passed on. A receiver keeps the bytes past its own DFHCOMMAREA record in Storage.beyond (from a byte[] COMMAREA or a LINK's area). A further RETURN, XCTL or LINK of that area with the LENGTH passes them on (commareaOut / Cobol.commarea read them). A LINK target's writes there go back by reference (Cobol.commareaBack, the receiver's caBack).
  • oracle_assumptions.md X10: the det: XCTL COMMAREA LENGTH past the DTO passes those bytes; failed XCTL sets RESP2 (#4501) #4678 note is extended with all of the above.

Touched

det/cics.py (LINK branch, commarea_out), det/program.py (DFHCOMMAREA receiver), cobolrt/Storage.java (beyond), cobolrt/Cobol.java (beyond, commarea, commareaBack), cobolrt/cics/DetCics.java (linkResp2, commareaBytes, commareaOut), tests/tools/equivalence_cics.py (java_commarea), docs/language_status/oracle_assumptions.md, tests in test_det_translate.py (translator shapes plus a javac/java runtime test for beyond pass-through and write-back) and test_equivalence_cics.py.

Evidence

Overlaps

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 8, 2026 00:43
…ailed XCTL sets RESP2 (#4501)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…O passes the bytes; opaque bytes passed on (#4679)

- LINK stores RESP2 from its condition (DetCics.linkResp2: LENGERR 11, PGMIDERR 1),
  as XCTL does since #4501.
- RETURN TRANSID COMMAREA with a LENGTH past the DTO passes those bytes
  (DetCics.commareaOut), as XCTL; the equivalence harness reads a byte[]
  COMMAREA by the case's layout (equivalence_cics.java_commarea).
- LINK with a LENGTH past the target's DTO lays that many bytes over the
  caller's storage (Cobol.commarea), capped at 32763.
- A receiver keeps the bytes past its DFHCOMMAREA record (Storage.beyond);
  a further RETURN / XCTL / LINK of the area passes them on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread tests/cobol_mainframe/test_det_translate.py Fixed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 2 commits October 8, 2026 03:33
…a-link-lengths undefined-program) (#4679)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@squid-protocol squid-protocol changed the title WIP: det: LINK RESP2; RETURN/LINK COMMAREA LENGTH past the DTO; opaque bytes passed on (#4679) det: LINK RESP2; RETURN/LINK COMMAREA LENGTH past the DTO passes the bytes; opaque bytes passed on (#4679) Oct 8, 2026
squid-protocol and others added 2 commits October 8, 2026 12:53
…rged)

Conflicts resolved as a 3-way merge against #4678's own commit (c719d88,
identical to its squash on main for these files): det/cics.py,
DetCics.java, program.py and oracle_assumptions.md merge cleanly that way.
Tests: keep this PR's RETURN-past-the-DTO assertion and #4679 tests next
to main's new tests (integer literal vs alphanumeric; SQL ids).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
…COBOL side's (#4679 x #4635)

#4635 (#4660) reads the COBOL side's RETURN COMMAREA exact (LOW-VALUES
apart from spaces); #4679's Java byte[] COMMAREA went through
decode_record without it, so COCRDLIC's MOVE LOW-VALUES TO WS-ALL-ROWS
read as '' on the Java side against the COBOL side's NULs: cardlist,
acctupdate, cotrtlic, cotrtupc not proven after the merge. Same bytes on
both sides; now decoded the same way. Re-swept: as expected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
@squid-protocol
squid-protocol marked this pull request as ready for review October 8, 2026 18:37
@squid-protocol
squid-protocol merged commit 3f8fdfe into main Oct 8, 2026
37 checks passed
@squid-protocol
squid-protocol deleted the fix/4679-link-return-commarea branch October 8, 2026 18:37
squid-protocol added a commit that referenced this pull request Oct 8, 2026
expr.py: keep this PR's NumLit (a numeric literal keeps its spelling)
and main's module-level DFHRESP import; #4654's Lit.text (the literal
as written, for det/osvs.py's literal identity) becomes a property read
from the NumLit's spelling instead of a second copy of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

det: LINK RESP2, RETURN TRANSID LENGTH past the DTO, and onward pass-through of opaque COMMAREA bytes (follow-up to #4501)

2 participants