Repository navigation
Description
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:
- what the Java forge must re-parse today to emit DTOs/entities (
cobol_to_java_*, the DFHCOMMAREA→DTO / entity work cobol-to-java: 26 CBSA entities all map @Table(name = "DFHCOMMAREA") #3233/cobol-to-java: same-name programs collapse into one Service/Controller (the Java side of #3218) #3221) — it can't take these from the DB because the DB doesn't have them; - required for field-level data-flow (which field flows into which dataset/copybook), the precision layer above Extract COBOL SELECT/ASSIGN and OPEN modes (and JCL DD bindings) by name, so dataset lineage can come from the engine #3201's file-level dataset lineage;
- the natural completion of the "consume engine signals" epic Epic: CICS Platform Modernization — consume engine signals in the refraction pipeline #3122 — once the DB carries record layouts, the refraction pipeline stops re-parsing COBOL entirely.
Scope sketch
- Extract the DATA DIVISION (WORKING-STORAGE, LINKAGE, FILE SECTION FD/01) as a nested item tree per program/copybook, into new
*_datatable(s) in the master DB, exposed viagalaxy_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
recordsfield) 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.
Activity
refactor(mainframe): shared per-file fact-channel helpers + onboardin…
feat(llm): optional Named System Facts section in the LLM brief (#3200/…
feat(audit): carry Named System Facts in the full forensic report (#3246
feat(mainframe): extract COBOL DATA DIVISION items & FD record layouts (
Engine: COMMAREA contract fact -- LINK/XCTL/RETURN COMMAREA to callee…
Engine: COMMAREA contract fact -- LINK/XCTL/RETURN COMMAREA to callee…