{"abstract":"Edge and corner chains report extra liberties.","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":"An off-by-one upper bound still counts the bottom and right edges as liberties.","family":"w2-go-territory-scoring-chain-liberties-off-board-liberties","id":"FA-83096","implementations":{"attempt":{"sha256":"eb1cfdcd9326ef08de1016eacfd2dfebe197e4b9d5eaa31cc8bb6456aa8e2be4","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] == 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 (p == n or q == m or 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.', 'B.B', '.B.'], 1, 0], ['B', 1, 3]], [[['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, 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..W', 'B..W', 'B..W', 'B..W'], 1, 0], ['B', 4, 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]], [[['W....', '.....', '.....', '.....', '....B'], 4, 4], ['B', 1, 2]]], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['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]], [[['WWW', 'W.W', 'WWW'], 2, 1], ['W', 8, 1]]], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 3], ['W', 6, 4]], [[['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]], [[['.B...', 'B....', '.....', '....W', '...W.'], 4, 3], ['W', 1, 3]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 3, 0], ['B', 3, 4]], [[['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]], [[['WB.B', 'B.B.', '.B..', 'B...'], 3, 0], ['B', 1, 2]]]]\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":"1cfb264bc3efce941cc250b8f469ee006f4d60ea4bf8599e8bfd905de0d88611","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] == 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 not (0 <= p < n and 0 <= q < m) or 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.', 'B.B', '.B.'], 1, 0], ['B', 1, 3]], [[['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, 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..W', 'B..W', 'B..W', 'B..W'], 1, 0], ['B', 4, 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]], [[['W....', '.....', '.....', '.....', '....B'], 4, 4], ['B', 1, 2]]], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 3, 2], ['W', 4, 4]], [[['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]], [[['WWW', 'W.W', 'WWW'], 2, 1], ['W', 8, 1]]], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 3, 3], ['W', 6, 4]], [[['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]], [[['.B...', 'B....', '.....', '....W', '...W.'], 4, 3], ['W', 1, 3]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 3, 0], ['B', 3, 4]], [[['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]], [[['WB.B', 'B.B.', '.B..', 'B...'], 3, 0], ['B', 1, 2]]]]\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-off-board-liberties","generated_at":"2026-09-29T14:50:18.452995+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":"Off-board neighbours pass the liberty test.","sha256":"340b6005998e413fa9f77dc069e73013f3e38d15110bf4ca0bbd6c51c719dd2b","title":"The board edge counts as liberties · 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":38.827,"exit_code":1,"observations":[{"actual":["B",1,3],"check":"chain case 0","expected":["B",1,3],"passed":true},{"actual":["W",4,9],"check":"chain case 1","expected":["W",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 2","expected":[".",0,0],"passed":true},{"actual":["W",4,5],"check":"chain case 3","expected":["W",4,4],"passed":false},{"actual":["B",4,5],"check":"chain case 4","expected":["B",4,4],"passed":false},{"actual":["B",4,5],"check":"chain case 5","expected":["B",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 6","expected":[".",0,0],"passed":true},{"actual":["W",6,6],"check":"chain case 7","expected":["W",6,4],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"chain case 0\", \"actual\": [\"B\", 1, 3], \"expected\": [\"B\", 1, 3], \"passed\": true}, {\"check\": \"chain case 1\", \"actual\": [\"W\", 4, 9], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 2\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 3\", \"actual\": [\"W\", 4, 5], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 4\", \"actual\": [\"B\", 4, 5], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 5\", \"actual\": [\"B\", 4, 5], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 6\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 7\", \"actual\": [\"W\", 6, 6], \"expected\": [\"W\", 6, 4], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.673,"exit_code":1,"observations":[{"actual":["B",1,4],"check":"chain case 0","expected":["B",1,3],"passed":false},{"actual":["W",4,10],"check":"chain case 1","expected":["W",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 2","expected":[".",0,0],"passed":true},{"actual":["W",4,6],"check":"chain case 3","expected":["W",4,4],"passed":false},{"actual":["B",4,6],"check":"chain case 4","expected":["B",4,4],"passed":false},{"actual":["B",4,6],"check":"chain case 5","expected":["B",4,4],"passed":false},{"actual":[".",0,0],"check":"chain case 6","expected":[".",0,0],"passed":true},{"actual":["W",6,7],"check":"chain case 7","expected":["W",6,4],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"chain case 0\", \"actual\": [\"B\", 1, 4], \"expected\": [\"B\", 1, 3], \"passed\": false}, {\"check\": \"chain case 1\", \"actual\": [\"W\", 4, 10], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 2\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 3\", \"actual\": [\"W\", 4, 6], \"expected\": [\"W\", 4, 4], \"passed\": false}, {\"check\": \"chain case 4\", \"actual\": [\"B\", 4, 6], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 5\", \"actual\": [\"B\", 4, 6], \"expected\": [\"B\", 4, 4], \"passed\": false}, {\"check\": \"chain case 6\", \"actual\": [\".\", 0, 0], \"expected\": [\".\", 0, 0], \"passed\": true}, {\"check\": \"chain case 7\", \"actual\": [\"W\", 6, 7], \"expected\": [\"W\", 6, 4], \"passed\": false}], \"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."}}