Skip to content

fix(cobol): CICS queues, containers, abends and condition suppression (#2484, #2485) - #2807

Merged
squid-protocol merged 1 commit into
mainfrom
fix/2484-2486-cics-hardening
Sep 6, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/2484-2486-cics-hardening

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #2484. Closes #2485. Addresses #2486 (see "The jcl half" below — it comes back "no change", with evidence).

COBOL's CICS surface was almost entirely unmeasured. Of the ten constructs the two issues name, nine recorded no correct signal; only WRITEQ TD (telemetry) worked. Everything else fired reflection_metaprogramming's deliberate bare EXEC CICS catch-all and nothing specific.

Measured against language-crucible v1.2.0 — 331 .cbl/.cpy files across 8 real CICS repos (AWS carddemo, CICS genapp, CBSA banking, NIST CCVS85, Che4z fixtures).

What changes

rule added crucible effect
io EXEC CICS (READQ|WRITEQ|DELETEQ) (TS|TD) +32 across 7 files
panics_and_aborts EXEC CICS ABEND +91 across 47 files
ipc_rpc_bridges EXEC CICS (PUT|GET|MOVE) CONTAINER +18 across 8 files
state_mutation EXEC CICS PUT CONTAINER +9 across 7 files
safety_bypasses EXEC CICS IGNORE CONDITION +2 in 1 file

The Q is why the queue lifecycle read zero

io's CICS arm was EXEC\s+CICS\s+(?:READ|WRITE|REWRITE|DELETE) closed by \b. Engine rule 9: \b asserts a word/non-word transition, and in READQ the character after READ is Q — a word character — so the boundary never fires and the alternative fails outright. The whole TSQ/TDQ lifecycle (30 real occurrences) recorded no io.

Added as its own alternative carrying the mandatory TS/TD qualifier rather than relaxing the existing one to READ(?:Q)?, which would have matched a bare EXEC CICS READQ — not a valid CICS command. test_cobol_cics_queue_verbs_need_their_own_alternative_2485 guards both halves.

Three deliberate departures from the issues' proposed regexes

1. telemetry stays TD-only. #2485 proposes (?:WRITEQ|READQ|DELETEQ)\s+(?:TD|TS) for telemetry. A transient-data queue is the CICS journalling destination (CESE/CESO/CSMT) — a WRITEQ TD really is telemetry. A temporary-storage queue is a scratchpad for passing data between transactions, and a READQ TS is a read, not an emission. Putting all six verbs in telemetry would mis-describe the code. All six go to io instead; WRITEQ TD counts as both, the same intentional dual as sqlite's .read (import + io).

2. EXEC CICS ABEND goes to panics_and_aborts, not high_risk_execution. Engine rule 3 keeps that key for constructs that execute, and an abend runs nothing. STOP RUN sits in both today, so the precedent for widening exists — but doing it here would move high_risk_execution by 91 hits across 47 files as a side effect of a queue/container PR. That deserves its own justification. test_cobol_cics_abend_is_an_abort_not_an_execution_2485 pins the current split so a later change has to be deliberate.

3. IGNORE CONDITION goes to safety_bypasses, not panics_and_aborts. #2485 groups it with the abend. They are opposites: an abend raises, IGNORE CONDITION suppresses — it switches off the handler for a condition for the rest of the task, which is what safety_bypasses means.

GET CONTAINER is excluded from state_mutation for the same kind of reason: reading a container mutates nothing. It is a bridge, never a mutation, and the asymmetry is asserted in the double-classification sweep.

Golden master

144 differences, every one attributed: 133 in cobol files, 11 cobol-scoped aggregates, and zero movement in any other language. The per-signal file counts match the pre-change prediction exactly (aborts 47, ipc 8, io 7, flux 7, bypasses 1); the remainder is downstream risk exposure plus the 22 topological coordinates the corpus-wide re-solve always produces.

One diff needed isolating: EDUCHAN.cbl's state_flux moved 19 → 26 where the raw regex predicts +3. Reverting only the state_mutation rule and re-scanning gives exactly the baseline 19, so all +7 is the 3 new matches amplified by the existing mitigation pass, not a second effect.

Verification

  • tests/extraction — 6,742 passed
  • test_cobol_strict.py — 95 passed, including 7 new parametrized cases and 2 new regression tests
  • audit_check.py — ruff / mypy / dead-key / ast-accuracy all clear
  • crucible_check.py — both fixtures PASS after the bless
  • rosetta_audit.py — corpus-inert, 44/46. apex and groovy args fail identically on unmodified origin/main (verified by stashing this branch and re-running) and are unrelated; flagged separately.

The jcl half (#2486)

Worked and comes back "no change" on all three parts — full evidence posted as a comment on that issue. In short: (1) PGM=DFHCSDUP is excluded by high_risk_execution's own documented criterion, which explicitly leaves out "destructive-capable utilities that execute a fixed command language" (IDCAMS/IEHPROGM/ADRDSSU) — #2751 set that three weeks ago; (2) DFHCSD/DFHRPL DDs are already covered generically, all 12 record io and _dependency_capture already resolves the ones with real dataset names; (3) the crucible contains no EXCI at all, so that rule has nothing to verify against and would flip a keyword-rosetta cell from n/a to a scored 0 at the same time. The real need there is a new domain sensor, not a regex widening.

🤖 Generated with Claude Code

…#2484, #2485)

COBOL's CICS surface was almost entirely unmeasured. Of the ten CICS
constructs the two issues name, nine recorded no correct signal: the whole
TSQ/TDQ queue lifecycle, channels and containers, task abends, and condition
suppression. Only `WRITEQ TD` (telemetry) worked.

Five rules change, each verified against language-crucible v1.2.0 (331 .cbl/.cpy
files, 8 real CICS repos):

* `io` -- the queue lifecycle. `EXEC CICS READQ TS` could never reach the
  existing `(?:READ|WRITE|REWRITE|DELETE)` arm: engine rule 9's `\b` needs a
  word/non-word transition and `READ` is followed by `Q`. Added as its own
  alternative with the mandatory TS/TD qualifier rather than `READ(?:Q)?`,
  which would have matched a bare `EXEC CICS READQ` -- not a valid command.
  +32 occurrences across 7 files.
* `panics_and_aborts` -- `EXEC CICS ABEND`, the CICS sibling of `STOP RUN`.
  +91 across 47 files. Deliberately NOT added to `high_risk_execution`:
  rule 3 keeps that key for things that execute, and an abend runs nothing.
* `safety_bypasses` -- `EXEC CICS IGNORE CONDITION`. +2 in 1 file. The issue
  proposed `panics_and_aborts`; that is the opposite reading (an abend raises,
  IGNORE CONDITION suppresses), so it is routed here.
* `ipc_rpc_bridges` -- channels/containers, the modern replacement for the
  COMMAREA on LINK/XCTL. +18 across 8 files.
* `state_mutation` -- `PUT CONTAINER` only. +9 across 7 files. `GET CONTAINER`
  is excluded: reading a container mutates nothing.

`telemetry` is deliberately left at TD-only, against #2485's proposed regex.
A transient-data queue is the CICS journalling destination; a temporary-storage
queue is a scratchpad, and a `READQ TS` is not an emission. All six queue verbs
count as `io` instead; `WRITEQ TD` counts as both, the same dual as sqlite's
`.read`.

Golden master: 144 differences, every one attributed -- 133 in cobol files,
11 cobol-scoped aggregates, zero non-cobol movement. Signal-field diffs match
the predicted file counts exactly (aborts 47, ipc 8, io 7, flux 7, bypasses 1);
the remainder is downstream risk exposure plus the 22 topological coordinates
the corpus-wide re-solve always produces. EDUCHAN.cbl's `state_flux` 19 -> 26
was isolated by reverting that one rule and re-scanning: it reads exactly the
baseline 19, so all +7 comes from the 3 new matches amplified by the existing
mitigation pass.

keyword-rosetta is unaffected (44/46 pass; apex and groovy `args` fail
identically on unmodified origin/main and are unrelated to this change).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 294c017 into main Sep 6, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the fix/2484-2486-cics-hardening branch September 6, 2026 11:15
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.

Extraction hardening: cobol CICS advanced queuing and exceptions Extraction hardening: cobol CICS channels and containers

1 participant