Skip to content

Mainframe fact channel: IMS PSB / DBD definitions and the access check (#3477) - #3483

Merged
squid-protocol merged 1 commit into
mainfrom
feat/ims-gen-3477
Sep 24, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/ims-gen-3477

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of epic #3445.

What it does

IMS PSB and DBD generation members (.psb / .dbd) are now scanned as hlasm. The macros are assembler, so no new language is needed. JCL EXEC PGM=DFSRRC00,PARM='DLI|BMP,program,psb' steps become region rows. Both land in ims_gen_data (core/ims_gen.py, reached through extract_boundary):

kind from
PSBGEN / PCB / SENSEG PSB: PCB type, DBD and PROCOPT; SENSEGs belong to the PCB above them (an unlabeled PCB is PCB@<line>)
DBD / SEGM / FIELD / LCHILD / DATASET DBD: access method, segment hierarchy, BYTES, SEQ key field, index pairing
REGION JCL DFSRRC00: region type, program, PSB

Column-72 continuations are joined. hlasm joins BOUNDARY_DIALECTS; its other channels stay empty, as before.

GalaxyIR gains four joins:

  • ims_psbs(): each PSB's PCBs, with their DBD, PROCOPT and SENSEGs.
  • ims_databases(): each DBD's segments, with parent, bytes and SEQ key.
  • ims_program_psbs(): each program's PSB, from a JCL region naming its PROGRAM-ID or an EXEC DLI SCHD PSB((name)) resolved through the name's VALUE.
  • ims_access_check(): each Mainframe fact channel: IMS DL/I database access (CBLTDLI / EXEC DLI) #3450 program × segment access checked against the PSB's SENSEGs and PROCOPT. Status is ok, denied (with the refused accesses), not_sensitive or no_psb.

CardDemo: 4 PSBs and 4 DBDs, and 7 programs resolve to a PSB. All 14 program × segment accesses are ok: the AP programs update, and PAUDBUNL (GOTP) and DBUNLDGS read only.

Ground truth

  • Independent key reader and join: cobol_answer_key.py add-ims-gen, with its own column-72 reader, operand scan and PROCOPT letter check.
  • New scored fields: IMS definitions, where engine and key agree 39/39 on CardDemo, and IMS access check, 14/14. Ledger flag: ims_gen_validated. CBSA and zOpenEditor have no IMS, so they get empty sections.

Checks

  • New tests: unit, recorder (including restoring a pre-IMS: scan PSB / DBD generation sources and resolve DL/I PCBs to databases #3477 DB), IR (all four statuses) and key.
  • The hlasm extension pin is updated. The dead-key allowlist gets the IMS macro operands.
  • Golden masters PASS unchanged in both full and zero-dependency modes.
  • The ledger is clean. ruff and mypy audits are clean.
  • Full suite: 11256 passed.

Closes #3477

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

#3477)

PSB and DBD generation members (.psb / .dbd, scanned as hlasm) and JCL
DFSRRC00 region steps become ims_gen_data rows (core/ims_gen.py): PSBGEN,
PCB, SENSEG, DBD, SEGM, FIELD, LCHILD, DATASET, REGION, with column-72
continuations. GalaxyIR adds ims_psbs, ims_databases, ims_program_psbs
(region PARM by PROGRAM-ID, or EXEC DLI SCHD PSB through its VALUE) and
ims_access_check: each #3450 segment access checked against the PSB's
SENSEGs and PROCOPT (ok / denied / not_sensitive / no_psb).

Answer key: independent reader + join (add-ims-gen), scored fields
"IMS definitions" (CardDemo 39/39) and "IMS access check" (14/14),
ledger flags ims_gen_validated. Golden masters unchanged.

Closes #3477

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 55dbf33 into main Sep 24, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the feat/ims-gen-3477 branch September 24, 2026 14:28
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.

IMS: scan PSB / DBD generation sources and resolve DL/I PCBs to databases

1 participant