Skip to content

Mainframe fact channel: IMS DL/I calls and the segment matrix (#3450) - #3478

Merged
squid-protocol merged 1 commit into
feat/call-using-3454from
feat/ims-dli-3450
Sep 24, 2026
Merged

squid-protocol merged 1 commit into
feat/call-using-3454from
feat/ims-dli-3450

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3450. Part of #3445. Stacked on #3475, which sits on #3474. GitHub retargets each PR as the one below it merges.

What

core/dli_calls.py: one row per IMS call, operands as written → dli_call_data.

New joins in galaxy_ir:

  • ims_calls():
    • A CBLTDLI function code is resolved through its data item's VALUE; FUNC-GU lives in a copybook.
    • Each SSA is decoded from its group's COPY-expanded VALUEs: the segment name, then either a (FIELD OP qualification or * command codes.
    • EXEC WHERE clauses are paired with their segments.
  • ims_segment_access(): the program × segment matrix, the IMS counterpart of sql_table_access. A path call acts on its last segment and reads the parents it positions through.

CardDemo

35 calls over PAUTSUM0 / PAUTDTL1 in 7 programs:

  • COPAUA0C reads, updates and inserts PAUTSUM0, and inserts PAUTDTL1 under it.
  • CBPAUP0C reads and deletes both segments.
  • DBUNLDGS reads both, and its ISRTs go to GSAM PCBs with no SSA.

Ground truth

  • Independent reader: add-dli, with its own copybook lookup and its own PIC-width VALUE decoding.
  • New scored fields: DL/I calls and IMS segment access, drafted.
  • Result: the engine matches the key exactly: CardDemo 35/35 calls and 20/20 segment accesses. CBSA and zopeneditor have no IMS.

Not in this PR

PSB / DBD generation sources aren't scanned yet, so PCBs aren't resolved to databases. That's #3477.

Checks

  • Golden masters: unchanged (the crucible corpus has no IMS).
  • Tests: full suite passes locally (11,236 passed). The ruff, mypy, dead-key and X-Ray checks are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

IMS database calls were invisible: nothing said which programs read or update
which IMS segments.

core/dli_calls.py: one row per EXEC DLI command (the command, PCB(...), each
SEGMENT(...) of a path call, INTO / FROM, WHERE(...), SCHD PSB((name))) and per
CALL 'CBLTDLI' / 'AIBTDLI' (function operand, PCB mask, I/O area, SSAs -- read
with the #3454 USING reader), operands as written -> dli_call_data.

galaxy_ir: EngineDliCall / EngineFile.dli_calls and
- ims_calls(): a CBLTDLI function code resolved through its data item's VALUE
  (FUNC-GU lives in a copybook) and each SSA decoded from its group's
  COPY-expanded VALUEs -- segment name, `(FIELD OP` qualification or `*`
  command codes; EXEC WHERE clauses paired with their segments;
- ims_segment_access(): the program x segment matrix (the IMS counterpart of
  sql_table_access). A path call acts on its last segment and reads the
  parents it positions through.

CardDemo: 35 calls over PAUTSUM0 / PAUTDTL1 in 7 programs -- e.g. COPAUA0C
reads / updates / inserts PAUTSUM0 and inserts PAUTDTL1 under it; CBPAUP0C
reads and deletes both; DBUNLDGS reads both and ISRTs its GSAM PCBs (no SSA).

Ground truth: an independent reader (add-dli) with its own copybook lookup and
PIC-width VALUE decoding, and two scored fields, "DL/I calls" and "IMS segment
access" (drafted). Engine matches the key exactly: CardDemo 35/35 calls and
20/20 segment accesses (no IMS in CBSA or zopeneditor). Golden masters
unchanged (no IMS in the crucible corpus). PSB / DBD generation sources are not
scanned yet; follow-up issue.

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 efb0328 into feat/call-using-3454 Sep 24, 2026
2 checks passed
@squid-protocol
squid-protocol deleted the feat/ims-dli-3450 branch September 24, 2026 12:48
squid-protocol added a commit that referenced this pull request Sep 24, 2026
…#3478)

IMS database calls were invisible: nothing said which programs read or update
which IMS segments.

core/dli_calls.py: one row per EXEC DLI command (the command, PCB(...), each
SEGMENT(...) of a path call, INTO / FROM, WHERE(...), SCHD PSB((name))) and per
CALL 'CBLTDLI' / 'AIBTDLI' (function operand, PCB mask, I/O area, SSAs -- read
with the #3454 USING reader), operands as written -> dli_call_data.

galaxy_ir: EngineDliCall / EngineFile.dli_calls and
- ims_calls(): a CBLTDLI function code resolved through its data item's VALUE
  (FUNC-GU lives in a copybook) and each SSA decoded from its group's
  COPY-expanded VALUEs -- segment name, `(FIELD OP` qualification or `*`
  command codes; EXEC WHERE clauses paired with their segments;
- ims_segment_access(): the program x segment matrix (the IMS counterpart of
  sql_table_access). A path call acts on its last segment and reads the
  parents it positions through.

CardDemo: 35 calls over PAUTSUM0 / PAUTDTL1 in 7 programs -- e.g. COPAUA0C
reads / updates / inserts PAUTSUM0 and inserts PAUTDTL1 under it; CBPAUP0C
reads and deletes both; DBUNLDGS reads both and ISRTs its GSAM PCBs (no SSA).

Ground truth: an independent reader (add-dli) with its own copybook lookup and
PIC-width VALUE decoding, and two scored fields, "DL/I calls" and "IMS segment
access" (drafted). Engine matches the key exactly: CardDemo 35/35 calls and
20/20 segment accesses (no IMS in CBSA or zopeneditor). Golden masters
unchanged (no IMS in the crucible corpus). PSB / DBD generation sources are not
scanned yet; follow-up issue.


Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-protocol added a commit that referenced this pull request Sep 24, 2026
* Mainframe fact channel: batch CALL USING contracts (#3454)

#3355 matched CICS COMMAREAs to the callee's DFHCOMMAREA; a batch
`CALL 'X' USING A B C` passes its data positionally to the callee's
`PROCEDURE DIVISION USING P Q R`, and neither side was recorded, so an arity or
length mismatch was invisible.

core/call_using.py:
- a CALL's USING list, by position (BY CONTENT / BY VALUE prefix the items that
  follow, `A OF B` kept, subscripts dropped, ADDRESS OF / LENGTH OF / OMITTED /
  literals as written), ending at RETURNING / ON / NOT / END-CALL / a period /
  the next verb -> call_site_data.using_args (a column, like #3355's COMMAREA;
  healed onto older tables; only on a CALL that has one, so every other row
  keeps its shape);
- each PROCEDURE DIVISION [USING] and ENTRY 'X' [USING] -> entry_point_data.
Sequence fields are blanked once per file (a slice would misplace cols 73-80).

galaxy_ir: EngineCall.using_args, EngineEntryPoint / EngineFile.entry_points,
and GalaxyIR.call_contracts(): each CALL paired with its callee's entry (the
ENTRY the target names, else the PROCEDURE DIVISION) -- status paired /
arity_mismatch / callee_unresolved / callee_no_using / caller_no_using -- and
per position the argument's and parameter's byte length (record_layout,
COPY-expanded) and length_match.

CardDemo: CBSTM03A -> CBSTM03B (13 sites, 1040 = 1040 bytes), CORPT00C /
COTRN02C -> CSUTLDTC (10/10/80 = 10/10/80); the other 43 CALLs go to LE / MQ
services outside the repo. zopeneditor: SAM1 -> SAM2 (4 and 5 arguments).

Ground truth: an independent reader (add-call-using) and a scored field "CALL
USING" (drafted). Engine matches the key exactly: CardDemo 71/71, CBSA 22/22,
zopeneditor 5/5. Golden masters: a USING field on 227 call sites (purely
additive) and new Entry Points blocks.

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

* Mainframe fact channel: IMS DL/I calls and the segment matrix (#3450) (#3478)

IMS database calls were invisible: nothing said which programs read or update
which IMS segments.

core/dli_calls.py: one row per EXEC DLI command (the command, PCB(...), each
SEGMENT(...) of a path call, INTO / FROM, WHERE(...), SCHD PSB((name))) and per
CALL 'CBLTDLI' / 'AIBTDLI' (function operand, PCB mask, I/O area, SSAs -- read
with the #3454 USING reader), operands as written -> dli_call_data.

galaxy_ir: EngineDliCall / EngineFile.dli_calls and
- ims_calls(): a CBLTDLI function code resolved through its data item's VALUE
  (FUNC-GU lives in a copybook) and each SSA decoded from its group's
  COPY-expanded VALUEs -- segment name, `(FIELD OP` qualification or `*`
  command codes; EXEC WHERE clauses paired with their segments;
- ims_segment_access(): the program x segment matrix (the IMS counterpart of
  sql_table_access). A path call acts on its last segment and reads the
  parents it positions through.

CardDemo: 35 calls over PAUTSUM0 / PAUTDTL1 in 7 programs -- e.g. COPAUA0C
reads / updates / inserts PAUTSUM0 and inserts PAUTDTL1 under it; CBPAUP0C
reads and deletes both; DBUNLDGS reads both and ISRTs its GSAM PCBs (no SSA).

Ground truth: an independent reader (add-dli) with its own copybook lookup and
PIC-width VALUE decoding, and two scored fields, "DL/I calls" and "IMS segment
access" (drafted). Engine matches the key exactly: CardDemo 35/35 calls and
20/20 segment accesses (no IMS in CBSA or zopeneditor). Golden masters
unchanged (no IMS in the crucible corpus). PSB / DBD generation sources are not
scanned yet; follow-up issue.


Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

Co-authored-by: Claude Opus 5.5 <[email protected]>

---------

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.

1 participant