Skip to content

COBOL: a paragraph named END-... is a unit; only reserved END- words are terminators (#4031) - #4069

Merged
squid-protocol merged 1 commit into
mainfrom
fix/cobol-end-paragraphs-4031
Oct 1, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/cobol-end-paragraphs-4031

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4031.

The engine's COBOL func_start shield excluded every END-... word as a scope terminator, so a legal paragraph named END-... was never a unit. It now excludes only the reserved END- words, using the list #4028 gave the graveyard finder (COBOL 2014, IBM Enterprise COBOL, GnuCOBOL).

Why galaxyscope's output changes (golden masters re-blessed, both modes)

  • NIST CCVS85 (language-crucible): about 600 paragraphs named END-ROUTINE, END-ROUTINE-1, END-RTN-EXIT and so on are real (PERFORM END-ROUTINE THRU END-ROUTINE-13) and were missed. COBOL unit, archetype and composition counts rise. Every file's map coordinates move slightly with the totals, which accounts for most of the 3,345 changed values.
  • cics-genapp: END-PROGRAM is now a unit in the 5 programs the issue names. In the ground-truth ledger, units tp goes from 157 to 162, the 5 #4031 rows are ratcheted away, and the fixed cause is removed.
  • In 3 of those 5 programs, END-PROGRAM is reached only by fall-through. The engine's unreferenced-by-name census therefore flags them, and they are assigned to the existing deliberate cause engine_dead_is_unreferenced_by_name (orphaned_logic reports 100% dead code for five languages whose invocation model never names the callee — the family #2727 closed without covering #2806: usage_status is a name census, not reachability). The 2 programs that name it (PERFORM / GO TO) are correctly not flagged.

Tests: END-PROGRAM, END-IPROC1 and End-Program are units, while END-IF, END-PERFORM and END-EXEC are not. The carried-forward invalid case END-TargetFunc. encoded the old behaviour and is now a valid one.

The full tests/ tree passes with language-crucible v1.6.0 and the mainframe corpora present (13,247 passed). audit_check is clear.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ

…ND- words are terminators

The engine's COBOL func_start shield excluded every `END-...` word as a
scope terminator, so a legal paragraph named END-... was never a unit.
It now excludes only the reserved END- words -- the list #4028 gave the
graveyard finder (COBOL 2014 / IBM Enterprise COBOL / GnuCOBOL).

Golden masters re-blessed (both modes), because galaxyscope's output
changes on real code: the NIST CCVS85 suite in language-crucible names
~600 paragraphs END-ROUTINE / END-ROUTINE-1 / END-RTN-EXIT / ...
(`PERFORM END-ROUTINE THRU END-ROUTINE-13`) that the engine missed; COBOL
units and archetype counts rise, and every file's map coordinates move
slightly with the totals. cics-genapp's END-PROGRAM is a unit in 5
programs (ground-truth ledger: units tp 157 -> 162, the 5 #4031 rows
ratcheted away, the fixed cause removed). Three of those END-PROGRAMs are
reached only by fall-through, so the engine's unreferenced-by-name census
flags them -- assigned to the existing deliberate cause (#2806: usage_status
is a name census, not reachability).

Tests: END-PROGRAM / END-IPROC1 / End-Program are units, END-IF /
END-PERFORM / END-EXEC are not; the carried-forward `END-TargetFunc.`
invalid case was the old behaviour and is now a valid one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 4f53a4c into main Oct 1, 2026
39 checks passed
@squid-protocol
squid-protocol deleted the fix/cobol-end-paragraphs-4031 branch October 1, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COBOL engine: a paragraph named END-... is not a unit (function-start rule excludes every END- word)

1 participant