Skip to content

Mainframe fact channel: units of work and error handling, + TD trigger starts (#3453) - #3464

Merged
squid-protocol merged 1 commit into
mainfrom
feat/uow-handlers-3453
Sep 24, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/uow-handlers-3453

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3453. Part of #3445.

What

New fact channel uow_handler_data (core/uow_handlers.py). One row per:

  • COMMIT / ROLLBACK: EXEC CICS SYNCPOINT [ROLLBACK] and EXEC SQL COMMIT / ROLLBACK [WORK | TO SAVEPOINT].
  • Handlers:
    • HANDLE CONDITION and HANDLE AID pairs: condition or key → handler paragraph, or DEFAULT when the condition is named with no handler;
    • IGNORE CONDITION;
    • HANDLE ABEND: LABEL / PROGRAM / CANCEL / RESET;
    • PUSH / POP HANDLE.
  • Explicit EXEC CICS ABEND: its ABCODE (resolved through VALUE), plus NODUMP / CANCEL.
  • RESP_CHECK: every command coded with RESP(v) (or NOHANDLE, which leaves the result in EIBRESP), together with the DFHRESP(...) conditions tested on that field. The window ends when the field is set again, at the next paragraph header, or after 8000 characters. An empty result means the outcome is never tested.

New joins in galaxy_ir:

  • units_of_work(): commit and rollback points with the paragraph that owns them.
  • error_handlers(): each handler with its owning paragraph and handler_found (the label is a real paragraph of the program).
  • unchecked_responses(): RESP-coded commands whose result is never tested.
  • Add-on, tdq_trigger_starts(): a WRITEQ TD to a CSD TDQUEUE that carries TRIGGERLEVEL + TRANSID → the transaction CICS starts once the queue fills → that transaction's program. This async start used to be hidden. No pinned corpus defines one, so it's covered by unit tests only.

What the corpora show

commit rollback handlers RESP results untested
CBSA 3 16 9 14 of 157 (mostly RETURN, INQUIRE)
CardDemo 14 2 11 41 of 96 (mostly RECEIVE/SEND MAP)

Every handler label resolves to a paragraph.

Ground truth

  • Independent readers: cobol_answer_key.py add-uow. They have their own EXEC CICS/SQL reading, their own Area A header detection and RESP window, and a TD-trigger join over the key's own CSD, WRITEQ and transaction reads.
  • New scored fields: units of work and handlers and TD trigger starts, both drafted.
  • Result: the engine matches the key exactly: CBSA 245/245, CardDemo 128/128. zopeneditor has none.

Checks

  • Golden masters re-blessed. The only change is one new Units Of Work And Handlers block per COBOL file that has any; nothing else moved.
  • Tests: full suite passes locally (11,188 passed). The ruff, mypy and dead-key audits show no new findings. LABEL, RESP and ABCODE are allowlisted as parsed CICS option words, like CHANNEL.
  • X-Ray: long regexes are built from named pieces, so the entropy scan stays clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

…r starts (#3453)

Commit / rollback points and error handlers only fed risk-signal counts; the
engine could not say where a unit of work ends or which condition goes to
which handler.

New channel uow_handler_data (core/uow_handlers.py), one row per:
- COMMIT / ROLLBACK: EXEC CICS SYNCPOINT [ROLLBACK], EXEC SQL COMMIT /
  ROLLBACK [WORK | TO SAVEPOINT];
- HANDLE CONDITION / HANDLE AID pairs (condition or key -> handler paragraph,
  or DEFAULT when named bare), IGNORE CONDITION, HANDLE ABEND (LABEL /
  PROGRAM / CANCEL / RESET), PUSH / POP HANDLE;
- explicit EXEC CICS ABEND with its ABCODE (VALUE-resolved) and NODUMP/CANCEL;
- RESP_CHECK: every RESP-coded (or NOHANDLE -> EIBRESP) command with the
  DFHRESP(...) conditions tested on that field before it is set again, the
  next paragraph header, or 8000 chars; NULL = the result is never tested.

galaxy_ir: EngineUowHandler / EngineFile.uow_handlers and
- units_of_work(): commit / rollback points with their owning paragraph;
- error_handlers(): handlers with owning paragraph and handler_found (the
  LABEL is a paragraph of the program);
- unchecked_responses(): RESP-coded commands never tested;
- tdq_trigger_starts() (add-on): WRITEQ TD to a CSD TDQUEUE carrying
  TRIGGERLEVEL + TRANSID -> the transaction CICS starts when it fills -> its
  program. No pinned corpus defines one; unit-tested.

Corpora: CBSA 3 commit / 16 rollback points, 9 handlers, 14 of 157 RESP
results untested; CardDemo 14 / 2, 11 handlers, 41 of 96 untested (mostly
RECEIVE / SEND MAP). Every handler label resolves to a paragraph.

Ground truth: independent readers in cobol_answer_key.py (add-uow): its own
EXEC CICS / SQL reading, Area A header detection and RESP window, and a TD
trigger join over its own CSD / WRITEQ / transaction reads. New scored fields
"units of work and handlers" (uow_validated) and "TD trigger starts"
(tdq_triggers_validated), drafted. Engine matches the key exactly: CBSA
245/245, CardDemo 128/128.

Golden masters re-blessed: one new Units Of Work And Handlers block per COBOL
file with any; nothing else moved. dead_key_audit: LABEL / RESP / ABCODE
allowlisted (parsed EXEC CICS option words, like CHANNEL). Long regexes built
from named pieces so the X-Ray entropy scan stays clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@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 2789a4e into main Sep 24, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the feat/uow-handlers-3453 branch September 24, 2026 09:54
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.

Mainframe fact channel: unit of work and error handling: SYNCPOINT/COMMIT points, HANDLE CONDITION handlers

1 participant