FA-4301 / Collection algebra / Open access
Suffix empty identity · case 01
The operation returns a result or retained state that violates this contract: Return whether right is a positional suffix of left, with empty right always matching.
ROOT CAUSE
Negative-zero slicing selects the full sequence instead of the empty suffix.
VERIFIED REPAIR
Return whether right is a positional suffix of left, with empty right always matching.
Unsuccessful approach: Prefix comparison checks the opposite boundary.
Case contract
Return whether right is a positional suffix of left, with empty right always matching. 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[-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('nonprefix suffix matches', solve(['b','a'], ['a']), True)
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 |
| nonprefix suffix matches | True | True | Passed |
SHA-256 / 5d497f987680f5c06970d7872cd70326266e8d3b43ae2b202c6621657552a7ef
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('nonprefix suffix matches', solve(['b','a'], ['a']), True)
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 |
| nonprefix suffix matches | False | True | Failed |
SHA-256 / 2416145d3bd186775e7405b80d397607709b8209988dc24d6c9155e0c356322b
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 not y or 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('nonprefix suffix matches', solve(['b','a'], ['a']), True)
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 |
| nonprefix suffix matches | True | True | Passed |
SHA-256 / afbc706a7d61579e2b4fc75f24023552fdfc93521953e067c8bde019c058932c
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.702484+00:00.
Case digest / ba877c85dcd4da635eed3ec4e7a46cb8d386a48c832503a458ffc3fc8719c056