[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not roots

Open Beginner friendly
#4,477 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@dchaudhari7177 is already working on this.

Since Oct 24, 2026.

  • #4606 by @dchaudhari7177 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, testing

Research direction

Start in packages/core/src/repowise/core/ingestion/cobol/csd.py, reading read_csd and defined_programs, then inspect _add_mainframe_edges and the related cases in tests/unit/ingestion/test_mainframe_edges.py. Add coverage showing that both _PGMPH names in the supplied _PGMLIST become roots while existing PROGRAM and TRANSACTION behavior stays intact. The issue is done when that test passes.

Written by the indexing model from the issue text.

Description

bug good first issue

Summary

A Micro Focus CSD _PGMLIST lists PLT startup programs with _PGMPH(prog,n). The reader only understands PROGRAM and a TRANSACTION's PROGRAM(), so those programs get no root edge and stay isolated. Seen in RocketSoftwareCOBOLandMainframe/BankDemo (BANKDEMO_AL2.csd: UBNKPLT1, UBNKPLT2).

packages/core/src/repowise/core/ingestion/cobol/csd.py:27

r"^\s*(?P<command>[A-Z]+)\s+(?P<resource>[A-Z]+)\s*\(\s*(?P<name>[^()\s]+)\s*\)(?P<rest>.*)"

Mechanism

  • [A-Z]+ does not match _PGMLIST (leading underscore), so read_csd yields no definition for it.
  • defined_programs (:95) returns only PROGRAM names and transaction programs; framework_edges/mainframe.py:105 turns each into a root edge.
  • Precedent: _PROGRAM_ATTR (:31) reads the PROGRAM attribute of a transaction.

Repro

DEFINE _PGMLIST(PI) GROUP(G)
       _PGMPH(UBNKPLT1,1) _PGMPH(UBNKPLT2,2)

plus UBNKPLT1.cbl and UBNKPLT2.cbl, run through _add_mainframe_edges as in tests/unit/ingestion/test_mainframe_edges.py:

edges: []
roots: []

DEFINE PROGRAM(UBNKPLT1) GROUP(G) instead gives edges: [('csd/R.csd', 'cbl/UBNKPLT1.cbl')], roots: ['cbl/UBNKPLT1.cbl'].

Impact

Startup programs look unreferenced, so they show as dead code and have no entry point.

Done looks like

  • _PGMPH(NAME,n) names inside a _PGMLIST definition count in defined_programs.
  • Must not change: PROGRAM/TRANSACTION handling and the symbols parse_csd_file emits; other _-prefixed attributes stay ignored.
  • Good first issue: one pattern and one case in csd.py.
  • A CSD whose only resource is _PGMLIST also hits the empty-definitions crash in parse_csd_file (separate issue); keep this one to the edges.

Tests

tests/unit/ingestion/test_mainframe_edges.py: the CSD above roots both programs.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.