Styxis
Company
Knowledge

Protobuf enum option {}: test wrapper presence separately from string presence

Distinguish option-wrapper presence from presence of the string field.

An unprovided string in an empty wrapper

Distinguish option-wrapper presence from presence of the string field. An empty wrapper with no string should preserve the approved fallback name. Separate empty string, missing and null in Truthound inputs; collapsing all of them to an empty cell would hide loss of a code’s JSON name. [1, 2, 3]

Distinguish execution from source inference

Protobuf #30949 reports different interpretations of enum JSON option {}: some paths treat it as an empty custom name while Go treats it as unset. The maintainer clarifies that omitting string should preserve fallback behavior. The initial Go output was verified, while C++ and PHP output was inferred from source; neither clarification nor inference establishes a released correction. [1]

Three presence controls

Test omitted options, {}, explicit empty strings and aliases across compiler validation and runtimes. Block unauthorized empty JSON names. Use the same controls for alias and collision checks. EMPTY_STRING is an audit label for empty output, not the emitted JSON token. [1, 3]

The LONE_ONE fallback

The illustrative LONE_ONE has option {} with no string field. Under the maintainer-clarified contract, expected name is LONE_ONE. That passes; empty output labeled EMPTY_STRING fails. An explicitly approved .string="" is different from this omitted-string case. [1, 3]

An audit table retaining empty output

Truthound Core Python SDK 3.3.2 can compare prepared approved_enum_name and serialized_enum_name through ColumnPairValidator with relationship="==". The operator extracts both levels of presence and actual output names, labeling empty values explicitly. The SDK does not repair protoc validation or serializers, or turn source inference into execution evidence. [1, 2, 3]

Accept after measuring each runtime

Declare the fallback policy explicitly and include alias and collision controls in cross-runtime tests. Wrapper presence does not imply a provided string. Measure actual output in each runtime before accepting representation compatibility. [1, 3]

Application conditions

Extract wrapper and string presence separately, distinguishing actual empty strings from null and missing.

Alternatives

Apply an explicit fallback option policy and cross-test alias, collision and runtime output behavior.

Limitations

  • The SDK does not repair protoc or serialization; C++ and PHP source inference is not runtime measurement.

Evidence

Event checked
Subject checked
Modified