Skip to content

CICS coverage: symbolic maps generated from BMS source (#3490) - #3500

Merged
squid-protocol merged 1 commit into
mainfrom
feat/bms-symbolic-3490
Sep 24, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/bms-symbolic-3490

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of epic #3489 (CICS estate coverage gaps).

Problem

A CICS program COPYs its screen's symbolic map, which is the copybook the BMS assembler (DFHMAPS) generates at build time. Repositories rarely ship it: CBSA has none of its ten. So every screen field (CUSTNAMI, MESSAGEO, …) stayed unresolved, and field lineage (#3452) stopped at the terminal.

What it does

  • core/bms_symbolic.py generates the COBOL symbolic map as copybook text from the screen fields we already extract (Engine: extract BMS symbolic-map field layouts as a fact channel #3347). That covers:

    • the TIOA prefix;
    • L/F/A/I items per named field, plus the O record REDEFINES;
    • extended-attribute bytes (DSATTS / EXTATT=YES, in C P H V U M T order);
    • PICIN / PICOUT;
    • OCCURS, in IBM's …D / DFHMSn form.

    It matches all 21 generated copybooks CardDemo checks in, line for line. That comparison is a test whenever the corpus is present.

  • GalaxyIR parses the text with the engine's own record parser. It attaches the result (EngineFile.symbolic_copies, never added to files) to any program whose COPY <mapset> has no real COBOL copybook. Copybook resolution, storage spans and qualified lookups all see it. A real copybook always wins. A mapset defined in several BMS sources resolves to the file named after it: CBSA's BNK1TFM is in both BNK1B2M.bms and BNK1TFM.bms.

  • GalaxyIR.symbolic_map_layouts() lists every generated map as NAME @offset+bytes.

Effect (CBSA)

  • Unresolved data-move targets: 779 → 0. Unresolved sources: 105 → 1.
  • field_lineage(UPDCUST, COMM-NAME, backward) now reaches BNK1DCS's CUSTNAMI, tagged with the endpoint cics MAP BNK1DC read.

Ground truth

  • The key computes its own layout by arithmetic from the BMS source: 3 + k + LENGTH bytes per field, after the prefix. It writes no COBOL and uses no record parser.
  • New subcommand add-symbolic-maps; new scored field "symbolic maps"; ledger flag symbolic_validated.
CardDemo CBSA
symbolic-map items 5307/5307 1320/1320

A blind census of the new key section is still owed. CardDemo's layouts are also checked against the real generated copybooks, which serve as an external oracle.

Checks

  • Tests: an exact-text unit test, the CardDemo oracle, IR tests (resolution, and a real copybook winning over the generated one) and a key test.
  • Golden masters are unchanged: this is a reader derivation with no new table.
  • The ledger is clean, and the ruff, mypy and dead-key audits are clean.
  • Full suite: 11273 passed.

Closes #3490

🤖 Generated with Claude Code

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

A program's COPY of its mapset names a BUILD artefact (the DFHMAPS symbolic
map) that repositories rarely ship -- CBSA has none of its ten -- so every
screen field (CUSTNAMI, MESSAGEO ...) stayed unresolved and field lineage
stopped at the terminal.

core/bms_symbolic.py generates the COBOL symbolic map from the #3347 screen
fields as copybook text: TIOA prefix, L/F/A/I per named field, the O record
REDEFINES, extended-attribute bytes (DSATTS / EXTATT=YES, C P H V U M T
order), PICIN / PICOUT, OCCURS (IBM's D / DFHMSn form). It matches all 21
generated copybooks CardDemo checks in, line for line.

GalaxyIR parses it with the engine's record parser and attaches it
(EngineFile.symbolic_copies, never in `files`) to a program whose COPY
member no real COBOL copybook answers; copybook resolution, storage spans
and qualified lookups see it. A mapset several BMS sources define resolves
to the file named after it. GalaxyIR.symbolic_map_layouts lists every map.

CBSA: unresolved move targets 779 -> 0 (sources 105 -> 1); the lineage of
UPDCUST COMM-NAME now reaches BNK1DCS's CUSTNAMI (cics MAP BNK1DC read).

Answer key: independent layout by arithmetic (add-symbolic-maps), scored
field "symbolic maps" (CardDemo 5307/5307, CBSA 1320/1320), ledger flag
symbolic_validated. Golden masters unchanged.

Closes #3490

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@squid-protocol
squid-protocol merged commit 705d38a into main Sep 24, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the feat/bms-symbolic-3490 branch September 24, 2026 15:57
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.

CICS coverage: symbolic map layouts generated from BMS source

1 participant