Skip to content

Referee panel: rate GitGalaxy's COBOL / CICS parsing against independent open-source parsers on CICS estates #4377

Closed

Description

@squid-protocol

Why

GitGalaxy's scanner is AST-free and has a zero-dependency mode, and that stays. But "first, validate ourselves": we want to know, with numbers, how the engine's COBOL / CICS facts compare with independent parsers on real CICS estates. Several referees disagreeing in different ways is much stronger evidence than any single check.

Today we have two machine referees: the det translator's tree-sitter parse (#4273, the cross-check gate) and GnuCOBOL (the equivalence oracle). We also have the hand-verified answer keys (#4318) and the estate-crucible's generated key (#4317). Open-source COBOL parsers could add more referees, living in test / validation tooling only, never in the shipped scanner, so the zero-dependency promise is untouched.

Candidates (license-checked; see also the translator bake-off #4378)

Tool License Activity (Oct 2026) What it is Likely role
Eclipse Che4z COBOL LSP EPL-2.0 (weak copyleft; fine as an external, unmodified test tool) very active, Broadcom-backed Industrial IBM Enterprise COBOL parser: CICS, SQL, IDMS, DaCo, copybook preprocessing units, calls, CICS / SQL referee
mapa MIT active, single author ANTLR grammars for IBM Z COBOL, CICS APIs/SPIs and JCL, plus a call-tree tool (CALL, LINK, XCTL, SQL CALL, program inputs/outputs) network-map referee (call tree, CICS, JCL)
Spantree tree-sitter-cobol-enterprise MIT new (Apr 2026) Tree-sitter grammar for IBM Enterprise COBOL; EXEC CICS / SQL parsed into typed nodes; 65/66 CardDemo files parse parser referee; translator front-end candidate
ProLeap MIT stale (last release 2018) ANTLR4 AST + semantic graph (data and control flow); passes NIST COBOL-85; EXEC blocks kept as text data-flow referee
Cobrix Apache-2.0 active Copybook parser + EBCDIC reader: COMP-3, OCCURS DEPENDING ON, REDEFINES record-layout / byte-offset referee
cobol-rekt MIT active Reverse-engineering toolkit: flowcharts, control-flow analysis reachability / dead-code referee
TypeCobol CeCILL-C (LGPL-like) active Incremental IBM Enterprise COBOL 6 parser (C#) dialect-coverage reference
Not permissive: SuperBOL (AGPL), GnuCOBOL (GPL; already our oracle, run as a separate process) leave as is

What to measure: "how does our COBOL parsing rate?"

For each referee, on the same corpus, score agreement with the engine per fact channel:

  • Programs and units: PROGRAM-IDs (incl. nested and sibling programs), paragraphs and sections with extents, main-line entry code.
  • Edges: PERFORM / PERFORM THRU / GO TO / GO TO DEPENDING ON, CALL (static vs dynamic), EXEC CICS LINK / XCTL / RETURN TRANSID / START.
  • Copybooks: COPY / INCLUDE resolution, REPLACING, library (SYSLIB) resolution.
  • Data: items, PIC / USAGE / OCCURS / REDEFINES / VALUE, offsets and sizes (Cobrix is the specialist here).
  • CICS / SQL: commands, resources (files, queues, maps, transactions), SQL statements and tables.
  • JCL: steps, programs, DD / DSN (mapa).
    Also per referee: parse success rate, wall time per member, and what it can't see (dialect gaps, unparsed EXEC blocks).

Corpus: the keyed CICS estates (CardDemo, CBSA, GenApp, zECS, DSF; DBB for batch), the language-crucible's COBOL slice (~450 files incl. NIST CCVS85), and estate-crucible v0.3.0+.

Output: a published scorecard, one table per fact channel, with the engine and each referee scored against each other, against the answer keys and against the estate-crucible key. It can sit next to the tri-comparison chart (GitGalaxy vs tree-sitter vs ctags), which already does this for 40+ languages. Every disagreement gets adjudicated against the source, as in #4273: engine wrong, referee wrong, or definitional.

Open questions (brainstorm here)

  • Which referees are worth the integration cost? JVM tools (Che4z, mapa, ProLeap, Cobrix via Scala) vs tree-sitter (Python bindings) vs .NET (TypeCobol).
  • Majority vote across three or more parsers, or per-channel ownership (COBOL: engine-to-translator fact cross-check as a CI gate (and who owns each fact) #4273's "who owns each fact")?
  • Run on demand / nightly only, or as a CI gate? JVM startup and corpus fetch cost in CI.
  • Che4z is an LSP server: drive it over LSP, or call its parser module directly?
  • How to treat referee dialect gaps (COBOL-85-rooted tools on IBM 6.x code) so they don't count as engine errors.
  • Could a referee panel also run on a customer estate at scan time, as an opt-in "verified mode", while the default scanner stays zero-dependency?
  • Licensing posture for each (EPL / CeCILL vs MIT / Apache) as test-time tools.

Related: #4273 (engine-to-translator cross-check gate), #4318 (answer keys with extents and edges), #4317 (estate-crucible), the translator bake-off #4378, and the tri-comparison chart.

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    testing
    legacy-modernization
    on Oct 4, 2026
  2. squid-protocol commented on Oct 5, 2026

    @squid-protocol
    OwnerAuthor

    First measured pass of the referee panel: tooling in draft PR #4384, which also has the full adjudication table and the draft issues.

    Referee panel scorecard (#4377)

    Corpora: aws-mainframe-modernization-carddemo @ 59cc6c2fd7eb, cics-banking-sample-application-cbsa @ 417334533178, cics-genapp @ f6f3f4b2580d, estate-crucible @ 0.3.0, zecs @ 6d6bcbbc89c9.

    Parse success and speed (the key-covered members each source reads: programs and / or keyed copybooks)

    source version(s) clean partial failed not attempted median s / member
    engine ca152eb 242 0 0 0 —
    che4z 2.5.1 35 70 29 0 2.487
    cobrix cobol-parser_2.12-2.11.2-SNAPSHOT 92 0 16 0 0.002
    mapa 6ebe2d4059f5 127 0 7 0 0.995
    tree-sitter-cobol-enterprise 86a2c479cb7e 51 73 10 0 0.002

    Per corpus, clean / partial / failed:

    source aws-mainframe-modernization-carddemo cics-banking-sample-application-cbsa cics-genapp estate-crucible zecs
    engine 105 / 0 / 0 63 / 0 / 0 44 / 0 / 0 23 / 0 / 0 7 / 0 / 0
    che4z 2 / 19 / 23 16 / 12 / 3 6 / 25 / 0 11 / 9 / 3 0 / 5 / 0
    cobrix 55 / 0 / 6 25 / 0 / 7 10 / 0 / 3 — 2 / 0 / 0
    mapa 44 / 0 / 0 31 / 0 / 0 31 / 0 / 0 17 / 0 / 6 4 / 0 / 1
    tree-sitter-cobol-enterprise 24 / 20 / 0 0 / 31 / 0 15 / 16 / 0 12 / 4 / 7 0 / 2 / 3

    Each source vs the answer keys (ground truth), all corpora pooled

    channel engine che4z cobrix mapa tree-sitter-cobol-enterprise
    program_ids P 100.0% · R 100.0% P 100.0% · R 73.5% (R parsed 95.2%) n/a P 100.0% · R 94.1% (R parsed 99.2%) P 100.0% · R 91.2% (R parsed 100.0%)
    units P 99.9% · R 100.0% P 100.0% · R 71.7% (R parsed 98.8%) n/a n/a P 99.8% · R 89.0% (R parsed 99.4%)
    unit_extents P 99.8% · R 99.2% P 99.5% · R 71.0% (R parsed 98.2%) n/a n/a P 98.8% · R 88.1% (R parsed 98.5%)
    edges P 99.5% · R 99.9% P 100.0% · R 60.7% (R parsed 99.4%) n/a n/a P 99.2% · R 89.7% (R parsed 99.2%)
    calls P 100.0% · R 100.0% n/a n/a n/a P 100.0% · R 97.0% (R parsed 100.0%)
    call_targets P 100.0% · R 100.0% n/a n/a P 98.1% · R 71.7% (R parsed 71.7%) P 100.0% · R 96.6% (R parsed 100.0%)
    copybooks P 100.0% · R 100.0% P 100.0% · R 68.9% (R parsed 98.7%) n/a P 100.0% · R 98.9% (R parsed 100.0%) P 100.0% · R 97.5% (R parsed 100.0%)
    data_items P 99.9% · R 99.9% P 99.5% · R 67.5% (R parsed 99.2%) n/a n/a P 99.8% · R 92.2% (R parsed 99.8%)
    pic P 99.8% · R 100.0% P 99.8% · R 70.1% (R parsed 99.3%) n/a n/a P 99.8% · R 90.6% (R parsed 100.0%)
    usage P 99.9% · R 100.0% P 100.0% · R 75.1% (R parsed 99.3%) n/a n/a P 100.0% · R 81.6% (R parsed 100.0%)
    occurs P 100.0% · R 100.0% P 51.4% · R 28.1% (R parsed 50.0%) n/a n/a P 100.0% · R 96.9% (R parsed 100.0%)
    redefines P 100.0% · R 100.0% P 100.0% · R 63.7% (R parsed 100.0%) n/a n/a P 100.0% · R 97.5% (R parsed 100.0%)
    value P 95.7% · R 98.6% P 95.2% · R 66.5% (R parsed 98.4%) n/a n/a P 94.7% · R 83.6% (R parsed 98.0%)
    layouts P 100.0% · R 100.0% n/a P 100.0% · R 89.5% (R parsed 100.0%) n/a n/a
    sql_access P 100.0% · R 100.0% n/a n/a P 100.0% · R 78.3% (R parsed 78.3%) P 100.0% · R 100.0% (R parsed 100.0%)
    cics_commands P 100.0% · R 100.0% n/a n/a n/a P 100.0% · R 90.2% (R parsed 99.7%)
    cics_files P 100.0% · R 100.0% n/a n/a P 81.5% · R 84.6% (R parsed 84.6%) P 100.0% · R 96.2% (R parsed 100.0%)

    P = correct / reported, R = correct / true over (file, value) pairs; R parsed counts only the files the source parsed. n/a = the source does not produce that channel.

    Agreement with the engine (|A ∩ B| / |A ∪ B| on files both parsed)

    channel che4z cobrix mapa tree-sitter-cobol-enterprise
    program_ids 95.2% n/a 99.2% 100.0%
    units 98.6% n/a n/a 99.0%
    unit_extents 97.3% n/a n/a 96.4%
    edges 98.8% n/a n/a 98.1%
    calls n/a n/a n/a 100.0%
    call_targets n/a n/a 70.7% 100.0%
    copybooks 98.7% n/a 100.0% 100.0%
    data_items 99.1% n/a n/a 99.9%
    pic 99.3% n/a n/a 99.9%
    usage 99.2% n/a n/a 99.9%
    occurs 34.0% n/a n/a 100.0%
    redefines 100.0% n/a n/a 100.0%
    value 99.5% n/a n/a 97.6%
    layouts n/a 99.9% n/a n/a
    sql_access n/a n/a 78.3% 100.0%
    cics_commands n/a n/a n/a 99.7%
    cics_files n/a n/a 71.0% 100.0%

    How to read it

    Adjudicated disagreements (at least 3 sampled per pattern, against the source)

    pattern count verdict
    tree-sitter fails CBL CICS(SP) programs (zECS ZECS000/001/003) 3 files referee wrong (dialect gap)
    tree-sitter phantom paragraph PADFLPCB / PAUTBPCB from ENTRY ... USING (DBUNLDGS, PAUDBLOD, PAUDBUNL) 3 units + 10 edges referee wrong
    tree-sitter exit-paragraph extent stops before EXEC SQL INCLUDE / COPY in PROCEDURE (COTRTLIC 9550, COTRTUPC 9800, COCRDSLC) 13 definitional (key + engine count the copied code)
    tree-sitter misses ZECSPLT paragraphs / START / WRITEQ inside an ERROR region 11 units referee wrong
    tree-sitter DBCS names (KYUYO02 賞与額 → Z) 2 referee wrong
    tree-sitter / Che4z have a main-line extent, the engine has none (CBACT0xC, ECS001, ZECS00x) 15 engine gap (by design, #4302)
    engine PERFORM TEST / 3 / WS-N (ACCTRPT, BANKDATA A010) 8 engine wrong (open #4305)
    engine IDMS sections as units (LNIDMS01) 3 engine wrong (open #4306)
    engine misses the self GO TO 8500-READTRNX-READ (CBSTM03A) 1 engine wrong, deliberate (#3362)
    engine extent CDW010 L1407-1436 vs L1433 (key, tree-sitter, Che4z) 1 engine wrong, new (draft B)
    engine VALUE of a continued literal (CBSTM03A HTML-L08 ...) 11 engine wrong, new (draft A); the key is wrong too
    engine, tree-sitter and Che4z read VALUE +18 / +0 / -1; the key has null (lgacdb01 L83, ABNDPROC L40, CBPAUP0C L82) 83 key wrong
    key names 10 PIC X(20) VALUE ... as PIC (COPAUS1C L58-67); engine FILLER 10 key wrong
    key VALUE X'0D25' → X (ZECS001 L45, ZECS003 L49) 3 key wrong
    key COMM-OVERDR value 'TO' (last DATA DIVISION item, BNK1CAC L157 and 9 more) 10 key wrong (key-side twin of #4329)
    key strips a literal's leading / trailing blanks (' LGACDB01') many definitional (the scorer trims both sides)
    Cobrix pic xXXXXX = 5 bytes (GETSCODE) 1 referee wrong
    Che4z occurs without DEPENDING ON (COPAUS1C L153, COTRTLIC L494, COTRTUPC L341) 17 referee export gap
    mapa misses LINK PROGRAM(WS-ABEND-PGM) (BNK1CCA, BNK1DAC, BNK1CRA) 41 referee wrong
    mapa misses CBSA DB2 access (XFRFUN SELECT ... FROM ACCOUNT, DELACC, BANKDATA) 13 referee wrong
    mapa ZF-FCT as a file name (ZECS000/001) 15 referee wrong (unresolved operand)

    Recommendation

    • Keep Cobrix as the layout / byte-offset referee. It is cheap (one JVM run per corpus, ms per copybook) and exact where it parses. Its rejections (POINTER, 77, lowercase PIC, .dcl) are easy to report as "not attempted" rather than as disagreements.
    • Keep tree-sitter-cobol-enterprise as the fast, broad structural referee: units, extents, edges, calls, COPY, data items, typed CICS / SQL, with no JVM and Python bindings. Upstream fixes would help it: CBL / PROCESS cards, ENTRY, DBCS names. It is also the strongest Translator front-end bake-off: which COBOL parser should the det translator use? #4378 front-end candidate seen here.
    • Che4z: keep, but drive it over LSP (documentSymbol + diagnostics) instead of the 2.5.1 analysis CLI. The CLI's CALL crash and AST-serialisation failures cost it about a quarter of the members. Where it works, it is the most independent industrial referee (preprocessor + copybook resolution).
    • mapa: keep only for the call-tree / JCL channels, as a secondary opinion. It is precise but silently incomplete on CBSA, and it does not flag what it drops.
    • Skip ProLeap / cobol-rekt for now. Two structural referees plus Cobrix already over-determine every channel except dynamic call resolution, and neither tool adds dialect coverage.
    • Next:
      • Fix the four key-quality findings, so engine-vs-key numbers stop carrying key noise.
      • Add a "referee majority" column (engine vs 2-of-3 referees).
      • Run nightly rather than as a CI gate. JVM start-up and the 5-minute grammar generation make it a poor PR gate.

    🤖 Generated with Claude Code

  3. squid-protocol commented on Oct 5, 2026

    @squid-protocol
    OwnerAuthor

    Closing: the first measured pass is complete. The tooling merged in #4384 and the scorecard is above. Every finding against the engine (#4302, #4305, #4306, #4391, #4392) and against the answer keys (#4393) is fixed. Result: on the five CICS estates the engine read 242/242 members and scored 99–100% against the keys; where the referees parse, they agree with it at 96–100% on every structural channel. Remaining improvements (re-score on current main, referee-majority column, Che4z over LSP, nightly run) continue in #4438. Referees stay test-only.

  4. added
    scope:infra
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlegacy-modernizationscope:infratesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions