You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
COBOL: the main line (PROCEDURE DIVISION code before the first paragraph) has no function_data row, so its size, complexity and calls are missing from every per-function view #7170
What happens. A COBOL program's main line is the procedure-division code before its first paragraph. It gets no row in function_data. The file's coding_loc counts that code, but no function does. So its LOC, complexity, fan-out, archetype and signals are missing from every per-function view: hotspots, distributions, archetype mix, sfs fingerprints and call-graph shape.
#4302 (closed 2026-10-04) records the main line's PERFORM/CALL edges. It did not give the main line a unit row, and the ground-truth ledger still attributes CardDemo's unit-extent gap (871/881) to "main line in no unit".
Across the repo, tests/tools/cobol_answer_key.py (draft + add-extents) puts 906 of 2,008 procedure lines (45%) in main lines of 9 of its 11 programs. The scorer reports unit extents P 57/57 · R 57/68 · 875 code lines outside any unit. In other repos it varies widely: 39% in acherm/agentic-cobol-pygame, 5% in acherm/agentic-cobol-compress, and 0% in programs that open with a named paragraph. Per-function statistics therefore compare different fractions of each codebase, and a whole program with no paragraphs (eval.cob) is invisible to them.
Expected. One unit per main line, with a stable name (for example the PROGRAM-ID, or a reserved marker for the main line, as other languages' top-level slices get), from the first procedure statement to the line before the first paragraph header. It should carry complexity, LOC, signals and the main-line call edges #4302 already records. The answer key's main_line extents give the target.
Scope to check in the fix
Every COBOL path that writes function_data. Check what the existing __global_context__ convention means for COBOL, and keep downstream readers that drop synthetic slices consistent with it (sfs drops __global_context__, so the main line likely needs a distinct, non-synthetic name).
Nested programs and multiple PROCEDURE DIVISIONs in one file.
Programs whose main line is empty: no row, unchanged.
Procedure code that lives in COPYed copybooks.
Fixed and free format.
Ledger: the CardDemo unit-extents row should rise from 871/881 by the main-line share. That needs a golden and ledger re-bless.
Found by the agentic-COBOL structural comparison (DOOM study follow-up). That comparison is on hold until this is fixed, because main-line share differs sharply between the systems compared.
Activity
DOOM-rosetta: bless agentic-cobol-doom-codex, gridwalker.cob's main l…
#7170: the #4203 free-format test reads paragraph units; main lines p…
#7170: ruff format the #4203 data-name check
Re-bless goldens after merging origin/main at 0d81fdb (#7170)
golden: re-bless gpu_json snapshots after merging main (#7170)
Merge origin/main (#7172 main lines) into #7206: keep both COBOL entr…