Skip to content

Engine: extract COBOL data-division items and FD record layouts (the last structural datum the DB doesn't carry) #3246

Closed

Description

@squid-protocol

Follow-up from the #3211 differential review. After #3200 (call graph) and #3201 (dataset lineage), the galaxy_ir SCOPE comment lists exactly one structural datum still owned by the forge tools and absent from the master DB:

NOT in the DB, so still owned by the forge tools: data-division items, FD record layouts, and reachability-based dead code.

(Reachability is a deliberate, separate design choice — usage_status is a by-name signal, see docs/unreferenced_by_name_contract.md. This issue is about the data half.)

Why it matters

Data-division items (the 01/05/... hierarchy: name, level, PIC, USAGE/COMP-3, OCCURS, REDEFINES, VALUE) and the FD record layouts bound to each file are the schema of the system. They are:

Scope sketch

  • Extract the DATA DIVISION (WORKING-STORAGE, LINKAGE, FILE SECTION FD/01) as a nested item tree per program/copybook, into new *_data table(s) in the master DB, exposed via galaxy_ir (e.g. EngineFile.records / data_items).
  • Handle the hard cases COBOL data division is made of: level numbers and nesting, OCCURS [DEPENDING ON], REDEFINES, PIC/USAGE COMP-3, VALUE, and copybook-supplied layouts.
  • Add answer-key coverage (a records field) so the differential/scorer can grade it, same as COBOL modernization answer key: hand-verified per-program truth for the #3120 corpora, scored against forge and engine #3210 did for units/copybooks/lineage.

Acceptance

refraction_differential.py --corpus shows record layouts as a compared datum (not stated_absence via orphaned_vars), and the Java forge can source entity/DTO fields from the DB.

Part of epic #3122.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, sensor, or structural signaturelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forging

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions