Skip to content

tests/tools/ctags_reader.py's cobol CTAGS_FUNC_KINDS drops section-kind tags, undercounting ctags-side cobol function readings #1891

Closed

Description

@squid-protocol

Description

Found investigating tri-comparison ledger shape cobol/function/existence/agree[gitgalaxy]_vs[ctags] (verified via tri-comparison-ledger-sweep, Gemini-dispatched read-only investigation, cross-checked directly against source and a live ctags run).

tests/tools/ctags_reader.py's CTAGS_FUNC_KINDS["cobol"] is {"p"} (paragraph kind only):

"cobol": {"p"},  # paragraph -- GitGalaxy's own func_start for cobol targets paragraphs

That inline comment is factually wrong — gitgalaxy/standards/language_standards.py's own func_start docstring for cobol says it anchors "Executable Logic Anchors... Paragraphs and Sections", and the regex does capture SECTION headers (e.g. MAINLINE SECTION.). Universal Ctags tags these as a distinct section kind (letter s), separate from paragraph (letter p):

$ ctags --list-kinds-full=Cobol
p       paragraph  yes     no      0      NONE   paragraphs
s       section    yes     no      0      NONE   sections

Because ctags_reader.py only reads kind p, every real COBOL SECTION header that both GitGalaxy and ctags correctly identify shows up in the tri-comparison tool as a false "GitGalaxy-alone" disagreement — ctags' own reading is silently dropped before comparison, not actually missing.

Steps to Reproduce

language-crucible/data/cobol/cics-genapp/lgacdb01.cbl:128:

       MAINLINE SECTION.
$ ctags --languages=Cobol --fields=+K -o - lgacdb01.cbl | grep MAINLINE
MAINLINE  .../lgacdb01.cbl  /^       MAINLINE SECTION.$/;"  section

ctags correctly tags this as kind section, but ctags_reader.py's CTAGS_FUNC_KINDS["cobol"] = {"p"} filters it out, so the tri-comparison tool records it as "ctags: null" — a manufactured disagreement, not a real one. Same pattern confirmed for TIMESTAMP SECTION. (cics-banking-sample-application-cbsa/BANKDATA.cbl:1441).

Suggested fix

tests/tools/ctags_reader.py: change "cobol": {"p"} to "cobol": {"p", "s"} and correct the stale inline comment.

Evidence

Full discrepancy record in docs/self_scan/tri_comparison_ledger.json, shape cobol/function/existence/agree[gitgalaxy]_vs[ctags] (majority of 18 occurrences; the LOCAL-STORAGE example in the same shape is a separate, unrelated real GitGalaxy false-positive bug, tracked separately).

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernizationtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions