Skip to content

Fix #4005: CICS harness models terminal RECEIVE of unformatted input - #4012

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4005-terminal-receive
Sep 29, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4005-terminal-receive

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #4005
Part of #3989 (phase 3, lane B)

What

The CICS harness now models a terminal RECEIVE INTO LENGTH: unformatted input, which a step's text gives (SPEC §5, typed on a cleared screen).

  • Translator (tests/tools/equivalence_cics.py): RECEIVE INTO [LENGTH|FLENGTH] [MAXLENGTH|MAXFLENGTH] becomes a GGCRECT stub call.
    • LENGTH is in-out. On the way in it is the most INTO takes (MAXLENGTH overrides it). On the way out it is the data's length. It goes through GG-LEN, a new field at the end of the GG-CICS block.
    • An omitted LENGTH defaults to LENGTH OF INTO.
    • SET, NOTRUNCATE, BUFFER and the session/partition options are refused by name.
  • Stub (ggcics.c):
    • Returns the step's text once per task.
    • Longer input is truncated to LENGTH and raises LENGERR, and LENGTH is set to the full length. IBM, EXEC CICS RECEIVE: "the data is truncated to that value and the LENGERR condition occurs. The data area specified in the LENGTH option is set to the original length of data."
    • A second RECEIVE would wait for the operator, which no step can express, so it becomes a DRIVER-ERROR.
  • Runner:
    • A RECEIVE event (resp, length, data) on both sides.
    • The COBOL driver hands the input to whichever program of the task reads it first. After an XCTL, the next program sees it as already read.
  • Java (generated CicsTask):
    • New methods: withTerminalInput(text), receiveText(maxLength) returning Received(resp, length, data), and terminalInputRead().
    • receiveText records the RECEIVE event and has the same LENGERR semantics.
    • The Java driver passes the step's text.

Cells (side × status)

side before pass/fail/unsupported after
engine-facts 10 / 0 / 0 10 / 0 / 0
forge-compile 10 / 0 / 0 10 / 0 / 0
cobol-stub 0 / 0 / 37 2 / 1 / 34
java 0 / 12 / 25 0 / 28 / 9

Tests

  • Translator: unit tests for LENGTH in/out, MAXLENGTH, an omitted LENGTH, and the refused options.
  • Runner: stub log → event (LENGERR, RECEIVE-WAIT); Java output → event.
  • tests/cics_crucible/test_cics_runtimes.py (new):
    • Compiles ggcics.c with cc and drives GGCRECT: read once, truncation + LENGERR, no input, already read.
    • Compiles the generated CicsTask with javac and drives receiveText.
    • Skipped when there is no compiler.
  • End to end:
    • EQUIVALENCE_E2E=1 runner fixture passes.
    • The CardDemo account-view equivalence (carddemo-acctview) still passes 9/9 events.

Generated output

CicsTask.java gains the RECEIVE API. That file is generated only for CICS programs with a transaction. This change is intended, and java-compile compiles it. No goldens change.

Audits: ruff, mypy and dead-key show no new findings. Touched files are ruff-formatted. No new regexes.

🤖 Generated with Claude Code

- Translator: RECEIVE INTO [LENGTH|FLENGTH] [MAXLENGTH] becomes a GGCRECT stub
  call. LENGTH is in-out (GG-LEN, new in the GG-CICS block); an omitted
  LENGTH is LENGTH OF INTO. SET, NOTRUNCATE, BUFFER, ... are refused by name.
- Stub: returns the step's text (SPEC 5, cleared screen), once per task.
  Longer input is truncated with LENGERR and LENGTH set to the full length
  (IBM, EXEC CICS RECEIVE). A second RECEIVE is a driver error.
- Runner: RECEIVE events on both sides; the COBOL driver hands the input to
  whichever program of the task reads it first.
- CicsTask: withTerminalInput / receiveText(maxLength) / Received, recording
  the RECEIVE event.

cobol-stub: ca-xctl-versions short-upgrade and long-overread now pass;
length-range fails on XCTL LENGERR (#4008). 16 java cells move from
unsupported to fail (the unported runTask records no events).

Part of #3989.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 2c6a5a2 into main Sep 29, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the fix/4005-terminal-receive branch September 29, 2026 17:49
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.

CICS harness: terminal RECEIVE of unformatted input (unlocks through 24 cobol-stub cells)

1 participant