{"abstract":"The operation returns a result or retained state that violates this contract: Look up the key in the first containing scope, retaining falsy values; return missing only when no scope contains it.","category":"Scoped mappings","checks":4,"contract":"Look up the key in the first containing scope, retaining falsy values; return missing only when no scope contains it. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-aa2d5b77ebdb4872","failed_approach":"A truthiness-based search skips legitimate falsy inner values.","family":"xr-chainmap-lookup-first-scope-wins","id":"FA-4711","implementations":{"attempt":{"sha256":"ce28a4f776ccce11b0b646a36922a938c83d90cdea5b3bc9b8457cd02f423f3e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return next((scope[y] for scope in x if scope.get(y)),\"missing\")\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('inner shadows outer', solve([{'a': 'inner'}, {'a': 'outer'}], 'a'), 'inner')\ncheck('None shadows outer', solve([{'a': None}, {'a': 'outer'}], 'a'), None)\ncheck('fallback scope', solve([{}, {'a': 'outer'}], 'a'), 'outer')\ncheck('absent', solve([{}, {}], 'a'), 'missing')\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":"200ce9fb2dc568ac78141b085cb403e79c9cdd369a341ed197224ca93475bf7b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return ChainMap(*reversed(x)).get(y,\"missing\")\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('inner shadows outer', solve([{'a': 'inner'}, {'a': 'outer'}], 'a'), 'inner')\ncheck('None shadows outer', solve([{'a': None}, {'a': 'outer'}], 'a'), None)\ncheck('fallback scope', solve([{}, {'a': 'outer'}], 'a'), 'outer')\ncheck('absent', solve([{}, {}], 'a'), 'missing')\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":"2049015e496f98242d81ba63482c3c0989e632207fc92febae460238daa9d6dc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return ChainMap(*x).get(y,\"missing\")\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('inner shadows outer', solve([{'a': 'inner'}, {'a': 'outer'}], 'a'), 'inner')\ncheck('None shadows outer', solve([{'a': None}, {'a': 'outer'}], 'a'), None)\ncheck('fallback scope', solve([{}, {'a': 'outer'}], 'a'), 'outer')\ncheck('absent', solve([{}, {}], 'a'), 'missing')\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-chainmap-lookup-first-scope-wins","generated_at":"2026-09-29T14:37:42.096673+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":"Look up the key in the first containing scope, retaining falsy values; return missing only when no scope contains it.","root_cause":"Reversing scope traversal lets outer bindings override inner bindings.","sha256":"99479823abc3115391c95be8fd5908b3873eac3d3d24891604daa1fa0e8bebb8","title":"Chainmap lookup first scope wins · 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.533,"exit_code":1,"observations":[{"actual":"inner","check":"inner shadows outer","expected":"inner","passed":true},{"actual":"outer","check":"None shadows outer","expected":null,"passed":false},{"actual":"outer","check":"fallback scope","expected":"outer","passed":true},{"actual":"missing","check":"absent","expected":"missing","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"inner shadows outer\", \"actual\": \"inner\", \"expected\": \"inner\", \"passed\": true}, {\"check\": \"None shadows outer\", \"actual\": \"outer\", \"expected\": null, \"passed\": false}, {\"check\": \"fallback scope\", \"actual\": \"outer\", \"expected\": \"outer\", \"passed\": true}, {\"check\": \"absent\", \"actual\": \"missing\", \"expected\": \"missing\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.347,"exit_code":1,"observations":[{"actual":"outer","check":"inner shadows outer","expected":"inner","passed":false},{"actual":"outer","check":"None shadows outer","expected":null,"passed":false},{"actual":"outer","check":"fallback scope","expected":"outer","passed":true},{"actual":"missing","check":"absent","expected":"missing","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"inner shadows outer\", \"actual\": \"outer\", \"expected\": \"inner\", \"passed\": false}, {\"check\": \"None shadows outer\", \"actual\": \"outer\", \"expected\": null, \"passed\": false}, {\"check\": \"fallback scope\", \"actual\": \"outer\", \"expected\": \"outer\", \"passed\": true}, {\"check\": \"absent\", \"actual\": \"missing\", \"expected\": \"missing\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.391,"exit_code":0,"observations":[{"actual":"inner","check":"inner shadows outer","expected":"inner","passed":true},{"actual":null,"check":"None shadows outer","expected":null,"passed":true},{"actual":"outer","check":"fallback scope","expected":"outer","passed":true},{"actual":"missing","check":"absent","expected":"missing","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"inner shadows outer\", \"actual\": \"inner\", \"expected\": \"inner\", \"passed\": true}, {\"check\": \"None shadows outer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"fallback scope\", \"actual\": \"outer\", \"expected\": \"outer\", \"passed\": true}, {\"check\": \"absent\", \"actual\": \"missing\", \"expected\": \"missing\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}