{"abstract":"G4 cannot be respelled as Abb4 and G4 on F returns None instead of Fx4.","category":"Music interval and transposition theory","checks":8,"contract":"Input [note, letter]. note: letter, accidentals (# +1, b -1, x +2), nonnegative octave. Return the same sounding pitch spelled on the requested letter in whichever octave needs the fewest accidentals, rendering +2 x, +1 #, -1 b, -2 bb; octave numbers follow the letter (B#3 = C4). If more than two accidentals would be needed return None.","contract_signature":"x","evaluation_group":"w2-music-interval-respell-letter","failed_approach":"Allowing +2 but not -2 still rejects double-flat respellings such as Abb4.","family":"w2-music-interval-respell-letter-accidental-budget","id":"FA-80946","implementations":{"attempt":{"sha256":"8a24e51711346e6e84b9ab54d3d1ca5d61bf502f8b281b25ba622c794543377b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    note, letter = x\n    if letter not in base or not isinstance(note, str) or len(note) < 2 or note[0] not in base:\n        return None\n    i = 1\n    acc = 0\n    while i < len(note) and note[i] in '#bx':\n        acc += {'#': 1, 'b': -1, 'x': 2}[note[i]]\n        i += 1\n    if not note[i:].isdigit():\n        return None\n    m = 12 * (int(note[i:]) + 1) + base[note[0]] + acc\n    best = None\n    for o in range(m // 12 - 2, m // 12 + 1):\n        shift = m - (12 * (o + 1) + base[letter])\n        if abs(shift) <= 1 or shift == 2 and (best is None or abs(shift) < abs(best[1])):\n            best = (o, shift)\n    if best is None:\n        return None\n    o, shift = best\n    sign = {2: 'x', 1: '#', 0: '', -1: 'b', -2: 'bb'}[shift]\n    return letter + sign + str(o)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C4', 'B'], 'B#3'), (['B3', 'C'], 'Cb4'), (['E4', 'F'], 'Fb4'), (['F4', 'E'], 'E#4'), (['G4', 'A'], 'Abb4'), (['C4', 'D'], 'Dbb4'), (['C4', 'E'], None), (['A4', 'B'], 'Bbb4')], [(['F4', 'E'], 'E#4'), (['G4', 'A'], 'Abb4'), (['A4', 'G'], 'Gx4'), (['C4', 'D'], 'Dbb4'), (['C4', 'E'], None), (['C#4', 'D'], 'Db4'), (['Db4', 'C'], 'C#4'), (['G4', 'F'], 'Fx4')], [(['C4', 'D'], 'Dbb4'), (['Db4', 'C'], 'C#4'), (['B#3', 'C'], 'C4'), (['Cb4', 'B'], 'B3'), (['Fx4', 'G'], 'G4'), (['D4', 'C'], 'Cx4'), (['C0', 'B'], 'B#-1'), (['F4', 'G'], 'Gbb4')], [(['Fx4', 'G'], 'G4'), (['G4', 'F'], 'Fx4'), (['C0', 'B'], 'B#-1'), (['B0', 'C'], 'Cb1'), (['E4', 'D'], 'Dx4'), (['F4', 'G'], 'Gbb4'), (['C4', 'C'], 'C4'), (['A4', 'B'], 'Bbb4')], [(['G4', 'A'], 'Abb4'), (['D4', 'C'], 'Cx4'), (['F4', 'G'], 'Gbb4'), (['C4', 'C'], 'C4'), (['Bb3', 'A'], 'A#3'), (['A#3', 'B'], 'Bb3'), (['C4', 'H'], None), (['A4', 'B'], 'Bbb4')]]\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":"3a662e1dc110e69c11e23b78a03e2b35632b0e582593ea569a50bf38af54c77a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    note, letter = x\n    if letter not in base or not isinstance(note, str) or len(note) < 2 or note[0] not in base:\n        return None\n    i = 1\n    acc = 0\n    while i < len(note) and note[i] in '#bx':\n        acc += {'#': 1, 'b': -1, 'x': 2}[note[i]]\n        i += 1\n    if not note[i:].isdigit():\n        return None\n    m = 12 * (int(note[i:]) + 1) + base[note[0]] + acc\n    best = None\n    for o in range(m // 12 - 2, m // 12 + 1):\n        shift = m - (12 * (o + 1) + base[letter])\n        if abs(shift) < 2 and (best is None or abs(shift) < abs(best[1])):\n            best = (o, shift)\n    if best is None:\n        return None\n    o, shift = best\n    sign = {2: 'x', 1: '#', 0: '', -1: 'b', -2: 'bb'}[shift]\n    return letter + sign + str(o)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C4', 'B'], 'B#3'), (['B3', 'C'], 'Cb4'), (['E4', 'F'], 'Fb4'), (['F4', 'E'], 'E#4'), (['G4', 'A'], 'Abb4'), (['C4', 'D'], 'Dbb4'), (['C4', 'E'], None), (['A4', 'B'], 'Bbb4')], [(['F4', 'E'], 'E#4'), (['G4', 'A'], 'Abb4'), (['A4', 'G'], 'Gx4'), (['C4', 'D'], 'Dbb4'), (['C4', 'E'], None), (['C#4', 'D'], 'Db4'), (['Db4', 'C'], 'C#4'), (['G4', 'F'], 'Fx4')], [(['C4', 'D'], 'Dbb4'), (['Db4', 'C'], 'C#4'), (['B#3', 'C'], 'C4'), (['Cb4', 'B'], 'B3'), (['Fx4', 'G'], 'G4'), (['D4', 'C'], 'Cx4'), (['C0', 'B'], 'B#-1'), (['F4', 'G'], 'Gbb4')], [(['Fx4', 'G'], 'G4'), (['G4', 'F'], 'Fx4'), (['C0', 'B'], 'B#-1'), (['B0', 'C'], 'Cb1'), (['E4', 'D'], 'Dx4'), (['F4', 'G'], 'Gbb4'), (['C4', 'C'], 'C4'), (['A4', 'B'], 'Bbb4')], [(['G4', 'A'], 'Abb4'), (['D4', 'C'], 'Cx4'), (['F4', 'G'], 'Gbb4'), (['C4', 'C'], 'C4'), (['Bb3', 'A'], 'A#3'), (['A#3', 'B'], 'Bb3'), (['C4', 'H'], None), (['A4', 'B'], 'Bbb4')]]\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-respell-letter-accidental-budget","generated_at":"2026-09-29T14:49:58.613187+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Pitch spelling and interval arithmetic decide the notes that notation, transposition and analysis tools display or play.","root_cause":"The accidental budget stops at one, although the contract allows two.","sha256":"569aae40b3566570b9bedc53d57ec80fd1b5b1ade980ba038f872f1f3906b1e0","title":"Enharmonic respelling on a requested letter: double accidentals excluded from respelling · 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":39.874,"exit_code":1,"observations":[{"actual":"B#3","check":"oracle 0","expected":"B#3","passed":true},{"actual":"Cb4","check":"oracle 1","expected":"Cb4","passed":true},{"actual":"Fb4","check":"oracle 2","expected":"Fb4","passed":true},{"actual":"E#4","check":"oracle 3","expected":"E#4","passed":true},{"actual":null,"check":"oracle 4","expected":"Abb4","passed":false},{"actual":null,"check":"oracle 5","expected":"Dbb4","passed":false},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":null,"check":"oracle 7","expected":"Bbb4","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": \"B#3\", \"expected\": \"B#3\", \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": \"Cb4\", \"expected\": \"Cb4\", \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": \"Fb4\", \"expected\": \"Fb4\", \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": \"E#4\", \"expected\": \"E#4\", \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": null, \"expected\": \"Abb4\", \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": \"Dbb4\", \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": \"Bbb4\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.545,"exit_code":1,"observations":[{"actual":"B#3","check":"oracle 0","expected":"B#3","passed":true},{"actual":"Cb4","check":"oracle 1","expected":"Cb4","passed":true},{"actual":"Fb4","check":"oracle 2","expected":"Fb4","passed":true},{"actual":"E#4","check":"oracle 3","expected":"E#4","passed":true},{"actual":null,"check":"oracle 4","expected":"Abb4","passed":false},{"actual":null,"check":"oracle 5","expected":"Dbb4","passed":false},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":null,"check":"oracle 7","expected":"Bbb4","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": \"B#3\", \"expected\": \"B#3\", \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": \"Cb4\", \"expected\": \"Cb4\", \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": \"Fb4\", \"expected\": \"Fb4\", \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": \"E#4\", \"expected\": \"E#4\", \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": null, \"expected\": \"Abb4\", \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": \"Dbb4\", \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": \"Bbb4\", \"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."}}