Skip to content

det translator: COPY resolution is a first-hit directory search, so a member in two libraries silently takes the wrong layout #4461

Closed

Description

@squid-protocol

Problem

The det translator resolves every COPY by searching a flat list of directories its caller hands it (a det-port case's copy_dirs, or every copybook directory of the estate). It has no notion of a program's SYSLIB concatenation, of COPY X IN LIB, or of a member that exists in several libraries. Where the same member lives in two libraries, the translator silently takes whichever directory comes first; the engine already resolves these from the estate's copy-library declaration (#4265) and reports collisions.

Evidence (origin/main e3ace8a, #4273 cross-check on estate-crucible v0.4.0, whose key states the resolution)

  • H-0034: apps/ACCT/cobol/ACCTPOST.cbl:45, apps/CUST/cobol/CUSTINQ.cbl COPY DATEWS → key and engine shared/copylib/DATEWS.cpy (16 bytes); translator apps/PAYR/copybook/DATEWS.cpy (18 bytes). WS-DATE-AREA comes out 18 bytes with WS-CURR-TIME @10 instead of @8.
  • H-0052: apps/ORDR/cobol/ORDVOLD.cbl:14 COPY ORDREC → key and engine apps/ORDR/oldcopy/ORDREC.cpy (36 bytes); translator apps/ORDR/copybook/ORDREC.cpy (41). apps/SHIP/cobol/SHPINQ.cbl:12 likewise (key 36, translator 41).
  • Measured over estate-crucible: translator offsets vs the key 90.5% P / 90.8% R; engine 99.4% / 98.9% (same records).

Impact on a real estate

Any estate with copybook version drift across libraries gets a translation built on the wrong layout, with no warning. The equivalence proof would not catch it if the oracle is given the same directory list.

Acceptance criteria

  • The translator takes each COPY's resolved member from the engine (EngineFile.copy_deps / the scan's copy-library resolution), or from the estate's SYSLIB declaration per program, instead of a first-hit directory search; an ambiguous member with no declaration is refused by name.
  • The cross-check ledger cause translator-copy-search-order loses its entries.

Decision recorded in docs/language_status/fact_ownership.md (PR #4456): the engine owns COPY resolution.

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