Skip to content

COBOL engine and answer key read only the first program's DATA DIVISION in a multi-program source #4245

Description

@squid-protocol

Problem

On DBB MortgageApplication zBuilder/MortgageApplication/cobol/epscsmrd.cbl @ ce2c1be58eb049e000c6627bd8273263fef0c606 (4,052 lines, 13 PROGRAM-IDs), the engine's record_data has 65 rows, the last at line 138, and tests/tools/cobol_answer_key.py _data_items(Source(path)) returns the same 65 items, last line 138. The first program ends well before line 334, where EPSCSMRF begins; the other 12 programs' DATA DIVISIONs are never read. _data_items takes the first DATA DIVISION match to the first PROCEDURE DIVISION.

Evidence

Reproduced on origin/main by scanning the file and calling _data_items. Both readers share the one-program assumption.

Acceptance criteria

  • Each program's DATA DIVISION is read (engine record_data and key _data_items), with the owning program recorded or derivable
  • Records of sibling programs with the same names do not collide
  • Fixture with two programs, each with a WORKING-STORAGE item

Out of scope

PROGRAM-ID recording; function-count changes.

Found during: PR #4226

🤖 Generated with Claude Code

Activity

  1. added
    bug
    data-integrity
    core-engine
    on Oct 3, 2026
  2. added 2 commits that reference this issue on Oct 3, 2026
  3. squid-protocol commented on Oct 4, 2026

    @squid-protocol
    OwnerAuthor

    Confirmed on a planted multi-program member (estate-crucible horror H-0031, a nested program plus a sibling in one source):

    The horror also records 4 more missing WORKING-STORAGE items (01 WS-I, 01 WS-GROSS, ...).

    Found by estate-crucible v0.2.0 (#4317); planted in squid-protocol/estate-crucible, scored by tests/tools/estate_crucible.py on main (#4337 has the full scorecard). The horror flips to pass when this is fixed.

  4. added
    scope:core
    era:2
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginedata-integrityera:2priority: mediumscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions