{"abstract":"A contact fight reports one merged chain with the liberties of both sides.","category":"Go territory scoring","checks":8,"contract":"Input [board, row, col]. Return [colour, chain_size, distinct_orthogonal_empty_liberties]; an empty point gives [\".\", 0, 0].","contract_signature":"x","evaluation_group":"w2-go-territory-scoring-chain-liberties","failed_approach":"Expanding through empty points as well as own stones reports whole regions instead of chains.","family":"w2-go-territory-scoring-chain-liberties-chain-membership-colour","id":"FA-83101","implementations":{"attempt":{"sha256":"ca51a4724a194583825fa783bdf9bd5ed8fc15e82034ce405e67dbf050224512","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    board, r, c = x\n    n = len(board)\n    m = len(board[0])\n    col = board[r][c]\n    if col == '.':\n        return ['.', 0, 0]\n    chain = [(r, c)]\n    k = 0\n    while k < len(chain):\n        i, j = chain[k]\n        k += 1\n        for p, q in ((i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] in (col, '.') and (p, q) not in chain:\n                chain.append((p, q))\n    libs = set()\n    for i, j in chain:\n        for p, q in ((i, j - 1), (i, j + 1), (i - 1, j), (i + 1, j)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] == '.':\n                libs.add((p, q))\n    return [col, len(chain), len(libs)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['B..W', 'B..W', 'B..W', 'B..W'], 3, 0], ['B', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 3], ['W', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 2], ['.', 0, 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 1], ['B', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 1], ['B', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 0], ['.', 0, 0]]], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 3], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 1], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 2], ['B', 7, 6]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], ['.', 0, 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 1, 1], ['B', 1, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 3, 0], ['B', 3, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 4, 3], ['.', 0, 0]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 4, 4], ['B', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 0, 0], ['W', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 1, 0], ['.', 0, 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 1], ['W', 1, 2]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 4, 0], ['B', 1, 1]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 3, 0], ['W', 1, 1]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0, 2], ['.', 0, 0]]], [[[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 4, 0], ['B', 1, 1]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 0], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 2], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 1], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2, 2], ['.', 0, 0]], [[['WWW', 'W.W', 'WWW'], 2, 1], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 1, 2], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 0, 2], ['W', 8, 1]]], [[[['WWW', 'W.W', 'WWW'], 0, 2], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 1, 1], ['.', 0, 0]], [[['B.W', '...', 'W.B'], 0, 0], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 0, 2], ['W', 1, 2]], [[['B.W', '...', 'W.B'], 2, 2], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 1, 2], ['.', 0, 0]], [[['.B...', 'B....', '.....', '....W', '...W.'], 4, 3], ['W', 1, 3]], [[['BW.', 'BW.', 'BW.'], 0, 1], ['W', 3, 3]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"chain case %d\" % i, 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":"18c6b4a4759ee9220ec50179ea657e93751980915f3624d4b4aeb33a5adb7b34","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    board, r, c = x\n    n = len(board)\n    m = len(board[0])\n    col = board[r][c]\n    if col == '.':\n        return ['.', 0, 0]\n    chain = [(r, c)]\n    k = 0\n    while k < len(chain):\n        i, j = chain[k]\n        k += 1\n        for p, q in ((i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] != '.' and (p, q) not in chain:\n                chain.append((p, q))\n    libs = set()\n    for i, j in chain:\n        for p, q in ((i, j - 1), (i, j + 1), (i - 1, j), (i + 1, j)):\n            if 0 <= p < n and 0 <= q < m and board[p][q] == '.':\n                libs.add((p, q))\n    return [col, len(chain), len(libs)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['B..W', 'B..W', 'B..W', 'B..W'], 3, 0], ['B', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 3], ['W', 4, 4]], [[['B..W', 'B..W', 'B..W', 'B..W'], 3, 2], ['.', 0, 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 1], ['B', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 1], ['B', 4, 4]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 0], ['.', 0, 0]]], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 3], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 1], ['W', 6, 4]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 2], ['B', 7, 6]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], ['.', 0, 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 1, 1], ['B', 1, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 3, 0], ['B', 3, 4]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 4, 3], ['.', 0, 0]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 2, 2], ['B', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 4, 4], ['B', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 0, 0], ['W', 1, 2]], [[['W....', '.....', '.....', '.....', '....B'], 1, 0], ['.', 0, 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 1], ['W', 1, 2]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 4, 0], ['B', 1, 1]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 3, 0], ['W', 1, 1]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0, 2], ['.', 0, 0]]], [[[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 4, 0], ['B', 1, 1]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 0], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 3, 2], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 1], ['B', 12, 4]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2, 2], ['.', 0, 0]], [[['WWW', 'W.W', 'WWW'], 2, 1], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 1, 2], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 0, 2], ['W', 8, 1]]], [[[['WWW', 'W.W', 'WWW'], 0, 2], ['W', 8, 1]], [[['WWW', 'W.W', 'WWW'], 1, 1], ['.', 0, 0]], [[['B.W', '...', 'W.B'], 0, 0], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 0, 2], ['W', 1, 2]], [[['B.W', '...', 'W.B'], 2, 2], ['B', 1, 2]], [[['B.W', '...', 'W.B'], 1, 2], ['.', 0, 0]], [[['.B...', 'B....', '.....', '....W', '...W.'], 4, 3], ['W', 1, 3]], [[['BW.', 'BW.', 'BW.'], 0, 1], ['W', 3, 3]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"chain case %d\" % i, 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":"Small rectangular toy boards given as strings of B, W and dot; a bounded teaching model of one scoring or bookkeeping rule, not a complete rules engine or server implementation. 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-go-territory-scoring-chain-liberties-chain-membership-colour","generated_at":"2026-09-29T14:50:18.548150+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Go servers and scoring tools compute this value automatically; a wrong answer changes a game result.","root_cause":"The chain expansion accepts any stone rather than stones of the clicked colour.","sha256":"0162365a5678b147b3e0f33b3244bb4674a6fb9c114ecce521229a78f88fe42b","title":"Chains grow through adjacent opponent stones · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.381,"exit_code":1,"observations":[{"actual":["B",12,8],"check":"chain case 0","expected":["B",4,4],"passed":false},{"actual":["W",12,8],"check":"chain case 1","expected":["W",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 2","expected":[".",0,0],"passed":true},{"actual":["W",8,4],"check":"chain case 3","expected":["W",4,4],"passed":false},{"actual":["W",8,4],"check":"chain case 4","expected":["W",4,4],"passed":false},{"actual":["B",8,4],"check":"chain case 5","expected":["B",4,4],"passed":false},{"actual":["B",8,4],"check":"chain case 6","expected":["B",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 7","expected":[".",0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"chain case 0\", \"actual\": [\"B\", 12, 8], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 1\", \"actual\": [\"W\", 12, 8], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 2\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 3\", \"actual\": [\"W\", 8, 4], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 4\", \"actual\": [\"W\", 8, 4], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 5\", \"actual\": [\"B\", 8, 4], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 6\", \"actual\": [\"B\", 8, 4], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 7\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.45,"exit_code":1,"observations":[{"actual":["B",4,4],"check":"chain case 0","expected":["B",4,4],"passed":true},{"actual":["W",4,4],"check":"chain case 1","expected":["W",4,4],"passed":true},{"actual":[".",0,0],"check":"chain case 2","expected":[".",0,0],"passed":true},{"actual":["W",8,8],"check":"chain case 3","expected":["W",4,4],"passed":false},{"actual":["W",8,8],"check":"chain case 4","expected":["W",4,4],"passed":false},{"actual":["B",8,8],"check":"chain case 5","expected":["B",4,4],"passed":false},{"actual":["B",8,8],"check":"chain case 6","expected":["B",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 7","expected":[".",0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"chain case 0\", \"actual\": [\"B\", 4, 4], \"expected\": [\"B\", 4, 4], \"passed\": true}, {\"check\": \"chain case 1\", \"actual\": [\"W\", 4, 4], \"expected\": [\"W\", 4, 4], \"passed\": true}, {\"check\": \"chain case 2\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 3\", \"actual\": [\"W\", 8, 8], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 4\", \"actual\": [\"W\", 8, 8], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 5\", \"actual\": [\"B\", 8, 8], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 6\", \"actual\": [\"B\", 8, 8], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 7\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}