{"abstract":"Conflicting object members collapse to one value, hiding an ambiguous source document.","category":"Serialization","checks":9,"contract":"Decode any valid JSON value into an {ok, value} envelope. Reject syntax errors and duplicate decoded keys at any object depth with {ok: False}; key reuse in different objects is allowed.","evaluation_group":"model-1d1532676fea2ebf","failed_approach":"Searching raw key text across the whole document rejects legitimate reuse in separate objects and misses escaped equivalent names.","family":"parse-json-duplicate-keys","id":"FA-176","implementations":{"attempt":{"sha256":"4ec55786b9975aaf8df69e2e0550587b9973222af9424640aa62ccfdf9cfce12","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re\ndef reject_constant(value):\n    raise ValueError('non-JSON numeric constant')\nN = 1\nobservations = []\ndef solve(text):\n    keys = re.findall(r'\"([^\"\\\\]*)\"\\s*:', text)\n    if len(keys) != len(set(keys)):\n        return {'ok': False}\n    try:\n        return {'ok': True, 'value': json.loads(text, parse_constant=reject_constant)}\n    except ValueError:\n        return {'ok': False}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicate top-level member', solve('{\"a\":' + str(N) + ',\"a\":0}'), {'ok': False})\ncheck('duplicate nested member', solve('{\"outer\":{\"a\":1,\"a\":2}}'), {'ok': False})\ncheck('same name in separate scopes', solve('{\"a\":' + str(N) + ',\"child\":{\"a\":2}}'), {'ok': True, 'value': {'a': N, 'child': {'a': 2}}})\ncheck('escaped name equals literal name', solve(r'{\"a\":1,\"\\u0061\":2}'), {'ok': False})\ncheck('same member in separate array objects', solve(json.dumps([{'a': i} for i in range(N + 1)])), {'ok': True, 'value': [{'a': i} for i in range(N + 1)]})\ncheck('empty object', solve('{}'), {'ok': True, 'value': {}})\ncheck('valid null differs from decode failure', solve('null'), {'ok': True, 'value': None})\ncheck('malformed syntax', solve('{\"a\":}'), {'ok': False})\ncheck('non-JSON numeric constant rejected', solve('NaN'), {'ok': False})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"a62ccacb2feefff838cd7d64a865e4d0d953bcfa4bdbb48b28a9de086ec350a5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re\ndef reject_constant(value):\n    raise ValueError('non-JSON numeric constant')\nN = 1\nobservations = []\ndef solve(text):\n    try:\n        return {'ok': True, 'value': json.loads(text, parse_constant=reject_constant)}\n    except ValueError:\n        return {'ok': False}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicate top-level member', solve('{\"a\":' + str(N) + ',\"a\":0}'), {'ok': False})\ncheck('duplicate nested member', solve('{\"outer\":{\"a\":1,\"a\":2}}'), {'ok': False})\ncheck('same name in separate scopes', solve('{\"a\":' + str(N) + ',\"child\":{\"a\":2}}'), {'ok': True, 'value': {'a': N, 'child': {'a': 2}}})\ncheck('escaped name equals literal name', solve(r'{\"a\":1,\"\\u0061\":2}'), {'ok': False})\ncheck('same member in separate array objects', solve(json.dumps([{'a': i} for i in range(N + 1)])), {'ok': True, 'value': [{'a': i} for i in range(N + 1)]})\ncheck('empty object', solve('{}'), {'ok': True, 'value': {}})\ncheck('valid null differs from decode failure', solve('null'), {'ok': True, 'value': None})\ncheck('malformed syntax', solve('{\"a\":}'), {'ok': False})\ncheck('non-JSON numeric constant rejected', solve('NaN'), {'ok': False})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"baab9d35afaa65beaa1eae3396bbdee3b05232ecd6515bcdef4b8e03140ebdae","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re\ndef reject_constant(value):\n    raise ValueError('non-JSON numeric constant')\nN = 1\nobservations = []\ndef solve(text):\n    def object_from_pairs(pairs):\n        result = {}\n        for key, value in pairs:\n            if key in result:\n                raise ValueError('duplicate member')\n            result[key] = value\n        return result\n    try:\n        return {'ok': True, 'value': json.loads(text, object_pairs_hook=object_from_pairs, parse_constant=reject_constant)}\n    except ValueError:\n        return {'ok': False}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicate top-level member', solve('{\"a\":' + str(N) + ',\"a\":0}'), {'ok': False})\ncheck('duplicate nested member', solve('{\"outer\":{\"a\":1,\"a\":2}}'), {'ok': False})\ncheck('same name in separate scopes', solve('{\"a\":' + str(N) + ',\"child\":{\"a\":2}}'), {'ok': True, 'value': {'a': N, 'child': {'a': 2}}})\ncheck('escaped name equals literal name', solve(r'{\"a\":1,\"\\u0061\":2}'), {'ok': False})\ncheck('same member in separate array objects', solve(json.dumps([{'a': i} for i in range(N + 1)])), {'ok': True, 'value': [{'a': i} for i in range(N + 1)]})\ncheck('empty object', solve('{}'), {'ok': True, 'value': {}})\ncheck('valid null differs from decode failure', solve('null'), {'ok': True, 'value': None})\ncheck('malformed syntax', solve('{\"a\":}'), {'ok': False})\ncheck('non-JSON numeric constant rejected', solve('NaN'), {'ok': False})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"parse-json-duplicate-keys","generated_at":"2026-09-29T14:36:51.012628+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A strict configuration or signed-message consumer must distinguish repeated members from valid reuse in separate scopes. This contract is stricter than Python's default JSON decoder.","repair":"Reject duplicate decoded member names within every individual object before constructing its dictionary.","root_cause":"The decoder materializes a dictionary before validating the original member pairs.","sha256":"e767858ce1d6fb2c600bd69076fdbad94d6afb2971f2dc99382968dbb1809950","title":"A repeated JSON key silently overwrites a value · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":31.827,"exit_code":1,"observations":[{"actual":{"ok":false},"check":"duplicate top-level member","expected":{"ok":false},"passed":true},{"actual":{"ok":false},"check":"duplicate nested member","expected":{"ok":false},"passed":true},{"actual":{"ok":false},"check":"same name in separate scopes","expected":{"ok":true,"value":{"a":1,"child":{"a":2}}},"passed":false},{"actual":{"ok":true,"value":{"a":2}},"check":"escaped name equals literal name","expected":{"ok":false},"passed":false},{"actual":{"ok":false},"check":"same member in separate array objects","expected":{"ok":true,"value":[{"a":0},{"a":1}]},"passed":false},{"actual":{"ok":true,"value":{}},"check":"empty object","expected":{"ok":true,"value":{}},"passed":true},{"actual":{"ok":true,"value":null},"check":"valid null differs from decode failure","expected":{"ok":true,"value":null},"passed":true},{"actual":{"ok":false},"check":"malformed syntax","expected":{"ok":false},"passed":true},{"actual":{"ok":false},"check":"non-JSON numeric constant rejected","expected":{"ok":false},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate top-level member\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"duplicate nested member\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"same name in separate scopes\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": true, \"value\": {\"a\": 1, \"child\": {\"a\": 2}}}, \"passed\": false}, {\"check\": \"escaped name equals literal name\", \"actual\": {\"ok\": true, \"value\": {\"a\": 2}}, \"expected\": {\"ok\": false}, \"passed\": false}, {\"check\": \"same member in separate array objects\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": true, \"value\": [{\"a\": 0}, {\"a\": 1}]}, \"passed\": false}, {\"check\": \"empty object\", \"actual\": {\"ok\": true, \"value\": {}}, \"expected\": {\"ok\": true, \"value\": {}}, \"passed\": true}, {\"check\": \"valid null differs from decode failure\", \"actual\": {\"ok\": true, \"value\": null}, \"expected\": {\"ok\": true, \"value\": null}, \"passed\": true}, {\"check\": \"malformed syntax\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"non-JSON numeric constant rejected\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":32.627,"exit_code":1,"observations":[{"actual":{"ok":true,"value":{"a":0}},"check":"duplicate top-level member","expected":{"ok":false},"passed":false},{"actual":{"ok":true,"value":{"outer":{"a":2}}},"check":"duplicate nested member","expected":{"ok":false},"passed":false},{"actual":{"ok":true,"value":{"a":1,"child":{"a":2}}},"check":"same name in separate scopes","expected":{"ok":true,"value":{"a":1,"child":{"a":2}}},"passed":true},{"actual":{"ok":true,"value":{"a":2}},"check":"escaped name equals literal name","expected":{"ok":false},"passed":false},{"actual":{"ok":true,"value":[{"a":0},{"a":1}]},"check":"same member in separate array objects","expected":{"ok":true,"value":[{"a":0},{"a":1}]},"passed":true},{"actual":{"ok":true,"value":{}},"check":"empty object","expected":{"ok":true,"value":{}},"passed":true},{"actual":{"ok":true,"value":null},"check":"valid null differs from decode failure","expected":{"ok":true,"value":null},"passed":true},{"actual":{"ok":false},"check":"malformed syntax","expected":{"ok":false},"passed":true},{"actual":{"ok":false},"check":"non-JSON numeric constant rejected","expected":{"ok":false},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate top-level member\", \"actual\": {\"ok\": true, \"value\": {\"a\": 0}}, \"expected\": {\"ok\": false}, \"passed\": false}, {\"check\": \"duplicate nested member\", \"actual\": {\"ok\": true, \"value\": {\"outer\": {\"a\": 2}}}, \"expected\": {\"ok\": false}, \"passed\": false}, {\"check\": \"same name in separate scopes\", \"actual\": {\"ok\": true, \"value\": {\"a\": 1, \"child\": {\"a\": 2}}}, \"expected\": {\"ok\": true, \"value\": {\"a\": 1, \"child\": {\"a\": 2}}}, \"passed\": true}, {\"check\": \"escaped name equals literal name\", \"actual\": {\"ok\": true, \"value\": {\"a\": 2}}, \"expected\": {\"ok\": false}, \"passed\": false}, {\"check\": \"same member in separate array objects\", \"actual\": {\"ok\": true, \"value\": [{\"a\": 0}, {\"a\": 1}]}, \"expected\": {\"ok\": true, \"value\": [{\"a\": 0}, {\"a\": 1}]}, \"passed\": true}, {\"check\": \"empty object\", \"actual\": {\"ok\": true, \"value\": {}}, \"expected\": {\"ok\": true, \"value\": {}}, \"passed\": true}, {\"check\": \"valid null differs from decode failure\", \"actual\": {\"ok\": true, \"value\": null}, \"expected\": {\"ok\": true, \"value\": null}, \"passed\": true}, {\"check\": \"malformed syntax\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"non-JSON numeric constant rejected\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":33.868,"exit_code":0,"observations":[{"actual":{"ok":false},"check":"duplicate top-level member","expected":{"ok":false},"passed":true},{"actual":{"ok":false},"check":"duplicate nested member","expected":{"ok":false},"passed":true},{"actual":{"ok":true,"value":{"a":1,"child":{"a":2}}},"check":"same name in separate scopes","expected":{"ok":true,"value":{"a":1,"child":{"a":2}}},"passed":true},{"actual":{"ok":false},"check":"escaped name equals literal name","expected":{"ok":false},"passed":true},{"actual":{"ok":true,"value":[{"a":0},{"a":1}]},"check":"same member in separate array objects","expected":{"ok":true,"value":[{"a":0},{"a":1}]},"passed":true},{"actual":{"ok":true,"value":{}},"check":"empty object","expected":{"ok":true,"value":{}},"passed":true},{"actual":{"ok":true,"value":null},"check":"valid null differs from decode failure","expected":{"ok":true,"value":null},"passed":true},{"actual":{"ok":false},"check":"malformed syntax","expected":{"ok":false},"passed":true},{"actual":{"ok":false},"check":"non-JSON numeric constant rejected","expected":{"ok":false},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate top-level member\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"duplicate nested member\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"same name in separate scopes\", \"actual\": {\"ok\": true, \"value\": {\"a\": 1, \"child\": {\"a\": 2}}}, \"expected\": {\"ok\": true, \"value\": {\"a\": 1, \"child\": {\"a\": 2}}}, \"passed\": true}, {\"check\": \"escaped name equals literal name\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"same member in separate array objects\", \"actual\": {\"ok\": true, \"value\": [{\"a\": 0}, {\"a\": 1}]}, \"expected\": {\"ok\": true, \"value\": [{\"a\": 0}, {\"a\": 1}]}, \"passed\": true}, {\"check\": \"empty object\", \"actual\": {\"ok\": true, \"value\": {}}, \"expected\": {\"ok\": true, \"value\": {}}, \"passed\": true}, {\"check\": \"valid null differs from decode failure\", \"actual\": {\"ok\": true, \"value\": null}, \"expected\": {\"ok\": true, \"value\": null}, \"passed\": true}, {\"check\": \"malformed syntax\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}, {\"check\": \"non-JSON numeric constant rejected\", \"actual\": {\"ok\": false}, \"expected\": {\"ok\": false}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}