{"abstract":"B3 in treble clef (just below middle C) reports two ledger lines instead of one.","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":"Rounding the positive distance up gives D4, which hangs below the bottom line, a ledger line it does not need.","family":"w2-music-interval-staff-position-lower-ledger-count","id":"FA-81291","implementations":{"attempt":{"sha256":"5e5704eddd2c1744a09c261168a9015be70f55e74f76de9978fb2db4c247ddd0","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 + 1) // 2\n    elif pos > 8:\n        ledgers = (pos - 8) // 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]), (['A3', 'treble'], [-4, 2]), (['F5', 'treble'], [8, 0]), (['G5', 'treble'], [9, 0]), (['Bb3', 'treble'], [-3, 1]), (['G3', 'treble'], [-5, 2])], [(['D4', 'treble'], [-1, 0]), (['B3', 'treble'], [-3, 1]), (['F5', 'treble'], [8, 0]), (['G5', 'treble'], [9, 0]), (['A5', 'treble'], [10, 1]), (['C6', 'treble'], [12, 2]), (['C#4', 'treble'], [-2, 1]), (['G3', 'treble'], [-5, 2])], [(['D4', 'treble'], [-1, 0]), (['B3', 'treble'], [-3, 1]), (['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])], [(['B3', 'treble'], [-3, 1]), (['Bb3', 'treble'], [-3, 1]), (['C4', 'alto'], [4, 0]), (['C4', 'bass'], [10, 1]), (['E2', 'bass'], [-2, 1]), (['C4', 'tenor'], [6, 0]), (['G2', 'bass'], [0, 0]), (['G3', 'treble'], [-5, 2])], [(['D4', 'treble'], [-1, 0]), (['Bb3', 'treble'], [-3, 1]), (['C4', 'tenor'], [6, 0]), (['G2', 'bass'], [0, 0]), (['F3', 'alto'], [0, 0]), (['B2', 'alto'], [-4, 2]), (['H4', 'treble'], None), (['G3', 'treble'], [-5, 2])]]\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":"15a5d3ea07548dbaa28cf8cd2468992ae189394f8528d8375805adaef87c4a76","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) // 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]), (['A3', 'treble'], [-4, 2]), (['F5', 'treble'], [8, 0]), (['G5', 'treble'], [9, 0]), (['Bb3', 'treble'], [-3, 1]), (['G3', 'treble'], [-5, 2])], [(['D4', 'treble'], [-1, 0]), (['B3', 'treble'], [-3, 1]), (['F5', 'treble'], [8, 0]), (['G5', 'treble'], [9, 0]), (['A5', 'treble'], [10, 1]), (['C6', 'treble'], [12, 2]), (['C#4', 'treble'], [-2, 1]), (['G3', 'treble'], [-5, 2])], [(['D4', 'treble'], [-1, 0]), (['B3', 'treble'], [-3, 1]), (['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])], [(['B3', 'treble'], [-3, 1]), (['Bb3', 'treble'], [-3, 1]), (['C4', 'alto'], [4, 0]), (['C4', 'bass'], [10, 1]), (['E2', 'bass'], [-2, 1]), (['C4', 'tenor'], [6, 0]), (['G2', 'bass'], [0, 0]), (['G3', 'treble'], [-5, 2])], [(['D4', 'treble'], [-1, 0]), (['Bb3', 'treble'], [-3, 1]), (['C4', 'tenor'], [6, 0]), (['G2', 'bass'], [0, 0]), (['F3', 'alto'], [0, 0]), (['B2', 'alto'], [-4, 2]), (['H4', 'treble'], None), (['G3', 'treble'], [-5, 2])]]\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-lower-ledger-count","generated_at":"2026-09-29T14:50:01.777924+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":"Negation is applied after floor division, so odd negative positions round away from the staff.","sha256":"d91c1273409a6ab2403776fbda46c2375017ace44489ece5ed08c424427366da","title":"Staff position and ledger lines for a clef: lower ledger count rounded the wrong way · 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.609,"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,1],"check":"oracle 2","expected":[-1,0],"passed":false},{"actual":[-4,2],"check":"oracle 3","expected":[-4,2],"passed":true},{"actual":[8,0],"check":"oracle 4","expected":[8,0],"passed":true},{"actual":[9,0],"check":"oracle 5","expected":[9,0],"passed":true},{"actual":[-3,2],"check":"oracle 6","expected":[-3,1],"passed":false},{"actual":[-5,3],"check":"oracle 7","expected":[-5,2],"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, 1], \"expected\": [-1, 0], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": [-4, 2], \"expected\": [-4, 2], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [8, 0], \"expected\": [8, 0], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [9, 0], \"expected\": [9, 0], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [-3, 2], \"expected\": [-3, 1], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": [-5, 3], \"expected\": [-5, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.872,"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,1],"check":"oracle 2","expected":[-1,0],"passed":false},{"actual":[-4,2],"check":"oracle 3","expected":[-4,2],"passed":true},{"actual":[8,0],"check":"oracle 4","expected":[8,0],"passed":true},{"actual":[9,0],"check":"oracle 5","expected":[9,0],"passed":true},{"actual":[-3,2],"check":"oracle 6","expected":[-3,1],"passed":false},{"actual":[-5,3],"check":"oracle 7","expected":[-5,2],"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, 1], \"expected\": [-1, 0], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": [-4, 2], \"expected\": [-4, 2], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [8, 0], \"expected\": [8, 0], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [9, 0], \"expected\": [9, 0], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [-3, 2], \"expected\": [-3, 1], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": [-5, 3], \"expected\": [-5, 2], \"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."}}