Repository navigation
Description
Description
Found via the new tri-comparison tool (tests/tools/tri_comparison_chart.py on feature/tri-comparison-audit), which checks GitGalaxy's own extraction against tree-sitter and universal-ctags with neither treated as ground truth — cobol is one of the 9 languages tree-sitter has no grammar for at all, so this is the first external check cobol's class detection has ever had.
Across the full pinned language-crucible cobol corpus (34 files), GitGalaxy's class_data returns zero rows for every file that ctags independently identifies a PROGRAM-ID on — 0/19 real occurrences found, where ctags finds 19/19.
gitgalaxy/standards/language_standards.py's cobol class_start regex explicitly lists PROGRAM-ID as a matched keyword:
"class_start": re.compile(
r"^(?:[0-9a-zA-Z \t]{6}[ \-]?)?[ \t]*(?:PROGRAM-ID|CLASS-ID|INTERFACE-ID|FACTORY|OBJECT)\.\s+([A-Za-z0-9_-]+)(?:[ \t\n]+(?!DIVISION\b)[A-Za-z0-9_-]+){0,6}(?=[ \t]*\.|\n|$)",
...
)but it isn't producing any real class_data rows on production COBOL source.
Steps to Reproduce
Real, confirmed example — language-crucible/data/cobol/cics-banking-sample-application-cbsa/BANKDATA.cbl, line 35:
PROGRAM-ID. BANKDATA.ctags finds it (kind:P "program", line 35). GitGalaxy's class_data for this file is empty. Same shape confirmed on at least 4 more files in the same corpus subdirectory (BNKMENU.cbl, XFRFUN.cbl, cics-genapp/lgacdb01.cbl, cics-genapp/lgacdb02.cbl).
Note: GitGalaxy's cobol function detection (paragraphs) is working and non-trivial (126/259 real occurrences matched against the corpus) — this looks isolated to class_start specifically, not a language-routing or corpus problem (cobol files are being correctly identified as language="cobol" in file_data).
Why this wasn't caught before
#1264 (closed) covered class detection regressions for apex/csharp/fortran/solidity but did not include cobol. #854 (closed, "Extraction hardening: cobol") predates any real-corpus check against cobol specifically — until this tri-comparison tool, cobol had no tree-sitter grammar to diff against and no external validator at all, so a 0%-match regex could pass every synthetic unit test in tests/extraction/languages/test_cobol_strict.py while silently not firing on real production formatting (sequence-number columns, continuation, etc.).
Suggested next step
Reproduce directly against the regex in isolation with real corpus lines (starting with the BANKDATA.cbl example above) to find where the match is failing — worth checking the leading (?:[0-9a-zA-Z \t]{6}[ \-]?)? sequence-number-column allowance against this file's actual column formatting first, since that's the part most likely to differ from the synthetic test fixtures.
Evidence
Full discrepancy record (19 total occurrences, up to 10 examples) in docs/self_scan/tri_comparison_ledger.json, shape cobol/class/existence/agree[ctags]_vs[gitgalaxy], once feature/tri-comparison-audit merges.
Activity
squid-protocol commentedon Aug 20, 2026
Corrected root cause (found via tri-comparison-ledger-sweep, 2026-08-19)
The original diagnosis here is wrong on one key point: the
class_startregex does matchPROGRAM-IDin real corpus source. Verified directly:The real bug is one step downstream:
gitgalaxy/core/detector.py's_CLASS_START_NAMED_EXTRACTION_LANGS(line 369-402) is an allowlist gating which languages use their ownclass_startrule for named-entity extraction (added by epic #1295, closed 2026-08-12, 11/13 languages done)."cobol"was never added to it — not decided out like css/html, just never considered, because #1295's own verification method (tree_sitter_accuracy_audit.py) requires a tree-sitter grammar as ground truth, and cobol has none.Any language missing from that allowlist falls through to a hardcoded, language-agnostic fallback regex (
detector.py:733-735):r"^\s*(?:export\s+|public\s+|abstract\s+)?(?:class|struct|interface|trait|enum)\s+([a-zA-Z0-9_]+)..."which structurally cannot match
PROGRAM-ID. BANKDATA.(noclass/struct/interface/trait/enumkeyword ever appears in COBOL). That's whyclass_datacomes back empty for every cobol file despite the language's ownclass_startregex working correctly — the correct match is computed (and feeds the numericclass_startrisk-signal count) but discarded before named-entity output.Fix: add
"cobol"to_CLASS_START_NAMED_EXTRACTION_LANGSingitgalaxy/core/detector.py. Since cobol has no tree-sitter grammar, verification for this one can't use #1295's standardtree_sitter_accuracy_audit.pymethod — use ctags as the alternate ground truth instead (already available intests/tools/ctags_reader.py/the tri-comparison harness this was found through), confirming class recall goes from 0/19 to 19/19 (or close) after the allowlist add.Full discrepancy record:
docs/self_scan/tri_comparison_ledger.json, shapecobol/class/existence/agree[ctags]_vs[gitgalaxy].docs: add §9 tri-comparison section to cobol language-status doc
docs: add cobol language-status doc (sections 1-8) (#1893)
docs(self-scan): validate all 3 cobol tri-comparison ledger shapes (#…
docs: honest CICS / mainframe coverage in the language status docs (#…