Styxis
Company
Knowledge

Runtime differences in ProtoJSON quoted numbers: define the exchange policy from raw tokens

Separate a runtime’s numeric acceptance from the exchange contract.

The raw token before conversion

Separate a runtime’s numeric acceptance from the exchange contract. Apply an approved ASCII-digit policy at the boundary while preserving raw input. Give Truthound raw-token observations as well as converted values so one runtime’s acceptance is not mistaken for approved portability. [1, 2, 3]

Intended behavior and compatibility costs

Protobuf #29893 reports Python and Java accepting non-ASCII decimal digits in quoted numeric fields while C++ rejects them. A maintainer confirms ASCII behavior as intended but notes compatibility costs of tightening existing acceptance. A string-field control preserves the characters, distinguishing this numeric path from general UTF-8 handling. [1]

A runtime acceptance matrix

Send the same quoted token to multiple runtimes and record an acceptance matrix. Do not silently admit non-ASCII digits under an ASCII-only contract. Preserve codepoints and field kind before numeric conversion, keeping numeric admission separate from preservation of the user’s language strings. [1, 3]

١٢٣ and ASCII 123

The illustrative exchange contract accepts ASCII 0~9 only. Token ١٢٣ therefore has expected admission 0. Boundary admission 0 meets that rejection policy; admitting it as 1 merely because Python obtains 123 fails. ASCII 123 is a valid control, so this is not a rule rejecting every numeric string. [1, 3]

Compare policy flags

Truthound Core Python SDK 3.3.2 can compare prepared ascii_policy_admission and admitted_by_boundary through ColumnPairValidator with relationship="==". The operator supplies non-missing flags from the raw-token policy and observations. The SDK does not change runtime parsers or Protobuf compatibility policy, or prohibit ordinary localized strings. [1, 2, 3]

Preserve language strings separately

Choose either an approved explicit Unicode-digit normalization stage or ASCII-only exchange input. Preserving the same characters in a string field is a separate valid contract. Do not retain only converted 123 and erase the original token. [1, 3]

Application conditions

Preserve raw tokens before numeric conversion, distinguishing string fields and an explicit ASCII-only numeric policy.

Alternatives

Use an approved explicit digit normalization stage or accept only ASCII exchange representations.

Limitations

  • The SDK does not change parsers or compatibility policy; the numeric rule does not prohibit localized strings.

Evidence

Event checked
Subject checked
Modified