Skip to content

Dependency resolver drops ambiguous targets: COBOL COPY loses most copybook edges (same stem as the program, or duplicated copybook roots) #3199

Closed

Description

@squid-protocol

Found by the #3120 differential. network_risk_sensor._resolve_target drops an edge when a capture matches more than one file. For COBOL COPY that throws away most copybook edges in real repos.

Evidence

  • zopeneditor-sample: the programs' 12 COPY statements produce 0 edges. Every copybook exists twice, once in COPYBOOK/ and once in multiroot/copybooks/, so each is ambiguous.
  • CBSA: 56 of 119 COPY statements get no edge. For 36 of them the copybook exists in src/base/cobol_copy/ and only ambiguity drops the edge. The other 20 are system copybooks absent from the repo (11) and BMS-generated symbolic maps (9, a Phase-2 cross-language link):
    • COPY ACCTCTRL matches ACCTCTRL.cpy, and also the program ACCTCTRL.cbl, ACCTCTRL.jcl and ACCTCTRL.lked.
    • COPY CUSTOMER matches CUSTOMER.cpy and CUSTOMER.java (exact case, different language).

The same-language lowercase retry doesn't help: .cbl and .cpy are both cobol.

Suggested tie-break (not pre-decided)

Before giving up on an ambiguous target, prefer:

  1. the importer's own language;
  2. then, for a COBOL COPY or PL/I %INCLUDE, a member that is not itself a program (no PROGRAM-ID / class_start);
  3. then the path nearest the importer.

Only if a tie remains, drop the edge (as today).

This changes edge_data, popularity, PageRank and blast radius on every mainframe repo, so it needs a golden-master bless and a scoped diff. Context: docs/refraction_engine_differential.md D3 (PR for #3120).

Activity

  1. added
    bug
    core-engine
    legacy-modernization
    on Sep 19, 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-enginelegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions