Skip to content

COMMAREA basis: a caller's record outranks a concrete declared LINKAGE DFHCOMMAREA of a different width #3688

Closed

Description

@squid-protocol

Found while building the migration worklist (#3651, PR #3687).

GalaxyIR.program_interfaces() picks a program's COMMAREA in this order:

  1. the program's own unpack of DFHCOMMAREA;
  2. a resolved caller's record;
  3. the program's LINKAGE DFHCOMMAREA.

When the callee declares a concrete, fixed-width DFHCOMMAREA with fields, a caller's record still wins, even if the widths differ.

Repro (the real-scan fixture in tests/cobol_mainframe/test_migration_worklist.py):

  • ACCTINQ declares 01 DFHCOMMAREA. 05 LK-ACCT-ID PIC 9(11). 05 LK-NAME PIC X(20). (31 bytes);
  • MENU LINKs it with WS-AREA (6 bytes); OTHER LINKs it with WS-OTHER (43 bytes).

The result is basis: caller_record, record: WS-AREA (cbl/MENU.cbl), bytes: 6, and the declared 31-byte layout is not mentioned anywhere.

Question: when the declared LINKAGE layout is concrete (fixed width, real fields, not an opaque PIC X OCCURS … DEPENDING ON EIBCALEN), should it win? Or should the disagreement at least be surfaced as a conflict (declared DFHCOMMAREA is 31 bytes; callers pass 6 / 43)? The caller-first rule exists for estates like CardDemo, whose DFHCOMMAREA is an opaque byte array. A declared record with fields is stronger evidence of what the program reads.

Scope: engine (galaxy_ir basis selection) plus the transaction forge's DTO. Check the blast radius on the 6 keyed corpora with ir_join_diff. If it's a defect, log it in field_testing.json.

Part of #3625.

🤖 Generated with Claude Code

Activity

  1. added
    scope:frontier
    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

    scope:frontier

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions