FAILURE MAP
← Case archive

FA-4501 / Borrow checking / Open access

Owner move forbidden during borrow · case 01

The operation returns a result or retained state that violates this contract: A single local object grants either any number of shared borrows or one exclusive borrow. Commands are [operation,token,value]. Reads return the value or denied; writes and acquisitions return booleans. Ownership can move only with no borrows. Moving ownership requires a live object and no shared or exclusive borrows.

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

ROOT CAUSE

Moving ownership requires a live object and no shared or exclusive borrows. The broken transition violates that invariant.

THE FAILURE

Moving ownership requires a live object and no shared or exclusive borrows. The broken transition violates that invariant.

Unsuccessful approach: The attempted transition changes the behavior but still violates the same invariant in at least one independent regression fixture.

Case contract

A single local object grants either any number of shared borrows or one exclusive borrow. Commands are [operation,token,value]. Reads return the value or denied; writes and acquisitions return booleans. Ownership can move only with no borrows. Moving ownership requires a live object and no shared or exclusive borrows. 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):
    shared=set(); exclusive=None; value=y; live=True; out=[]
    for op,k,arg in x:
        if op=='shared':
            ok=live and exclusive is None and k not in shared
            if ok: shared.add(k)
            out.append(ok)
        elif op=='exclusive':
            ok=live and not shared and exclusive is None
            if ok: exclusive=k
            out.append(ok)
        elif op=='release':
            shared.discard(k)
            if exclusive==k: exclusive=None
            out.append(True)
        elif op=='read':
            out.append(value if live and (k in shared or (exclusive is not None and k==exclusive)) else 'denied')
        elif op=='write':
            ok=live and exclusive is not None and k==exclusive
            if ok: value=arg
            out.append(ok)
        elif op=='ownerwrite':
            ok=live and not shared and exclusive is None
            if ok: value=arg
            out.append(ok)
        elif op=='move':
            ok=live and exclusive is None
            if ok: live=False
            out.append(ok)
        elif op=='inspect': out.append([value,live,sorted(shared),exclusive])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('shared readers prohibit mutation', solve([['shared', 'a', None], ['shared', 'a', None], ['shared', 'b', None], ['exclusive', 'w', None], ['write', 'a', 'bad'], ['ownerwrite', None, 'bad'], ['move', None, None], ['read', 'a', None], ['read', 'ghost', None], ['inspect', None, None]], 'initial'), [True, False, True, False, False, False, False, 'initial', 'denied', ['initial', True, ['a', 'b'], None]])
check('exclusive token protects identity', solve([['exclusive', 'w', None], ['exclusive', 'other', None], ['shared', 'a', None], ['write', 'ghost', 'bad'], ['release', 'ghost', None], ['ownerwrite', None, 'bad'], ['move', None, None], ['write', 'w', 'new'], ['read', 'w', None], ['inspect', None, None]], 'initial'), [True, False, False, False, True, False, False, True, 'new', ['new', True, [], 'w']])
check('released token loses rights', solve([['shared', 'a', None], ['release', 'a', None], ['read', 'a', None], ['exclusive', 'w', None], ['release', 'w', None], ['write', 'w', 'bad'], ['ownerwrite', None, 'new'], ['inspect', None, None]], 'initial'), [True, True, 'denied', True, True, False, True, ['new', True, [], None]])
check('moved object stays unavailable', solve([['move', None, None], ['shared', 'a', None], ['exclusive', 'w', None], ['ownerwrite', None, 'bad'], ['read', None, None], ['move', None, None], ['inspect', None, None]], 'initial'), [True, False, False, False, 'denied', False, ['initial', False, [], None]])
check('None is not a borrowed token', solve([['read',None,None]], 'initial'), ['denied'])
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
shared readers prohibit mutation[True, False, True, False, False, False, True, 'denied', 'denied', ['initial', False, ['a', 'b'], None]][True, False, True, False, False, False, False, 'initial', 'denied', ['initial', True, ['a', 'b'], None]]Failed
exclusive token protects identity[True, False, False, False, True, False, False, True, 'new', ['new', True, [], 'w']][True, False, False, False, True, False, False, True, 'new', ['new', True, [], 'w']]Passed
released token loses rights[True, True, 'denied', True, True, False, True, ['new', True, [], None]][True, True, 'denied', True, True, False, True, ['new', True, [], None]]Passed
moved object stays unavailable[True, False, False, False, 'denied', False, ['initial', False, [], None]][True, False, False, False, 'denied', False, ['initial', False, [], None]]Passed
None is not a borrowed token['denied']['denied']Passed

SHA-256 / 3ec03684af9d24778b0f8febf3b5ed17b88d609f005c7729af6e2562cee491c6

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x, y=None):
    shared=set(); exclusive=None; value=y; live=True; out=[]
    for op,k,arg in x:
        if op=='shared':
            ok=live and exclusive is None and k not in shared
            if ok: shared.add(k)
            out.append(ok)
        elif op=='exclusive':
            ok=live and not shared and exclusive is None
            if ok: exclusive=k
            out.append(ok)
        elif op=='release':
            shared.discard(k)
            if exclusive==k: exclusive=None
            out.append(True)
        elif op=='read':
            out.append(value if live and (k in shared or (exclusive is not None and k==exclusive)) else 'denied')
        elif op=='write':
            ok=live and exclusive is not None and k==exclusive
            if ok: value=arg
            out.append(ok)
        elif op=='ownerwrite':
            ok=live and not shared and exclusive is None
            if ok: value=arg
            out.append(ok)
        elif op=='move':
            ok=live and not shared
            if ok: live=False
            out.append(ok)
        elif op=='inspect': out.append([value,live,sorted(shared),exclusive])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('shared readers prohibit mutation', solve([['shared', 'a', None], ['shared', 'a', None], ['shared', 'b', None], ['exclusive', 'w', None], ['write', 'a', 'bad'], ['ownerwrite', None, 'bad'], ['move', None, None], ['read', 'a', None], ['read', 'ghost', None], ['inspect', None, None]], 'initial'), [True, False, True, False, False, False, False, 'initial', 'denied', ['initial', True, ['a', 'b'], None]])
check('exclusive token protects identity', solve([['exclusive', 'w', None], ['exclusive', 'other', None], ['shared', 'a', None], ['write', 'ghost', 'bad'], ['release', 'ghost', None], ['ownerwrite', None, 'bad'], ['move', None, None], ['write', 'w', 'new'], ['read', 'w', None], ['inspect', None, None]], 'initial'), [True, False, False, False, True, False, False, True, 'new', ['new', True, [], 'w']])
check('released token loses rights', solve([['shared', 'a', None], ['release', 'a', None], ['read', 'a', None], ['exclusive', 'w', None], ['release', 'w', None], ['write', 'w', 'bad'], ['ownerwrite', None, 'new'], ['inspect', None, None]], 'initial'), [True, True, 'denied', True, True, False, True, ['new', True, [], None]])
check('moved object stays unavailable', solve([['move', None, None], ['shared', 'a', None], ['exclusive', 'w', None], ['ownerwrite', None, 'bad'], ['read', None, None], ['move', None, None], ['inspect', None, None]], 'initial'), [True, False, False, False, 'denied', False, ['initial', False, [], None]])
check('None is not a borrowed token', solve([['read',None,None]], 'initial'), ['denied'])
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
shared readers prohibit mutation[True, False, True, False, False, False, False, 'initial', 'denied', ['initial', True, ['a', 'b'], None]][True, False, True, False, False, False, False, 'initial', 'denied', ['initial', True, ['a', 'b'], None]]Passed
exclusive token protects identity[True, False, False, False, True, False, True, False, 'denied', ['initial', False, [], 'w']][True, False, False, False, True, False, False, True, 'new', ['new', True, [], 'w']]Failed
released token loses rights[True, True, 'denied', True, True, False, True, ['new', True, [], None]][True, True, 'denied', True, True, False, True, ['new', True, [], None]]Passed
moved object stays unavailable[True, False, False, False, 'denied', False, ['initial', False, [], None]][True, False, False, False, 'denied', False, ['initial', False, [], None]]Passed
None is not a borrowed token['denied']['denied']Passed

SHA-256 / 3f67ce95f67f2914ef27aea0cfa07cefbe70815a47d063e9de92f7b92635cb23

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 5 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:39.897982+00:00.

Case digest / c34ddd068886c9efbbe08ca72f2a7099fad9971421d8482cf544f955bccb47f1