{"abstract":"Every scale containing a flat degree returns None because a flat is folded to +11 and rejected.","category":"Music interval and transposition theory","checks":8,"contract":"Input [tonic, mode]: tonic is a letter plus optional accidental from \"\", #, b, x, bb; mode is one of the seven church modes ionian..locrian. The step pattern is the major pattern 2 2 1 2 2 2 1 rotated left by the mode index. Each degree uses the next letter; its alteration is the pitch-class difference from the natural letter folded into -6..5. Return the seven names, or None if any alteration exceeds two or input is invalid.","contract_signature":"x","evaluation_group":"w2-music-interval-modal-scale-spelling","failed_approach":"Dropping the fold entirely breaks degrees that wrap past B to C, e.g. C# locrian.","family":"w2-music-interval-modal-scale-spelling-alteration-folding","id":"FA-81011","implementations":{"attempt":{"sha256":"74e70e2791aeef469aa25e42af879ff8dc58e274fcb7f0732550cc0e30684aed","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    modes = ['ionian', 'dorian', 'phrygian', 'lydian', 'mixolydian', 'aeolian', 'locrian']\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    tonic, mode = x\n    if mode not in modes or not isinstance(tonic, str) or not tonic or tonic[0] not in base:\n        return None\n    signs = {'': 0, '#': 1, 'b': -1, 'x': 2, 'bb': -2}\n    if tonic[1:] not in signs:\n        return None\n    steps = [2, 2, 1, 2, 2, 2, 1]\n    k = modes.index(mode)\n    steps = steps[k:] + steps[:k]\n    pc = base[tonic[0]] + signs[tonic[1:]]\n    li = 'CDEFGAB'.index(tonic[0])\n    out = []\n    for step in steps:\n        letter = 'CDEFGAB'[li % 7]\n        alter = pc - base[letter]\n        if abs(alter) > 2:\n            return None\n        out.append(letter + {0: '', 1: '#', -1: 'b', 2: 'x', -2: 'bb'}[alter])\n        pc += step\n        li += 1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C', 'ionian'], ['C', 'D', 'E', 'F', 'G', 'A', 'B']), (['D', 'dorian'], ['D', 'E', 'F', 'G', 'A', 'B', 'C']), (['G', 'mixolydian'], ['G', 'A', 'B', 'C', 'D', 'E', 'F']), (['C', 'dorian'], ['C', 'D', 'Eb', 'F', 'G', 'A', 'Bb']), (['C', 'lydian'], ['C', 'D', 'E', 'F#', 'G', 'A', 'B']), (['C', 'locrian'], ['C', 'Db', 'Eb', 'F', 'Gb', 'Ab', 'Bb']), (['C#', 'locrian'], ['C#', 'D', 'E', 'F#', 'G', 'A', 'B']), (['Dx', 'ionian'], None)], [(['E', 'phrygian'], ['E', 'F', 'G', 'A', 'B', 'C', 'D']), (['A', 'aeolian'], ['A', 'B', 'C', 'D', 'E', 'F', 'G']), (['C', 'phrygian'], ['C', 'Db', 'Eb', 'F', 'G', 'Ab', 'Bb']), (['Eb', 'aeolian'], ['Eb', 'F', 'Gb', 'Ab', 'Bb', 'Cb', 'Db']), (['Dx', 'ionian'], None), (['D', 'major'], None), (['Abb', 'locrian'], None), (['H', 'ionian'], None)], [(['D', 'dorian'], ['D', 'E', 'F', 'G', 'A', 'B', 'C']), (['E', 'phrygian'], ['E', 'F', 'G', 'A', 'B', 'C', 'D']), (['F', 'lydian'], ['F', 'G', 'A', 'B', 'C', 'D', 'E']), (['B', 'locrian'], ['B', 'C', 'D', 'E', 'F', 'G', 'A']), (['C', 'locrian'], ['C', 'Db', 'Eb', 'F', 'Gb', 'Ab', 'Bb']), (['Bb', 'mixolydian'], ['Bb', 'C', 'D', 'Eb', 'F', 'G', 'Ab']), (['H', 'ionian'], None), (['Cq', 'ionian'], None)], [(['E', 'phrygian'], ['E', 'F', 'G', 'A', 'B', 'C', 'D']), (['F', 'lydian'], ['F', 'G', 'A', 'B', 'C', 'D', 'E']), (['G', 'mixolydian'], ['G', 'A', 'B', 'C', 'D', 'E', 'F']), (['A', 'aeolian'], ['A', 'B', 'C', 'D', 'E', 'F', 'G']), (['B', 'locrian'], ['B', 'C', 'D', 'E', 'F', 'G', 'A']), (['C', 'dorian'], ['C', 'D', 'Eb', 'F', 'G', 'A', 'Bb']), (['Eb', 'aeolian'], ['Eb', 'F', 'Gb', 'Ab', 'Bb', 'Cb', 'Db']), (['Gb', 'lydian'], ['Gb', 'Ab', 'Bb', 'C', 'Db', 'Eb', 'F'])], [(['A', 'aeolian'], ['A', 'B', 'C', 'D', 'E', 'F', 'G']), (['B', 'locrian'], ['B', 'C', 'D', 'E', 'F', 'G', 'A']), (['C', 'dorian'], ['C', 'D', 'Eb', 'F', 'G', 'A', 'Bb']), (['C', 'phrygian'], ['C', 'Db', 'Eb', 'F', 'G', 'Ab', 'Bb']), (['C', 'locrian'], ['C', 'Db', 'Eb', 'F', 'Gb', 'Ab', 'Bb']), (['F#', 'ionian'], ['F#', 'G#', 'A#', 'B', 'C#', 'D#', 'E#']), (['Bb', 'mixolydian'], ['Bb', 'C', 'D', 'Eb', 'F', 'G', 'Ab']), (['Fb', 'locrian'], ['Fb', 'Gbb', 'Abb', 'Bbb', 'Cbb', 'Dbb', 'Ebb'])]]\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":"d8635d0ef61598bb38a9ebd3719498bdbb0d93ab0acdcd0d5eaf926153c72de6","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    modes = ['ionian', 'dorian', 'phrygian', 'lydian', 'mixolydian', 'aeolian', 'locrian']\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    tonic, mode = x\n    if mode not in modes or not isinstance(tonic, str) or not tonic or tonic[0] not in base:\n        return None\n    signs = {'': 0, '#': 1, 'b': -1, 'x': 2, 'bb': -2}\n    if tonic[1:] not in signs:\n        return None\n    steps = [2, 2, 1, 2, 2, 2, 1]\n    k = modes.index(mode)\n    steps = steps[k:] + steps[:k]\n    pc = base[tonic[0]] + signs[tonic[1:]]\n    li = 'CDEFGAB'.index(tonic[0])\n    out = []\n    for step in steps:\n        letter = 'CDEFGAB'[li % 7]\n        alter = (pc - base[letter]) % 12\n        if abs(alter) > 2:\n            return None\n        out.append(letter + {0: '', 1: '#', -1: 'b', 2: 'x', -2: 'bb'}[alter])\n        pc += step\n        li += 1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C', 'ionian'], ['C', 'D', 'E', 'F', 'G', 'A', 'B']), (['D', 'dorian'], ['D', 'E', 'F', 'G', 'A', 'B', 'C']), (['G', 'mixolydian'], ['G', 'A', 'B', 'C', 'D', 'E', 'F']), (['C', 'dorian'], ['C', 'D', 'Eb', 'F', 'G', 'A', 'Bb']), (['C', 'lydian'], ['C', 'D', 'E', 'F#', 'G', 'A', 'B']), (['C', 'locrian'], ['C', 'Db', 'Eb', 'F', 'Gb', 'Ab', 'Bb']), (['C#', 'locrian'], ['C#', 'D', 'E', 'F#', 'G', 'A', 'B']), (['Dx', 'ionian'], None)], [(['E', 'phrygian'], ['E', 'F', 'G', 'A', 'B', 'C', 'D']), (['A', 'aeolian'], ['A', 'B', 'C', 'D', 'E', 'F', 'G']), (['C', 'phrygian'], ['C', 'Db', 'Eb', 'F', 'G', 'Ab', 'Bb']), (['Eb', 'aeolian'], ['Eb', 'F', 'Gb', 'Ab', 'Bb', 'Cb', 'Db']), (['Dx', 'ionian'], None), (['D', 'major'], None), (['Abb', 'locrian'], None), (['H', 'ionian'], None)], [(['D', 'dorian'], ['D', 'E', 'F', 'G', 'A', 'B', 'C']), (['E', 'phrygian'], ['E', 'F', 'G', 'A', 'B', 'C', 'D']), (['F', 'lydian'], ['F', 'G', 'A', 'B', 'C', 'D', 'E']), (['B', 'locrian'], ['B', 'C', 'D', 'E', 'F', 'G', 'A']), (['C', 'locrian'], ['C', 'Db', 'Eb', 'F', 'Gb', 'Ab', 'Bb']), (['Bb', 'mixolydian'], ['Bb', 'C', 'D', 'Eb', 'F', 'G', 'Ab']), (['H', 'ionian'], None), (['Cq', 'ionian'], None)], [(['E', 'phrygian'], ['E', 'F', 'G', 'A', 'B', 'C', 'D']), (['F', 'lydian'], ['F', 'G', 'A', 'B', 'C', 'D', 'E']), (['G', 'mixolydian'], ['G', 'A', 'B', 'C', 'D', 'E', 'F']), (['A', 'aeolian'], ['A', 'B', 'C', 'D', 'E', 'F', 'G']), (['B', 'locrian'], ['B', 'C', 'D', 'E', 'F', 'G', 'A']), (['C', 'dorian'], ['C', 'D', 'Eb', 'F', 'G', 'A', 'Bb']), (['Eb', 'aeolian'], ['Eb', 'F', 'Gb', 'Ab', 'Bb', 'Cb', 'Db']), (['Gb', 'lydian'], ['Gb', 'Ab', 'Bb', 'C', 'Db', 'Eb', 'F'])], [(['A', 'aeolian'], ['A', 'B', 'C', 'D', 'E', 'F', 'G']), (['B', 'locrian'], ['B', 'C', 'D', 'E', 'F', 'G', 'A']), (['C', 'dorian'], ['C', 'D', 'Eb', 'F', 'G', 'A', 'Bb']), (['C', 'phrygian'], ['C', 'Db', 'Eb', 'F', 'G', 'Ab', 'Bb']), (['C', 'locrian'], ['C', 'Db', 'Eb', 'F', 'Gb', 'Ab', 'Bb']), (['F#', 'ionian'], ['F#', 'G#', 'A#', 'B', 'C#', 'D#', 'E#']), (['Bb', 'mixolydian'], ['Bb', 'C', 'D', 'Eb', 'F', 'G', 'Ab']), (['Fb', 'locrian'], ['Fb', 'Gbb', 'Abb', 'Bbb', 'Cbb', 'Dbb', 'Ebb'])]]\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-modal-scale-spelling-alteration-folding","generated_at":"2026-09-29T14:49:59.218329+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 alteration is reduced into 0..11 instead of a signed window around the natural letter.","sha256":"f87f8bb2fa7d31c7559865c5ada8e44aab33abe142e7d0200e5851aa6c732508","title":"Modal scale spelling from a tonic: flat degrees reported as eleven-semitone sharps · 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.322,"exit_code":1,"observations":[{"actual":["C","D","E","F","G","A","B"],"check":"oracle 0","expected":["C","D","E","F","G","A","B"],"passed":true},{"actual":null,"check":"oracle 1","expected":["D","E","F","G","A","B","C"],"passed":false},{"actual":null,"check":"oracle 2","expected":["G","A","B","C","D","E","F"],"passed":false},{"actual":["C","D","Eb","F","G","A","Bb"],"check":"oracle 3","expected":["C","D","Eb","F","G","A","Bb"],"passed":true},{"actual":["C","D","E","F#","G","A","B"],"check":"oracle 4","expected":["C","D","E","F#","G","A","B"],"passed":true},{"actual":["C","Db","Eb","F","Gb","Ab","Bb"],"check":"oracle 5","expected":["C","Db","Eb","F","Gb","Ab","Bb"],"passed":true},{"actual":["C#","D","E","F#","G","A","B"],"check":"oracle 6","expected":["C#","D","E","F#","G","A","B"],"passed":true},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"], \"expected\": [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": null, \"expected\": [\"D\", \"E\", \"F\", \"G\", \"A\", \"B\", \"C\"], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": null, \"expected\": [\"G\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": [\"C\", \"D\", \"Eb\", \"F\", \"G\", \"A\", \"Bb\"], \"expected\": [\"C\", \"D\", \"Eb\", \"F\", \"G\", \"A\", \"Bb\"], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [\"C\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"expected\": [\"C\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [\"C\", \"Db\", \"Eb\", \"F\", \"Gb\", \"Ab\", \"Bb\"], \"expected\": [\"C\", \"Db\", \"Eb\", \"F\", \"Gb\", \"Ab\", \"Bb\"], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [\"C#\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"expected\": [\"C#\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.762,"exit_code":1,"observations":[{"actual":["C","D","E","F","G","A","B"],"check":"oracle 0","expected":["C","D","E","F","G","A","B"],"passed":true},{"actual":["D","E","F","G","A","B","C"],"check":"oracle 1","expected":["D","E","F","G","A","B","C"],"passed":true},{"actual":["G","A","B","C","D","E","F"],"check":"oracle 2","expected":["G","A","B","C","D","E","F"],"passed":true},{"actual":null,"check":"oracle 3","expected":["C","D","Eb","F","G","A","Bb"],"passed":false},{"actual":["C","D","E","F#","G","A","B"],"check":"oracle 4","expected":["C","D","E","F#","G","A","B"],"passed":true},{"actual":null,"check":"oracle 5","expected":["C","Db","Eb","F","Gb","Ab","Bb"],"passed":false},{"actual":["C#","D","E","F#","G","A","B"],"check":"oracle 6","expected":["C#","D","E","F#","G","A","B"],"passed":true},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"], \"expected\": [\"C\", \"D\", \"E\", \"F\", \"G\", \"A\", \"B\"], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [\"D\", \"E\", \"F\", \"G\", \"A\", \"B\", \"C\"], \"expected\": [\"D\", \"E\", \"F\", \"G\", \"A\", \"B\", \"C\"], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [\"G\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"], \"expected\": [\"G\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": null, \"expected\": [\"C\", \"D\", \"Eb\", \"F\", \"G\", \"A\", \"Bb\"], \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": [\"C\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"expected\": [\"C\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": [\"C\", \"Db\", \"Eb\", \"F\", \"Gb\", \"Ab\", \"Bb\"], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [\"C#\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"expected\": [\"C#\", \"D\", \"E\", \"F#\", \"G\", \"A\", \"B\"], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"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."}}