{"abstract":"The last row of the last repeat is reported as finishing row 0.","category":"Knitting and sewing pattern grading","checks":8,"contract":"Rows are 1-based. Rows 1..setup are [\"setup\", row]. The next length*repeats rows are [\"repeat\", repeat_number, row_in_repeat] (both 1-based). Later rows are [\"finishing\", k] counting from 1 after the last repeat. row < 1 -> \"error: rows start at 1\".","evaluation_group":"w2-knitting_and_sewing_pattern_grading-row-locator","failed_approach":"Extending one row further swallows the first finishing row.","family":"w2-knitting_and_sewing_pattern_grading-row-locator-finishing-boundary","id":"FA-97451","implementations":{"attempt":{"sha256":"8dca0c89336443b4a2881baeb64f17f9559b8ccc3210b4282b464749a28ef08f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(row, setup, length, repeats):\n    if row < 1:\n        return 'error: rows start at 1'\n    if row <= setup:\n        return ['setup', row]\n    k = row - setup\n    if k <= length * repeats + 1:\n        return ['repeat', (k - 1) // length + 1, (k - 1) % length + 1]\n    return ['finishing', k - length * repeats]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['last setup row', [4, 4, 8, 3], ['setup', 4]], ['first repeat row', [5, 4, 8, 3], ['repeat', 1, 1]],\n  ['single setup row', [1, 1, 4, 2], ['setup', 1]],\n  ['regression: finishing boundary', [12, 4, 4, 2], ['repeat', 2, 4]],\n  ['repair check: finishing boundary', [6, 4, 1, 1], ['finishing', 1]],\n  ['generated control 1', [48, 2, 12, 5], ['repeat', 4, 10]],\n  ['generated control 2', [43, 2, 4, 1], ['finishing', 37]],\n  ['generated control 3', [17, 6, 6, 2], ['repeat', 2, 5]]],\n [['first repeat row', [5, 4, 8, 3], ['repeat', 1, 1]], ['single setup row', [1, 1, 4, 2], ['setup', 1]],\n  ['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['regression: finishing boundary', [4, 2, 1, 2], ['repeat', 2, 1]],\n  ['repair check: finishing boundary', [27, 2, 12, 2], ['finishing', 1]],\n  ['generated control 1', [46, 6, 4, 3], ['finishing', 28]],\n  ['generated control 2', [58, 1, 1, 1], ['finishing', 56]],\n  ['generated control 3', [35, 1, 8, 1], ['finishing', 26]]],\n [['single setup row', [1, 1, 4, 2], ['setup', 1]], ['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['regression: finishing boundary', [30, 6, 12, 2], ['repeat', 2, 12]],\n  ['repair check: finishing boundary', [25, 4, 4, 5], ['finishing', 1]],\n  ['generated control 1', [15, 4, 1, 5], ['finishing', 6]],\n  ['generated control 2', [24, 2, 6, 5], ['repeat', 4, 4]],\n  ['generated control 3', [52, 1, 12, 1], ['finishing', 39]]],\n [['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['row zero', [0, 2, 4, 2], 'error: rows start at 1'],\n  ['regression: finishing boundary', [26, 2, 8, 3], ['repeat', 3, 8]],\n  ['repair check: finishing boundary', [5, 0, 4, 1], ['finishing', 1]],\n  ['generated control 1', [40, 4, 4, 2], ['finishing', 28]],\n  ['generated control 2', [25, 1, 4, 1], ['finishing', 20]],\n  ['generated control 3', [5, 2, 8, 2], ['repeat', 1, 3]]],\n [['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['row zero', [0, 2, 4, 2], 'error: rows start at 1'], ['last setup row', [4, 4, 8, 3], ['setup', 4]],\n  ['regression: finishing boundary', [30, 6, 8, 3], ['repeat', 3, 8]],\n  ['repair check: finishing boundary', [13, 0, 4, 3], ['finishing', 1]],\n  ['generated control 1', [42, 1, 6, 3], ['finishing', 23]],\n  ['generated control 2', [45, 4, 12, 5], ['repeat', 4, 5]],\n  ['generated control 3', [51, 0, 4, 2], ['finishing', 43]]]]\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":"4aaebe0635695c14e4df79227790015932186b01dd8422070c9061104129875f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(row, setup, length, repeats):\n    if row < 1:\n        return 'error: rows start at 1'\n    if row <= setup:\n        return ['setup', row]\n    k = row - setup\n    if k < length * repeats:\n        return ['repeat', (k - 1) // length + 1, (k - 1) % length + 1]\n    return ['finishing', k - length * repeats]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['last setup row', [4, 4, 8, 3], ['setup', 4]], ['first repeat row', [5, 4, 8, 3], ['repeat', 1, 1]],\n  ['single setup row', [1, 1, 4, 2], ['setup', 1]],\n  ['regression: finishing boundary', [12, 4, 4, 2], ['repeat', 2, 4]],\n  ['repair check: finishing boundary', [6, 4, 1, 1], ['finishing', 1]],\n  ['generated control 1', [48, 2, 12, 5], ['repeat', 4, 10]],\n  ['generated control 2', [43, 2, 4, 1], ['finishing', 37]],\n  ['generated control 3', [17, 6, 6, 2], ['repeat', 2, 5]]],\n [['first repeat row', [5, 4, 8, 3], ['repeat', 1, 1]], ['single setup row', [1, 1, 4, 2], ['setup', 1]],\n  ['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['regression: finishing boundary', [4, 2, 1, 2], ['repeat', 2, 1]],\n  ['repair check: finishing boundary', [27, 2, 12, 2], ['finishing', 1]],\n  ['generated control 1', [46, 6, 4, 3], ['finishing', 28]],\n  ['generated control 2', [58, 1, 1, 1], ['finishing', 56]],\n  ['generated control 3', [35, 1, 8, 1], ['finishing', 26]]],\n [['single setup row', [1, 1, 4, 2], ['setup', 1]], ['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['regression: finishing boundary', [30, 6, 12, 2], ['repeat', 2, 12]],\n  ['repair check: finishing boundary', [25, 4, 4, 5], ['finishing', 1]],\n  ['generated control 1', [15, 4, 1, 5], ['finishing', 6]],\n  ['generated control 2', [24, 2, 6, 5], ['repeat', 4, 4]],\n  ['generated control 3', [52, 1, 12, 1], ['finishing', 39]]],\n [['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['row zero', [0, 2, 4, 2], 'error: rows start at 1'],\n  ['regression: finishing boundary', [26, 2, 8, 3], ['repeat', 3, 8]],\n  ['repair check: finishing boundary', [5, 0, 4, 1], ['finishing', 1]],\n  ['generated control 1', [40, 4, 4, 2], ['finishing', 28]],\n  ['generated control 2', [25, 1, 4, 1], ['finishing', 20]],\n  ['generated control 3', [5, 2, 8, 2], ['repeat', 1, 3]]],\n [['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['row zero', [0, 2, 4, 2], 'error: rows start at 1'], ['last setup row', [4, 4, 8, 3], ['setup', 4]],\n  ['regression: finishing boundary', [30, 6, 8, 3], ['repeat', 3, 8]],\n  ['repair check: finishing boundary', [13, 0, 4, 3], ['finishing', 1]],\n  ['generated control 1', [42, 1, 6, 3], ['finishing', 23]],\n  ['generated control 2', [45, 4, 12, 5], ['repeat', 4, 5]],\n  ['generated control 3', [51, 0, 4, 2], ['finishing', 43]]]]\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":"d48c01db7fe98c5b637e5bc21dbd6fb1a6055d16e8d6dc04be8d164eb27a4622","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(row, setup, length, repeats):\n    if row < 1:\n        return 'error: rows start at 1'\n    if row <= setup:\n        return ['setup', row]\n    k = row - setup\n    if k <= length * repeats:\n        return ['repeat', (k - 1) // length + 1, (k - 1) % length + 1]\n    return ['finishing', k - length * repeats]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['last setup row', [4, 4, 8, 3], ['setup', 4]], ['first repeat row', [5, 4, 8, 3], ['repeat', 1, 1]],\n  ['single setup row', [1, 1, 4, 2], ['setup', 1]],\n  ['regression: finishing boundary', [12, 4, 4, 2], ['repeat', 2, 4]],\n  ['repair check: finishing boundary', [6, 4, 1, 1], ['finishing', 1]],\n  ['generated control 1', [48, 2, 12, 5], ['repeat', 4, 10]],\n  ['generated control 2', [43, 2, 4, 1], ['finishing', 37]],\n  ['generated control 3', [17, 6, 6, 2], ['repeat', 2, 5]]],\n [['first repeat row', [5, 4, 8, 3], ['repeat', 1, 1]], ['single setup row', [1, 1, 4, 2], ['setup', 1]],\n  ['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['regression: finishing boundary', [4, 2, 1, 2], ['repeat', 2, 1]],\n  ['repair check: finishing boundary', [27, 2, 12, 2], ['finishing', 1]],\n  ['generated control 1', [46, 6, 4, 3], ['finishing', 28]],\n  ['generated control 2', [58, 1, 1, 1], ['finishing', 56]],\n  ['generated control 3', [35, 1, 8, 1], ['finishing', 26]]],\n [['single setup row', [1, 1, 4, 2], ['setup', 1]], ['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['regression: finishing boundary', [30, 6, 12, 2], ['repeat', 2, 12]],\n  ['repair check: finishing boundary', [25, 4, 4, 5], ['finishing', 1]],\n  ['generated control 1', [15, 4, 1, 5], ['finishing', 6]],\n  ['generated control 2', [24, 2, 6, 5], ['repeat', 4, 4]],\n  ['generated control 3', [52, 1, 12, 1], ['finishing', 39]]],\n [['last row of repeat', [12, 4, 8, 3], ['repeat', 1, 8]],\n  ['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['row zero', [0, 2, 4, 2], 'error: rows start at 1'],\n  ['regression: finishing boundary', [26, 2, 8, 3], ['repeat', 3, 8]],\n  ['repair check: finishing boundary', [5, 0, 4, 1], ['finishing', 1]],\n  ['generated control 1', [40, 4, 4, 2], ['finishing', 28]],\n  ['generated control 2', [25, 1, 4, 1], ['finishing', 20]],\n  ['generated control 3', [5, 2, 8, 2], ['repeat', 1, 3]]],\n [['first finishing row', [29, 4, 8, 3], ['finishing', 1]],\n  ['row zero', [0, 2, 4, 2], 'error: rows start at 1'], ['last setup row', [4, 4, 8, 3], ['setup', 4]],\n  ['regression: finishing boundary', [30, 6, 8, 3], ['repeat', 3, 8]],\n  ['repair check: finishing boundary', [13, 0, 4, 3], ['finishing', 1]],\n  ['generated control 1', [42, 1, 6, 3], ['finishing', 23]],\n  ['generated control 2', [45, 4, 12, 5], ['repeat', 4, 5]],\n  ['generated control 3', [51, 0, 4, 2], ['finishing', 43]]]]\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 contract stated in full here; it is a bounded teaching model, not an authoritative reference or standards 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-knitting_and_sewing_pattern_grading-row-locator-finishing-boundary","generated_at":"2026-09-29T14:52:32.332738+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Row counter apps must map an absolute row number onto setup, repeat and finishing sections.","repair":"Rows up to length*repeats past setup are repeat rows.","root_cause":"The repeat section excludes its final row.","sha256":"2e7e47b9143aa57c1d89ccfd7e1426888d18603e7f74f7ece8a543cdf786efbc","title":"Pattern row locator: finishing boundary · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.093,"exit_code":1,"observations":[{"actual":["setup",4],"check":"last setup row","expected":["setup",4],"passed":true},{"actual":["repeat",1,1],"check":"first repeat row","expected":["repeat",1,1],"passed":true},{"actual":["setup",1],"check":"single setup row","expected":["setup",1],"passed":true},{"actual":["repeat",2,4],"check":"regression: finishing boundary","expected":["repeat",2,4],"passed":true},{"actual":["repeat",2,1],"check":"repair check: finishing boundary","expected":["finishing",1],"passed":false},{"actual":["repeat",4,10],"check":"generated control 1","expected":["repeat",4,10],"passed":true},{"actual":["finishing",37],"check":"generated control 2","expected":["finishing",37],"passed":true},{"actual":["repeat",2,5],"check":"generated control 3","expected":["repeat",2,5],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last setup row\", \"actual\": [\"setup\", 4], \"expected\": [\"setup\", 4], \"passed\": true}, {\"check\": \"first repeat row\", \"actual\": [\"repeat\", 1, 1], \"expected\": [\"repeat\", 1, 1], \"passed\": true}, {\"check\": \"single setup row\", \"actual\": [\"setup\", 1], \"expected\": [\"setup\", 1], \"passed\": true}, {\"check\": \"regression: finishing boundary\", \"actual\": [\"repeat\", 2, 4], \"expected\": [\"repeat\", 2, 4], \"passed\": true}, {\"check\": \"repair check: finishing boundary\", \"actual\": [\"repeat\", 2, 1], \"expected\": [\"finishing\", 1], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [\"repeat\", 4, 10], \"expected\": [\"repeat\", 4, 10], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"finishing\", 37], \"expected\": [\"finishing\", 37], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [\"repeat\", 2, 5], \"expected\": [\"repeat\", 2, 5], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.523,"exit_code":1,"observations":[{"actual":["setup",4],"check":"last setup row","expected":["setup",4],"passed":true},{"actual":["repeat",1,1],"check":"first repeat row","expected":["repeat",1,1],"passed":true},{"actual":["setup",1],"check":"single setup row","expected":["setup",1],"passed":true},{"actual":["finishing",0],"check":"regression: finishing boundary","expected":["repeat",2,4],"passed":false},{"actual":["finishing",1],"check":"repair check: finishing boundary","expected":["finishing",1],"passed":true},{"actual":["repeat",4,10],"check":"generated control 1","expected":["repeat",4,10],"passed":true},{"actual":["finishing",37],"check":"generated control 2","expected":["finishing",37],"passed":true},{"actual":["repeat",2,5],"check":"generated control 3","expected":["repeat",2,5],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last setup row\", \"actual\": [\"setup\", 4], \"expected\": [\"setup\", 4], \"passed\": true}, {\"check\": \"first repeat row\", \"actual\": [\"repeat\", 1, 1], \"expected\": [\"repeat\", 1, 1], \"passed\": true}, {\"check\": \"single setup row\", \"actual\": [\"setup\", 1], \"expected\": [\"setup\", 1], \"passed\": true}, {\"check\": \"regression: finishing boundary\", \"actual\": [\"finishing\", 0], \"expected\": [\"repeat\", 2, 4], \"passed\": false}, {\"check\": \"repair check: finishing boundary\", \"actual\": [\"finishing\", 1], \"expected\": [\"finishing\", 1], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [\"repeat\", 4, 10], \"expected\": [\"repeat\", 4, 10], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"finishing\", 37], \"expected\": [\"finishing\", 37], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [\"repeat\", 2, 5], \"expected\": [\"repeat\", 2, 5], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.946,"exit_code":0,"observations":[{"actual":["setup",4],"check":"last setup row","expected":["setup",4],"passed":true},{"actual":["repeat",1,1],"check":"first repeat row","expected":["repeat",1,1],"passed":true},{"actual":["setup",1],"check":"single setup row","expected":["setup",1],"passed":true},{"actual":["repeat",2,4],"check":"regression: finishing boundary","expected":["repeat",2,4],"passed":true},{"actual":["finishing",1],"check":"repair check: finishing boundary","expected":["finishing",1],"passed":true},{"actual":["repeat",4,10],"check":"generated control 1","expected":["repeat",4,10],"passed":true},{"actual":["finishing",37],"check":"generated control 2","expected":["finishing",37],"passed":true},{"actual":["repeat",2,5],"check":"generated control 3","expected":["repeat",2,5],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last setup row\", \"actual\": [\"setup\", 4], \"expected\": [\"setup\", 4], \"passed\": true}, {\"check\": \"first repeat row\", \"actual\": [\"repeat\", 1, 1], \"expected\": [\"repeat\", 1, 1], \"passed\": true}, {\"check\": \"single setup row\", \"actual\": [\"setup\", 1], \"expected\": [\"setup\", 1], \"passed\": true}, {\"check\": \"regression: finishing boundary\", \"actual\": [\"repeat\", 2, 4], \"expected\": [\"repeat\", 2, 4], \"passed\": true}, {\"check\": \"repair check: finishing boundary\", \"actual\": [\"finishing\", 1], \"expected\": [\"finishing\", 1], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [\"repeat\", 4, 10], \"expected\": [\"repeat\", 4, 10], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"finishing\", 37], \"expected\": [\"finishing\", 37], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [\"repeat\", 2, 5], \"expected\": [\"repeat\", 2, 5], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}