FAILURE MAP
← Case archive

FA-99811 / Tool call schema validation / Open access

Nullable field rejects null before applying its base type · case 01

Nullable field rejects null before applying its base type.

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

ROOT CAUSE

The base type test runs without a null union branch.

THE FAILURE

The base type test runs without a null union branch.

Unsuccessful approach: Using isinstance for the base-type check admits bool values in an integer schema because bool subclasses int.

Case contract

A nullable value is valid when it is None or its exact type equals base_type.

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, base_type):
    return type(value) is base_type
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('null branch',solve(None,int),True)
check('integer branch',solve(N,int),True)
check('bool not int',solve(True,int),False)
check('wrong scalar type',solve('x',int),False)
check('false null-like',solve(False,str),False)
check('null string type',solve(None,str),True)
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
null branchFalseTrueFailed
integer branchTrueTruePassed
bool not intFalseFalsePassed
wrong scalar typeFalseFalsePassed
false null-likeFalseFalsePassed
null string typeFalseTrueFailed

SHA-256 / 5a2b879ead34f2ec305833d69ec0f2134a9929b38971eaf10eef52d54648214f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(value, base_type):
    return value is None or isinstance(value,base_type)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('null branch',solve(None,int),True)
check('integer branch',solve(N,int),True)
check('bool not int',solve(True,int),False)
check('wrong scalar type',solve('x',int),False)
check('false null-like',solve(False,str),False)
check('null string type',solve(None,str),True)
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
null branchTrueTruePassed
integer branchTrueTruePassed
bool not intTrueFalseFailed
wrong scalar typeFalseFalsePassed
false null-likeFalseFalsePassed
null string typeTrueTruePassed

SHA-256 / 63952c9e7173f93270052b2a08c7f9f72a291dfdef7c8b742e297d6347587ad7

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 6 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.523159+00:00.

Case digest / 94b2cbcac5c1daff8404478e25a3e02c184baefa382876aae289719234fc1f99