Repository navigation
Closed
Labels
enhancementNew feature, sensor, or structural signatureera:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)legacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingpriority: highCore feature broken, but workarounds existscope:infraCI, tooling, churn/factory, docs infrastructuretestingUnit, integration, and E2E pipeline verification
Description
Problem
The engine (regex + fact channels) and the det translator (tree-sitter parse) independently derive layouts, units, PERFORM/GO TO edges, calls, data moves and copybook expansion for every proven program, but nothing compares them. Engine bugs therefore never break a proof (#4242, #4245, #4246, #4203).
Evidence (file:line, origin/main)
- Translator side:
gitgalaxy/tools/cobol_to_java/det/layout.py:123(parser) anddet/stmt.py:65(parse). - Engine side:
gitgalaxy/core/mainframe_boundary.py,gitgalaxy/core/data_moves.py, and the cobol language standard. - Already known disagreement: COPY REPLACING (engine does not resolve it, translator does:
data_moves.py:53-55vsdet/source.py:~130). - An agreement-measuring experiment ran on 2026-10-03 (scripts at
/tmp/gitgalaxy-scratch/claude/xcheck/); this issue tracks productising it.
Impact on a real estate
Every proven program is a free ground-truth sample for the engine's facts, and today it is unused. Customers get engine facts (call graphs, lineage, layouts) that no test ties to the code that was actually proven.
Acceptance criteria
- Move the experiment scripts into the repo (tests/tools) with a documented comparison per fact family: layouts/offsets, units, PERFORM/GO TO edges, calls, data moves, copybook expansion
- Recorded baseline of agreement per family over all proven programs; a CI gate fails on regression below baseline
- Each disagreement classified (engine bug / translator bug / legitimate difference) and tracked
- Decision recorded on fact ownership (e.g. translator consumes engine layouts, or engine consumes translator layouts) per family
Out of scope
Fixing the individual engine bugs (#4242, #4245, #4246, #4203).
Found during: 2026-10-03 COBOL engine/translator audit
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
enhancementNew feature, sensor, or structural signatureera:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)legacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingpriority: highCore feature broken, but workarounds existscope:infraCI, tooling, churn/factory, docs infrastructuretestingUnit, integration, and E2E pipeline verification
Activity
squid-protocol commentedon Oct 3, 2026
Experiment result (2026-10-03): engine vs translator on 54 det-ported programs
Engine
origin/maineefa097 (fresh scans of CardDemo, CBSA, GenApp, DBB mortgage) vs the det translator's own parse (det.source,det.layout.parse,det.stmt.parse). Items joined on (file, line, level): 14,714 of 14,714 matched. Scripts and outputs (durable copy):/nvme-data/projects/agent-scratch-2026-10-03/xcheck/(xcheck.py,summarize.py,classify.py,srcline.py,robust.py,scan_estates.sh). A run takes ~2 s after the scans (~1 min), so it is ready to become the gate.(MAIN))Every disagreement checked against the COBOL source was either engine-wrong or definitional. None was translator-wrong.
Engine bugs found:
VALUE +0,VALUE -1) is dropped on 132 items (_VALUE_CLAUSEcan't start with a sign), e.g.lgicdb01.cbl:35.record_layout, and nothing reports it. In COTRTLIC the fields after line 304 sit 817 bytes early; the GenApp DFHCOMMAREA size comes back unknown.COTRN02C:62: 158 vs 100 bytes).COADM02Y272 vs 407; CORPT00C 1,360 vs 80,000).COTRTUPC:115).DELACC.cbl:200.POINTER width (engine 4 = z/OS, translator 8 = 64-bit GnuCOBOL oracle) is defensible on both sides and needs a target-platform setting.
Robustness on 149 unported programs: tree-sitter's DATA DIVISION fails on 25 (long continued literals: 14 NIST plus
CBSTM03A:168;*>comments; IDMS; fragments), and the PROCEDURE DIVISION on 6 (SEARCH ALLcrashes with "no open EVALUATE"; CBIMPORT and lgtestc1 don't parse). The engine still produced facts on 24/25 and 6/6, but that shows it emits output, not that the output is correct: bug 2 is silent.Recommended ownership:
For the translator to consume the engine's layouts:
record_layoutreturns every item (groups, REDEFINES overlays, 66/88) with offsets;The (file, line, level) join already maps 100% of items, so an engine→
det.layout.Itemadapter is feasible, withlayout()kept as the check.squid-protocol commentedon Oct 4, 2026
Two related explorations filed: #4377, a referee panel rating the engine's COBOL / CICS parsing against independent open-source parsers (Che4z, mapa, Cobrix, ProLeap, Spantree…), and #4378, a bake-off for the det translator's COBOL front end. This gate would be the first, two-parser case of #4377.
squid-protocol commentedon Oct 5, 2026
Queue note 2026-10-05: next up for an agent once the det/ translator work in flight (#4436 READ LENGTH) lands, to avoid two agents in det/ at once. Context since this was filed: the translator now refuses unmodelled CICS options and swallowed parse errors (#4411), re-wraps continuations (#4412: NIST CCVS85 39 → 143 of 150 parse), and keeps the language-pack grammar (#4378). The estate-crucible gate (#4446) now holds the engine side.
Engine-vs-translator fact cross-check: ledger, ownership doc, CI gate (…
fact cross-check: the ledger is a two-way ratchet (a stale entry fail…
squid-protocol commentedon Oct 5, 2026
Closing: delivered in PR #4456 (105943d).
tests/tools/fact_crosscheck.pycompares engine and translator facts per channel on 7 keyed corpora, the 54 det-port programs, 112 copybooks and estate-crucible v0.4.0.docs/language_status/fact_ownership.md.tests/cobol_mainframe/fact_crosscheck_ledger.json(824 known disagreements under 14 causes). A new disagreement fails, and so does a ledgered one that stops reproducing.det: refuse a program whose COPY resolution differs from the engine's (…
det: take COPY resolution from the engine (#4468) (#4489)