Skip to content

det: RETURN TRANSID COMMAREA carries its bytes to the next task (Part of #4817) - #4871

Merged
squid-protocol merged 5 commits into
mainfrom
fix/4817-return-transid-bytes
Oct 11, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
fix/4817-return-transid-bytes

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4817 · follow-up: #4870

Why

IBM: a level-1 RETURN TRANSID ... COMMAREA passes the COMMAREA's bytes to the next task of the pseudo-conversation (a copy). Every byte arrives as it was. GitGalaxy carried only the typed DTO, so a numeric DISPLAY field holding spaces was decoded as a number (spaces → -16), and the next task got digits where the previous task left spaces.

Change (the same approach #4806 used for LINK / XCTL: the bytes travel beside the DTO)

Reach (measured on the burned estates)

  • 36 programs RETURN TRANSID with a COMMAREA.
  • 4 can put non-digits in a numeric DISPLAY field of it: GenApp LGTESTP1–4 do an unguarded MOVE of a map PIC X field into CA-CUSTOMER-NUM PIC 9(10).
  • 2 are possible: CardDemo COCRDUPC, and DBB EPSCMORT's first entry.
  • The issue's CBSA example did not reproduce.

Tests

Checks

  • pr_gates --fast: PASS.
  • --ratchets: 7/7 PASS, nothing skipped (including ports, estate and port-surface).
  • det_port.py check: 23 of 104 det ports changed (81 unchanged), all programs with RETURN TRANSID COMMAREA. CI's det sweep re-proves exactly those: carddemo-adminmenu carddemo-billpay carddemo-menu carddemo-report carddemo-signon carddemo-tranadd carddemo-tranlist carddemo-tranview carddemo-useradd carddemo-userdel carddemo-userlist carddemo-userupd cbsa-bnk1cac cbsa-bnk1cra cbsa-bnk1dac cbsa-bnk1dcs cbsa-bnkmenu genapp-lgtestc1 genapp-lgtestp1 genapp-lgtestp2 genapp-lgtestp3 genapp-lgtestp4 mortgage-cmort --work DIR

Provenance

The first implementation and one review round were done by agy (Gemini) in its own worktree, following a code map and a count from two Haiku scouts. My review then found and fixed:

  • a compile break: an abstract Region method that the harness implements;
  • misplaced javadoc;
  • two new mypy errors;
  • the facade surface problem above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX

squid-protocol and others added 5 commits October 10, 2026 21:22
A level-1 RETURN TRANSID COMMAREA passes the bytes to the next task of the pseudo-conversation (like #4806 XCTL).
Bytes the DTO cannot decode are preserved rather than replaced by decoded fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX
…RETURN helper, facade round-trip test)

1. CicsTask.Region.transaction with byte[] is a default method in the interface to prevent FacadeRegion compile breaks.
2. Javadoc ordering corrected in CicsTask / CicsSpec.
3. Removed stray blank line before public CicsTask linked(...).
4. _return_call helper extracts the duplicated RETURN/RETURN IMMEDIATE code in det/cics.py, respecting the <= 120 character limit and file style.
5. tests/cobol_mainframe/test_return_transid_commarea_bytes_4817.py is cleaned up (renamed function, added module docstring, updated _jdk to use mark.skipif, trailing whitespaces removed).
6. Note: Infrastructure for testing the generated facade in javac does not exist in these unit tests, so I kept the unit test as-is as permitted by the instructions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX
…ted, facade overload test

- forge: returned()'s javadoc back directly above returned(); the default
  Region.transaction(..., byte[]) copies on its own line.
- det/cics.py: _return_call documented and moved out of the RESP section.
- test_facade_layout_4449: the generated facade keeps handleTransaction
  (transid, request) unchanged, adds the byte[] overload and lastAnswerBytes(),
  and the det facade rebuilt from that stub keeps both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX
…only)

Exposing the bytes on the generated facade (a handleTransaction overload,
lastAnswerBytes) changes every committed port's surface: port_surface would
have to resurface ~25 equivalence ports (and it matches facades by name, so
it cannot yet tell two handleTransaction overloads apart) and each would be
re-proven. That is its own follow-up. This PR keeps the runtime
(returnedBytes, the returnTransid / returnImmediate overloads, the default
Region.transaction(..., bytes)) and the det translator passing the bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: low UI tweaks, documentation, and minor optimizations shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 11, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 11, 2026 02:01
@squid-protocol
squid-protocol enabled auto-merge (squash) October 11, 2026 02:01
"""

import os
import shutil
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: low UI tweaks, documentation, and minor optimizations shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants