{"abstract":"A dorian or capitalised Major request returns a major signature instead of None.","category":"Music interval and transposition theory","checks":8,"contract":"Input [tonic, mode] with tonic a letter optionally followed by one # or b, and mode major or minor. The signature is the letter position on the line of fifths (F -1, C 0, G 1, D 2, A 3, E 4, B 5) plus 7 per sharp and minus 7 per flat; minor keys use the relative major, three fifths flatward. Return the count (positive sharps, negative flats) or None if it lies outside -7..7 or the input is invalid.","evaluation_group":"w2-music-interval-tonic-key-fifths","failed_approach":"Checking that the mode is a string still accepts arbitrary unknown mode names.","family":"w2-music-interval-tonic-key-fifths-mode-validation","id":"FA-80976","implementations":{"attempt":{"sha256":"0965d1ca8f5399200748d8c1c45820a4a2154559921fe988c96e54c60ed15ef3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = {'F': -1, 'C': 0, 'G': 1, 'D': 2, 'A': 3, 'E': 4, 'B': 5}\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    tonic, mode = x\n    if not isinstance(mode, str):\n        return None\n    if not isinstance(tonic, str) or not tonic or tonic[0] not in base:\n        return None\n    rest = tonic[1:]\n    if rest not in ('', '#', 'b'):\n        return None\n    acc = {'': 0, '#': 1, 'b': -1}[rest]\n    fifths = base[tonic[0]] + 7 * acc\n    if mode == 'minor':\n        fifths -= 3\n    if fifths < -7 or fifths > 7:\n        return None\n    return fifths\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C', 'major'], 0), (['G', 'major'], 1), (['F', 'major'], -1), (['F#', 'major'], 6), (['Gb', 'major'], -6), (['C#', 'major'], 7), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['F#', 'major'], 6), (['Gb', 'major'], -6), (['C#', 'major'], 7), (['Cb', 'major'], -7), (['Db', 'major'], -5), (['B', 'major'], 5), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['Cb', 'major'], -7), (['Db', 'major'], -5), (['B', 'major'], 5), (['A', 'minor'], 0), (['E', 'minor'], 1), (['D', 'minor'], -1), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['A', 'minor'], 0), (['E', 'minor'], 1), (['D', 'minor'], -1), (['C#', 'minor'], 4), (['Eb', 'minor'], -6), (['Ab', 'minor'], -7), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['C#', 'minor'], 4), (['Eb', 'minor'], -6), (['Ab', 'minor'], -7), (['G#', 'minor'], 5), (['D#', 'minor'], 6), (['A#', 'minor'], 7), (['C', 'dorian'], None), (['C', 'Major'], None)]]\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":"f54cc6a73b42b776387ebb565c076cb592a25569939957603bc3ac19ae2d3f95","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = {'F': -1, 'C': 0, 'G': 1, 'D': 2, 'A': 3, 'E': 4, 'B': 5}\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    tonic, mode = x\n    if not mode:\n        return None\n    if not isinstance(tonic, str) or not tonic or tonic[0] not in base:\n        return None\n    rest = tonic[1:]\n    if rest not in ('', '#', 'b'):\n        return None\n    acc = {'': 0, '#': 1, 'b': -1}[rest]\n    fifths = base[tonic[0]] + 7 * acc\n    if mode == 'minor':\n        fifths -= 3\n    if fifths < -7 or fifths > 7:\n        return None\n    return fifths\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C', 'major'], 0), (['G', 'major'], 1), (['F', 'major'], -1), (['F#', 'major'], 6), (['Gb', 'major'], -6), (['C#', 'major'], 7), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['F#', 'major'], 6), (['Gb', 'major'], -6), (['C#', 'major'], 7), (['Cb', 'major'], -7), (['Db', 'major'], -5), (['B', 'major'], 5), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['Cb', 'major'], -7), (['Db', 'major'], -5), (['B', 'major'], 5), (['A', 'minor'], 0), (['E', 'minor'], 1), (['D', 'minor'], -1), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['A', 'minor'], 0), (['E', 'minor'], 1), (['D', 'minor'], -1), (['C#', 'minor'], 4), (['Eb', 'minor'], -6), (['Ab', 'minor'], -7), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['C#', 'minor'], 4), (['Eb', 'minor'], -6), (['Ab', 'minor'], -7), (['G#', 'minor'], 5), (['D#', 'minor'], 6), (['A#', 'minor'], 7), (['C', 'dorian'], None), (['C', 'Major'], None)]]\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"},"fixed":{"sha256":"45825ee6afbafba40ae8311109ca9dfcbd0e08816ebb65ca3d9b27333bd1ff48","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    base = {'F': -1, 'C': 0, 'G': 1, 'D': 2, 'A': 3, 'E': 4, 'B': 5}\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    tonic, mode = x\n    if mode not in ('major', 'minor'):\n        return None\n    if not isinstance(tonic, str) or not tonic or tonic[0] not in base:\n        return None\n    rest = tonic[1:]\n    if rest not in ('', '#', 'b'):\n        return None\n    acc = {'': 0, '#': 1, 'b': -1}[rest]\n    fifths = base[tonic[0]] + 7 * acc\n    if mode == 'minor':\n        fifths -= 3\n    if fifths < -7 or fifths > 7:\n        return None\n    return fifths\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['C', 'major'], 0), (['G', 'major'], 1), (['F', 'major'], -1), (['F#', 'major'], 6), (['Gb', 'major'], -6), (['C#', 'major'], 7), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['F#', 'major'], 6), (['Gb', 'major'], -6), (['C#', 'major'], 7), (['Cb', 'major'], -7), (['Db', 'major'], -5), (['B', 'major'], 5), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['Cb', 'major'], -7), (['Db', 'major'], -5), (['B', 'major'], 5), (['A', 'minor'], 0), (['E', 'minor'], 1), (['D', 'minor'], -1), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['A', 'minor'], 0), (['E', 'minor'], 1), (['D', 'minor'], -1), (['C#', 'minor'], 4), (['Eb', 'minor'], -6), (['Ab', 'minor'], -7), (['C', 'dorian'], None), (['C', 'Major'], None)], [(['C#', 'minor'], 4), (['Eb', 'minor'], -6), (['Ab', 'minor'], -7), (['G#', 'minor'], 5), (['D#', 'minor'], 6), (['A#', 'minor'], 7), (['C', 'dorian'], None), (['C', 'Major'], None)]]\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-tonic-key-fifths-mode-validation","generated_at":"2026-09-29T14:49:58.695026+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.","repair":"Restore the mode validation step so that it reads `if mode not in ('major', 'minor'):`.","root_cause":"The mode guard only rejects empty values, so any unknown mode falls through to the major branch.","sha256":"02956d842d15ab6164ba0e169bed500ab3ab5c2564a0d7299d22634e0b03ccd5","title":"Key signature size for a named tonic: unknown mode treated as major · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.193,"exit_code":1,"observations":[{"actual":0,"check":"oracle 0","expected":0,"passed":true},{"actual":1,"check":"oracle 1","expected":1,"passed":true},{"actual":-1,"check":"oracle 2","expected":-1,"passed":true},{"actual":6,"check":"oracle 3","expected":6,"passed":true},{"actual":-6,"check":"oracle 4","expected":-6,"passed":true},{"actual":7,"check":"oracle 5","expected":7,"passed":true},{"actual":0,"check":"oracle 6","expected":null,"passed":false},{"actual":0,"check":"oracle 7","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": -6, \"expected\": -6, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": 0, \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.495,"exit_code":1,"observations":[{"actual":0,"check":"oracle 0","expected":0,"passed":true},{"actual":1,"check":"oracle 1","expected":1,"passed":true},{"actual":-1,"check":"oracle 2","expected":-1,"passed":true},{"actual":6,"check":"oracle 3","expected":6,"passed":true},{"actual":-6,"check":"oracle 4","expected":-6,"passed":true},{"actual":7,"check":"oracle 5","expected":7,"passed":true},{"actual":0,"check":"oracle 6","expected":null,"passed":false},{"actual":0,"check":"oracle 7","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": -6, \"expected\": -6, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": 0, \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.821,"exit_code":0,"observations":[{"actual":0,"check":"oracle 0","expected":0,"passed":true},{"actual":1,"check":"oracle 1","expected":1,"passed":true},{"actual":-1,"check":"oracle 2","expected":-1,"passed":true},{"actual":6,"check":"oracle 3","expected":6,"passed":true},{"actual":-6,"check":"oracle 4","expected":-6,"passed":true},{"actual":7,"check":"oracle 5","expected":7,"passed":true},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": -6, \"expected\": -6, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}