{"abstract":"Respelling C4 on B returns None because the octave holding B#3 is outside the search window.","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":"Shifting the window down now misses the octave above, so B3 cannot be respelled as Cb4.","family":"w2-music-interval-respell-letter-octave-candidate-window","id":"FA-80941","implementations":{"attempt":{"sha256":"60cb4119fc018e602d5fbe1d0a5ef33466bc6e8e9419ebc6644e4512f763ce36","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):\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'), (['A4', 'G'], 'Gx4'), (['C4', 'D'], 'Dbb4'), (['C5', 'B'], 'B#4')], [(['C4', 'B'], 'B#3'), (['A4', 'G'], 'Gx4'), (['C4', 'D'], 'Dbb4'), (['C4', 'E'], None), (['C#4', 'D'], 'Db4'), (['Db4', 'C'], 'C#4'), (['C0', 'B'], 'B#-1'), (['B0', 'C'], 'Cb1')], [(['C#4', 'D'], 'Db4'), (['Db4', 'C'], 'C#4'), (['B#3', 'C'], 'C4'), (['Cb4', 'B'], 'B3'), (['Fx4', 'G'], 'G4'), (['C0', 'B'], 'B#-1'), (['B4', 'C'], 'Cb5'), (['C5', 'B'], 'B#4')], [(['C4', 'B'], 'B#3'), (['B3', 'C'], 'Cb4'), (['Cb4', 'B'], 'B3'), (['Fx4', 'G'], 'G4'), (['G4', 'F'], 'Fx4'), (['D4', 'C'], 'Cx4'), (['E4', 'D'], 'Dx4'), (['C5', 'B'], 'B#4')], [(['C4', 'B'], 'B#3'), (['D4', 'C'], 'Cx4'), (['C0', 'B'], 'B#-1'), (['B0', 'C'], 'Cb1'), (['E4', 'D'], 'Dx4'), (['F4', 'G'], 'Gbb4'), (['C4', 'C'], 'C4'), (['Bb3', 'A'], 'A#3')]]\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":"a4b593f1972e4887cd3d89a9e430d3c31e19f13838e9bba64a08c5597f93d6ff","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 - 1, 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'), (['A4', 'G'], 'Gx4'), (['C4', 'D'], 'Dbb4'), (['C5', 'B'], 'B#4')], [(['C4', 'B'], 'B#3'), (['A4', 'G'], 'Gx4'), (['C4', 'D'], 'Dbb4'), (['C4', 'E'], None), (['C#4', 'D'], 'Db4'), (['Db4', 'C'], 'C#4'), (['C0', 'B'], 'B#-1'), (['B0', 'C'], 'Cb1')], [(['C#4', 'D'], 'Db4'), (['Db4', 'C'], 'C#4'), (['B#3', 'C'], 'C4'), (['Cb4', 'B'], 'B3'), (['Fx4', 'G'], 'G4'), (['C0', 'B'], 'B#-1'), (['B4', 'C'], 'Cb5'), (['C5', 'B'], 'B#4')], [(['C4', 'B'], 'B#3'), (['B3', 'C'], 'Cb4'), (['Cb4', 'B'], 'B3'), (['Fx4', 'G'], 'G4'), (['G4', 'F'], 'Fx4'), (['D4', 'C'], 'Cx4'), (['E4', 'D'], 'Dx4'), (['C5', 'B'], 'B#4')], [(['C4', 'B'], 'B#3'), (['D4', 'C'], 'Cx4'), (['C0', 'B'], 'B#-1'), (['B0', 'C'], 'Cb1'), (['E4', 'D'], 'Dx4'), (['F4', 'G'], 'Gbb4'), (['C4', 'C'], 'C4'), (['Bb3', 'A'], 'A#3')]]\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-octave-candidate-window","generated_at":"2026-09-29T14:49:58.585965+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 octave scan starts one octave too high, skipping the letter octave below the sounding octave.","sha256":"a51fe379552e67186e3b1a89f8b758fba5959d149c9d8d4c22363d67c051f6c3","title":"Enharmonic respelling on a requested letter: B sharp octave never searched · 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.736,"exit_code":1,"observations":[{"actual":"B#3","check":"oracle 0","expected":"B#3","passed":true},{"actual":null,"check":"oracle 1","expected":"Cb4","passed":false},{"actual":"Fb4","check":"oracle 2","expected":"Fb4","passed":true},{"actual":"E#4","check":"oracle 3","expected":"E#4","passed":true},{"actual":"Abb4","check":"oracle 4","expected":"Abb4","passed":true},{"actual":"Gx4","check":"oracle 5","expected":"Gx4","passed":true},{"actual":"Dbb4","check":"oracle 6","expected":"Dbb4","passed":true},{"actual":"B#4","check":"oracle 7","expected":"B#4","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": \"B#3\", \"expected\": \"B#3\", \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": null, \"expected\": \"Cb4\", \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": \"Fb4\", \"expected\": \"Fb4\", \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": \"E#4\", \"expected\": \"E#4\", \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": \"Abb4\", \"expected\": \"Abb4\", \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": \"Gx4\", \"expected\": \"Gx4\", \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": \"Dbb4\", \"expected\": \"Dbb4\", \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": \"B#4\", \"expected\": \"B#4\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.94,"exit_code":1,"observations":[{"actual":null,"check":"oracle 0","expected":"B#3","passed":false},{"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":"Abb4","check":"oracle 4","expected":"Abb4","passed":true},{"actual":"Gx4","check":"oracle 5","expected":"Gx4","passed":true},{"actual":"Dbb4","check":"oracle 6","expected":"Dbb4","passed":true},{"actual":null,"check":"oracle 7","expected":"B#4","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": null, \"expected\": \"B#3\", \"passed\": false}, {\"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\": \"Abb4\", \"expected\": \"Abb4\", \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": \"Gx4\", \"expected\": \"Gx4\", \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": \"Dbb4\", \"expected\": \"Dbb4\", \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": \"B#4\", \"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."}}