Repository navigation
Description
Problem
The COBOL import and _dependency_capture rules (cobol.py:639-652) anchor COPY at line start (^ + sequence area + whitespace). A COPY after another clause on the same line is not seen:
01 WS-REC. COPY CUSTREC.05 X. COPY Y.- several COPYs on one line
file_data.raw_imports stays empty and no edge_data import edge is drawn. The record reader does see the member (record_data.copy_members = CPYB), so the two channels disagree about the same file.
Evidence
- Crucible:
che-che4z_lsp_project_fixtures/TEST.CBL:1801 PARENT. COPY A. COPY B. COPY C.gives raw_imports[].outline.cbl:1801 PARENT. COPY AST.gives[]. - Minimal repro
REPRO6.cbl(below), main 737cab8 and Fix #4264: fixed / free COBOL reference format, per file and per directive #4290 head:01 WS-REC. COPY CPYB.and01 WS-OTHER. COPY CPYC. COPY CPYD.give raw_imports[]and 0 import edges, while record_data has copy_membersCPYBandCPYC,CPYD.
Impact
The copybook dependency graph misses members, and so does popularity. An unreferenced data-only copybook (popularity 0, zero signals, >50 LOC) is then relegated by the Zero-Density threshold (statistical_auditor.py:477-484), and its layout leaves the DB.
Acceptance criteria
- COPY / EXEC SQL INCLUDE are recognized at any statement position outside literals and comments, each occurrence counted
- raw_imports / import edges agree with record_data.copy_members on the repro
- Valid fixtures: same-line COPY after a level entry, and two COPYs on one line
Found during: crucible mainframe count audit (2026-10-04)
Reproducer
REPRO6.cbl
IDENTIFICATION DIVISION.
PROGRAM-ID. REPRO6.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-REC. COPY CPYB.
01 WS-OTHER. COPY CPYC. COPY CPYD.
PROCEDURE DIVISION.
MAIN-PARA.
MOVE B-FIELD TO C-FIELD
STOP RUN.Found by a grep-vs-engine count audit of every mainframe file in language-crucible v1.7.0 (802 of 815 files compared), on main 737cab8 and the #4290 head (now merged as c136f46).
Activity
COBOL: a COPY / EXEC SQL INCLUDE after a separator period on the same…