{"abstract":"The operation returns a result or retained state that violates this contract: Return the second positional element or None if fewer than two elements exist.","category":"Sequence semantics","checks":5,"contract":"Return the second positional element or None if fewer than two elements exist. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","contract_signature":"x, y=None","evaluation_group":"model-4e9ac90c86a7f992","failed_approach":"Distinct-value ranking skips an equal-valued second position.","family":"xr-second-element-not-second-distinct","id":"FA-4126","implementations":{"attempt":{"sha256":"5f80d85cd2238c5a9bdf433aafabeb024f2f3c80c8c687402926285a735b96ab","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return list(dict.fromkeys(x))[1] if len(set(x))>1 else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty collection', solve([]), None)\ncheck('singleton collection', solve(['a']), None)\ncheck('two distinct elements', solve(['a', 'b']), 'b')\ncheck('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), 'a')\ncheck('equal first and second', solve(['a','a','b']), 'a')\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":"a263a1b7f3ecf55b0a7def427c69fdafb1d0f4bf46ff02d1736719aa2991506c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return x[0] if x else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty collection', solve([]), None)\ncheck('singleton collection', solve(['a']), None)\ncheck('two distinct elements', solve(['a', 'b']), 'b')\ncheck('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), 'a')\ncheck('equal first and second', solve(['a','a','b']), 'a')\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":" 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":"xr-second-element-not-second-distinct","generated_at":"2026-09-29T14:37:36.052484+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.","root_cause":"The first element is selected even when a second element is required.","sha256":"3164b6f60765f51689d347de9999fe96dce145a95ca86fad5aa02a9ca2d05548","title":"Second element not second distinct · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":38.699,"exit_code":1,"observations":[{"actual":null,"check":"empty collection","expected":null,"passed":true},{"actual":null,"check":"singleton collection","expected":null,"passed":true},{"actual":"b","check":"two distinct elements","expected":"b","passed":true},{"actual":"a","check":"nonadjacent duplicate and unsorted order","expected":"a","passed":true},{"actual":"b","check":"equal first and second","expected":"a","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty collection\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"singleton collection\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"two distinct elements\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"nonadjacent duplicate and unsorted order\", \"actual\": \"a\", \"expected\": \"a\", \"passed\": true}, {\"check\": \"equal first and second\", \"actual\": \"b\", \"expected\": \"a\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.538,"exit_code":1,"observations":[{"actual":null,"check":"empty collection","expected":null,"passed":true},{"actual":"a","check":"singleton collection","expected":null,"passed":false},{"actual":"a","check":"two distinct elements","expected":"b","passed":false},{"actual":"b","check":"nonadjacent duplicate and unsorted order","expected":"a","passed":false},{"actual":"a","check":"equal first and second","expected":"a","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty collection\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"singleton collection\", \"actual\": \"a\", \"expected\": null, \"passed\": false}, {\"check\": \"two distinct elements\", \"actual\": \"a\", \"expected\": \"b\", \"passed\": false}, {\"check\": \"nonadjacent duplicate and unsorted order\", \"actual\": \"b\", \"expected\": \"a\", \"passed\": false}, {\"check\": \"equal first and second\", \"actual\": \"a\", \"expected\": \"a\", \"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."}}