FA-4391 / Mapping semantics / Open access
Map pop preserves present default value · case 01
The operation returns a result or retained state that violates this contract: Pop a key if present and return [value,remaining map], using fallback only when absent.
ROOT CAUSE
A lookup reads the value without removing its binding.
THE FAILURE
A lookup reads the value without removing its binding.
Unsuccessful approach: Boolean fallback discards legitimate falsy popped values.
Case contract
Pop a key if present and return [value,remaining map], using fallback only when absent. 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
N = 1
observations = []
def solve(x, y=None):
a=dict(x); v=a.get(y[0],y[1]); return [v,a]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present value', solve({'a': 'v'}, ['a', 'd']), ['v', {}])
check('present zero', solve({'a': 0}, ['a', 'd']), [0, {}])
check('missing', solve({'b': 'v'}, ['a', 'd']), ['d', {'b': 'v'}])
check('present None', solve({'a': None}, ['a', 'd']), [None, {}])
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 |
|---|---|---|---|
| present value | ['v', {'a': 'v'}] | ['v', {}] | Failed |
| present zero | [0, {'a': 0}] | [0, {}] | Failed |
| missing | ['d', {'b': 'v'}] | ['d', {'b': 'v'}] | Passed |
| present None | [None, {'a': None}] | [None, {}] | Failed |
SHA-256 / 51348de728d53d012fbe5c20c6317d0be2a797c3933e7752c4817b9173c3b9ec
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x, y=None):
a=dict(x); v=a.pop(y[0],y[1]); return [v or y[1],a]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present value', solve({'a': 'v'}, ['a', 'd']), ['v', {}])
check('present zero', solve({'a': 0}, ['a', 'd']), [0, {}])
check('missing', solve({'b': 'v'}, ['a', 'd']), ['d', {'b': 'v'}])
check('present None', solve({'a': None}, ['a', 'd']), [None, {}])
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 |
|---|---|---|---|
| present value | ['v', {}] | ['v', {}] | Passed |
| present zero | ['d', {}] | [0, {}] | Failed |
| missing | ['d', {'b': 'v'}] | ['d', {'b': 'v'}] | Passed |
| present None | ['d', {}] | [None, {}] | Failed |
SHA-256 / 62d5c0040bb72bd994dca7716873cf1cc2bfd2350d4d57c0ff68307f7568624a
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 4 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
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:38.547194+00:00.
Case digest / 092b781220416f6a63844e2b8e8836a5e3a7b8b10a145eb375ca6c21d4bf6380