{"abstract":"The operation returns a result or retained state that violates this contract: Insert the default only for an absent key; return [selected value,map].","category":"Mapping semantics","checks":4,"contract":"Insert the default only for an absent key; return [selected value,map]. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-5d448f27c7187b59","failed_approach":"A None-based presence check replaces legitimate None values.","family":"xr-map-setdefault-keeps-existing-none","id":"FA-4386","implementations":{"attempt":{"sha256":"660652cef6fa1fda125deb7734b038b89d7ae24b39ccddf31564bd7e6fb9e64b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=dict(x)\n    if a.get(y[0]) is None: a[y[0]]=y[1]\n    return [a[y[0]],a]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('existing None', solve({'a': None}, ['a', 'd']), [None, {'a': None}])\ncheck('existing scalar', solve({'a': 'v'}, ['a', 'd']), ['v', {'a': 'v'}])\ncheck('absent key', solve({}, ['a', 'd']), ['d', {'a': 'd'}])\ncheck('existing false', solve({'a': False}, ['a', 'd']), [False, {'a': 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":"e10676ede3e310abeec06619303770af942afecba87480df2834fb3b75398fd2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=dict(x); a[y[0]]=y[1]; return [y[1],a]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('existing None', solve({'a': None}, ['a', 'd']), [None, {'a': None}])\ncheck('existing scalar', solve({'a': 'v'}, ['a', 'd']), ['v', {'a': 'v'}])\ncheck('absent key', solve({}, ['a', 'd']), ['d', {'a': 'd'}])\ncheck('existing false', solve({'a': False}, ['a', 'd']), [False, {'a': 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":"1658e46243ccc213b75c5d128c16d05297599c56a6b2e7a03d641af610363778","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=dict(x); v=a.setdefault(y[0],y[1]); return [v,a]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('existing None', solve({'a': None}, ['a', 'd']), [None, {'a': None}])\ncheck('existing scalar', solve({'a': 'v'}, ['a', 'd']), ['v', {'a': 'v'}])\ncheck('absent key', solve({}, ['a', 'd']), ['d', {'a': 'd'}])\ncheck('existing false', solve({'a': False}, ['a', 'd']), [False, {'a': 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":"xr-map-setdefault-keeps-existing-none","generated_at":"2026-09-29T14:37:38.534708+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.","repair":"Insert the default only for an absent key; return [selected value,map].","root_cause":"Unconditional assignment overwrites an existing binding.","sha256":"895318ca13130d41339130014d2bda1bc342b3f1d0db315be7dcf2c163760aa1","title":"Map setdefault keeps existing none · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verification":{"attempt":{"elapsed_ms":38.3,"exit_code":1,"observations":[{"actual":["d",{"a":"d"}],"check":"existing None","expected":[null,{"a":null}],"passed":false},{"actual":["v",{"a":"v"}],"check":"existing scalar","expected":["v",{"a":"v"}],"passed":true},{"actual":["d",{"a":"d"}],"check":"absent key","expected":["d",{"a":"d"}],"passed":true},{"actual":[false,{"a":false}],"check":"existing false","expected":[false,{"a":false}],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"existing None\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [null, {\"a\": null}], \"passed\": false}, {\"check\": \"existing scalar\", \"actual\": [\"v\", {\"a\": \"v\"}], \"expected\": [\"v\", {\"a\": \"v\"}], \"passed\": true}, {\"check\": \"absent key\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [\"d\", {\"a\": \"d\"}], \"passed\": true}, {\"check\": \"existing false\", \"actual\": [false, {\"a\": false}], \"expected\": [false, {\"a\": false}], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.683,"exit_code":1,"observations":[{"actual":["d",{"a":"d"}],"check":"existing None","expected":[null,{"a":null}],"passed":false},{"actual":["d",{"a":"d"}],"check":"existing scalar","expected":["v",{"a":"v"}],"passed":false},{"actual":["d",{"a":"d"}],"check":"absent key","expected":["d",{"a":"d"}],"passed":true},{"actual":["d",{"a":"d"}],"check":"existing false","expected":[false,{"a":false}],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"existing None\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [null, {\"a\": null}], \"passed\": false}, {\"check\": \"existing scalar\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [\"v\", {\"a\": \"v\"}], \"passed\": false}, {\"check\": \"absent key\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [\"d\", {\"a\": \"d\"}], \"passed\": true}, {\"check\": \"existing false\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [false, {\"a\": false}], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.523,"exit_code":0,"observations":[{"actual":[null,{"a":null}],"check":"existing None","expected":[null,{"a":null}],"passed":true},{"actual":["v",{"a":"v"}],"check":"existing scalar","expected":["v",{"a":"v"}],"passed":true},{"actual":["d",{"a":"d"}],"check":"absent key","expected":["d",{"a":"d"}],"passed":true},{"actual":[false,{"a":false}],"check":"existing false","expected":[false,{"a":false}],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"existing None\", \"actual\": [null, {\"a\": null}], \"expected\": [null, {\"a\": null}], \"passed\": true}, {\"check\": \"existing scalar\", \"actual\": [\"v\", {\"a\": \"v\"}], \"expected\": [\"v\", {\"a\": \"v\"}], \"passed\": true}, {\"check\": \"absent key\", \"actual\": [\"d\", {\"a\": \"d\"}], \"expected\": [\"d\", {\"a\": \"d\"}], \"passed\": true}, {\"check\": \"existing false\", \"actual\": [false, {\"a\": false}], \"expected\": [false, {\"a\": false}], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}