Skip to content

Harness numeric comparison is lenient: int() accepts spaces, + and _; sign nibble and ±0 not compared #3830

Closed

Description

@squid-protocol

equivalence_common.decode_field uses Decimal(int(text)). Python's int() accepts ' 12' and '1_2' (probe), so " 12" (spaces left by a MOVE) compares equal to "0012". The COMP-3 C/F sign nibble and ±0 are not compared either. Not cultural, but it masks data-shape bugs in every cell.

Fix: Compare the raw field bytes too, or reject non-digit characters before int().

Found by a cultural-assumptions audit (2026-09-26): confirmed in code or by probe (JDK 17 locales, IBM code-page decoding, the harness's GnuCOBOL image) unless marked plausible.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    on Sep 26, 2026
  2. added a commit that references this issue on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions