Skip to content

CICS programs read their COMMAREA in segments: model the unpack, count data-driven callers (#3655) - #3670

Merged
squid-protocol merged 1 commit into
mainfrom
feat/inbound-commareas-3655
Sep 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/inbound-commareas-3655

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3655 (epic #3625).

The contract, as the program itself reads it

CardDemo's screens are entered with the shared 160-byte CARDDEMO-COMMAREA from the menu, and on re-entry with that record plus their own state. They read both from an opaque DFHCOMMAREA (PIC X OCCURS 1 TO 32767 DEPENDING ON EIBCALEN) by reference modification:

MOVE DFHCOMMAREA (1:LENGTH OF CARDDEMO-COMMAREA) TO CARDDEMO-COMMAREA
MOVE DFHCOMMAREA (LENGTH OF CARDDEMO-COMMAREA + 1:LENGTH OF WS-THIS-PROGCOMMAREA) TO WS-THIS-PROGCOMMAREA

The #3615 layout rule only saw the self RETURN TRANSID (2000-byte WS-COMMAREA), so every menu entry carried // TODO: this site passes CARDDEMO-COMMAREA; COACTUPC receives WS-COMMAREA.

Changes

layer change
engine (core/data_moves) keeps each reference modification as written: source_refmod_text / target_refmod_text (the flags are unchanged)
DB new data_move_data columns, healed into existing DBs by _ensure_columns; the rehydrator and galaxy_ir read them, and a pre-#3655 DB loads them as None
IR program_interfaces().commarea_unpack: the program's own MOVE DFHCOMMAREA(start:length) TO record, evaluated (integers, LENGTH OF item, +/-; EIBCALEN = the receiving record's width) into offset-ordered segments. When they tile an opaque area, that is the COMMAREA (basis: unpack), ahead of the older rules. inbound: every site that can enter the program, data-driven XCTLs included, with the record each passes
forge two or more segments become a composite DTO (one field per segment DTO) with fromPrefix(first); a caller passing only the leading record calls handleLink(X.fromPrefix(...))
public class CoactupcCommarea {
    // DFHCOMMAREA(1:LENGTH OF CARDDEMO-COMMAREA) at line 888: offset 0, 160 bytes -> CARDDEMO-COMMAREA (app/cpy/COCOM01Y.cpy)
    private CarddemoCommarea carddemoCommarea;
    // DFHCOMMAREA(LENGTH OF CARDDEMO-COMMAREA + 1:LENGTH OF WS-THIS-PROGCOMMAREA) at line 890: offset 160, 873 bytes -> WS-THIS-PROGCOMMAREA
    private CoactupcWsThisProgcommarea wsThisProgcommarea;
    public static CoactupcCommarea fromPrefix(CarddemoCommarea carddemoCommarea) { ... }
}

and in the menu's dispatch: case "COACTUPC": return coactupcService.getObject().handleLink(CoactupcCommarea.fromPrefix((CarddemoCommarea) request));

Not guessing: the GENAPP trap

The first cut also "found" unpacks in all 20 GENAPP programs. They were MOVE DFHCOMMAREA(1:EIBCALEN) TO CA-DATA, where CA-DATA PIC X(90) sits inside an error message: a diagnostic dump. Two rules now exclude it:

  • only an opaque LINKAGE area is read by unpack; a declared one (GENAPP's COPY LGCMAREA) is read through its own fields;
  • a segment must land in a group record; a move into a PIC X(n) is a copy.

Both rules are pinned by a test (ERRDUMP).

Results

corpus read by unpack "passes X, receives Y" mapping TODOs (before → after)
CardDemo 20 programs (e.g. COACTUPC: CARDDEMO-COMMAREA 160 + WS-THIS-PROGCOMMAREA 873) 20 → 0
GENAPP 0 (declared COMMAREA) 20 → 20 (real mapping decisions)
CBSA 1 (BNK1CCS) 2 → 2

Attributes consumed (consumer audit)

attribute keyed?
data-move source / target / verb / line keyed (data moves, field-tested)
refmod text (new) unverified. Spot-checked: on all 20 CardDemo programs the segments tile exactly, and each program's own repack (MOVE WS-THIS-PROGCOMMAREA TO WS-COMMAREA(LENGTH OF CARDDEMO-COMMAREA + 1:...)) uses the same offsets. Add it to #3649's key work
record widths behind LENGTH OF unverified (#3649); they agree with the tiling above
dynamic candidates → inbound keyed names; file links fixed in D022

Verified

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

…t data-driven callers (#3655)

CardDemo's screens are entered with the shared 160-byte CARDDEMO-COMMAREA
from the menu, and on re-entry with that record plus their own state. They
read both from an opaque DFHCOMMAREA (PIC X OCCURS ... DEPENDING ON
EIBCALEN):

    MOVE DFHCOMMAREA (1:LENGTH OF CARDDEMO-COMMAREA) TO CARDDEMO-COMMAREA
    MOVE DFHCOMMAREA (LENGTH OF CARDDEMO-COMMAREA + 1:
                      LENGTH OF WS-THIS-PROGCOMMAREA) TO WS-THIS-PROGCOMMAREA

Engine:
- core/data_moves keeps each reference modification as written
  (source_refmod_text / target_refmod_text); the flags are unchanged;
- new data_move_data columns, healed into existing DBs;
- the rehydrator and galaxy_ir read them, and an older DB loads them as
  None.

IR:
- program_interfaces().commarea_unpack evaluates those MOVEs (integers,
  LENGTH OF item, + / -; EIBCALEN = the receiving record's width) into
  offset-ordered segments;
- when they tile an OPAQUE area, that is the COMMAREA layout (basis
  "unpack"), ahead of the caller-record and own-DFHCOMMAREA rules;
- a declared DFHCOMMAREA is read through its fields, and a move into a
  PIC X(n) is a copy. That rule is GENAPP's case: it dumps
  DFHCOMMAREA(1:EIBCALEN) into an error message.
- `inbound` lists every site that can enter a program, data-driven XCTLs
  included, with the record each passes.

Forge:
- an unpacked COMMAREA of two or more records becomes a composite DTO
  (one field per segment DTO) with fromPrefix(first);
- a caller that passes only the leading record, such as CardDemo's menu
  through its data-driven XCTL, builds the callee's COMMAREA with
  fromPrefix instead of carrying a mapping TODO.

Results:
- CardDemo: 20 programs read by unpack (e.g. COACTUPC = CARDDEMO-COMMAREA
  160 + WS-THIS-PROGCOMMAREA 873), and "passes X, receives Y" mapping
  TODOs go from 20 to 0;
- GENAPP: unchanged (declared COMMAREA); CBSA: 1 opaque unpack (BNK1CCS);
- 6 corpora x 13 configs compile via --scan;
- ir_join_diff: only program_interfaces (and programs, whose data moves
  gained the texts) change;
- refraction snapshot 0 differ; full suite 11,647 passed; ruff / mypy /
  dead-key / X-Ray 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 56c3f60 into main Sep 25, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the feat/inbound-commareas-3655 branch September 25, 2026 19:13
squid-protocol added a commit that referenced this pull request Sep 25, 2026
The Java repository forge (#3617) maps each CICS FILE command's RIDFLD
onto an entity key, and no key compared it.

New field `CICS RIDFLD`: `L<line> VERB FILE NAME RIDFLD=OPERAND` per
FILE command with a RIDFLD, spacing normalized.
- Key: this tool's own EXEC CICS reader (cics_resource_ops now keeps
  the option), over COBOL, PL/I and assembler sources.
- Engine: cics_resource_data.attributes, nested parentheses included.
It is a section of its own, so the reviewed `CICS resources` units are
untouched.

Key and engine agree on all 781 units: CardDemo 46, CBSA 17, GENAPP 7,
zECS 22, DSF 689 (PL/I). The field enters at tier draft, with
development_rounds 6. Ledger update: +0 -0, 0 untriaged; check clean.

Part 2 (the reference-modification texts) needs #3670's engine columns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
squid-protocol added a commit that referenced this pull request Sep 25, 2026
…lds (#3602, #3649 part 1) (#3672)

* Answer key: copybook record layouts, a new ledger field (#3602)

The layouts the Java generators depend on mostly live in copybooks, which
no key checked. New field `copybook layouts`:
- Key: draft_copybook_layouts lays out every COBOL copybook with this
  tool's own reader and storage arithmetic, as `ROOT/NAME @offset+bytes`
  per elementary PIC item.
- Engine: GalaxyIR.record_layout per root.
- The contract is the engine's: a REDEFINES overlay is skipped; items
  without a PIC take their storage but are not units; an OCCURS item is
  listed once; an item under a PIC item is not storage.
- A copybook that COPYs another member is not keyed (this reader does
  not expand COPY).

Three key-reader errors, found against the corpora and fixed to COBOL's
rules:
- `1 THROUGH 12.` continuing an 88's VALUES was read as a level-1 item
  named THROUGH (CardDemo CSUTLDWY);
- a POINTER took 0 bytes and shifted every later field (CBSA PROCISRT);
  POINTER / INDEX / COMP-1 are 4, COMP-2 8;
- an item under an elementary PIC item was laid out (GENAPP soaipm1).
_pic_bytes also counts CR / DB (2), E, and national N / G (2 each).

Result: key and engine agree on all 2,759 units in 113 copybooks
(CardDemo 2,131, CBSA 389, GENAPP 188, zOE 34, zECS 17; DSF has no COBOL
copybooks). The ledger adds the field at tier draft (update: +0 -0, 0
untriaged; check clean). The field-testing registry marks it
development_rounds 6: it was built against every keyed estate, so it
stays `untested` until fresh estates or a census.

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

* Field testing: copybook layouts introduced by #3672

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

* Answer key: the CICS RIDFLD operand, a new ledger field (#3649, part 1)

The Java repository forge (#3617) maps each CICS FILE command's RIDFLD
onto an entity key, and no key compared it.

New field `CICS RIDFLD`: `L<line> VERB FILE NAME RIDFLD=OPERAND` per
FILE command with a RIDFLD, spacing normalized.
- Key: this tool's own EXEC CICS reader (cics_resource_ops now keeps
  the option), over COBOL, PL/I and assembler sources.
- Engine: cics_resource_data.attributes, nested parentheses included.
It is a section of its own, so the reviewed `CICS resources` units are
untouched.

Key and engine agree on all 781 units: CardDemo 46, CBSA 17, GENAPP 7,
zECS 22, DSF 689 (PL/I). The field enters at tier draft, with
development_rounds 6. Ledger update: +0 -0, 0 untriaged; check clean.

Part 2 (the reference-modification texts) needs #3670's engine columns.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Java conversion: CICS programs have several inbound COMMAREAs (first entry vs re-entry); count data-driven callers and model prefix layouts

1 participant