FA-4741 / Scoped mappings / Open access
Chainmap membership searches all scopes · case 01
The operation returns a result or retained state that violates this contract: Membership is true if any scope contains the key, regardless of its value.
ROOT CAUSE
Checking only the first scope misses inherited bindings.
VERIFIED REPAIR
Membership is true if any scope contains the key, regardless of its value.
Unsuccessful approach: Boolean lookup conflates absent keys with present falsy values.
Case contract
Membership is true if any scope contains the key, regardless of its value. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.
Why this case matters
A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
return y in x[0]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('outer membership', solve([{}, {'a': 1}], 'a'), True)
check('None present', solve([{'a': None}], 'a'), True)
check('absent', solve([{}, {}], 'a'), False)
check('false present', solve([{}, {'a': False}], 'a'), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| outer membership | False | True | Failed |
| None present | True | True | Passed |
| absent | False | False | Passed |
| false present | False | True | Failed |
SHA-256 / 0e67638040ccd149cf1aa454963e2487735763ee6fe22a29dbb9ca663ba2bb39
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
return bool(ChainMap(*x).get(y))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('outer membership', solve([{}, {'a': 1}], 'a'), True)
check('None present', solve([{'a': None}], 'a'), True)
check('absent', solve([{}, {}], 'a'), False)
check('false present', solve([{}, {'a': False}], 'a'), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| outer membership | True | True | Passed |
| None present | False | True | Failed |
| absent | False | False | Passed |
| false present | False | True | Failed |
SHA-256 / f6c689c97cc6f4944368813e2883d553d8a9fe9967a5c925d11f707a150eb38f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
return y in ChainMap(*x)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('outer membership', solve([{}, {'a': 1}], 'a'), True)
check('None present', solve([{'a': None}], 'a'), True)
check('absent', solve([{}, {}], 'a'), False)
check('false present', solve([{}, {'a': False}], 'a'), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| outer membership | True | True | Passed |
| None present | True | True | Passed |
| absent | False | False | Passed |
| false present | True | True | Passed |
SHA-256 / 18129badb7c8c7eecf26a5e06d04d3fe9571ec4686616634b14361d56cfd41df
Verification & scope
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-29T14:37:42.187718+00:00.
Case digest / e6628dd933982999328e8b7f92e933dd7e24a58d943bb93b2e806dea03941a76