{"abstract":"G5 above the treble staff reports a ledger line although it sits on top of the staff.","category":"Music interval and transposition theory","checks":8,"contract":"Input [note, clef] where note is a letter, accidentals (# b x, ignored for placement) and a nonnegative octave, and clef is treble (bottom line E4), bass (G2), alto (F3) or tenor (D3). Position counts diatonic steps above the bottom line (lines are even positions 0..8). Ledger lines: below the staff (-position)//2 for negative positions, above (position-8)//2 for positions over 8, else 0. Return [position, ledgers] or None when invalid.","contract_signature":"x","evaluation_group":"w2-music-interval-staff-position","failed_approach":"Offsetting from position 9 misses the ledger line through A5.","family":"w2-music-interval-staff-position-upper-ledger-count","id":"FA-81296","implementations":{"attempt":{"sha256":"494e373e413808a82ba3dc78d14d881e0c263be2c587eb36856d6736e46125a6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = 'CDEFGAB'\n    refs = {'treble': ('E', 4), 'bass': ('G', 2), 'alto': ('F', 3), 'tenor': ('D', 3)}\n    if not isinstance(x, list) or len(x) != 2 or x[1] not in refs:\n        return None\n    note, clef = x\n    if not isinstance(note, str) or len(note) < 2 or note[0] not in base:\n        return None\n    tail = note[1:].lstrip('#bx')\n    if not tail.isdigit():\n        return None\n    letter, octave = refs[clef]\n    pos = (int(tail) * 7 + base.index(note[0])) - (octave * 7 + base.index(letter))\n    if pos < 0:\n        ledgers = -pos // 2\n    elif pos > 8:\n        ledgers = (pos - 9) // 2\n    else:\n        ledgers = 0\n    return [pos, ledgers]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['E4', 'treble'], [0, 0]), (['C4', 'treble'], [-2, 1]), (['D4', 'treble'], [-1, 0]), (['B3', 'treble'], [-3, 1]), (['G5', 'treble'], [9, 0]), (['A5', 'treble'], [10, 1]), (['D6', 'treble'], [13, 2]), (['E6', 'treble'], [14, 3])], [(['B3', 'treble'], [-3, 1]), (['A3', 'treble'], [-4, 2]), (['F5', 'treble'], [8, 0]), (['A5', 'treble'], [10, 1]), (['C6', 'treble'], [12, 2]), (['C#4', 'treble'], [-2, 1]), (['B5', 'treble'], [11, 1]), (['A4', 'alto'], [9, 0])], [(['G5', 'treble'], [9, 0]), (['C6', 'treble'], [12, 2]), (['C#4', 'treble'], [-2, 1]), (['Fx4', 'treble'], [1, 0]), (['Bb3', 'treble'], [-3, 1]), (['C4', 'alto'], [4, 0]), (['C4', 'bass'], [10, 1]), (['D6', 'treble'], [13, 2])], [(['C4', 'alto'], [4, 0]), (['C4', 'bass'], [10, 1]), (['E2', 'bass'], [-2, 1]), (['C4', 'tenor'], [6, 0]), (['G2', 'bass'], [0, 0]), (['B5', 'treble'], [11, 1]), (['A4', 'alto'], [9, 0]), (['E6', 'treble'], [14, 3])], [(['G5', 'treble'], [9, 0]), (['A5', 'treble'], [10, 1]), (['G2', 'bass'], [0, 0]), (['F3', 'alto'], [0, 0]), (['B2', 'alto'], [-4, 2]), (['H4', 'treble'], None), (['D6', 'treble'], [13, 2]), (['E6', 'treble'], [14, 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":"cd782171ff3d22a495f21c6c9492cdf2833e7acfc0978fcae7958b17892226c3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = 'CDEFGAB'\n    refs = {'treble': ('E', 4), 'bass': ('G', 2), 'alto': ('F', 3), 'tenor': ('D', 3)}\n    if not isinstance(x, list) or len(x) != 2 or x[1] not in refs:\n        return None\n    note, clef = x\n    if not isinstance(note, str) or len(note) < 2 or note[0] not in base:\n        return None\n    tail = note[1:].lstrip('#bx')\n    if not tail.isdigit():\n        return None\n    letter, octave = refs[clef]\n    pos = (int(tail) * 7 + base.index(note[0])) - (octave * 7 + base.index(letter))\n    if pos < 0:\n        ledgers = -pos // 2\n    elif pos > 8:\n        ledgers = (pos - 8 + 1) // 2\n    else:\n        ledgers = 0\n    return [pos, ledgers]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['E4', 'treble'], [0, 0]), (['C4', 'treble'], [-2, 1]), (['D4', 'treble'], [-1, 0]), (['B3', 'treble'], [-3, 1]), (['G5', 'treble'], [9, 0]), (['A5', 'treble'], [10, 1]), (['D6', 'treble'], [13, 2]), (['E6', 'treble'], [14, 3])], [(['B3', 'treble'], [-3, 1]), (['A3', 'treble'], [-4, 2]), (['F5', 'treble'], [8, 0]), (['A5', 'treble'], [10, 1]), (['C6', 'treble'], [12, 2]), (['C#4', 'treble'], [-2, 1]), (['B5', 'treble'], [11, 1]), (['A4', 'alto'], [9, 0])], [(['G5', 'treble'], [9, 0]), (['C6', 'treble'], [12, 2]), (['C#4', 'treble'], [-2, 1]), (['Fx4', 'treble'], [1, 0]), (['Bb3', 'treble'], [-3, 1]), (['C4', 'alto'], [4, 0]), (['C4', 'bass'], [10, 1]), (['D6', 'treble'], [13, 2])], [(['C4', 'alto'], [4, 0]), (['C4', 'bass'], [10, 1]), (['E2', 'bass'], [-2, 1]), (['C4', 'tenor'], [6, 0]), (['G2', 'bass'], [0, 0]), (['B5', 'treble'], [11, 1]), (['A4', 'alto'], [9, 0]), (['E6', 'treble'], [14, 3])], [(['G5', 'treble'], [9, 0]), (['A5', 'treble'], [10, 1]), (['G2', 'bass'], [0, 0]), (['F3', 'alto'], [0, 0]), (['B2', 'alto'], [-4, 2]), (['H4', 'treble'], None), (['D6', 'treble'], [13, 2]), (['E6', 'treble'], [14, 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-staff-position-upper-ledger-count","generated_at":"2026-09-29T14:50:01.805987+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Engraving and notation-rendering code places noteheads and ledger lines from pitch spellings.","root_cause":"Positions above the staff are rounded up to the next ledger line.","sha256":"8b07dfe24d8ab8cca215ace4e4b70844ac46d7c803b28f1ece66bb0f2e702628","title":"Staff position and ledger lines for a clef: upper ledger count rounded up · 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.529,"exit_code":1,"observations":[{"actual":[0,0],"check":"oracle 0","expected":[0,0],"passed":true},{"actual":[-2,1],"check":"oracle 1","expected":[-2,1],"passed":true},{"actual":[-1,0],"check":"oracle 2","expected":[-1,0],"passed":true},{"actual":[-3,1],"check":"oracle 3","expected":[-3,1],"passed":true},{"actual":[9,0],"check":"oracle 4","expected":[9,0],"passed":true},{"actual":[10,0],"check":"oracle 5","expected":[10,1],"passed":false},{"actual":[13,2],"check":"oracle 6","expected":[13,2],"passed":true},{"actual":[14,2],"check":"oracle 7","expected":[14,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [-2, 1], \"expected\": [-2, 1], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [-1, 0], \"expected\": [-1, 0], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [-3, 1], \"expected\": [-3, 1], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [9, 0], \"expected\": [9, 0], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [10, 0], \"expected\": [10, 1], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [13, 2], \"expected\": [13, 2], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [14, 2], \"expected\": [14, 3], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.523,"exit_code":1,"observations":[{"actual":[0,0],"check":"oracle 0","expected":[0,0],"passed":true},{"actual":[-2,1],"check":"oracle 1","expected":[-2,1],"passed":true},{"actual":[-1,0],"check":"oracle 2","expected":[-1,0],"passed":true},{"actual":[-3,1],"check":"oracle 3","expected":[-3,1],"passed":true},{"actual":[9,1],"check":"oracle 4","expected":[9,0],"passed":false},{"actual":[10,1],"check":"oracle 5","expected":[10,1],"passed":true},{"actual":[13,3],"check":"oracle 6","expected":[13,2],"passed":false},{"actual":[14,3],"check":"oracle 7","expected":[14,3],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [-2, 1], \"expected\": [-2, 1], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [-1, 0], \"expected\": [-1, 0], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [-3, 1], \"expected\": [-3, 1], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [9, 1], \"expected\": [9, 0], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [10, 1], \"expected\": [10, 1], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [13, 3], \"expected\": [13, 2], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": [14, 3], \"expected\": [14, 3], \"passed\": true}], \"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."}}