{"abstract":"The last signal before a buffer stop shows green.","category":"Railway interlocking logic","checks":8,"contract":"Signals 0..n-1 each protect one block; occupied[i] is the block after signal i. Evaluate from the far end: a signal shows R if its block is occupied, else Y if the next signal is R, R if the next signal is DARK, YY if the next is Y, otherwise G. Beyond the last signal the next aspect is G on an open line and R at a buffer stop. A diverging signal is capped at Y. A signal whose red lamp has failed shows DARK instead of R.","evaluation_group":"w2-railway_interlocking_logic-four-aspect-chain","failed_approach":"Seeding an open line with Y makes the last signal show YY and degrades the whole chain.","family":"w2-railway_interlocking_logic-four-aspect-chain-line-end-boundary","id":"FA-66881","implementations":{"attempt":{"sha256":"4df3a9f8c7298fd7ca451c395288defcfaadb86fb9a551b4c9a8f531281eda8c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    occ = x['occupied']\n    n = len(occ)\n    fail = set(x['lamp_fail'])\n    div = set(x['diverging'])\n    nxt = 'Y' if x['open_end'] else 'R'\n    out = [None] * n\n    for i in range(n - 1, -1, -1):\n        if occ[i]:\n            a = 'R'\n        elif nxt in ('R', 'DARK'):\n            a = 'R' if nxt == 'DARK' else 'Y'\n        elif nxt == 'Y':\n            a = 'YY'\n        else:\n            a = 'G'\n        if i in div and a in ('YY', 'G'):\n            a = 'Y'\n        if a == 'R' and i in fail:\n            a = 'DARK'\n        out[i] = a\n        nxt = a\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: failed red lamp on a clear signal', {'occupied': [False, False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 3', {'occupied': [True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['R', 'G', 'YY', 'Y']), ('boundary: diverging junction behind a green', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('sampled regression 1', {'occupied': [False, True, False, False, False, False], 'lamp_fail': [0], 'diverging': [], 'open_end': False}, ['Y', 'R', 'G', 'G', 'YY', 'Y']), ('control 4', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R']), ('control 7', {'occupied': [True, False, False, True], 'lamp_fail': [], 'diverging': [3], 'open_end': True}, ['R', 'YY', 'Y', 'R'])], [('regression: dark signal at the buffer end', {'occupied': [False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('boundary: diverging junction behind a green', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G']), ('sampled regression 41', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 14', {'occupied': [False, False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'YY', 'Y', 'R', 'G']), ('boundary: diverging junction behind a double yellow', {'occupied': [False, False, True], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'Y', 'R']), ('sampled regression 12', {'occupied': [False, False], 'lamp_fail': [0], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 15', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['Y', 'R']), ('control 18', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'G'])], [('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: open line', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 67', {'occupied': [False, True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R', 'G', 'YY', 'Y']), ('control 28', {'occupied': [False, False, False, True, False, False, False], 'lamp_fail': [6], 'diverging': [1, 5], 'open_end': True}, ['YY', 'Y', 'Y', 'R', 'YY', 'Y', 'G']), ('boundary: train two blocks ahead', {'occupied': [False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['YY', 'Y', 'R', 'G']), ('control 23', {'occupied': [True, False, True], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['R', 'Y', 'R']), ('control 26', {'occupied': [False, False, False, True], 'lamp_fail': [], 'diverging': [3], 'open_end': False}, ['G', 'YY', 'Y', 'R']), ('control 29', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R'])], [('regression: dark signal at the buffer end', {'occupied': [False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('boundary: train two blocks ahead', {'occupied': [False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['YY', 'Y', 'R', 'G']), ('sampled regression 3', {'occupied': [True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['R', 'G', 'YY', 'Y']), ('control 48', {'occupied': [False, False, False, False], 'lamp_fail': [1], 'diverging': [2], 'open_end': True}, ['G', 'YY', 'Y', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('sampled regression 34', {'occupied': [False, False, False, False, False, False, False], 'lamp_fail': [], 'diverging': [1], 'open_end': False}, ['YY', 'Y', 'G', 'G', 'G', 'YY', 'Y']), ('control 37', {'occupied': [False, False, False, False], 'lamp_fail': [0], 'diverging': [0, 3], 'open_end': True}, ['Y', 'G', 'YY', 'Y']), ('control 40', {'occupied': [False, False, False, False], 'lamp_fail': [0], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G', 'G'])], [('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: failed red lamp on a clear signal', {'occupied': [False, False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 41', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 66', {'occupied': [False, False, False], 'lamp_fail': [2], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('control 45', {'occupied': [True, False, False, True], 'lamp_fail': [3], 'diverging': [1], 'open_end': True}, ['R', 'Y', 'R', 'DARK']), ('control 48', {'occupied': [False, False, False, False], 'lamp_fail': [1], 'diverging': [2], 'open_end': True}, ['G', 'YY', 'Y', 'G']), ('control 51', {'occupied': [False, False, False, True], 'lamp_fail': [], 'diverging': [0, 2, 3], 'open_end': True}, ['Y', 'YY', 'Y', '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":"1cfb8641c0e7ed7db473e880693d05592e73a5f75d71e142b34dd6f315528d2f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    occ = x['occupied']\n    n = len(occ)\n    fail = set(x['lamp_fail'])\n    div = set(x['diverging'])\n    nxt = 'G'\n    out = [None] * n\n    for i in range(n - 1, -1, -1):\n        if occ[i]:\n            a = 'R'\n        elif nxt in ('R', 'DARK'):\n            a = 'R' if nxt == 'DARK' else 'Y'\n        elif nxt == 'Y':\n            a = 'YY'\n        else:\n            a = 'G'\n        if i in div and a in ('YY', 'G'):\n            a = 'Y'\n        if a == 'R' and i in fail:\n            a = 'DARK'\n        out[i] = a\n        nxt = a\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: failed red lamp on a clear signal', {'occupied': [False, False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 3', {'occupied': [True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['R', 'G', 'YY', 'Y']), ('boundary: diverging junction behind a green', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('sampled regression 1', {'occupied': [False, True, False, False, False, False], 'lamp_fail': [0], 'diverging': [], 'open_end': False}, ['Y', 'R', 'G', 'G', 'YY', 'Y']), ('control 4', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R']), ('control 7', {'occupied': [True, False, False, True], 'lamp_fail': [], 'diverging': [3], 'open_end': True}, ['R', 'YY', 'Y', 'R'])], [('regression: dark signal at the buffer end', {'occupied': [False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('boundary: diverging junction behind a green', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G']), ('sampled regression 41', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 14', {'occupied': [False, False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'YY', 'Y', 'R', 'G']), ('boundary: diverging junction behind a double yellow', {'occupied': [False, False, True], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'Y', 'R']), ('sampled regression 12', {'occupied': [False, False], 'lamp_fail': [0], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 15', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['Y', 'R']), ('control 18', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'G'])], [('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: open line', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 67', {'occupied': [False, True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R', 'G', 'YY', 'Y']), ('control 28', {'occupied': [False, False, False, True, False, False, False], 'lamp_fail': [6], 'diverging': [1, 5], 'open_end': True}, ['YY', 'Y', 'Y', 'R', 'YY', 'Y', 'G']), ('boundary: train two blocks ahead', {'occupied': [False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['YY', 'Y', 'R', 'G']), ('control 23', {'occupied': [True, False, True], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['R', 'Y', 'R']), ('control 26', {'occupied': [False, False, False, True], 'lamp_fail': [], 'diverging': [3], 'open_end': False}, ['G', 'YY', 'Y', 'R']), ('control 29', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R'])], [('regression: dark signal at the buffer end', {'occupied': [False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('boundary: train two blocks ahead', {'occupied': [False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['YY', 'Y', 'R', 'G']), ('sampled regression 3', {'occupied': [True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['R', 'G', 'YY', 'Y']), ('control 48', {'occupied': [False, False, False, False], 'lamp_fail': [1], 'diverging': [2], 'open_end': True}, ['G', 'YY', 'Y', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('sampled regression 34', {'occupied': [False, False, False, False, False, False, False], 'lamp_fail': [], 'diverging': [1], 'open_end': False}, ['YY', 'Y', 'G', 'G', 'G', 'YY', 'Y']), ('control 37', {'occupied': [False, False, False, False], 'lamp_fail': [0], 'diverging': [0, 3], 'open_end': True}, ['Y', 'G', 'YY', 'Y']), ('control 40', {'occupied': [False, False, False, False], 'lamp_fail': [0], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G', 'G'])], [('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: failed red lamp on a clear signal', {'occupied': [False, False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 41', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 66', {'occupied': [False, False, False], 'lamp_fail': [2], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('control 45', {'occupied': [True, False, False, True], 'lamp_fail': [3], 'diverging': [1], 'open_end': True}, ['R', 'Y', 'R', 'DARK']), ('control 48', {'occupied': [False, False, False, False], 'lamp_fail': [1], 'diverging': [2], 'open_end': True}, ['G', 'YY', 'Y', 'G']), ('control 51', {'occupied': [False, False, False, True], 'lamp_fail': [], 'diverging': [0, 2, 3], 'open_end': True}, ['Y', 'YY', 'Y', '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":"2f576559f5db04fa2a8b6eab2135f5af5f709984cf64b324a7ea4e5463a15127","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    occ = x['occupied']\n    n = len(occ)\n    fail = set(x['lamp_fail'])\n    div = set(x['diverging'])\n    nxt = 'G' if x['open_end'] else 'R'\n    out = [None] * n\n    for i in range(n - 1, -1, -1):\n        if occ[i]:\n            a = 'R'\n        elif nxt in ('R', 'DARK'):\n            a = 'R' if nxt == 'DARK' else 'Y'\n        elif nxt == 'Y':\n            a = 'YY'\n        else:\n            a = 'G'\n        if i in div and a in ('YY', 'G'):\n            a = 'Y'\n        if a == 'R' and i in fail:\n            a = 'DARK'\n        out[i] = a\n        nxt = a\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: failed red lamp on a clear signal', {'occupied': [False, False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 3', {'occupied': [True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['R', 'G', 'YY', 'Y']), ('boundary: diverging junction behind a green', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('sampled regression 1', {'occupied': [False, True, False, False, False, False], 'lamp_fail': [0], 'diverging': [], 'open_end': False}, ['Y', 'R', 'G', 'G', 'YY', 'Y']), ('control 4', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R']), ('control 7', {'occupied': [True, False, False, True], 'lamp_fail': [], 'diverging': [3], 'open_end': True}, ['R', 'YY', 'Y', 'R'])], [('regression: dark signal at the buffer end', {'occupied': [False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('boundary: diverging junction behind a green', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G']), ('sampled regression 41', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 14', {'occupied': [False, False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'YY', 'Y', 'R', 'G']), ('boundary: diverging junction behind a double yellow', {'occupied': [False, False, True], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['Y', 'Y', 'R']), ('sampled regression 12', {'occupied': [False, False], 'lamp_fail': [0], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 15', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['Y', 'R']), ('control 18', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'G'])], [('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: open line', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 67', {'occupied': [False, True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R', 'G', 'YY', 'Y']), ('control 28', {'occupied': [False, False, False, True, False, False, False], 'lamp_fail': [6], 'diverging': [1, 5], 'open_end': True}, ['YY', 'Y', 'Y', 'R', 'YY', 'Y', 'G']), ('boundary: train two blocks ahead', {'occupied': [False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['YY', 'Y', 'R', 'G']), ('control 23', {'occupied': [True, False, True], 'lamp_fail': [], 'diverging': [0], 'open_end': True}, ['R', 'Y', 'R']), ('control 26', {'occupied': [False, False, False, True], 'lamp_fail': [], 'diverging': [3], 'open_end': False}, ['G', 'YY', 'Y', 'R']), ('control 29', {'occupied': [False, True], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['Y', 'R'])], [('regression: dark signal at the buffer end', {'occupied': [False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('boundary: train two blocks ahead', {'occupied': [False, False, True, False], 'lamp_fail': [], 'diverging': [], 'open_end': True}, ['YY', 'Y', 'R', 'G']), ('sampled regression 3', {'occupied': [True, False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['R', 'G', 'YY', 'Y']), ('control 48', {'occupied': [False, False, False, False], 'lamp_fail': [1], 'diverging': [2], 'open_end': True}, ['G', 'YY', 'Y', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('sampled regression 34', {'occupied': [False, False, False, False, False, False, False], 'lamp_fail': [], 'diverging': [1], 'open_end': False}, ['YY', 'Y', 'G', 'G', 'G', 'YY', 'Y']), ('control 37', {'occupied': [False, False, False, False], 'lamp_fail': [0], 'diverging': [0, 3], 'open_end': True}, ['Y', 'G', 'YY', 'Y']), ('control 40', {'occupied': [False, False, False, False], 'lamp_fail': [0], 'diverging': [0], 'open_end': True}, ['Y', 'G', 'G', 'G'])], [('regression: buffer stop at the end', {'occupied': [False, False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['G', 'YY', 'Y']), ('boundary: failed red lamp on a clear signal', {'occupied': [False, False, False], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('sampled regression 41', {'occupied': [False, False], 'lamp_fail': [], 'diverging': [], 'open_end': False}, ['YY', 'Y']), ('control 66', {'occupied': [False, False, False], 'lamp_fail': [2], 'diverging': [], 'open_end': True}, ['G', 'G', 'G']), ('boundary: dark signal ahead', {'occupied': [False, True], 'lamp_fail': [1], 'diverging': [], 'open_end': True}, ['R', 'DARK']), ('control 45', {'occupied': [True, False, False, True], 'lamp_fail': [3], 'diverging': [1], 'open_end': True}, ['R', 'Y', 'R', 'DARK']), ('control 48', {'occupied': [False, False, False, False], 'lamp_fail': [1], 'diverging': [2], 'open_end': True}, ['G', 'YY', 'Y', 'G']), ('control 51', {'occupied': [False, False, False, True], 'lamp_fail': [], 'diverging': [0, 2, 3], 'open_end': True}, ['Y', 'YY', 'Y', '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":"Stipulated toy interlocking contract for a bounded teaching model; it makes no claim of conformance to any railway signalling standard and omits real safety cases. 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-railway_interlocking_logic-four-aspect-chain-line-end-boundary","generated_at":"2026-09-29T14:47:47.814082+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Interlocking logic decides whether trains may be given authority; a wrong decision at this point either grants unsafe movements or strands traffic.","repair":"Seed the chain with R at a buffer stop and G on an open line.","root_cause":"The chain is seeded as if the line always continued, ignoring the buffer stop.","sha256":"78b0e4f82586f690dd60502f0ac435b3d6d05055668bbbc7eaf621ea334c5757","title":"Four-aspect signal chain evaluation: line end boundary · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.924,"exit_code":1,"observations":[{"actual":["G","YY","Y"],"check":"regression: buffer stop at the end","expected":["G","YY","Y"],"passed":true},{"actual":["G","G","YY"],"check":"boundary: failed red lamp on a clear signal","expected":["G","G","G"],"passed":false},{"actual":["R","G","YY","Y"],"check":"sampled regression 3","expected":["R","G","YY","Y"],"passed":true},{"actual":["Y","G","YY"],"check":"boundary: diverging junction behind a green","expected":["Y","G","G"],"passed":false},{"actual":["R","DARK"],"check":"boundary: dark signal ahead","expected":["R","DARK"],"passed":true},{"actual":["Y","R","G","G","YY","Y"],"check":"sampled regression 1","expected":["Y","R","G","G","YY","Y"],"passed":true},{"actual":["Y","R"],"check":"control 4","expected":["Y","R"],"passed":true},{"actual":["R","YY","Y","R"],"check":"control 7","expected":["R","YY","Y","R"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: buffer stop at the end\", \"actual\": [\"G\", \"YY\", \"Y\"], \"expected\": [\"G\", \"YY\", \"Y\"], \"passed\": true}, {\"check\": \"boundary: failed red lamp on a clear signal\", \"actual\": [\"G\", \"G\", \"YY\"], \"expected\": [\"G\", \"G\", \"G\"], \"passed\": false}, {\"check\": \"sampled regression 3\", \"actual\": [\"R\", \"G\", \"YY\", \"Y\"], \"expected\": [\"R\", \"G\", \"YY\", \"Y\"], \"passed\": true}, {\"check\": \"boundary: diverging junction behind a green\", \"actual\": [\"Y\", \"G\", \"YY\"], \"expected\": [\"Y\", \"G\", \"G\"], \"passed\": false}, {\"check\": \"boundary: dark signal ahead\", \"actual\": [\"R\", \"DARK\"], \"expected\": [\"R\", \"DARK\"], \"passed\": true}, {\"check\": \"sampled regression 1\", \"actual\": [\"Y\", \"R\", \"G\", \"G\", \"YY\", \"Y\"], \"expected\": [\"Y\", \"R\", \"G\", \"G\", \"YY\", \"Y\"], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [\"Y\", \"R\"], \"expected\": [\"Y\", \"R\"], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [\"R\", \"YY\", \"Y\", \"R\"], \"expected\": [\"R\", \"YY\", \"Y\", \"R\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.229,"exit_code":1,"observations":[{"actual":["G","G","G"],"check":"regression: buffer stop at the end","expected":["G","YY","Y"],"passed":false},{"actual":["G","G","G"],"check":"boundary: failed red lamp on a clear signal","expected":["G","G","G"],"passed":true},{"actual":["R","G","G","G"],"check":"sampled regression 3","expected":["R","G","YY","Y"],"passed":false},{"actual":["Y","G","G"],"check":"boundary: diverging junction behind a green","expected":["Y","G","G"],"passed":true},{"actual":["R","DARK"],"check":"boundary: dark signal ahead","expected":["R","DARK"],"passed":true},{"actual":["Y","R","G","G","G","G"],"check":"sampled regression 1","expected":["Y","R","G","G","YY","Y"],"passed":false},{"actual":["Y","R"],"check":"control 4","expected":["Y","R"],"passed":true},{"actual":["R","YY","Y","R"],"check":"control 7","expected":["R","YY","Y","R"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: buffer stop at the end\", \"actual\": [\"G\", \"G\", \"G\"], \"expected\": [\"G\", \"YY\", \"Y\"], \"passed\": false}, {\"check\": \"boundary: failed red lamp on a clear signal\", \"actual\": [\"G\", \"G\", \"G\"], \"expected\": [\"G\", \"G\", \"G\"], \"passed\": true}, {\"check\": \"sampled regression 3\", \"actual\": [\"R\", \"G\", \"G\", \"G\"], \"expected\": [\"R\", \"G\", \"YY\", \"Y\"], \"passed\": false}, {\"check\": \"boundary: diverging junction behind a green\", \"actual\": [\"Y\", \"G\", \"G\"], \"expected\": [\"Y\", \"G\", \"G\"], \"passed\": true}, {\"check\": \"boundary: dark signal ahead\", \"actual\": [\"R\", \"DARK\"], \"expected\": [\"R\", \"DARK\"], \"passed\": true}, {\"check\": \"sampled regression 1\", \"actual\": [\"Y\", \"R\", \"G\", \"G\", \"G\", \"G\"], \"expected\": [\"Y\", \"R\", \"G\", \"G\", \"YY\", \"Y\"], \"passed\": false}, {\"check\": \"control 4\", \"actual\": [\"Y\", \"R\"], \"expected\": [\"Y\", \"R\"], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [\"R\", \"YY\", \"Y\", \"R\"], \"expected\": [\"R\", \"YY\", \"Y\", \"R\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.331,"exit_code":0,"observations":[{"actual":["G","YY","Y"],"check":"regression: buffer stop at the end","expected":["G","YY","Y"],"passed":true},{"actual":["G","G","G"],"check":"boundary: failed red lamp on a clear signal","expected":["G","G","G"],"passed":true},{"actual":["R","G","YY","Y"],"check":"sampled regression 3","expected":["R","G","YY","Y"],"passed":true},{"actual":["Y","G","G"],"check":"boundary: diverging junction behind a green","expected":["Y","G","G"],"passed":true},{"actual":["R","DARK"],"check":"boundary: dark signal ahead","expected":["R","DARK"],"passed":true},{"actual":["Y","R","G","G","YY","Y"],"check":"sampled regression 1","expected":["Y","R","G","G","YY","Y"],"passed":true},{"actual":["Y","R"],"check":"control 4","expected":["Y","R"],"passed":true},{"actual":["R","YY","Y","R"],"check":"control 7","expected":["R","YY","Y","R"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: buffer stop at the end\", \"actual\": [\"G\", \"YY\", \"Y\"], \"expected\": [\"G\", \"YY\", \"Y\"], \"passed\": true}, {\"check\": \"boundary: failed red lamp on a clear signal\", \"actual\": [\"G\", \"G\", \"G\"], \"expected\": [\"G\", \"G\", \"G\"], \"passed\": true}, {\"check\": \"sampled regression 3\", \"actual\": [\"R\", \"G\", \"YY\", \"Y\"], \"expected\": [\"R\", \"G\", \"YY\", \"Y\"], \"passed\": true}, {\"check\": \"boundary: diverging junction behind a green\", \"actual\": [\"Y\", \"G\", \"G\"], \"expected\": [\"Y\", \"G\", \"G\"], \"passed\": true}, {\"check\": \"boundary: dark signal ahead\", \"actual\": [\"R\", \"DARK\"], \"expected\": [\"R\", \"DARK\"], \"passed\": true}, {\"check\": \"sampled regression 1\", \"actual\": [\"Y\", \"R\", \"G\", \"G\", \"YY\", \"Y\"], \"expected\": [\"Y\", \"R\", \"G\", \"G\", \"YY\", \"Y\"], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [\"Y\", \"R\"], \"expected\": [\"Y\", \"R\"], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [\"R\", \"YY\", \"Y\", \"R\"], \"expected\": [\"R\", \"YY\", \"Y\", \"R\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}