Skip to content

Fix #4007: CICS harness models HANDLE AID - #4022

Merged
squid-protocol merged 2 commits into
mainfrom
fix/4007-handle-aid
Sep 29, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/4007-handle-aid

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

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

Stacked on #4020 (#4008), and through it on #4019, #4018 and #4016. This stays a draft until those merge, and I will rebase it then.

What

Stub:

  • HANDLE AID gives each key its label index per program level: ENTER, CLEAR, PA1–3, PF1–24, ANYKEY, CLRPARTN, LIGHTPEN, OPERID and TRIGGER.
  • An option without a label deactivates it. IBM, HANDLE AID: "To ignore an AID, issue a HANDLE AID command that specifies the associated option without a label".
  • PUSH HANDLE suspends HANDLE AID together with the other handlers (IBM, PUSH HANDLE), and POP restores it.
  • Dispatch (GGCAID): the EIBAID byte is mapped to its key. A test pins this table to the harness's DFHAID.cpy, which the driver sets EIBAID from. The result is:
    1. the key's own label;
    2. else ANYKEY's label for a PA or PF key or CLEAR, never ENTER ("ANYKEY (any PA key, any PF key, or the CLEAR key, but not ENTER)");
    3. else control goes on after the input command ("control returns to the application program at the instruction immediately following the input command").

Translator:

  • In a program that issues HANDLE AID, RECEIVE MAP and terminal RECEIVE GO TO the pressed key's label once they complete normally, the same way CICS harness: condition machinery (HANDLE/IGNORE CONDITION, RESP/NOHANDLE, HANDLE ABEND, PUSH/POP HANDLE) #4003 transfers control.
  • RESP or NOHANDLE on the command suppresses this ("RESP implies NOHANDLE, which overrides HANDLE AID", the case's [RESP] citation).
  • The label keeps COBOL fall-through: MENU-REFRESH falls into SHOW-MENU.
  • Precedence: a condition the same command raised is handled first. IBM does not document whether the AID label or the condition label wins, pc-aid-menu's NOTES list this under avoided ambiguities, and the crucible never raises both on one command.
  • CLEAR before RECEIVE: nothing is needed. The program tests EIBAID before RECEIVE, and the translator leaves that code untouched.
  • Java: no change. A port reads task.aid() and branches on it itself.

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 25 / 0 / 12 25 / 0 / 12
java 0 / 37 / 0 0 / 37 / 0

Tests

  • Stub, compiled with cc: own labels, a key with no label, ENTER, ANYKEY (PF, CLEAR and PA but not ENTER), deactivation, and PUSH/POP. A test also pins the stub's EIBAID bytes to DFHAID.cpy.
  • Translator: HANDLE AID registration, dispatch after RECEIVE MAP and RECEIVE, none without HANDLE AID in the program, none under RESP or NOHANDLE, and refusal of an unknown key.
  • End to end: the EQUIVALENCE_E2E=1 fixture passes, and CardDemo account view passes 9/9 events.

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

🤖 Generated with Claude Code

@squid-protocol
squid-protocol force-pushed the fix/4007-handle-aid branch 2 times, most recently from 86bd4da to 0e677de Compare September 29, 2026 19:39
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol force-pushed the fix/4007-handle-aid branch 3 times, most recently from 147a912 to 12b33d6 Compare September 29, 2026 20:38
squid-protocol and others added 2 commits September 29, 2026 16:42
- Stub: HANDLE AID gives each key (ENTER, CLEAR, PA1-3, PF1-24, ANYKEY, ...)
  its label index per level; an option without a label deactivates it; PUSH
  HANDLE suspends it with the other handlers. GGCAID maps the EIBAID byte
  (the harness's DFHAID, pinned by a test) to its key: the key's label, else
  ANYKEY's for a PA / PF key or CLEAR (not ENTER), else 0 -- control goes on
  after the input command.
- Translator: in a program that issues HANDLE AID, RECEIVE MAP and terminal
  RECEIVE GO TO the pressed key's label when they completed normally; RESP or
  NOHANDLE suspends it. A condition the command raised is handled first (the
  precedence is not documented; the crucible never has both).

pc-aid-menu's cobol-stub cells lose their HANDLE AID blocker: their event
flow matches the oracle except for the SEND-MAP fields and cursor, which
BMS output fidelity (#4001) adds.

Part of #3989.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EC8FWfn3aPmsUPnRgKNVup
@squid-protocol
squid-protocol marked this pull request as ready for review September 29, 2026 20:42
@squid-protocol
squid-protocol merged commit a9a1a25 into main Sep 29, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/4007-handle-aid branch September 29, 2026 20:53
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: HANDLE AID (unlocks pc-aid-menu)

1 participant