fix(cobol): func_start no longer mistakes LE service calls for paragraphs - #2552
Merged
Merged
Conversation
…aphs Closes #2538. `CEE3DMP.`/`CEEMOUT.`/`CEEDUMP.` (Language Environment runtime diagnostic calls) sitting alone on a line indented into Area B were counted as paragraph headers -- func_start's reserved-word shield had no entry for them, and the post-sequence-area whitespace slot tolerates any horizontal indent to support genuinely free-format source, so it can't distinguish Area A from Area B on its own. Traced #2489 (the previous func_start sequence-area hardening) to confirm this wasn't a deliberate decision -- that PR only fixed vertical-whitespace handling, unrelated to column position. Fix: add CEE3DMP/CEEMOUT/CEEDUMP to the reserved-word shield, the same low-risk pattern already used repeatedly in this file (CONTINUE, LOCAL-STORAGE, SOURCE-COMPUTER/OBJECT-COMPUTER). These three are already a recognized class elsewhere in cobol.py (the `telemetry` rule). A general Area-A column anchor was considered and deferred -- the existing sequence-area consumer can't reliably tell a genuine fixed-format sequence number from free-format leading spaces without file-level fixed/free-format detection, a bigger change than this bug warrants. Verification: reproduced the exact FP (5 matches for 3 real paragraphs, now 3), added cases to test_cobol.py/test_cobol_strict.py, full cobol + cross-language strict suites pass, audit_check.py clean, crucible_check.py both modes PASS against the full corpus with zero diffs (these tokens aren't present in the existing corpus). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
squid-protocol
added a commit
that referenced
this pull request
Aug 31, 2026
…engine PRs (#2557) (#2617) The engine had no rosetta gate: a PR shifting corpus-observed counts merged green here and detonated keyword-rosetta later on an unrelated PR (the #2552 cobol drift surfaced days late that way). rosetta-audit.yml now checks out keyword-rosetta at the pinned KEYWORD_ROSETTA_REF Actions variable (set: 7686b0a) and runs all 46 verify gates + the corpus's baseline-gated n/a review audit against the PR's engine build -- path-filtered to engine code, ~6 min, workflow_dispatch for manual runs. BUMPING_THE_ROSETTA_PIN.md documents the re-baseline protocol (the crucible-pin twin): corpus re-baseline PR with ENGINE_REF=pull/<N>/head -> merge -> engine PR bumps the var. ecosystem.md's rosetta-sweep row updated to the new choreography (no more draft-PR limbo / rerun dance). Cross-repo: companion keyword-rosetta PRs #6 (n/a semantics) + #7 (ENGINE_REF + na_check); the n/a audit step self-activates when the pin advances past #7. Closes #2557 Claude-Session: https://claude.ai/code/session_01PUfXMUECX4Vq1vqh9mMQqt Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2538.
Root cause
CEE3DMP./CEEMOUT.(Language Environment runtime diagnostic calls) sitting aloneon a line indented into COBOL's Area B were counted as paragraph headers by
func_start— the reserved-word negative-lookahead shield had no entry for them,and the post-sequence-area whitespace slot (
[ \t]*) tolerates any horizontalindent to support genuinely free-format source, so it can't distinguish Area A
(paragraph names, columns 8-11) from Area B on its own.
Was this deliberate?
No. #2489 (cited in the issue) is the previous
func_startsequence-areahardening, but it only narrowed the vertical-whitespace slot (
[ \t\n]*→[ \t]*) to fix a debug-line name-mangling bug — unrelated to column position.Confirmed via
git logthat Area A/B has never been discussed or implemented inthis file's history before this issue.
Fix
Added
CEE3DMP|CEEMOUT|CEEDUMPtofunc_start's existing reserved-word shield —the same low-risk, precedent-backed fix pattern already used repeatedly in this
exact file (
CONTINUEfor #1890's sibling class,LOCAL-STORAGE,SOURCE-COMPUTER/OBJECT-COMPUTER). These three tokens are already a recognizedclass elsewhere in
cobol.py(thetelemetryrule), so this reuses an existingcategorization rather than inventing a new one.
Considered and deferred: a general Area-A column anchor (the issue's other
option). The existing optional 6-char sequence-area consumer is itself a loose
heuristic —
[0-9a-zA-Z \t]{6}happily matches 6 leading spaces in a free-formatfile too, so "did the sequence-area group engage" doesn't reliably distinguish a
genuine fixed-format line from a free-format one. A correct structural fix needs
file-level fixed/free-format detection, which is a materially bigger change than
this specific bug warrants — left as a follow-up if the general class (any bare
token in Area B, not just these three) needs closing later.
Verification
func_startmatches for 3 real paragraphs(
CEE3DMP./CEEMOUT.both miscounted); confirmed the fix brings it back to 3.tests/extraction/languages/test_cobol.py(invalid-match cases)and
test_cobol_strict.py(reserved-verb exclusion sweep).test_cobol.py+test_cobol_strict.py: 148 passed.tests/core_engine/test_language_standards_strict.py: 21 passed.tests/tools/audit_check.py: clean (ruff/mypy/dead-key/ast-accuracy).tests/tools/crucible_check.py(bothfull_precisionandzero_dependencymodes, full corpus): PASS, zero diffs — these tokens aren't present in the
existing golden-master/crucible corpus, so no other output changed.
🤖 Generated with Claude Code