{"abstract":"A part written a whole step up from C major gets ten sharps-worth reduced to two flats instead of two sharps.","category":"Music interval and transposition theory","checks":8,"contract":"Input [concert_fifths, written_semitones_above_concert] with concert_fifths -7..7 and an integer semitone shift. The key moves by (7 * shift) mod 12 fifths; the written signature is concert_fifths plus that move, then normalised into -5..6 by adding or subtracting 12 (so six flats is written as six sharps). Invalid input returns None.","contract_signature":"x","evaluation_group":"w2-music-interval-part-key-signature","failed_approach":"Using the raw semitone count as a fifths count only works for shifts of 0 and 12.","family":"w2-music-interval-part-key-signature-fifths-per-semitone","id":"FA-81141","implementations":{"attempt":{"sha256":"cac457ca68952785d6220b5c41b1ca8d6cbdbbc315aec97edb966da3f4c6339c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    concert, shift = x\n    if not isinstance(concert, int) or not isinstance(shift, int) or concert < -7 or concert > 7:\n        return None\n    move = shift % 12\n    r = concert + move\n    while r > 6:\n        r -= 12\n    while r < -5:\n        r += 12\n    return r\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 2], 2), ([-3, 2], -1), ([0, 9], 3), ([-6, 0], 6), ([6, 0], 6), ([7, 0], -5), ([-7, 0], 5), ([0, 1], -5)], [([0, -2], -2), ([0, 9], 3), ([0, 3], -3), ([-7, 0], 5), ([0, 0], 0), ([0, -1], 5), ([0, 12], 0), ([8, 0], None)], [([-3, 2], -1), ([0, 3], -3), ([0, 7], 1), ([-2, 9], 1), ([8, 0], None), ([0, '2'], None), ([-8, 0], None), ([-9, 2], None)], [([0, 2], 2), ([0, -2], -2), ([-3, 2], -1), ([0, 9], 3), ([0, 7], 1), ([0, 1], -5), ([3, -3], 6), ([-9, 2], None)], [([-3, 2], -1), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([1, 2], 3), ([0, -1], 5), ([-5, 7], -4)]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"oracle %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":"aee580dbebc3728b5f74f44ff63743a07c2193836a6a33ad17212cfab3db6cdf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    concert, shift = x\n    if not isinstance(concert, int) or not isinstance(shift, int) or concert < -7 or concert > 7:\n        return None\n    move = (5 * shift) % 12\n    r = concert + move\n    while r > 6:\n        r -= 12\n    while r < -5:\n        r += 12\n    return r\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 2], 2), ([-3, 2], -1), ([0, 9], 3), ([-6, 0], 6), ([6, 0], 6), ([7, 0], -5), ([-7, 0], 5), ([0, 1], -5)], [([0, -2], -2), ([0, 9], 3), ([0, 3], -3), ([-7, 0], 5), ([0, 0], 0), ([0, -1], 5), ([0, 12], 0), ([8, 0], None)], [([-3, 2], -1), ([0, 3], -3), ([0, 7], 1), ([-2, 9], 1), ([8, 0], None), ([0, '2'], None), ([-8, 0], None), ([-9, 2], None)], [([0, 2], 2), ([0, -2], -2), ([-3, 2], -1), ([0, 9], 3), ([0, 7], 1), ([0, 1], -5), ([3, -3], 6), ([-9, 2], None)], [([-3, 2], -1), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([1, 2], 3), ([0, -1], 5), ([-5, 7], -4)]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"oracle %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":"A deterministic bounded teaching model with a stipulated toy contract; it is not a complete music notation or theory engine. 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-music-interval-part-key-signature-fifths-per-semitone","generated_at":"2026-09-29T14:50:00.291643+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Part extraction must print a transposed key signature consistent with the transposed notes.","root_cause":"The key movement multiplies the semitone shift by five (fourths) instead of seven (fifths).","sha256":"286ae94393d988414b1f86f0bf3b8bcfe4e7580c946a2b07f6c33a3fc194d5d2","title":"Written key signature for a transposing part: transposition counted in fourths · 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":40.407,"exit_code":1,"observations":[{"actual":2,"check":"oracle 0","expected":2,"passed":true},{"actual":-1,"check":"oracle 1","expected":-1,"passed":true},{"actual":-3,"check":"oracle 2","expected":3,"passed":false},{"actual":6,"check":"oracle 3","expected":6,"passed":true},{"actual":6,"check":"oracle 4","expected":6,"passed":true},{"actual":-5,"check":"oracle 5","expected":-5,"passed":true},{"actual":5,"check":"oracle 6","expected":5,"passed":true},{"actual":1,"check":"oracle 7","expected":-5,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": -3, \"expected\": 3, \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": -5, \"expected\": -5, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": 1, \"expected\": -5, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.379,"exit_code":1,"observations":[{"actual":-2,"check":"oracle 0","expected":2,"passed":false},{"actual":-5,"check":"oracle 1","expected":-1,"passed":false},{"actual":-3,"check":"oracle 2","expected":3,"passed":false},{"actual":6,"check":"oracle 3","expected":6,"passed":true},{"actual":6,"check":"oracle 4","expected":6,"passed":true},{"actual":-5,"check":"oracle 5","expected":-5,"passed":true},{"actual":5,"check":"oracle 6","expected":5,"passed":true},{"actual":5,"check":"oracle 7","expected":-5,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": -2, \"expected\": 2, \"passed\": false}, {\"check\": \"oracle 1\", \"actual\": -5, \"expected\": -1, \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": -3, \"expected\": 3, \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": -5, \"expected\": -5, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": 5, \"expected\": -5, \"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."}}