FAILURE MAP
← Case archive

FA-99761 / Tool call schema validation / Open access

Enum membership ignores JSON value type · case 01

Enum membership ignores JSON value type.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Host-language equality collapses distinct JSON scalar types.

THE FAILURE

Host-language equality collapses distinct JSON scalar types.

Unsuccessful approach: Rejecting booleans whenever any integer choice exists fixes the numeric collision but rejects a valid boolean in a mixed enum.

Case contract

JSON-like enum membership requires both equal type and equal value, so true differs from integer one.

Why this case matters

Tool argument validation prevents malformed structured payloads from entering a deterministic downstream operation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(value, choices):
    return value in choices
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matching integer',solve(N,[N,'x']),True)
check('bool differs from one',solve(True,[1]),False)
check('matching false',solve(False,[False]),True)
check('bool alongside integer choice',solve(True,[True,1]),True)
check('string differs',solve('1',[1]),False)
check('empty choices',solve('x',[]),False)
check('unlisted',solve('z',['a','b']),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
matching integerTrueTruePassed
bool differs from oneTrueFalseFailed
matching falseTrueTruePassed
bool alongside integer choiceTrueTruePassed
string differsFalseFalsePassed
empty choicesFalseFalsePassed
unlistedFalseFalsePassed

SHA-256 / 03fbac20237e9d3c4b79a9f7fc7799739e7a79fd5891d649bd8a613142cd239b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(value, choices):
    return value in choices and not (isinstance(value,bool) and any(type(x) is int for x in choices))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matching integer',solve(N,[N,'x']),True)
check('bool differs from one',solve(True,[1]),False)
check('matching false',solve(False,[False]),True)
check('bool alongside integer choice',solve(True,[True,1]),True)
check('string differs',solve('1',[1]),False)
check('empty choices',solve('x',[]),False)
check('unlisted',solve('z',['a','b']),False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
matching integerTrueTruePassed
bool differs from oneFalseFalsePassed
matching falseTrueTruePassed
bool alongside integer choiceFalseTrueFailed
string differsFalseFalsePassed
empty choicesFalseFalsePassed
unlistedFalseFalsePassed

SHA-256 / ee10938a38708a7a45ed48ce2bec99c023d2499c09eb9ed1d082fa672da12347

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Self-contained toy JSON-like schema contract over in-memory Python values; no compatibility with a production schema standard or callable binding is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:28.064245+00:00.

Case digest / bd27ad8dba33dc61ac0494f57cfb3e8d6f690e8d1a7d83272363b800cca4eeb6