Skip to content

det: TS items in the region's code page; DTO copybooks in their declared page (#4528) - #4533

Merged
squid-protocol merged 5 commits into
mainfrom
fix/4528-det-charset
Oct 6, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
fix/4528-det-charset

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4528

What was wrong

A TS item is "the bytes the program wrote, in the region's code page" (CicsTask). The COBOL side's region keeps it in CCSID 037 (cics-crucible SPEC 2, and the stub transcodes its Latin-1 storage at the boundary). The det port gave CicsTask its storage's bytes (CS, CobolRecords.charset()) unchanged. So WS-ONE VALUE 'W' reached the queue as X'57' (ï), and an item A came back as Á. Separately, Cics.declared read DTO copybooks as Latin-1.

Change

  • det/cics.py: WRITEQ / READQ TS (and REWRITE) now go through DetCics.toRegion(.., CS, REGION) and DetCics.fromRegion(.., REGION, CS).
  • The region page: region_page() returns the estate's declared code page for the program (EngineCopies.page, det translator: 32 programs refused across the keyed corpora and estate-crucible (code pages, free format, multi-program sources, grammar gaps); KYUYJP crashes #4462) when it is an EBCDIC page. Otherwise it is CCSID 037: an ASCII-family declaration only says how the source was transferred. At run time the system property gitgalaxy.cics.charset can name another page, as with CobolRecords.charset().
  • DetCics.java: a strict per-byte transcode. A byte that is not one character in both pages stops the run by name. No ? is ever substituted. NL/LF follow CDRA and Python's cp037 (X'15' is NEL, X'25' is LF), not the JDK's IBM037, which maps both to LF and encodes LF as X'15'. The test checks all 256 bytes against Python's cp037 table.
  • Cics.declared: reads the DTO copybook with _raw_lines(path, engine), the same reader the program source goes through. Gen.engine carries the EngineCopies.
  • Not changed, already correct: TD (Cobol.text(.., CS)), SEND TEXT, terminal RECEIVE and the COMMAREA DTO codecs. They already convert through characters.

Evidence

Not in this PR

hc-abend-link/sub-unhandled on the det port now gets further and fails on a different gap. The trail byte s that HCSUB writes into the caller's COMMAREA before its unhandled abend is not written back, because caBack runs only on a normal return. That is LINK abend write-back, not a charset problem.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

squid-protocol and others added 5 commits October 6, 2026 00:11
…red page (#4528)

WRITEQ / READQ TS move each byte between the port's storage page (CS) and
the region's (REGION: the estate's declared EBCDIC page, else CCSID 037;
gitgalaxy.cics.charset overrides), as the COBOL side's region does. NL/LF
follow CDRA / Python cp037, not the JDK's LF-for-both; a byte one page
cannot carry is refused by name. Cics.declared reads a DTO copybook with
the estate's declared page instead of Latin-1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine data-integrity Issues relating to RAM state or SQLite database fidelity legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist labels Oct 6, 2026
try:
if " ".encode(declared) == b"\x40":
page = declared
except (LookupError, UnicodeError):
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 6, 2026 05:22
@squid-protocol
squid-protocol merged commit e5a322c into main Oct 6, 2026
37 of 38 checks passed
@squid-protocol
squid-protocol deleted the fix/4528-det-charset branch October 6, 2026 05:22
squid-protocol added a commit that referenced this pull request Oct 6, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

# Conflicts:
#	docs/language_status/det_port_design.md
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 data-integrity Issues relating to RAM state or SQLite database fidelity legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

det ports on the CICS crucible decode TS/COMMAREA bytes in the wrong charset (and det/cics.py reads DTO copybooks as latin-1)

2 participants