Skip to content

Fix #3984: name the program's DECIMAL-POINT in its port ticket; pin the VSAM entity under it - #3990

Merged
squid-protocol merged 1 commit into
mainfrom
fix/3984-decimal-point-comma
Sep 29, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/3984-decimal-point-comma

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Resolves #3984

Finding

The issue's silent corruption (PIC 999,99 → BigDecimal scale 0, 123,45 read as 12345) does not reproduce on main. A real scan of a VSAM estate with DECIMAL-POINT IS COMMA generates:

@Column(name = "EU_AMT", length = 6)
private String euAmt;            // r.euAmt = CobolRecords.text(rec, 8, 6, text);
@Column(name = "EU_RAW", precision = 7, scale = 2)
private BigDecimal euRaw;        // PIC S9(5)V99

_pic_numeric returns None for any edited PICTURE, and java_type makes it a String column, so the value round-trips as written. Only plain 9/S/V/P PICTUREs become BigDecimals, and DECIMAL-POINT IS COMMA can't change how those are read. Detection of the clause (Required Action 1) already exists via special_names (#3820/#3827/#3911), and the schema and Spring forges already use it.

Changes

  • Regression tests (test_decimal_comma.py): a real scan → refractor → cobol-to-java run pins that the VSAM entity of a comma program keeps 999,99 / ZZZ.ZZ9,99 as String text columns and S9(5)V99 as precision = 7, scale = 2.
  • Port ticket gap: rules 10 and 11 only said generically to pass ',' / decimalComma "when the program codes DECIMAL-POINT IS COMMA", leaving the porter (an AI agent) to find the clause. The new decimal_point_rules adds a rule to that program's ticket naming its decimal point and its SPECIAL-NAMES line. It honours culture.decimal_point the same way the entities do (period overrides the program, comma forces it). A program without the clause keeps exactly today's rules, which the test asserts.
  • dead_key_audit.py: allowlist decimal_point. It's written by target_as_dict's vars() over the Culture dataclass, which the walker can't trace.

Verification

  • tests/cobol_mainframe: 997 passed, 50 skipped
  • ruff / mypy / dead-key audits: no new findings; the touched files are ruff format clean
  • No parsing logic touched, so no crucible run was needed.

🤖 Generated with Claude Code

…he VSAM entity under it

The silent 123,45 -> 12345 corruption the issue describes does not occur on main:
the repository forge's _pic_numeric rejects an edited PICTURE (999,99), so the
VSAM entity keeps it as its display text (a String column, byte for byte), and
only plain 9/S/V/P PICTUREs -- which DECIMAL-POINT IS COMMA cannot change --
become BigDecimals. New tests pin that through a real scan.

The remaining gap: the port ticket only said generically to pass ',' /
decimalComma "when the program codes DECIMAL-POINT IS COMMA", leaving the porter
to find it. decimal_point_rules now adds a rule naming this program's decimal
point (with its SPECIAL-NAMES line), honouring culture.decimal_point as the
entities do; a program without it keeps today's rules.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@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 70bcab7 into main Sep 29, 2026
37 checks passed
@squid-protocol
squid-protocol deleted the fix/3984-decimal-point-comma branch September 29, 2026 11:57
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.

Globe: DECIMAL-POINT IS COMMA Silently Corrupts Numeric Scale

1 participant