Skip to content

det translator: COPY after other text on its line, or with the member on the next line, is not expanded (record silently empty) #4459

Closed

Description

@squid-protocol

Problem

det.source.expand only recognises a COPY statement that starts its line with the member name on the same line (_COPY = ^\s*COPY\s+NAME). Two valid forms are left unexpanded, and the record they fill silently comes out empty (0 bytes); the layout parse does not fail and nothing is refused:

  • a COPY after other text on its line: 01 WS-RPT-HEAD. COPY RPTHDR. (the code below _COPY even handles head text before COPY, but the anchored pattern never matches it);
  • a COPY whose member name is on the next line: COPY / UPDCTL.

Evidence (origin/main e3ace8a, #4273 cross-check on estate-crucible v0.4.0)

  • apps/ACCT/cobol/ACCTRPT.cbl:21-22: 01 WS-RPT-HEAD. COPY RPTHDR. and 01 WS-RPT-TOTALS. COPY RPTTOT. COPY RPTCNT. → translator records 0 bytes; the estate's key (and the engine) have 51 and 22 bytes.
  • apps/ACCT/cobol/ACCTUPD.cbl:12-14: 01 WS-UPD-CONTROL. / COPY / UPDCTL. → translator 0 bytes; key and engine 14.
  • WRITE RPT-LINE FROM WS-RPT-HEAD would then move nothing.

Impact on a real estate

A silent layout error in a translation, the exact failure #4411 set out to refuse.

Acceptance criteria

  • Both forms are expanded (or, at minimum, refused by name, never left in place).
  • A test in tests/cobol_mainframe/test_det_translate.py for each form.
  • The cross-check ledger cause translator-copy-statement-forms loses its entries.

Found during: #4273 engine-vs-translator fact cross-check (PR #4456)

🤖 Generated with Claude Code

Activity

  1. added
    bug
    data-integrity
    legacy-modernization
    priority: high
    on Oct 5, 2026
  2. added
    scope:sweep
    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

    bugdata-integritylegacy-modernizationpriority: highscope:sweep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions