FA-4296 / Collection algebra / Open access
Prefix compares positionally · case 01
The operation returns a result or retained state that violates this contract: Return whether right is a positional prefix of left.
ROOT CAUSE
Membership ignores the starting position and order of a prefix.
VERIFIED REPAIR
Return whether right is a positional prefix of left.
Unsuccessful approach: Suffix comparison checks the opposite boundary.
Case contract
Return whether right is a positional prefix of left. 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 all(v in x for v in y)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('interior is not prefix', solve(['b','a'], ['a']), False)
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 |
|---|---|---|---|
| both empty | True | True | Passed |
| empty right operand | True | True | Passed |
| empty left operand | False | False | Passed |
| overlap and multiplicity | False | False | Passed |
| interior is not prefix | True | False | Failed |
SHA-256 / 9864af9cc70f7dc50e611fe413a8b0ecae0af0f2299b436cab769764e14e74f0
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[-len(y):]==y
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('interior is not prefix', solve(['b','a'], ['a']), False)
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 |
|---|---|---|---|
| both empty | True | True | Passed |
| empty right operand | False | True | Failed |
| empty left operand | False | False | Passed |
| overlap and multiplicity | False | False | Passed |
| interior is not prefix | True | False | Failed |
SHA-256 / b1e0caa8f94a3993e28f0c90d50dfb2102e59e5f2b874da1a71fd86bd6b92712
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[:len(y)]==y
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('interior is not prefix', solve(['b','a'], ['a']), False)
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 |
|---|---|---|---|
| both empty | True | True | Passed |
| empty right operand | True | True | Passed |
| empty left operand | False | False | Passed |
| overlap and multiplicity | False | False | Passed |
| interior is not prefix | False | False | Passed |
SHA-256 / d6a03c3241b31040dae3f989dd182eee30536c8b645c9ef65cf00558886180a1
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:37.701956+00:00.
Case digest / 867364a12fc47d54332263cc7477eb4f39e947cc0754f64e7a3b2aa4bceec811