Skip to content

COBOL record_data: read a signed (and leading-point) numeric VALUE (#4277) - #4346

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4277-signed-value
Oct 4, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4277-signed-value

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #4277

What was broken

mainframe_boundary._VALUE_CLAUSE's bareword alternative had to start with a letter or digit, so three shapes went wrong:

The fix

The bareword may now open with a sign and/or a decimal point when a digit follows: (?:[+-](?=\.?[0-9]))?(?:\.(?=[0-9]))?. These are unchanged:

Evidence

  • lgicdb01.cbl:35 WS-ABSTIME: value None → +0.
  • New tests in tests/cobol_mainframe/test_signed_value_4277.py. The first fails on main. It covers +0, -1, VALUE IS -12.5, +.5, and a sign on the next line. The second test pins the non-cases.

Golden-master diff (both legs regenerated, identical)

  • Record Layout only: 205 items in 57 files gain their VALUE, and no other field moves.
    • 198 were None and now read a signed literal: +0 ×68, -4 ×9, +10 ×8, -8.32 ×7, …
    • 4 were None and now read a leading-point literal: NIST .25, .01, .19, .1.
    • 3 were IS and now read the real literal: NC1344 -1.06, +10.1, -1.
  • pytest -m golden_crucible passes in both venvs.

Ground-truth ledger

ground_truth_ledger.py check is clean. tests/cobol_mainframe and tests/extraction pass with the pinned corpora (10,963).

Local checks

mypy_audit --ci, ruff_audit --ci (0.16.0), dead_key_audit --ci: nothing new.

🤖 Generated with Claude Code

…4277)

_VALUE_CLAUSE's bareword could not open with a sign or a decimal point,
so `VALUE +0` / `VALUE -1` / `VALUE .25` read no value at all, and
`VALUE IS -1.06` backtracked to read the keyword `IS` as the value. A
sign (or point) now opens the bareword when a digit follows; `VALUE - 1`
and a quoted '-' are unchanged.

Golden masters regenerated in both legs: 205 record_data VALUEs gained in
57 files, nothing else moved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 4, 2026 18:17
@squid-protocol
squid-protocol merged commit 0c513c9 into main Oct 4, 2026
32 checks passed
@squid-protocol
squid-protocol deleted the fix/4277-signed-value branch October 4, 2026 18:17
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: signed VALUE (VALUE +0, VALUE -1) is dropped

1 participant