FA-4166 / Sequence semantics / Open access
Right rotation one · case 01
The operation returns a result or retained state that violates this contract: Move the last item to the front; empty input remains empty.
ROOT CAUSE
The boundary element moves in the wrong rotation direction.
VERIFIED REPAIR
Move the last item to the front; empty input remains empty.
Unsuccessful approach: Prepending the final element without removing its old occurrence duplicates it.
Case contract
Move the last item to the front; empty input remains empty. 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 x[1:]+x[:1]
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']), ['b', 'a'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['c', 'b', 'a', 'b'])
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 |
|---|---|---|---|
| empty collection | [] | [] | Passed |
| singleton collection | ['a'] | ['a'] | Passed |
| two distinct elements | ['b', 'a'] | ['b', 'a'] | Passed |
| nonadjacent duplicate and unsorted order | ['a', 'b', 'c', 'b'] | ['c', 'b', 'a', 'b'] | Failed |
SHA-256 / 93e1dc64c78cd2d2d8f621b4696b845cfaa80bbe96f35dc7e282513f00d0ffd5
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 x[-1:]+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']), ['b', 'a'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['c', 'b', 'a', 'b'])
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 |
|---|---|---|---|
| empty collection | [] | [] | Passed |
| singleton collection | ['a', 'a'] | ['a'] | Failed |
| two distinct elements | ['b', 'a', 'b'] | ['b', 'a'] | Failed |
| nonadjacent duplicate and unsorted order | ['c', 'b', 'a', 'b', 'c'] | ['c', 'b', 'a', 'b'] | Failed |
SHA-256 / 9932450e0497c09a6968211ba1067b50aa39942ef068e2dc058591a74364d86d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x, y=None):
return x[-1:]+x[:-1]
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']), ['b', 'a'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['c', 'b', 'a', 'b'])
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 |
|---|---|---|---|
| empty collection | [] | [] | Passed |
| singleton collection | ['a'] | ['a'] | Passed |
| two distinct elements | ['b', 'a'] | ['b', 'a'] | Passed |
| nonadjacent duplicate and unsorted order | ['c', 'b', 'a', 'b'] | ['c', 'b', 'a', 'b'] | Passed |
SHA-256 / e98a2bba644b8411277351f10d2d866d4caf38da273776107385829325d1cc90
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:36.471724+00:00.
Case digest / 502a5e4fd8cc064d8ceed0009e8cda072241cf03a4d142890db3f0cb1e51d9a0