{"abstract":"Numbers at the start of a sequence ignore the sequence start type.","category":"Bidirectional text layout","checks":8,"contract":"Input [classes of one isolating run sequence, sos]. W1 NSM takes the previous type (sos at start; ON after LRI/RLI/FSI/PDI). W2 EN after the last strong AL becomes AN. W3 AL->R. W4 a single ES between EN and EN -> EN; a single CS between two numbers of the same type takes that type. W5 a run of ET adjacent to EN -> EN. W6 remaining ES/ET/CS -> ON. W7 EN whose last strong (sos at start) is L -> L. Return resolved classes.","evaluation_group":"w2-bidirectional-text-layout-weak-types","failed_approach":"Initialising with L is the opposite constant, still ignoring sos.","family":"w2-bidirectional-text-layout-weak-types-european-number-context-start","id":"FA-80411","implementations":{"attempt":{"sha256":"4c819ff6e5cdfbdb0d4b12a7f59da2caafa1b71c5bdbf64c4924c01f3ec5659c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    types, sos = x\n    t = list(types)\n    n = len(t)\n    prev = sos\n    for i in range(n):\n        if t[i] == 'NSM':\n            t[i] = 'ON' if prev in ('LRI', 'RLI', 'FSI', 'PDI') else prev\n        prev = t[i]\n    last_strong = 'L'\n    for i in range(n):\n        if t[i] in ('L', 'R', 'AL'):\n            last_strong = t[i]\n        elif t[i] == 'EN' and last_strong == 'AL':\n            t[i] = 'AN'\n    t = ['R' if c == 'AL' else c for c in t]\n    for i in range(1, n - 1):\n        if t[i] == 'ES' and t[i - 1] == 'EN' and t[i + 1] == 'EN':\n            t[i] = 'EN'\n        elif t[i] == 'CS' and t[i - 1] == t[i + 1] and t[i - 1] in ('EN', 'AN'):\n            t[i] = t[i - 1]\n    i = 0\n    while i < n:\n        if t[i] == 'ET':\n            j = i\n            while j < n and t[j] == 'ET':\n                j += 1\n            if (i > 0 and t[i - 1] == 'EN') or (j < n and t[j] == 'EN'):\n                for k in range(i, j):\n                    t[k] = 'EN'\n            i = j\n        else:\n            i += 1\n    t = ['ON' if c in ('ES', 'ET', 'CS') else c for c in t]\n    strong = 'L'\n    for i in range(n):\n        if t[i] in ('L', 'R'):\n            strong = t[i]\n        elif t[i] == 'EN' and strong == 'L':\n            t[i] = 'L'\n    return t\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: European number context start', [['ON', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['EN', 'NSM'], 'L'], ['L', 'L']), ('partial-repair probe', [['ES', 'ON', 'ET', 'CS', 'EN', 'EN', 'NSM', 'LRI', 'CS', 'PDI', 'EN'], 'R'], ['ON', 'ON', 'ON', 'ON', 'EN', 'EN', 'EN', 'LRI', 'ON', 'PDI', 'EN']), ('partial-repair probe', [['ET', 'ES', 'NSM', 'CS', 'EN', 'CS', 'EN'], 'R'], ['ON', 'ON', 'ON', 'ON', 'EN', 'EN', 'EN']), ('NSM after isolate initiator', [['LRI', 'NSM', 'L', 'PDI'], 'R'], ['LRI', 'ON', 'L', 'PDI']), ('Arabic number context', [['AL', 'EN', 'CS', 'EN'], 'L'], ['R', 'AN', 'AN', 'AN']), ('control layout', [['LRI', 'WS', 'ET'], 'R'], ['LRI', 'WS', 'ON']), ('control layout', [['AN', 'AL', 'L', 'EN', 'EN', 'AL', 'WS', 'ET'], 'R'], ['AN', 'R', 'L', 'L', 'L', 'R', 'WS', 'ON'])], [('regression: European number context start', [['EN', 'ON', 'R', 'AL', 'ES', 'AL'], 'L'], ['L', 'ON', 'R', 'R', 'ON', 'R']), ('regression: European number context start', [['LRI', 'EN', 'R', 'NSM', 'R', 'L', 'ON', 'EN'], 'L'], ['LRI', 'L', 'R', 'R', 'R', 'L', 'ON', 'L']), ('partial-repair probe', [['AN', 'EN'], 'R'], ['AN', 'EN']), ('partial-repair probe', [['CS', 'EN', 'EN'], 'R'], ['ON', 'EN', 'EN']), ('Arabic number context', [['AL', 'EN', 'CS', 'EN'], 'L'], ['R', 'AN', 'AN', 'AN']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['ES', 'NSM', 'AL'], 'R'], ['ON', 'ON', 'R']), ('control layout', [['CS', 'R', 'AN', 'L', 'NSM', 'EN', 'EN', 'AN', 'ET', 'AL', 'WS'], 'R'], ['ON', 'R', 'AN', 'L', 'L', 'L', 'L', 'AN', 'ON', 'R', 'WS'])], [('regression: European number context start', [['ES', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['EN', 'AN', 'LRI', 'ES', 'ON', 'L', 'EN', 'AL', 'R'], 'L'], ['L', 'AN', 'LRI', 'ON', 'ON', 'L', 'L', 'R', 'R']), ('partial-repair probe', [['CS', 'EN', 'PDI', 'ES', 'ET', 'R'], 'R'], ['ON', 'EN', 'PDI', 'ON', 'ON', 'R']), ('partial-repair probe', [['AN', 'AN', 'CS', 'EN', 'ON', 'EN', 'EN'], 'R'], ['AN', 'AN', 'ON', 'EN', 'ON', 'EN', 'EN']), ('percent after number', [['EN', 'ET', 'ET', 'L'], 'R'], ['EN', 'EN', 'EN', 'L']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['ES', 'NSM', 'R', 'AL'], 'L'], ['ON', 'ON', 'R', 'R']), ('control layout', [['LRI', 'AL', 'ES', 'LRI'], 'R'], ['LRI', 'R', 'ON', 'LRI'])], [('regression: European number context start', [['EN', 'AL', 'ES', 'R', 'LRI'], 'L'], ['L', 'R', 'ON', 'R', 'LRI']), ('regression: European number context start', [['EN', 'NSM', 'R'], 'L'], ['L', 'L', 'R']), ('partial-repair probe', [['CS', 'NSM', 'EN', 'AN', 'ET', 'ON'], 'R'], ['ON', 'ON', 'EN', 'AN', 'ON', 'ON']), ('partial-repair probe', [['ET', 'EN', 'ON', 'PDI', 'CS', 'PDI', 'ES'], 'R'], ['EN', 'EN', 'ON', 'PDI', 'ON', 'PDI', 'ON']), ('percent after number', [['EN', 'ET', 'ET', 'L'], 'R'], ['EN', 'EN', 'EN', 'L']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['WS', 'R', 'L', 'CS', 'AL', 'EN', 'AL', 'LRI', 'EN'], 'R'], ['WS', 'R', 'L', 'ON', 'R', 'AN', 'R', 'LRI', 'AN']), ('control layout', [['CS', 'R'], 'L'], ['ON', 'R'])], [('regression: European number context start', [['ES', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['WS', 'EN', 'AL', 'CS', 'NSM', 'WS', 'EN'], 'L'], ['WS', 'L', 'R', 'ON', 'ON', 'WS', 'AN']), ('partial-repair probe', [['EN', 'L', 'CS', 'EN'], 'R'], ['EN', 'L', 'ON', 'L']), ('partial-repair probe', [['AN', 'PDI', 'EN', 'CS', 'R', 'NSM', 'AN', 'ET'], 'R'], ['AN', 'PDI', 'EN', 'ON', 'R', 'R', 'AN', 'ON']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('NSM after isolate initiator', [['LRI', 'NSM', 'L', 'PDI'], 'R'], ['LRI', 'ON', 'L', 'PDI']), ('control layout', [['LRI', 'AN', 'L', 'AL', 'ON'], 'R'], ['LRI', 'AN', 'L', 'R', 'ON']), ('control layout', [['R', 'NSM', 'AN', 'CS', 'ET', 'ET', 'LRI', 'NSM', 'L', 'EN', 'R'], 'R'], ['R', 'R', 'AN', 'ON', 'ON', 'ON', 'LRI', 'ON', 'L', 'L', 'R'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"11fa11c9274791684ee2a29a5184fdf2bafabf1ecda50f1931803e78690f429c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    types, sos = x\n    t = list(types)\n    n = len(t)\n    prev = sos\n    for i in range(n):\n        if t[i] == 'NSM':\n            t[i] = 'ON' if prev in ('LRI', 'RLI', 'FSI', 'PDI') else prev\n        prev = t[i]\n    last_strong = 'R'\n    for i in range(n):\n        if t[i] in ('L', 'R', 'AL'):\n            last_strong = t[i]\n        elif t[i] == 'EN' and last_strong == 'AL':\n            t[i] = 'AN'\n    t = ['R' if c == 'AL' else c for c in t]\n    for i in range(1, n - 1):\n        if t[i] == 'ES' and t[i - 1] == 'EN' and t[i + 1] == 'EN':\n            t[i] = 'EN'\n        elif t[i] == 'CS' and t[i - 1] == t[i + 1] and t[i - 1] in ('EN', 'AN'):\n            t[i] = t[i - 1]\n    i = 0\n    while i < n:\n        if t[i] == 'ET':\n            j = i\n            while j < n and t[j] == 'ET':\n                j += 1\n            if (i > 0 and t[i - 1] == 'EN') or (j < n and t[j] == 'EN'):\n                for k in range(i, j):\n                    t[k] = 'EN'\n            i = j\n        else:\n            i += 1\n    t = ['ON' if c in ('ES', 'ET', 'CS') else c for c in t]\n    strong = 'R'\n    for i in range(n):\n        if t[i] in ('L', 'R'):\n            strong = t[i]\n        elif t[i] == 'EN' and strong == 'L':\n            t[i] = 'L'\n    return t\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: European number context start', [['ON', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['EN', 'NSM'], 'L'], ['L', 'L']), ('partial-repair probe', [['ES', 'ON', 'ET', 'CS', 'EN', 'EN', 'NSM', 'LRI', 'CS', 'PDI', 'EN'], 'R'], ['ON', 'ON', 'ON', 'ON', 'EN', 'EN', 'EN', 'LRI', 'ON', 'PDI', 'EN']), ('partial-repair probe', [['ET', 'ES', 'NSM', 'CS', 'EN', 'CS', 'EN'], 'R'], ['ON', 'ON', 'ON', 'ON', 'EN', 'EN', 'EN']), ('NSM after isolate initiator', [['LRI', 'NSM', 'L', 'PDI'], 'R'], ['LRI', 'ON', 'L', 'PDI']), ('Arabic number context', [['AL', 'EN', 'CS', 'EN'], 'L'], ['R', 'AN', 'AN', 'AN']), ('control layout', [['LRI', 'WS', 'ET'], 'R'], ['LRI', 'WS', 'ON']), ('control layout', [['AN', 'AL', 'L', 'EN', 'EN', 'AL', 'WS', 'ET'], 'R'], ['AN', 'R', 'L', 'L', 'L', 'R', 'WS', 'ON'])], [('regression: European number context start', [['EN', 'ON', 'R', 'AL', 'ES', 'AL'], 'L'], ['L', 'ON', 'R', 'R', 'ON', 'R']), ('regression: European number context start', [['LRI', 'EN', 'R', 'NSM', 'R', 'L', 'ON', 'EN'], 'L'], ['LRI', 'L', 'R', 'R', 'R', 'L', 'ON', 'L']), ('partial-repair probe', [['AN', 'EN'], 'R'], ['AN', 'EN']), ('partial-repair probe', [['CS', 'EN', 'EN'], 'R'], ['ON', 'EN', 'EN']), ('Arabic number context', [['AL', 'EN', 'CS', 'EN'], 'L'], ['R', 'AN', 'AN', 'AN']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['ES', 'NSM', 'AL'], 'R'], ['ON', 'ON', 'R']), ('control layout', [['CS', 'R', 'AN', 'L', 'NSM', 'EN', 'EN', 'AN', 'ET', 'AL', 'WS'], 'R'], ['ON', 'R', 'AN', 'L', 'L', 'L', 'L', 'AN', 'ON', 'R', 'WS'])], [('regression: European number context start', [['ES', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['EN', 'AN', 'LRI', 'ES', 'ON', 'L', 'EN', 'AL', 'R'], 'L'], ['L', 'AN', 'LRI', 'ON', 'ON', 'L', 'L', 'R', 'R']), ('partial-repair probe', [['CS', 'EN', 'PDI', 'ES', 'ET', 'R'], 'R'], ['ON', 'EN', 'PDI', 'ON', 'ON', 'R']), ('partial-repair probe', [['AN', 'AN', 'CS', 'EN', 'ON', 'EN', 'EN'], 'R'], ['AN', 'AN', 'ON', 'EN', 'ON', 'EN', 'EN']), ('percent after number', [['EN', 'ET', 'ET', 'L'], 'R'], ['EN', 'EN', 'EN', 'L']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['ES', 'NSM', 'R', 'AL'], 'L'], ['ON', 'ON', 'R', 'R']), ('control layout', [['LRI', 'AL', 'ES', 'LRI'], 'R'], ['LRI', 'R', 'ON', 'LRI'])], [('regression: European number context start', [['EN', 'AL', 'ES', 'R', 'LRI'], 'L'], ['L', 'R', 'ON', 'R', 'LRI']), ('regression: European number context start', [['EN', 'NSM', 'R'], 'L'], ['L', 'L', 'R']), ('partial-repair probe', [['CS', 'NSM', 'EN', 'AN', 'ET', 'ON'], 'R'], ['ON', 'ON', 'EN', 'AN', 'ON', 'ON']), ('partial-repair probe', [['ET', 'EN', 'ON', 'PDI', 'CS', 'PDI', 'ES'], 'R'], ['EN', 'EN', 'ON', 'PDI', 'ON', 'PDI', 'ON']), ('percent after number', [['EN', 'ET', 'ET', 'L'], 'R'], ['EN', 'EN', 'EN', 'L']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['WS', 'R', 'L', 'CS', 'AL', 'EN', 'AL', 'LRI', 'EN'], 'R'], ['WS', 'R', 'L', 'ON', 'R', 'AN', 'R', 'LRI', 'AN']), ('control layout', [['CS', 'R'], 'L'], ['ON', 'R'])], [('regression: European number context start', [['ES', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['WS', 'EN', 'AL', 'CS', 'NSM', 'WS', 'EN'], 'L'], ['WS', 'L', 'R', 'ON', 'ON', 'WS', 'AN']), ('partial-repair probe', [['EN', 'L', 'CS', 'EN'], 'R'], ['EN', 'L', 'ON', 'L']), ('partial-repair probe', [['AN', 'PDI', 'EN', 'CS', 'R', 'NSM', 'AN', 'ET'], 'R'], ['AN', 'PDI', 'EN', 'ON', 'R', 'R', 'AN', 'ON']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('NSM after isolate initiator', [['LRI', 'NSM', 'L', 'PDI'], 'R'], ['LRI', 'ON', 'L', 'PDI']), ('control layout', [['LRI', 'AN', 'L', 'AL', 'ON'], 'R'], ['LRI', 'AN', 'L', 'R', 'ON']), ('control layout', [['R', 'NSM', 'AN', 'CS', 'ET', 'ET', 'LRI', 'NSM', 'L', 'EN', 'R'], 'R'], ['R', 'R', 'AN', 'ON', 'ON', 'ON', 'LRI', 'ON', 'L', 'L', 'R'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"942cdbdbe6b395ef66ba7ecc56bee65edc6f44fda54711505d7d1ad57c83695e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    types, sos = x\n    t = list(types)\n    n = len(t)\n    prev = sos\n    for i in range(n):\n        if t[i] == 'NSM':\n            t[i] = 'ON' if prev in ('LRI', 'RLI', 'FSI', 'PDI') else prev\n        prev = t[i]\n    last_strong = sos\n    for i in range(n):\n        if t[i] in ('L', 'R', 'AL'):\n            last_strong = t[i]\n        elif t[i] == 'EN' and last_strong == 'AL':\n            t[i] = 'AN'\n    t = ['R' if c == 'AL' else c for c in t]\n    for i in range(1, n - 1):\n        if t[i] == 'ES' and t[i - 1] == 'EN' and t[i + 1] == 'EN':\n            t[i] = 'EN'\n        elif t[i] == 'CS' and t[i - 1] == t[i + 1] and t[i - 1] in ('EN', 'AN'):\n            t[i] = t[i - 1]\n    i = 0\n    while i < n:\n        if t[i] == 'ET':\n            j = i\n            while j < n and t[j] == 'ET':\n                j += 1\n            if (i > 0 and t[i - 1] == 'EN') or (j < n and t[j] == 'EN'):\n                for k in range(i, j):\n                    t[k] = 'EN'\n            i = j\n        else:\n            i += 1\n    t = ['ON' if c in ('ES', 'ET', 'CS') else c for c in t]\n    strong = sos\n    for i in range(n):\n        if t[i] in ('L', 'R'):\n            strong = t[i]\n        elif t[i] == 'EN' and strong == 'L':\n            t[i] = 'L'\n    return t\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: European number context start', [['ON', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['EN', 'NSM'], 'L'], ['L', 'L']), ('partial-repair probe', [['ES', 'ON', 'ET', 'CS', 'EN', 'EN', 'NSM', 'LRI', 'CS', 'PDI', 'EN'], 'R'], ['ON', 'ON', 'ON', 'ON', 'EN', 'EN', 'EN', 'LRI', 'ON', 'PDI', 'EN']), ('partial-repair probe', [['ET', 'ES', 'NSM', 'CS', 'EN', 'CS', 'EN'], 'R'], ['ON', 'ON', 'ON', 'ON', 'EN', 'EN', 'EN']), ('NSM after isolate initiator', [['LRI', 'NSM', 'L', 'PDI'], 'R'], ['LRI', 'ON', 'L', 'PDI']), ('Arabic number context', [['AL', 'EN', 'CS', 'EN'], 'L'], ['R', 'AN', 'AN', 'AN']), ('control layout', [['LRI', 'WS', 'ET'], 'R'], ['LRI', 'WS', 'ON']), ('control layout', [['AN', 'AL', 'L', 'EN', 'EN', 'AL', 'WS', 'ET'], 'R'], ['AN', 'R', 'L', 'L', 'L', 'R', 'WS', 'ON'])], [('regression: European number context start', [['EN', 'ON', 'R', 'AL', 'ES', 'AL'], 'L'], ['L', 'ON', 'R', 'R', 'ON', 'R']), ('regression: European number context start', [['LRI', 'EN', 'R', 'NSM', 'R', 'L', 'ON', 'EN'], 'L'], ['LRI', 'L', 'R', 'R', 'R', 'L', 'ON', 'L']), ('partial-repair probe', [['AN', 'EN'], 'R'], ['AN', 'EN']), ('partial-repair probe', [['CS', 'EN', 'EN'], 'R'], ['ON', 'EN', 'EN']), ('Arabic number context', [['AL', 'EN', 'CS', 'EN'], 'L'], ['R', 'AN', 'AN', 'AN']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['ES', 'NSM', 'AL'], 'R'], ['ON', 'ON', 'R']), ('control layout', [['CS', 'R', 'AN', 'L', 'NSM', 'EN', 'EN', 'AN', 'ET', 'AL', 'WS'], 'R'], ['ON', 'R', 'AN', 'L', 'L', 'L', 'L', 'AN', 'ON', 'R', 'WS'])], [('regression: European number context start', [['ES', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['EN', 'AN', 'LRI', 'ES', 'ON', 'L', 'EN', 'AL', 'R'], 'L'], ['L', 'AN', 'LRI', 'ON', 'ON', 'L', 'L', 'R', 'R']), ('partial-repair probe', [['CS', 'EN', 'PDI', 'ES', 'ET', 'R'], 'R'], ['ON', 'EN', 'PDI', 'ON', 'ON', 'R']), ('partial-repair probe', [['AN', 'AN', 'CS', 'EN', 'ON', 'EN', 'EN'], 'R'], ['AN', 'AN', 'ON', 'EN', 'ON', 'EN', 'EN']), ('percent after number', [['EN', 'ET', 'ET', 'L'], 'R'], ['EN', 'EN', 'EN', 'L']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['ES', 'NSM', 'R', 'AL'], 'L'], ['ON', 'ON', 'R', 'R']), ('control layout', [['LRI', 'AL', 'ES', 'LRI'], 'R'], ['LRI', 'R', 'ON', 'LRI'])], [('regression: European number context start', [['EN', 'AL', 'ES', 'R', 'LRI'], 'L'], ['L', 'R', 'ON', 'R', 'LRI']), ('regression: European number context start', [['EN', 'NSM', 'R'], 'L'], ['L', 'L', 'R']), ('partial-repair probe', [['CS', 'NSM', 'EN', 'AN', 'ET', 'ON'], 'R'], ['ON', 'ON', 'EN', 'AN', 'ON', 'ON']), ('partial-repair probe', [['ET', 'EN', 'ON', 'PDI', 'CS', 'PDI', 'ES'], 'R'], ['EN', 'EN', 'ON', 'PDI', 'ON', 'PDI', 'ON']), ('percent after number', [['EN', 'ET', 'ET', 'L'], 'R'], ['EN', 'EN', 'EN', 'L']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('control layout', [['WS', 'R', 'L', 'CS', 'AL', 'EN', 'AL', 'LRI', 'EN'], 'R'], ['WS', 'R', 'L', 'ON', 'R', 'AN', 'R', 'LRI', 'AN']), ('control layout', [['CS', 'R'], 'L'], ['ON', 'R'])], [('regression: European number context start', [['ES', 'EN'], 'L'], ['ON', 'L']), ('regression: European number context start', [['WS', 'EN', 'AL', 'CS', 'NSM', 'WS', 'EN'], 'L'], ['WS', 'L', 'R', 'ON', 'ON', 'WS', 'AN']), ('partial-repair probe', [['EN', 'L', 'CS', 'EN'], 'R'], ['EN', 'L', 'ON', 'L']), ('partial-repair probe', [['AN', 'PDI', 'EN', 'CS', 'R', 'NSM', 'AN', 'ET'], 'R'], ['AN', 'PDI', 'EN', 'ON', 'R', 'R', 'AN', 'ON']), ('NSM chain after R', [['R', 'NSM', 'NSM', 'EN'], 'L'], ['R', 'R', 'R', 'EN']), ('NSM after isolate initiator', [['LRI', 'NSM', 'L', 'PDI'], 'R'], ['LRI', 'ON', 'L', 'PDI']), ('control layout', [['LRI', 'AN', 'L', 'AL', 'ON'], 'R'], ['LRI', 'AN', 'L', 'R', 'ON']), ('control layout', [['R', 'NSM', 'AN', 'CS', 'ET', 'ET', 'LRI', 'NSM', 'L', 'EN', 'R'], 'R'], ['R', 'R', 'AN', 'ON', 'ON', 'ON', 'LRI', 'ON', 'L', 'L', 'R'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic toy bidi model over stipulated class labels and integer levels; it is inspired by, but does not claim conformance to, any published algorithm. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-bidirectional-text-layout-weak-types-european-number-context-start","generated_at":"2026-09-29T14:49:53.537251+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Mixed right-to-left and left-to-right text must resolve levels and visual order exactly, or words, numbers and carets land in the wrong place.","repair":"Initialise the W7 context with sos.","root_cause":"W7 starts its last-strong search from R instead of sos.","sha256":"2adbb395e521f6c0c876749ad9a486c91c43fa2a8597f155878f666a0f281b34","title":"Weak type resolution: European number context start · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.419,"exit_code":1,"observations":[{"actual":["ON","L"],"check":"regression: European number context start","expected":["ON","L"],"passed":true},{"actual":["L","L"],"check":"regression: European number context start","expected":["L","L"],"passed":true},{"actual":["ON","ON","ON","ON","L","L","L","LRI","ON","PDI","L"],"check":"partial-repair probe","expected":["ON","ON","ON","ON","EN","EN","EN","LRI","ON","PDI","EN"],"passed":false},{"actual":["ON","ON","ON","ON","L","L","L"],"check":"partial-repair probe","expected":["ON","ON","ON","ON","EN","EN","EN"],"passed":false},{"actual":["LRI","ON","L","PDI"],"check":"NSM after isolate initiator","expected":["LRI","ON","L","PDI"],"passed":true},{"actual":["R","AN","AN","AN"],"check":"Arabic number context","expected":["R","AN","AN","AN"],"passed":true},{"actual":["LRI","WS","ON"],"check":"control layout","expected":["LRI","WS","ON"],"passed":true},{"actual":["AN","R","L","L","L","R","WS","ON"],"check":"control layout","expected":["AN","R","L","L","L","R","WS","ON"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: European number context start\", \"actual\": [\"ON\", \"L\"], \"expected\": [\"ON\", \"L\"], \"passed\": true}, {\"check\": \"regression: European number context start\", \"actual\": [\"L\", \"L\"], \"expected\": [\"L\", \"L\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"ON\", \"ON\", \"ON\", \"ON\", \"L\", \"L\", \"L\", \"LRI\", \"ON\", \"PDI\", \"L\"], \"expected\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\", \"LRI\", \"ON\", \"PDI\", \"EN\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"ON\", \"ON\", \"ON\", \"ON\", \"L\", \"L\", \"L\"], \"expected\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\"], \"passed\": false}, {\"check\": \"NSM after isolate initiator\", \"actual\": [\"LRI\", \"ON\", \"L\", \"PDI\"], \"expected\": [\"LRI\", \"ON\", \"L\", \"PDI\"], \"passed\": true}, {\"check\": \"Arabic number context\", \"actual\": [\"R\", \"AN\", \"AN\", \"AN\"], \"expected\": [\"R\", \"AN\", \"AN\", \"AN\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"LRI\", \"WS\", \"ON\"], \"expected\": [\"LRI\", \"WS\", \"ON\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"AN\", \"R\", \"L\", \"L\", \"L\", \"R\", \"WS\", \"ON\"], \"expected\": [\"AN\", \"R\", \"L\", \"L\", \"L\", \"R\", \"WS\", \"ON\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.829,"exit_code":1,"observations":[{"actual":["ON","EN"],"check":"regression: European number context start","expected":["ON","L"],"passed":false},{"actual":["EN","EN"],"check":"regression: European number context start","expected":["L","L"],"passed":false},{"actual":["ON","ON","ON","ON","EN","EN","EN","LRI","ON","PDI","EN"],"check":"partial-repair probe","expected":["ON","ON","ON","ON","EN","EN","EN","LRI","ON","PDI","EN"],"passed":true},{"actual":["ON","ON","ON","ON","EN","EN","EN"],"check":"partial-repair probe","expected":["ON","ON","ON","ON","EN","EN","EN"],"passed":true},{"actual":["LRI","ON","L","PDI"],"check":"NSM after isolate initiator","expected":["LRI","ON","L","PDI"],"passed":true},{"actual":["R","AN","AN","AN"],"check":"Arabic number context","expected":["R","AN","AN","AN"],"passed":true},{"actual":["LRI","WS","ON"],"check":"control layout","expected":["LRI","WS","ON"],"passed":true},{"actual":["AN","R","L","L","L","R","WS","ON"],"check":"control layout","expected":["AN","R","L","L","L","R","WS","ON"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: European number context start\", \"actual\": [\"ON\", \"EN\"], \"expected\": [\"ON\", \"L\"], \"passed\": false}, {\"check\": \"regression: European number context start\", \"actual\": [\"EN\", \"EN\"], \"expected\": [\"L\", \"L\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\", \"LRI\", \"ON\", \"PDI\", \"EN\"], \"expected\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\", \"LRI\", \"ON\", \"PDI\", \"EN\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\"], \"expected\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\"], \"passed\": true}, {\"check\": \"NSM after isolate initiator\", \"actual\": [\"LRI\", \"ON\", \"L\", \"PDI\"], \"expected\": [\"LRI\", \"ON\", \"L\", \"PDI\"], \"passed\": true}, {\"check\": \"Arabic number context\", \"actual\": [\"R\", \"AN\", \"AN\", \"AN\"], \"expected\": [\"R\", \"AN\", \"AN\", \"AN\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"LRI\", \"WS\", \"ON\"], \"expected\": [\"LRI\", \"WS\", \"ON\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"AN\", \"R\", \"L\", \"L\", \"L\", \"R\", \"WS\", \"ON\"], \"expected\": [\"AN\", \"R\", \"L\", \"L\", \"L\", \"R\", \"WS\", \"ON\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.686,"exit_code":0,"observations":[{"actual":["ON","L"],"check":"regression: European number context start","expected":["ON","L"],"passed":true},{"actual":["L","L"],"check":"regression: European number context start","expected":["L","L"],"passed":true},{"actual":["ON","ON","ON","ON","EN","EN","EN","LRI","ON","PDI","EN"],"check":"partial-repair probe","expected":["ON","ON","ON","ON","EN","EN","EN","LRI","ON","PDI","EN"],"passed":true},{"actual":["ON","ON","ON","ON","EN","EN","EN"],"check":"partial-repair probe","expected":["ON","ON","ON","ON","EN","EN","EN"],"passed":true},{"actual":["LRI","ON","L","PDI"],"check":"NSM after isolate initiator","expected":["LRI","ON","L","PDI"],"passed":true},{"actual":["R","AN","AN","AN"],"check":"Arabic number context","expected":["R","AN","AN","AN"],"passed":true},{"actual":["LRI","WS","ON"],"check":"control layout","expected":["LRI","WS","ON"],"passed":true},{"actual":["AN","R","L","L","L","R","WS","ON"],"check":"control layout","expected":["AN","R","L","L","L","R","WS","ON"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: European number context start\", \"actual\": [\"ON\", \"L\"], \"expected\": [\"ON\", \"L\"], \"passed\": true}, {\"check\": \"regression: European number context start\", \"actual\": [\"L\", \"L\"], \"expected\": [\"L\", \"L\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\", \"LRI\", \"ON\", \"PDI\", \"EN\"], \"expected\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\", \"LRI\", \"ON\", \"PDI\", \"EN\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\"], \"expected\": [\"ON\", \"ON\", \"ON\", \"ON\", \"EN\", \"EN\", \"EN\"], \"passed\": true}, {\"check\": \"NSM after isolate initiator\", \"actual\": [\"LRI\", \"ON\", \"L\", \"PDI\"], \"expected\": [\"LRI\", \"ON\", \"L\", \"PDI\"], \"passed\": true}, {\"check\": \"Arabic number context\", \"actual\": [\"R\", \"AN\", \"AN\", \"AN\"], \"expected\": [\"R\", \"AN\", \"AN\", \"AN\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"LRI\", \"WS\", \"ON\"], \"expected\": [\"LRI\", \"WS\", \"ON\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"AN\", \"R\", \"L\", \"L\", \"L\", \"R\", \"WS\", \"ON\"], \"expected\": [\"AN\", \"R\", \"L\", \"L\", \"L\", \"R\", \"WS\", \"ON\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}