FA-5581 / Number theory / Open access
Decimal palindrome magnitude · case 01
A sign character participates in a magnitude-only comparison.
ROOT CAUSE
A sign character participates in a magnitude-only comparison.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(abs(n))==str(abs(n))[::-1]
Unsuccessful approach: Matching endpoint digits does not verify the interior.
Case contract
Integer inputs; n is positive unless a zero or negative fixture explicitly extends that operation. A modulus is greater than one; p is prime; exponent k may be signed when an inverse exists. n is any signed integer; compare magnitude digits in both directions. Exact operational definition: str(abs(n))==str(abs(n))[::-1]
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Number theory results depend on the stated convention.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(n):
return str(n)==str(n)[::-1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (-121,)', solve(*(-121,)), True)
check('fixture 2: (1231,)', solve(*(1231,)), False)
check('fixture 3: (0,)', solve(*(0,)), True)
check('fixture 4: (1221,)', solve(*(1221,)), 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 |
|---|---|---|---|
| fixture 1: (-121,) | False | True | Failed |
| fixture 2: (1231,) | False | False | Passed |
| fixture 3: (0,) | True | True | Passed |
| fixture 4: (1221,) | True | True | Passed |
SHA-256 / 74e3e6f28c1c155e0a17c02148dad8251f337ba06cf40c45e21c180ceee6dbc5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(n):
return str(abs(n))[0]==str(abs(n))[-1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (-121,)', solve(*(-121,)), True)
check('fixture 2: (1231,)', solve(*(1231,)), False)
check('fixture 3: (0,)', solve(*(0,)), True)
check('fixture 4: (1221,)', solve(*(1221,)), 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 |
|---|---|---|---|
| fixture 1: (-121,) | True | True | Passed |
| fixture 2: (1231,) | True | False | Failed |
| fixture 3: (0,) | True | True | Passed |
| fixture 4: (1221,) | True | True | Passed |
SHA-256 / b59b3417047440c6a5125bad1fa332e3efeb08ceb31649c2b1da7465f50ac30f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(n):
return str(abs(n))==str(abs(n))[::-1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (-121,)', solve(*(-121,)), True)
check('fixture 2: (1231,)', solve(*(1231,)), False)
check('fixture 3: (0,)', solve(*(0,)), True)
check('fixture 4: (1221,)', solve(*(1221,)), 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 |
|---|---|---|---|
| fixture 1: (-121,) | True | True | Passed |
| fixture 2: (1231,) | False | False | Passed |
| fixture 3: (0,) | True | True | Passed |
| fixture 4: (1221,) | True | True | Passed |
SHA-256 / 1a7ab3d4830128d0c25bd8595d682dc6f11251f32d52acb634c52f959d795176
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:50.988137+00:00.
Case digest / a418d97e92be42f70990c898dc878304574a69cd660411c59f029465897f7021