{"abstract":"The last row of each repeat is shown as 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\".","contract_signature":"row, setup, length, repeats","evaluation_group":"w2-knitting_and_sewing_pattern_grading-row-locator","failed_approach":"Adding one to k%length shifts every row by one.","family":"w2-knitting_and_sewing_pattern_grading-row-locator-row-within-repeat","id":"FA-97446","implementations":{"attempt":{"sha256":"279716a02faf25519569a61814fb089ca97812eae400fc997e54f572bb30d96f","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 % 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: row within repeat', [9, 6, 1, 5], ['repeat', 3, 1]],\n  ['repair check: row within repeat', [57, 0, 12, 5], ['repeat', 5, 9]],\n  ['generated control 1', [32, 0, 6, 1], ['finishing', 26]],\n  ['generated control 2', [48, 0, 8, 3], ['finishing', 24]],\n  ['generated control 3', [4, 2, 6, 2], ['repeat', 1, 2]]],\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: row within repeat', [24, 0, 8, 3], ['repeat', 3, 8]],\n  ['repair check: row within repeat', [4, 1, 6, 3], ['repeat', 1, 3]],\n  ['generated control 1', [40, 0, 8, 3], ['finishing', 16]],\n  ['generated control 2', [56, 2, 6, 1], ['finishing', 48]],\n  ['generated control 3', [24, 0, 12, 2], ['repeat', 2, 12]]],\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: row within repeat', [42, 2, 8, 5], ['repeat', 5, 8]],\n  ['repair check: row within repeat', [19, 1, 12, 3], ['repeat', 2, 6]],\n  ['generated control 1', [49, 2, 6, 2], ['finishing', 35]],\n  ['generated control 2', [21, 4, 4, 3], ['finishing', 5]],\n  ['generated control 3', [44, 4, 12, 2], ['finishing', 16]]],\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: row within repeat', [14, 6, 8, 5], ['repeat', 1, 8]],\n  ['repair check: row within repeat', [51, 4, 12, 5], ['repeat', 4, 11]],\n  ['generated control 1', [57, 6, 1, 3], ['finishing', 48]],\n  ['generated control 2', [50, 0, 6, 2], ['finishing', 38]],\n  ['generated control 3', [3, 2, 8, 3], ['repeat', 1, 1]]],\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: row within repeat', [1, 0, 1, 3], ['repeat', 1, 1]],\n  ['repair check: row within repeat', [25, 2, 12, 5], ['repeat', 2, 11]],\n  ['generated control 1', [32, 1, 4, 1], ['finishing', 27]],\n  ['generated control 2', [31, 2, 4, 2], ['finishing', 21]],\n  ['generated control 3', [48, 6, 8, 2], ['finishing', 26]]]]\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":"3545848d477d10ff7ec099fec1c0c0c0a3bec65011fc4156629eea59c360aca5","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 % length]\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: row within repeat', [9, 6, 1, 5], ['repeat', 3, 1]],\n  ['repair check: row within repeat', [57, 0, 12, 5], ['repeat', 5, 9]],\n  ['generated control 1', [32, 0, 6, 1], ['finishing', 26]],\n  ['generated control 2', [48, 0, 8, 3], ['finishing', 24]],\n  ['generated control 3', [4, 2, 6, 2], ['repeat', 1, 2]]],\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: row within repeat', [24, 0, 8, 3], ['repeat', 3, 8]],\n  ['repair check: row within repeat', [4, 1, 6, 3], ['repeat', 1, 3]],\n  ['generated control 1', [40, 0, 8, 3], ['finishing', 16]],\n  ['generated control 2', [56, 2, 6, 1], ['finishing', 48]],\n  ['generated control 3', [24, 0, 12, 2], ['repeat', 2, 12]]],\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: row within repeat', [42, 2, 8, 5], ['repeat', 5, 8]],\n  ['repair check: row within repeat', [19, 1, 12, 3], ['repeat', 2, 6]],\n  ['generated control 1', [49, 2, 6, 2], ['finishing', 35]],\n  ['generated control 2', [21, 4, 4, 3], ['finishing', 5]],\n  ['generated control 3', [44, 4, 12, 2], ['finishing', 16]]],\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: row within repeat', [14, 6, 8, 5], ['repeat', 1, 8]],\n  ['repair check: row within repeat', [51, 4, 12, 5], ['repeat', 4, 11]],\n  ['generated control 1', [57, 6, 1, 3], ['finishing', 48]],\n  ['generated control 2', [50, 0, 6, 2], ['finishing', 38]],\n  ['generated control 3', [3, 2, 8, 3], ['repeat', 1, 1]]],\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: row within repeat', [1, 0, 1, 3], ['repeat', 1, 1]],\n  ['repair check: row within repeat', [25, 2, 12, 5], ['repeat', 2, 11]],\n  ['generated control 1', [32, 1, 4, 1], ['finishing', 27]],\n  ['generated control 2', [31, 2, 4, 2], ['finishing', 21]],\n  ['generated control 3', [48, 6, 8, 2], ['finishing', 26]]]]\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-row-within-repeat","generated_at":"2026-09-29T14:52:32.331798+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.","root_cause":"Row-in-repeat uses a 0-based modulo on a 1-based offset.","sha256":"ea8fa2bc83200ef445c1173cf716103a59c1f4fd2a7b4ab41cf0b71cedafc701","title":"Pattern row locator: row within repeat · 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":41.904,"exit_code":1,"observations":[{"actual":["setup",4],"check":"last setup row","expected":["setup",4],"passed":true},{"actual":["repeat",1,2],"check":"first repeat row","expected":["repeat",1,1],"passed":false},{"actual":["setup",1],"check":"single setup row","expected":["setup",1],"passed":true},{"actual":["repeat",3,1],"check":"regression: row within repeat","expected":["repeat",3,1],"passed":true},{"actual":["repeat",5,10],"check":"repair check: row within repeat","expected":["repeat",5,9],"passed":false},{"actual":["finishing",26],"check":"generated control 1","expected":["finishing",26],"passed":true},{"actual":["finishing",24],"check":"generated control 2","expected":["finishing",24],"passed":true},{"actual":["repeat",1,3],"check":"generated control 3","expected":["repeat",1,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last setup row\", \"actual\": [\"setup\", 4], \"expected\": [\"setup\", 4], \"passed\": true}, {\"check\": \"first repeat row\", \"actual\": [\"repeat\", 1, 2], \"expected\": [\"repeat\", 1, 1], \"passed\": false}, {\"check\": \"single setup row\", \"actual\": [\"setup\", 1], \"expected\": [\"setup\", 1], \"passed\": true}, {\"check\": \"regression: row within repeat\", \"actual\": [\"repeat\", 3, 1], \"expected\": [\"repeat\", 3, 1], \"passed\": true}, {\"check\": \"repair check: row within repeat\", \"actual\": [\"repeat\", 5, 10], \"expected\": [\"repeat\", 5, 9], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [\"finishing\", 26], \"expected\": [\"finishing\", 26], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"finishing\", 24], \"expected\": [\"finishing\", 24], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [\"repeat\", 1, 3], \"expected\": [\"repeat\", 1, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.905,"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",3,0],"check":"regression: row within repeat","expected":["repeat",3,1],"passed":false},{"actual":["repeat",5,9],"check":"repair check: row within repeat","expected":["repeat",5,9],"passed":true},{"actual":["finishing",26],"check":"generated control 1","expected":["finishing",26],"passed":true},{"actual":["finishing",24],"check":"generated control 2","expected":["finishing",24],"passed":true},{"actual":["repeat",1,2],"check":"generated control 3","expected":["repeat",1,2],"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: row within repeat\", \"actual\": [\"repeat\", 3, 0], \"expected\": [\"repeat\", 3, 1], \"passed\": false}, {\"check\": \"repair check: row within repeat\", \"actual\": [\"repeat\", 5, 9], \"expected\": [\"repeat\", 5, 9], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [\"finishing\", 26], \"expected\": [\"finishing\", 26], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"finishing\", 24], \"expected\": [\"finishing\", 24], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [\"repeat\", 1, 2], \"expected\": [\"repeat\", 1, 2], \"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."}}