{"abstract":"The operation returns a result or retained state that violates this contract: Insert a value using Python positional insertion: negative offsets are relative to length and clamp at zero.","category":"Container mutation","checks":4,"contract":"Insert a value using Python positional insertion: negative offsets are relative to length and clamp at zero. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-720788da6b16d86d","failed_approach":"Modulo wraps oversized positions instead of applying insertion clamping.","family":"xr-list-insert-clamps-negative-index","id":"FA-4331","implementations":{"attempt":{"sha256":"dba6bb83584d47d30b7cd1575ab1f5b31d0c7a517a4f0b610bbb16846d29c1b8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=list(x); a.insert(y[0]%len(a) if a else 0,y[1]); return a\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('relative negative', solve(['a', 'b'], [-1, 'c']), ['a', 'c', 'b'])\ncheck('underflow clamps', solve(['a', 'b'], [-9, 'c']), ['c', 'a', 'b'])\ncheck('overflow appends', solve(['a', 'b'], [9, 'c']), ['a', 'b', 'c'])\ncheck('empty accepts', solve([], [0, 'c']), ['c'])\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":"88e57f1f03bbdaf505652d8533e6b225cffe329f693f190e2f482876c82edead","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=list(x); a.insert(max(0,y[0]),y[1]); return a\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('relative negative', solve(['a', 'b'], [-1, 'c']), ['a', 'c', 'b'])\ncheck('underflow clamps', solve(['a', 'b'], [-9, 'c']), ['c', 'a', 'b'])\ncheck('overflow appends', solve(['a', 'b'], [9, 'c']), ['a', 'b', 'c'])\ncheck('empty accepts', solve([], [0, 'c']), ['c'])\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":"978dc0cf8d3d7b4ef3b74e481fb9b5eb7ba586f948636906b7a551efd3db1d2f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=list(x); a.insert(y[0],y[1]); return a\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('relative negative', solve(['a', 'b'], [-1, 'c']), ['a', 'c', 'b'])\ncheck('underflow clamps', solve(['a', 'b'], [-9, 'c']), ['c', 'a', 'b'])\ncheck('overflow appends', solve(['a', 'b'], [9, 'c']), ['a', 'b', 'c'])\ncheck('empty accepts', solve([], [0, 'c']), ['c'])\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-list-insert-clamps-negative-index","generated_at":"2026-09-29T14:37:37.907067+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.","repair":"Insert a value using Python positional insertion: negative offsets are relative to length and clamp at zero.","root_cause":"Clamping before resolving a negative offset loses its relative-to-end meaning.","sha256":"4c98f141a368a30cb0628bd71469f608db37855a553c232a951cd6d423d5913f","title":"List insert clamps negative index · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verification":{"attempt":{"elapsed_ms":40.563,"exit_code":1,"observations":[{"actual":["a","c","b"],"check":"relative negative","expected":["a","c","b"],"passed":true},{"actual":["a","c","b"],"check":"underflow clamps","expected":["c","a","b"],"passed":false},{"actual":["a","c","b"],"check":"overflow appends","expected":["a","b","c"],"passed":false},{"actual":["c"],"check":"empty accepts","expected":["c"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"relative negative\", \"actual\": [\"a\", \"c\", \"b\"], \"expected\": [\"a\", \"c\", \"b\"], \"passed\": true}, {\"check\": \"underflow clamps\", \"actual\": [\"a\", \"c\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": false}, {\"check\": \"overflow appends\", \"actual\": [\"a\", \"c\", \"b\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"empty accepts\", \"actual\": [\"c\"], \"expected\": [\"c\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":114.479,"exit_code":1,"observations":[{"actual":["c","a","b"],"check":"relative negative","expected":["a","c","b"],"passed":false},{"actual":["c","a","b"],"check":"underflow clamps","expected":["c","a","b"],"passed":true},{"actual":["a","b","c"],"check":"overflow appends","expected":["a","b","c"],"passed":true},{"actual":["c"],"check":"empty accepts","expected":["c"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"relative negative\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"a\", \"c\", \"b\"], \"passed\": false}, {\"check\": \"underflow clamps\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": true}, {\"check\": \"overflow appends\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"empty accepts\", \"actual\": [\"c\"], \"expected\": [\"c\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.04,"exit_code":0,"observations":[{"actual":["a","c","b"],"check":"relative negative","expected":["a","c","b"],"passed":true},{"actual":["c","a","b"],"check":"underflow clamps","expected":["c","a","b"],"passed":true},{"actual":["a","b","c"],"check":"overflow appends","expected":["a","b","c"],"passed":true},{"actual":["c"],"check":"empty accepts","expected":["c"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"relative negative\", \"actual\": [\"a\", \"c\", \"b\"], \"expected\": [\"a\", \"c\", \"b\"], \"passed\": true}, {\"check\": \"underflow clamps\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"c\", \"a\", \"b\"], \"passed\": true}, {\"check\": \"overflow appends\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"empty accepts\", \"actual\": [\"c\"], \"expected\": [\"c\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}