{"abstract":"A composite index lookup omits some rows for its leading key or leaks rows from the next leading key.","category":"Storage and queries","checks":7,"contract":"Input rows are sorted unique tuples [integer_tenant,integer_secondary,payload_string]. Return all rows for the requested tenant in index order. Secondary keys can be any integer. The model assumes integer, not string, leading keys.","contract_signature":"rows, tenant","evaluation_group":"model-6bd1af3c82b7128e","failed_approach":"Adding zero as a secondary bound seems to fix empty prefix ranges but excludes negative secondary keys and admits negative keys of the next tenant.","family":"store-composite-index-prefix","id":"FA-136","implementations":{"attempt":{"sha256":"0f93058b4479d3dc6e931d99b34ce13f65678cd3b5c524b9c0d3509d0a931477","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom bisect import bisect_left, bisect_right\nN = 1\nobservations = []\ndef solve(rows, tenant):\n    index = [tuple(row) for row in rows]\n    return [list(row) for row in index[bisect_left(index, (tenant, 0)):bisect_left(index, (tenant+1, 0))]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows = [[N, -N, 'negative'], [N, 0, 'zero'], [N, N, 'positive'], [N+1, -N, 'next']]\ncheck('entire composite prefix', solve(rows, N), rows[:3])\ncheck('next tenant negative key is not leaked backward', solve([[N+1, -N, 'next']], N), [])\ncheck('negative secondary key is not omitted', solve([[N, -N, 'kept']], N), [[N, -N, 'kept']])\ncheck('negative leading key', solve([[-N, -2, 'a'], [-N, 1, 'b'], [0, 0, 'c']], -N), [[-N, -2, 'a'], [-N, 1, 'b']])\ncheck('missing leading prefix', solve(rows, N+3), [])\ncheck('positive-only prefix still works', solve([[N, 1, 'a'], [N, N+2, 'b']], N), [[N, 1, 'a'], [N, N+2, 'b']])\ncheck('empty index', solve([], N), [])\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":"b1e16b7afa9eeac3a432e6a5039a6debcf14bb774f2c79bb69b15148da9241c1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom bisect import bisect_left, bisect_right\nN = 1\nobservations = []\ndef solve(rows, tenant):\n    index = [tuple(row) for row in rows]\n    return [list(row) for row in index[bisect_left(index, (tenant,)):bisect_right(index, (tenant,))]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows = [[N, -N, 'negative'], [N, 0, 'zero'], [N, N, 'positive'], [N+1, -N, 'next']]\ncheck('entire composite prefix', solve(rows, N), rows[:3])\ncheck('next tenant negative key is not leaked backward', solve([[N+1, -N, 'next']], N), [])\ncheck('negative secondary key is not omitted', solve([[N, -N, 'kept']], N), [[N, -N, 'kept']])\ncheck('negative leading key', solve([[-N, -2, 'a'], [-N, 1, 'b'], [0, 0, 'c']], -N), [[-N, -2, 'a'], [-N, 1, 'b']])\ncheck('missing leading prefix', solve(rows, N+3), [])\ncheck('positive-only prefix still works', solve([[N, 1, 'a'], [N, N+2, 'b']], N), [[N, 1, 'a'], [N, N+2, 'b']])\ncheck('empty index', solve([], N), [])\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":"store-composite-index-prefix","generated_at":"2026-09-29T14:36:50.518921+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exercises lexicographic B-tree range-bound construction without claiming to implement a physical index. It covers short-tuple ordering and invalid sentinel assumptions rather than cursor pagination.","root_cause":"Tuple prefix bounds are incorrectly padded with a presumed minimum secondary key of zero.","sha256":"6931d3a36ec8252e029a46678c69cc889b9d61b8e7e337bc0f037ea66c4fa911","title":"A prefix range scan misses negative secondary keys · 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":34.593,"exit_code":1,"observations":[{"actual":[[1,0,"zero"],[1,1,"positive"],[2,-1,"next"]],"check":"entire composite prefix","expected":[[1,-1,"negative"],[1,0,"zero"],[1,1,"positive"]],"passed":false},{"actual":[[2,-1,"next"]],"check":"next tenant negative key is not leaked backward","expected":[],"passed":false},{"actual":[],"check":"negative secondary key is not omitted","expected":[[1,-1,"kept"]],"passed":false},{"actual":[[-1,1,"b"]],"check":"negative leading key","expected":[[-1,-2,"a"],[-1,1,"b"]],"passed":false},{"actual":[],"check":"missing leading prefix","expected":[],"passed":true},{"actual":[[1,1,"a"],[1,3,"b"]],"check":"positive-only prefix still works","expected":[[1,1,"a"],[1,3,"b"]],"passed":true},{"actual":[],"check":"empty index","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"entire composite prefix\", \"actual\": [[1, 0, \"zero\"], [1, 1, \"positive\"], [2, -1, \"next\"]], \"expected\": [[1, -1, \"negative\"], [1, 0, \"zero\"], [1, 1, \"positive\"]], \"passed\": false}, {\"check\": \"next tenant negative key is not leaked backward\", \"actual\": [[2, -1, \"next\"]], \"expected\": [], \"passed\": false}, {\"check\": \"negative secondary key is not omitted\", \"actual\": [], \"expected\": [[1, -1, \"kept\"]], \"passed\": false}, {\"check\": \"negative leading key\", \"actual\": [[-1, 1, \"b\"]], \"expected\": [[-1, -2, \"a\"], [-1, 1, \"b\"]], \"passed\": false}, {\"check\": \"missing leading prefix\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"positive-only prefix still works\", \"actual\": [[1, 1, \"a\"], [1, 3, \"b\"]], \"expected\": [[1, 1, \"a\"], [1, 3, \"b\"]], \"passed\": true}, {\"check\": \"empty index\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":34.249,"exit_code":1,"observations":[{"actual":[],"check":"entire composite prefix","expected":[[1,-1,"negative"],[1,0,"zero"],[1,1,"positive"]],"passed":false},{"actual":[],"check":"next tenant negative key is not leaked backward","expected":[],"passed":true},{"actual":[],"check":"negative secondary key is not omitted","expected":[[1,-1,"kept"]],"passed":false},{"actual":[],"check":"negative leading key","expected":[[-1,-2,"a"],[-1,1,"b"]],"passed":false},{"actual":[],"check":"missing leading prefix","expected":[],"passed":true},{"actual":[],"check":"positive-only prefix still works","expected":[[1,1,"a"],[1,3,"b"]],"passed":false},{"actual":[],"check":"empty index","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"entire composite prefix\", \"actual\": [], \"expected\": [[1, -1, \"negative\"], [1, 0, \"zero\"], [1, 1, \"positive\"]], \"passed\": false}, {\"check\": \"next tenant negative key is not leaked backward\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"negative secondary key is not omitted\", \"actual\": [], \"expected\": [[1, -1, \"kept\"]], \"passed\": false}, {\"check\": \"negative leading key\", \"actual\": [], \"expected\": [[-1, -2, \"a\"], [-1, 1, \"b\"]], \"passed\": false}, {\"check\": \"missing leading prefix\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"positive-only prefix still works\", \"actual\": [], \"expected\": [[1, 1, \"a\"], [1, 3, \"b\"]], \"passed\": false}, {\"check\": \"empty index\", \"actual\": [], \"expected\": [], \"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."}}