Skip to content

det: HANDLE AID, IGNORE CONDITION, PUSH / POP HANDLE and HANDLE CONDITION ERROR on the CICS port (#4414, #4502) - #4527

Merged
squid-protocol merged 2 commits into
mainfrom
feat/4414-cics-handle-aid-ignore
Oct 6, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/4414-cics-handle-aid-ignore

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4414
Closes #4502

What

The det translator refused EXEC CICS HANDLE AID (71 PL/I + 5 COBOL programs) and IGNORE CONDITION, and PUSH / POP HANDLE along with them. It also accepted HANDLE CONDITION ERROR(label) but never took that label. All of these now run on the CICS port. The stub side models them the same way. Where IBM is silent, both sides refuse by name.

  • Port state: handlers (now -1 = IGNORE) and aids (HANDLE AID labels, -1 = deactivated). There is also a pushed stack of DetCics.Handlers, kept beside CicsTask's own HANDLE ABEND stack. The aids map and the stack are declared only in programs that use them.

  • condition() checks, in order:

    1. the condition's own HANDLE or IGNORE (the last one issued wins);
    2. a default action of ignore (EOC);
    3. ERROR's label (det: HANDLE CONDITION ERROR(label) is accepted but never taken (condition() ignores ERROR) #4502; IBM: "if the default action for such a condition terminates the task abnormally, and the condition ERROR has been specified, the action for ERROR is taken");
    4. the abend.
  • aid() runs after RECEIVE MAP and after terminal RECEIVE (INTO / SET), after the data is moved and LENGTH is set. It uses DetCics.aidLabel: the key's own label, else ANYKEY's for a PA key, a PF key or CLEAR (not ENTER). It does nothing when the command has RESP or NOHANDLE.

  • PUSH / POP HANDLE: they stack the conditions and the AIDs; HANDLE ABEND goes through task.pushHandle/popHandle. POP HANDLE with nothing pushed raises INVREQ, which goes through outcome().

  • Refused by name (register X16):

    • IGNORE CONDITION ERROR;
    • an undocumented condition, or a HANDLE AID key that is not an attention key;
    • at run time, a HANDLE AID label that applies to an input command that also raised a condition (e.g. MAPFAIL after CLEAR). The stub now calls GGCAID first, with the condition, and records AID-REFUSED, which the runner reports as a DRIVER-ERROR;
    • at run time, a key deactivated while ANYKEY has a label.

    Before this change the stub silently took the condition first, and gave a deactivated key to ANYKEY.

  • Stub: the SET form of RECEIVE now consults HANDLE AID too.

  • Docs: register X16 in oracle_assumptions.md, and a finding in det_port_design.md.

Proof

These were run against new cics-crucible cases in squid-protocol/cics-crucible#4 (draft, stacked on #3). Their expected logs are hand-written, with IBM pages cited in each NOTES.md.

case cobol-stub det port (java-ported)
hc-handle-aid: a key's own label, ANYKEY not ENTER, a deactivated key, RESP, PUSH / POP, CLEAR / PA1 with no data 9/9 9/9
hc-ignore-error: IGNORE, ERROR, own HANDLE/IGNORE before ERROR, IGNORE overriding HANDLE, PUSH suspends IGNORE and ERROR, POP restores, POP INVREQ to ERROR 9/9 9/9
hc-eoc-error: ERROR does not take EOC; EOC's own label does 2/2 2/2

Det ports of existing pinned cases now translate with no holes: pc-aid-menu (PCMENU's HANDLE AID), hc-perform-range (IGNORE, ERROR) and hc-abend-link (PUSH / POP).

  • pc-aid-menu aid-keys and invalid-option pass on the det port.
  • hc-perform-range length-trap takes the ERROR label (e22). It still differs, but only in one TS-queue data byte: the det port's data charset on crucible TS / COMMAREA bytes is a separate harness gap, not a condition-handling one.

Gates and ratchets:

  • cics_crucible --ci on the pinned v0.2.0: rc 0, no regression.
  • The det sweep (proof_sweep --det-only --skip-db2) is as expected.
  • pr_gates --ratchets passes all five ratchets (ports, estate, fact-crosscheck, completeness, ground-truth).
  • pr_gates passes all 7 gates. After merging main (det: read continued apostrophe literals, "" inside literals, PROGRAM-ID without its period (#4523, #4462) #4526), --fast passes 5/5 and the ratchets pass again.
  • The mypy audit, run in a fresh py3.12 venv on a pristine worktree with an empty environment, shows no new errors.

Not in this PR

  • The crucible PR merge, release and pin bump are left to the owner. The new cases are proven locally only, with CICS_CRUCIBLE_ALLOW_UNPINNED=1 --crucible <branch>.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

squid-protocol and others added 2 commits October 5, 2026 22:39
…TION ERROR on the CICS port (#4414, #4502)

The det translator refused HANDLE AID and IGNORE CONDITION (and PUSH / POP
HANDLE) and accepted HANDLE CONDITION ERROR(label) without ever taking it.
The port now keeps handlers (-1 for IGNORE), aids and a PUSH HANDLE stack
(DetCics.Handlers beside CicsTask's HANDLE ABEND stack); condition() takes
the condition's own HANDLE / IGNORE, then a default of ignore (EOC), then
ERROR's label, then the abend; aid() runs after RECEIVE MAP and terminal
RECEIVE unless RESP / NOHANDLE (DetCics.aidLabel: ANYKEY is PA / PF / CLEAR).

Where IBM is silent, both sides refuse by name: IGNORE CONDITION ERROR, an
AID label beside a condition on one input command (stub GGCAID called
first with the condition: AID-REFUSED), a key deactivated while ANYKEY
has a label. Register X16; design-doc finding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist labels Oct 6, 2026
super().__init__()
self.g.para_index = {"GOT-PF7": 3, "GOT-ANY": 4, "GOT-ERR": 5}
self.g.jump = lambda target: f"GOTO({target});"
self.handle_aid = handle_aid
@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 03:44
@squid-protocol
squid-protocol merged commit 0acfcc5 into main Oct 6, 2026
37 of 38 checks passed
@squid-protocol
squid-protocol deleted the feat/4414-cics-handle-aid-ignore branch October 6, 2026 03:44
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 enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist

Projects

None yet

2 participants