{"abstract":"Any spelling with an x double sharp (Fx4, Cx-1) is rejected as malformed.","category":"Music interval and transposition theory","checks":8,"contract":"Input a spelled pitch string: uppercase letter A-G, any run of accidentals (# = +1, b = -1, x = +2), then a signed integer octave where C4 = 60 and C-1 = 0. Return the MIDI key number, or None for malformed text or results outside 0..127.","contract_signature":"x","evaluation_group":"w2-music-interval-spelled-midi","failed_approach":"Admitting x but capping the scan at two accidentals rejects legal triple accidentals such as Dbbb4 and Cxx4.","family":"w2-music-interval-spelled-midi-accidental-run","id":"FA-80861","implementations":{"attempt":{"sha256":"06cbb27ba75473c1b2bc286a7f25215eaac8678a03eb46591fc9432178f7ed82","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    names = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}\n    if not isinstance(x, str) or len(x) < 2 or x[0] not in names:\n        return None\n    i = 1\n    acc = 0\n    while i < len(x) and x[i] in '#bx' and i < 3:\n        acc += {'#': 1, 'b': -1, 'x': 2}[x[i]]\n        i += 1\n    tail = x[i:]\n    neg = tail.startswith('-')\n    digits = tail[1:] if neg else tail\n    if not digits.isdigit():\n        return None\n    octave = -int(digits) if neg else int(digits)\n    midi = (octave + 1) * 12 + names[x[0]] + acc\n    if midi < 0 or midi > 127:\n        return None\n    return midi\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('C4', 60), ('A4', 69), ('C-1', 0), ('G9', 127), ('G#9', None), ('Fx4', 67), ('Dbbb4', 59), ('Cxx4', 64)], [('G9', 127), ('G#9', None), ('Ab9', None), ('B#3', 60), ('Cb4', 59), ('Dbbb4', 59), ('Cx-1', 2), ('Bx-1', 13)], [('B#3', 60), ('Cb4', 59), ('Fx4', 67), ('Ebb4', 62), ('Dbbb4', 59), ('Cb-1', None), ('B-1', 11), ('Cxx4', 64)], [('Dbbb4', 59), ('Cb-1', None), ('B-1', 11), ('E4', 64), ('F4', 65), ('B4', 71), ('Cx-1', 2), ('Bx-1', 13)], [('Fx4', 67), ('Dbbb4', 59), ('F4', 65), ('B4', 71), ('Bb3', 58), ('C0', 12), ('D#0', 15), ('Cxx4', 64)]]\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":"91b8280f9c895b67512ff42d563ed243a41190f508bf7e789e4178a6631e9f19","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    names = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}\n    if not isinstance(x, str) or len(x) < 2 or x[0] not in names:\n        return None\n    i = 1\n    acc = 0\n    while i < len(x) and x[i] in '#b':\n        acc += {'#': 1, 'b': -1, 'x': 2}[x[i]]\n        i += 1\n    tail = x[i:]\n    neg = tail.startswith('-')\n    digits = tail[1:] if neg else tail\n    if not digits.isdigit():\n        return None\n    octave = -int(digits) if neg else int(digits)\n    midi = (octave + 1) * 12 + names[x[0]] + acc\n    if midi < 0 or midi > 127:\n        return None\n    return midi\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('C4', 60), ('A4', 69), ('C-1', 0), ('G9', 127), ('G#9', None), ('Fx4', 67), ('Dbbb4', 59), ('Cxx4', 64)], [('G9', 127), ('G#9', None), ('Ab9', None), ('B#3', 60), ('Cb4', 59), ('Dbbb4', 59), ('Cx-1', 2), ('Bx-1', 13)], [('B#3', 60), ('Cb4', 59), ('Fx4', 67), ('Ebb4', 62), ('Dbbb4', 59), ('Cb-1', None), ('B-1', 11), ('Cxx4', 64)], [('Dbbb4', 59), ('Cb-1', None), ('B-1', 11), ('E4', 64), ('F4', 65), ('B4', 71), ('Cx-1', 2), ('Bx-1', 13)], [('Fx4', 67), ('Dbbb4', 59), ('F4', 65), ('B4', 71), ('Bb3', 58), ('C0', 12), ('D#0', 15), ('Cxx4', 64)]]\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-spelled-midi-accidental-run","generated_at":"2026-09-29T14:49:57.730302+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 scanner only consumes # and b, so the x glyph is left in the octave field.","sha256":"dd6acd1d2973897752ff1ac9d6733eb971aec5ebc701cc9795610e5172efe15f","title":"Spelled pitch to MIDI key number: double sharp glyph not consumed · 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.985,"exit_code":1,"observations":[{"actual":60,"check":"oracle 0","expected":60,"passed":true},{"actual":69,"check":"oracle 1","expected":69,"passed":true},{"actual":0,"check":"oracle 2","expected":0,"passed":true},{"actual":127,"check":"oracle 3","expected":127,"passed":true},{"actual":null,"check":"oracle 4","expected":null,"passed":true},{"actual":67,"check":"oracle 5","expected":67,"passed":true},{"actual":null,"check":"oracle 6","expected":59,"passed":false},{"actual":64,"check":"oracle 7","expected":64,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 69, \"expected\": 69, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 127, \"expected\": 127, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": 67, \"expected\": 67, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": 59, \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": 64, \"expected\": 64, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.746,"exit_code":1,"observations":[{"actual":60,"check":"oracle 0","expected":60,"passed":true},{"actual":69,"check":"oracle 1","expected":69,"passed":true},{"actual":0,"check":"oracle 2","expected":0,"passed":true},{"actual":127,"check":"oracle 3","expected":127,"passed":true},{"actual":null,"check":"oracle 4","expected":null,"passed":true},{"actual":null,"check":"oracle 5","expected":67,"passed":false},{"actual":59,"check":"oracle 6","expected":59,"passed":true},{"actual":null,"check":"oracle 7","expected":64,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 69, \"expected\": 69, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 127, \"expected\": 127, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": 67, \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": 59, \"expected\": 59, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": 64, \"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."}}