Skip to content

fix(cobol): func_start no longer mistakes LE service calls for paragraphs - #2552

Merged
squid-protocol merged 1 commit into
mainfrom
fix/2538-cobol-func-start-le-service-tokens
Aug 31, 2026
Merged

fix(cobol): func_start no longer mistakes LE service calls for paragraphs#2552
squid-protocol merged 1 commit into
mainfrom
fix/2538-cobol-func-start-le-service-tokens

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #2538.

Root cause

CEE3DMP./CEEMOUT. (Language Environment runtime diagnostic calls) sitting alone
on 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 horizontal
indent 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_start sequence-area
hardening, 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 log that Area A/B has never been discussed or implemented in
this file's history before this issue.

Fix

Added CEE3DMP|CEEMOUT|CEEDUMP to func_start's existing reserved-word shield —
the same low-risk, precedent-backed fix pattern already used repeatedly in this
exact file (CONTINUE for #1890's sibling class, LOCAL-STORAGE,
SOURCE-COMPUTER/OBJECT-COMPUTER). These three tokens are already a recognized
class elsewhere in cobol.py (the telemetry rule), so this reuses an existing
categorization 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-format
file 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

  • Reproduced the exact FP locally: 5 func_start matches for 3 real paragraphs
    (CEE3DMP./CEEMOUT. both miscounted); confirmed the fix brings it back to 3.
  • Added cases to 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 (both full_precision and zero_dependency
    modes, 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

…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>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 8880281 into main Aug 31, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/2538-cobol-func-start-le-service-tokens branch August 31, 2026 16:32
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>
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 func_start counts a bare token + period in Area B as a paragraph (CEE3DMP.)

1 participant