FAILURE MAP
← Case archive

FA-12701 / Auction allocation rules / Open access

A buy order matches its own owner · case 01

A buy order matches its own owner.

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

ROOT CAUSE

Matching checks price but omits owner incompatibility.

VERIFIED REPAIR

Implement the stated toy allocation contract directly: For one buy [owner, limit] and asks [owner, price], return the cheapest differently owned ask price <= limit, or None. Input order breaks equal prices.

Unsuccessful approach: Discarding the best ask after a self-cross misses a later eligible seller.

Case contract

For one buy [owner, limit] and asks [owner, price], return the cheapest differently owned ask price <= limit, or None. Input order breaks equal prices.

Why this case matters

Deterministic teaching model for reviewing auction allocation software; not a representation of any venue or financial advice.

1 / The failure

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

N = 1
observations = []
def solve(buy, asks):
    return min((a[1] for a in asks if a[1]<=buy[1]),default=None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('skip own ask', solve(['a',20+N], [['a',1],['b',8]]), 8)
check('all own', solve(['a',10], [['a',2]]), None)
check('external cheapest', solve(['a',10], [['b',2],['a',3]]), 2)
check('no crossing', solve(['a',1], [['b',2]]), None)
check('empty asks', solve(['a',10], []), None)
check('equal limit', solve(['a',7], [['b',7]]), 7)
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
skip own ask18Failed
all own2NoneFailed
external cheapest22Passed
no crossingNoneNonePassed
empty asksNoneNonePassed
equal limit77Passed

SHA-256 / 9ca0f92aedc1e55957a33f568df618c425008e6fd04b995260621e1fc56a073a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(buy, asks):
    eligible=sorted([a for a in asks if a[1]<=buy[1]],key=lambda a:a[1])
    return eligible[0][1] if eligible and eligible[0][0]!=buy[0] else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('skip own ask', solve(['a',20+N], [['a',1],['b',8]]), 8)
check('all own', solve(['a',10], [['a',2]]), None)
check('external cheapest', solve(['a',10], [['b',2],['a',3]]), 2)
check('no crossing', solve(['a',1], [['b',2]]), None)
check('empty asks', solve(['a',10], []), None)
check('equal limit', solve(['a',7], [['b',7]]), 7)
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
skip own askNone8Failed
all ownNoneNonePassed
external cheapest22Passed
no crossingNoneNonePassed
empty asksNoneNonePassed
equal limit77Passed

SHA-256 / 13bfac248c5c96b82b47b30cadee674c17bda7e7ce92d7c389af3740f920d987

3 / The verified repair

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

N = 1
observations = []
def solve(buy, asks):
    eligible=[a for a in asks if a[0]!=buy[0] and a[1]<=buy[1]]
    return min((a[1] for a in eligible),default=None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('skip own ask', solve(['a',20+N], [['a',1],['b',8]]), 8)
check('all own', solve(['a',10], [['a',2]]), None)
check('external cheapest', solve(['a',10], [['b',2],['a',3]]), 2)
check('no crossing', solve(['a',1], [['b',2]]), None)
check('empty asks', solve(['a',10], []), None)
check('equal limit', solve(['a',7], [['b',7]]), 7)
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
skip own ask88Passed
all ownNoneNonePassed
external cheapest22Passed
no crossingNoneNonePassed
empty asksNoneNonePassed
equal limit77Passed

SHA-256 / 898b1766f06cee8efb3eccde92d231108c09274ae90b34e9565c3ef0c82ae1f8

Verification & scope

Offline toy model with explicit integer inputs; no strategic behavior or real market execution. 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:38:59.387438+00:00.

Case digest / 56b21221a165bd7a3b332bbfdfc9dc0688a8e52209c7d27c8163c5f5e5b8fad9