FAILURE MAP
← Case archive

FA-4431 / Runtime and resources / Open access

Owner clone requires live owner · case 01

The operation returns a result or retained state that violates this contract: A local shared-ownership model executes [operation,handle,argument] commands. Only owners retain the resource. Output is one result per command; weak and borrowed handles do not retain it. Cloning requires an owning source and a fresh destination handle.

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

ROOT CAUSE

Cloning requires an owning source and a fresh destination handle. The broken transition violates that invariant.

THE FAILURE

Cloning requires an owning source and a fresh destination handle. 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 local shared-ownership model executes [operation,handle,argument] commands. Only owners retain the resource. Output is one result per command; weak and borrowed handles do not retain it. Cloning requires an owning source and a fresh destination handle. 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):
    h={'root':'owner'}; destroyed=False; out=[]
    for op,k,arg in x:
        owners=lambda: sum(v=='owner' for v in h.values())
        if op=='clone':
            ok=arg in h and k not in h
            if ok: h[k]='owner'
            out.append(ok)
        elif op=='borrow':
            ok=h.get(arg)=='owner' and k not in h and not destroyed
            if ok: h[k]='borrow'
            out.append(ok)
        elif op=='weak':
            ok=k not in h
            if ok: h[k]='weak'
            out.append(ok)
        elif op=='upgrade':
            ok=h.get(k)=='weak' and owners()>0 and arg not in h and not destroyed
            if ok: h[arg]='owner'
            out.append(ok)
        elif op=='drop':
            existed=k in h
            kind=h.pop(k,None)
            if kind=='owner' and owners()==0: destroyed=True
            out.append(existed)
        elif op=='move':
            ok=k in h and arg not in h
            if ok:
                h[arg]=h[k]
                del h[k]
            out.append(ok)
        elif op=='use':
            out.append(h.get(k) in ('owner','borrow') and owners()>0 and not destroyed)
        elif op=='unique':
            out.append(h.get(k)=='owner' and owners()==1 and not destroyed)
        elif op=='inspect':
            out.append([owners(),destroyed,sorted(h)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('borrow cannot clone or outlive resource', solve([['borrow', 'b', 'root'], ['clone', 'c', 'b'], ['weak', 'w', None], ['use', 'w', None], ['unique', 'root', None], ['unique', 'b', None], ['drop', 'root', None], ['use', 'b', None], ['upgrade', 'w', 'c'], ['inspect', None, None]]), [True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]])
check('clones prevent premature destruction', solve([['clone', 'c', 'root'], ['drop', 'root', None], ['use', 'c', None], ['inspect', None, None], ['drop', 'c', None], ['inspect', None, None]]), [True, True, True, [1, False, ['c']], True, [0, True, []]])
check('destination collisions preserve all handles', solve([['clone', 'c', 'root'], ['borrow', 'b', 'root'], ['clone', 'b', 'root'], ['borrow', 'c', 'root'], ['weak', 'w', None], ['upgrade', 'w', 'b'], ['move', 'root', 'c'], ['move', 'root', 'root'], ['inspect', None, None]]), [True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]])
check('move and borrower release preserve ownership', solve([['borrow', 'b', 'root'], ['drop', 'b', None], ['move', 'root', 'new'], ['use', 'root', None], ['borrow', 'b', 'new'], ['weak', 'w', None], ['upgrade', 'w', 'c'], ['borrow', 'z', 'b'], ['inspect', None, None]]), [True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]])
check('weak collision cannot discard owner', solve([['weak','root',None],['inspect',None,None]]), [False,[1,False,['root']]])
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
borrow cannot clone or outlive resource[True, True, True, False, False, False, True, True, False, [1, False, ['b', 'c', 'w']]][True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]]Failed
clones prevent premature destruction[True, True, True, [1, False, ['c']], True, [0, True, []]][True, True, True, [1, False, ['c']], True, [0, True, []]]Passed
destination collisions preserve all handles[True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]][True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]]Passed
move and borrower release preserve ownership[True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]][True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]]Passed
weak collision cannot discard owner[False, [1, False, ['root']]][False, [1, False, ['root']]]Passed

SHA-256 / f7e78d68d483489fa8d36fdbba17c9f1b4e021287975a1f87c2f2bfa24a31ce3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x, y=None):
    h={'root':'owner'}; destroyed=False; out=[]
    for op,k,arg in x:
        owners=lambda: sum(v=='owner' for v in h.values())
        if op=='clone':
            ok=h.get(arg)=='owner' and not destroyed
            if ok: h[k]='owner'
            out.append(ok)
        elif op=='borrow':
            ok=h.get(arg)=='owner' and k not in h and not destroyed
            if ok: h[k]='borrow'
            out.append(ok)
        elif op=='weak':
            ok=k not in h
            if ok: h[k]='weak'
            out.append(ok)
        elif op=='upgrade':
            ok=h.get(k)=='weak' and owners()>0 and arg not in h and not destroyed
            if ok: h[arg]='owner'
            out.append(ok)
        elif op=='drop':
            existed=k in h
            kind=h.pop(k,None)
            if kind=='owner' and owners()==0: destroyed=True
            out.append(existed)
        elif op=='move':
            ok=k in h and arg not in h
            if ok:
                h[arg]=h[k]
                del h[k]
            out.append(ok)
        elif op=='use':
            out.append(h.get(k) in ('owner','borrow') and owners()>0 and not destroyed)
        elif op=='unique':
            out.append(h.get(k)=='owner' and owners()==1 and not destroyed)
        elif op=='inspect':
            out.append([owners(),destroyed,sorted(h)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('borrow cannot clone or outlive resource', solve([['borrow', 'b', 'root'], ['clone', 'c', 'b'], ['weak', 'w', None], ['use', 'w', None], ['unique', 'root', None], ['unique', 'b', None], ['drop', 'root', None], ['use', 'b', None], ['upgrade', 'w', 'c'], ['inspect', None, None]]), [True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]])
check('clones prevent premature destruction', solve([['clone', 'c', 'root'], ['drop', 'root', None], ['use', 'c', None], ['inspect', None, None], ['drop', 'c', None], ['inspect', None, None]]), [True, True, True, [1, False, ['c']], True, [0, True, []]])
check('destination collisions preserve all handles', solve([['clone', 'c', 'root'], ['borrow', 'b', 'root'], ['clone', 'b', 'root'], ['borrow', 'c', 'root'], ['weak', 'w', None], ['upgrade', 'w', 'b'], ['move', 'root', 'c'], ['move', 'root', 'root'], ['inspect', None, None]]), [True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]])
check('move and borrower release preserve ownership', solve([['borrow', 'b', 'root'], ['drop', 'b', None], ['move', 'root', 'new'], ['use', 'root', None], ['borrow', 'b', 'new'], ['weak', 'w', None], ['upgrade', 'w', 'c'], ['borrow', 'z', 'b'], ['inspect', None, None]]), [True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]])
check('weak collision cannot discard owner', solve([['weak','root',None],['inspect',None,None]]), [False,[1,False,['root']]])
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
borrow cannot clone or outlive resource[True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]][True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]]Passed
clones prevent premature destruction[True, True, True, [1, False, ['c']], True, [0, True, []]][True, True, True, [1, False, ['c']], True, [0, True, []]]Passed
destination collisions preserve all handles[True, True, True, False, True, False, False, False, [3, False, ['b', 'c', 'root', 'w']]][True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]]Failed
move and borrower release preserve ownership[True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]][True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]]Passed
weak collision cannot discard owner[False, [1, False, ['root']]][False, [1, False, ['root']]]Passed

SHA-256 / da2959a81a2ede803d0260fc164d04e343535777981dc9bbc9e59f702768fc02

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

Case digest / 1d17bff8a6e7e63dd8f76183a0d894a7cd7dae5ec033cac46f111d44310c408a