{"abstract":"The last setup row is reported as repeat 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":"Excluding single-row setups still misplaces row 1.","family":"w2-knitting_and_sewing_pattern_grading-row-locator-setup-boundary","id":"FA-97436","implementations":{"attempt":{"sha256":"775ff13fbc7ade16a6fb1ff051835042d98e28250965c8a597f95e95a6d82bf9","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 and setup > 1:\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: setup boundary', [4, 4, 1, 1], ['setup', 4]],\n  ['generated control 1', [19, 6, 8, 3], ['repeat', 2, 5]],\n  ['generated control 2', [11, 6, 8, 3], ['repeat', 1, 5]],\n  ['generated control 3', [0, 4, 1, 5], 'error: rows start at 1'],\n  ['generated control 4', [8, 4, 4, 2], ['repeat', 1, 4]]],\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: setup boundary', [2, 2, 4, 2], ['setup', 2]],\n  ['repair check: setup boundary', [1, 1, 4, 1], ['setup', 1]],\n  ['generated control 1', [56, 0, 8, 3], ['finishing', 32]],\n  ['generated control 2', [28, 2, 1, 5], ['finishing', 21]],\n  ['generated control 3', [49, 4, 12, 5], ['repeat', 4, 9]]],\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: setup boundary', [4, 4, 6, 1], ['setup', 4]],\n  ['repair check: setup boundary', [1, 1, 6, 5], ['setup', 1]],\n  ['generated control 1', [56, 1, 12, 3], ['finishing', 19]],\n  ['generated control 2', [57, 6, 1, 1], ['finishing', 50]],\n  ['generated control 3', [10, 0, 8, 3], ['repeat', 2, 2]]],\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: setup boundary', [6, 6, 8, 1], ['setup', 6]],\n  ['repair check: setup boundary', [1, 1, 4, 3], ['setup', 1]],\n  ['generated control 1', [16, 1, 1, 5], ['finishing', 10]],\n  ['generated control 2', [15, 4, 1, 3], ['finishing', 8]],\n  ['generated control 3', [30, 0, 8, 5], ['repeat', 4, 6]]],\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: setup boundary', [4, 4, 1, 3], ['setup', 4]],\n  ['repair check: setup boundary', [1, 1, 1, 1], ['setup', 1]],\n  ['generated control 1', [36, 6, 12, 2], ['finishing', 6]],\n  ['generated control 2', [11, 1, 8, 2], ['repeat', 2, 2]],\n  ['generated control 3', [55, 1, 12, 5], ['repeat', 5, 6]]]]\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":"ad502e7498482635ce86360df9aa22a6e63d7cd596720dfe5754f20ff86a6d1e","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: setup boundary', [4, 4, 1, 1], ['setup', 4]],\n  ['generated control 1', [19, 6, 8, 3], ['repeat', 2, 5]],\n  ['generated control 2', [11, 6, 8, 3], ['repeat', 1, 5]],\n  ['generated control 3', [0, 4, 1, 5], 'error: rows start at 1'],\n  ['generated control 4', [8, 4, 4, 2], ['repeat', 1, 4]]],\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: setup boundary', [2, 2, 4, 2], ['setup', 2]],\n  ['repair check: setup boundary', [1, 1, 4, 1], ['setup', 1]],\n  ['generated control 1', [56, 0, 8, 3], ['finishing', 32]],\n  ['generated control 2', [28, 2, 1, 5], ['finishing', 21]],\n  ['generated control 3', [49, 4, 12, 5], ['repeat', 4, 9]]],\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: setup boundary', [4, 4, 6, 1], ['setup', 4]],\n  ['repair check: setup boundary', [1, 1, 6, 5], ['setup', 1]],\n  ['generated control 1', [56, 1, 12, 3], ['finishing', 19]],\n  ['generated control 2', [57, 6, 1, 1], ['finishing', 50]],\n  ['generated control 3', [10, 0, 8, 3], ['repeat', 2, 2]]],\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: setup boundary', [6, 6, 8, 1], ['setup', 6]],\n  ['repair check: setup boundary', [1, 1, 4, 3], ['setup', 1]],\n  ['generated control 1', [16, 1, 1, 5], ['finishing', 10]],\n  ['generated control 2', [15, 4, 1, 3], ['finishing', 8]],\n  ['generated control 3', [30, 0, 8, 5], ['repeat', 4, 6]]],\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: setup boundary', [4, 4, 1, 3], ['setup', 4]],\n  ['repair check: setup boundary', [1, 1, 1, 1], ['setup', 1]],\n  ['generated control 1', [36, 6, 12, 2], ['finishing', 6]],\n  ['generated control 2', [11, 1, 8, 2], ['repeat', 2, 2]],\n  ['generated control 3', [55, 1, 12, 5], ['repeat', 5, 6]]]]\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":"a437231f0b35f1b1156a2529993970c86be8a90405a7b0c2098bc80e619abd9f","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: setup boundary', [4, 4, 1, 1], ['setup', 4]],\n  ['generated control 1', [19, 6, 8, 3], ['repeat', 2, 5]],\n  ['generated control 2', [11, 6, 8, 3], ['repeat', 1, 5]],\n  ['generated control 3', [0, 4, 1, 5], 'error: rows start at 1'],\n  ['generated control 4', [8, 4, 4, 2], ['repeat', 1, 4]]],\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: setup boundary', [2, 2, 4, 2], ['setup', 2]],\n  ['repair check: setup boundary', [1, 1, 4, 1], ['setup', 1]],\n  ['generated control 1', [56, 0, 8, 3], ['finishing', 32]],\n  ['generated control 2', [28, 2, 1, 5], ['finishing', 21]],\n  ['generated control 3', [49, 4, 12, 5], ['repeat', 4, 9]]],\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: setup boundary', [4, 4, 6, 1], ['setup', 4]],\n  ['repair check: setup boundary', [1, 1, 6, 5], ['setup', 1]],\n  ['generated control 1', [56, 1, 12, 3], ['finishing', 19]],\n  ['generated control 2', [57, 6, 1, 1], ['finishing', 50]],\n  ['generated control 3', [10, 0, 8, 3], ['repeat', 2, 2]]],\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: setup boundary', [6, 6, 8, 1], ['setup', 6]],\n  ['repair check: setup boundary', [1, 1, 4, 3], ['setup', 1]],\n  ['generated control 1', [16, 1, 1, 5], ['finishing', 10]],\n  ['generated control 2', [15, 4, 1, 3], ['finishing', 8]],\n  ['generated control 3', [30, 0, 8, 5], ['repeat', 4, 6]]],\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: setup boundary', [4, 4, 1, 3], ['setup', 4]],\n  ['repair check: setup boundary', [1, 1, 1, 1], ['setup', 1]],\n  ['generated control 1', [36, 6, 12, 2], ['finishing', 6]],\n  ['generated control 2', [11, 1, 8, 2], ['repeat', 2, 2]],\n  ['generated control 3', [55, 1, 12, 5], ['repeat', 5, 6]]]]\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-setup-boundary","generated_at":"2026-09-29T14:52:32.152775+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 and including setup are setup rows.","root_cause":"The setup test excludes its final row.","sha256":"80a132abc3b48905ac4db71ba54bb6cd02e9334e20956bdc3f3170fdf35a2e3b","title":"Pattern row locator: setup boundary · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.491,"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":["repeat",0,4],"check":"single setup row","expected":["setup",1],"passed":false},{"actual":["setup",4],"check":"regression: setup boundary","expected":["setup",4],"passed":true},{"actual":["repeat",2,5],"check":"generated control 1","expected":["repeat",2,5],"passed":true},{"actual":["repeat",1,5],"check":"generated control 2","expected":["repeat",1,5],"passed":true},{"actual":"error: rows start at 1","check":"generated control 3","expected":"error: rows start at 1","passed":true},{"actual":["repeat",1,4],"check":"generated control 4","expected":["repeat",1,4],"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\": [\"repeat\", 0, 4], \"expected\": [\"setup\", 1], \"passed\": false}, {\"check\": \"regression: setup boundary\", \"actual\": [\"setup\", 4], \"expected\": [\"setup\", 4], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [\"repeat\", 2, 5], \"expected\": [\"repeat\", 2, 5], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"repeat\", 1, 5], \"expected\": [\"repeat\", 1, 5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": \"error: rows start at 1\", \"expected\": \"error: rows start at 1\", \"passed\": true}, {\"check\": \"generated control 4\", \"actual\": [\"repeat\", 1, 4], \"expected\": [\"repeat\", 1, 4], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.279,"exit_code":1,"observations":[{"actual":["repeat",0,8],"check":"last setup row","expected":["setup",4],"passed":false},{"actual":["repeat",1,1],"check":"first repeat row","expected":["repeat",1,1],"passed":true},{"actual":["repeat",0,4],"check":"single setup row","expected":["setup",1],"passed":false},{"actual":["repeat",0,1],"check":"regression: setup boundary","expected":["setup",4],"passed":false},{"actual":["repeat",2,5],"check":"generated control 1","expected":["repeat",2,5],"passed":true},{"actual":["repeat",1,5],"check":"generated control 2","expected":["repeat",1,5],"passed":true},{"actual":"error: rows start at 1","check":"generated control 3","expected":"error: rows start at 1","passed":true},{"actual":["repeat",1,4],"check":"generated control 4","expected":["repeat",1,4],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last setup row\", \"actual\": [\"repeat\", 0, 8], \"expected\": [\"setup\", 4], \"passed\": false}, {\"check\": \"first repeat row\", \"actual\": [\"repeat\", 1, 1], \"expected\": [\"repeat\", 1, 1], \"passed\": true}, {\"check\": \"single setup row\", \"actual\": [\"repeat\", 0, 4], \"expected\": [\"setup\", 1], \"passed\": false}, {\"check\": \"regression: setup boundary\", \"actual\": [\"repeat\", 0, 1], \"expected\": [\"setup\", 4], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [\"repeat\", 2, 5], \"expected\": [\"repeat\", 2, 5], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"repeat\", 1, 5], \"expected\": [\"repeat\", 1, 5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": \"error: rows start at 1\", \"expected\": \"error: rows start at 1\", \"passed\": true}, {\"check\": \"generated control 4\", \"actual\": [\"repeat\", 1, 4], \"expected\": [\"repeat\", 1, 4], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.883,"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":["setup",4],"check":"regression: setup boundary","expected":["setup",4],"passed":true},{"actual":["repeat",2,5],"check":"generated control 1","expected":["repeat",2,5],"passed":true},{"actual":["repeat",1,5],"check":"generated control 2","expected":["repeat",1,5],"passed":true},{"actual":"error: rows start at 1","check":"generated control 3","expected":"error: rows start at 1","passed":true},{"actual":["repeat",1,4],"check":"generated control 4","expected":["repeat",1,4],"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: setup boundary\", \"actual\": [\"setup\", 4], \"expected\": [\"setup\", 4], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [\"repeat\", 2, 5], \"expected\": [\"repeat\", 2, 5], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [\"repeat\", 1, 5], \"expected\": [\"repeat\", 1, 5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": \"error: rows start at 1\", \"expected\": \"error: rows start at 1\", \"passed\": true}, {\"check\": \"generated control 4\", \"actual\": [\"repeat\", 1, 4], \"expected\": [\"repeat\", 1, 4], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}