FA-4056 / Parsing / Open access
A subtraction chain builds a right-associated tree · case 01
A subtraction chain builds a right-associated tree.
ROOT CAUSE
The implementation applies an operation whose text or grammar semantics violate this contract: Parse a valid alternating operand/minus token list with left associativity.
THE FAILURE
The implementation applies an operation whose text or grammar semantics violate this contract: Parse a valid alternating operand/minus token list with left associativity.
Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.
Case contract
Parse a valid alternating operand/minus token list with left associativity.
Why this case matters
A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap
N = 1
observations = []
def solve(x):
try:
tree=x[-1]
for i in range(len(x)-2,0,-2): tree=[x[i],x[i-1],tree]
return tree
except Exception as exc:
return {"error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve(['a', '-', 'b', '-', 'c']), ['-', ['-', 'a', 'b'], 'c'])
check('boundary 2', solve(['x']), 'x')
check('boundary 3', solve(['a', '-', 'b']), ['-', 'a', 'b'])
check('boundary 4', solve(['a', '-', 'b', '-', 'c', '-', 'd']), ['-', ['-', ['-', 'a', 'b'], 'c'], 'd'])
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 |
|---|---|---|---|
| boundary 1 | ['-', 'a', ['-', 'b', 'c']] | ['-', ['-', 'a', 'b'], 'c'] | Failed |
| boundary 2 | x | x | Passed |
| boundary 3 | ['-', 'a', 'b'] | ['-', 'a', 'b'] | Passed |
| boundary 4 | ['-', 'a', ['-', 'b', ['-', 'c', 'd']]] | ['-', ['-', ['-', 'a', 'b'], 'c'], 'd'] | Failed |
SHA-256 / 84829e7f67a1c8abdb24cae12f44c24ff62865ab9cafdbd0480d36cbfada5827
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap
N = 1
observations = []
def solve(x):
try:
return ['-',x[0],x[-1]] if len(x)>1 else x[0]
except Exception as exc:
return {"error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve(['a', '-', 'b', '-', 'c']), ['-', ['-', 'a', 'b'], 'c'])
check('boundary 2', solve(['x']), 'x')
check('boundary 3', solve(['a', '-', 'b']), ['-', 'a', 'b'])
check('boundary 4', solve(['a', '-', 'b', '-', 'c', '-', 'd']), ['-', ['-', ['-', 'a', 'b'], 'c'], 'd'])
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 |
|---|---|---|---|
| boundary 1 | ['-', 'a', 'c'] | ['-', ['-', 'a', 'b'], 'c'] | Failed |
| boundary 2 | x | x | Passed |
| boundary 3 | ['-', 'a', 'b'] | ['-', 'a', 'b'] | Passed |
| boundary 4 | ['-', 'a', 'd'] | ['-', ['-', ['-', 'a', 'b'], 'c'], 'd'] | Failed |
SHA-256 / 70ed0e0f6d80ec602c4d32b7bc480f501f9b0f878d74a9016821ccf3699415e0
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 4 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:34.961370+00:00.
Case digest / af26ff5fef39152fecbaea6e7547a2fb3e29264e8ec96a818cacfd133ce831fb