FAILURE MAP
← Case archive

FA-4111 / Sequence semantics / Open access

Only singleton members · case 01

The operation returns a result or retained state that violates this contract: Return values whose total occurrence count is exactly one, preserving input order.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Deduplication retains one copy of values that should be entirely excluded.

THE FAILURE

Deduplication retains one copy of values that should be entirely excluded.

Unsuccessful approach: Keeping first occurrences still retains duplicated members.

Case contract

Return values whose total occurrence count is exactly one, preserving input order. 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):
    return list(dict.fromkeys(x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), ['a'])
check('two distinct elements', solve(['a', 'b']), ['a', 'b'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['a', 'c'])
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 fixtureActualExpectedOutcome
empty collection[][]Passed
singleton collection['a']['a']Passed
two distinct elements['a', 'b']['a', 'b']Passed
nonadjacent duplicate and unsorted order['b', 'a', 'c']['a', 'c']Failed

SHA-256 / c1527362499fd4166e8476670c3d7b0ce56e2324224d1ccbd1c583a16b17f2bd

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x, y=None):
    return [v for i,v in enumerate(x) if v not in x[:i]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), ['a'])
check('two distinct elements', solve(['a', 'b']), ['a', 'b'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['a', 'c'])
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 fixtureActualExpectedOutcome
empty collection[][]Passed
singleton collection['a']['a']Passed
two distinct elements['a', 'b']['a', 'b']Passed
nonadjacent duplicate and unsorted order['b', 'a', 'c']['a', 'c']Failed

SHA-256 / 07585470be31d2ffa42a7a3d46ccbc8108ad4fa8377c819faea09eaa78e407a1

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:35.745394+00:00.

Case digest / 54422e166504f6fb55c1f6094eb786160fb34ac6a09567cacc8707266a0898ae