{"abstract":"Permit allocator rejects a request that exactly fits.","category":"Bounded deques","checks":6,"contract":"Bounded deque capacity includes live items and outstanding insertion permits. Grant a new permit only if it fits, then cancel one named permit and report the remaining permits and capacity.","contract_signature":"x","evaluation_group":"s3-bounded-deques-capacity-permits","failed_approach":"The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.","family":"s3-bounded-deques-capacity-permits-grant-inclusive","id":"FA-46171","implementations":{"attempt":{"sha256":"9b6833fd83c3903c3242218f5cb689ed8401ae981b6986ef8a155f121aeaece9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cap,size,claims,want,cancel=x\n    reserved=sum(c[1] for c in claims)\n    available=cap-size-reserved\n    accepted=want==0 or want<available\n    active=claims+([['new',want]] if accepted else [])\n    active=[c for c in active if c[0]!=cancel]\n    free=cap-size-sum(c[1] for c in active)\n    return [active,accepted,free]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('reserved blocks grant', solve([8,3,[[\"a\",3]],3,\"none\"]), {1: [[['a', 3]], False, 2], 2: [[['a', 3]], False, 2], 3: [[['a', 3]], False, 2], 4: [[['a', 3]], False, 2], 5: [[['a', 3]], False, 2]}[N])\ncheck('cancel existing', solve([9,2,[[\"a\",2],[\"b\",1]],2,\"a\"]), {1: [[['b', 1], ['new', 2]], True, 4], 2: [[['b', 1], ['new', 2]], True, 4], 3: [[['b', 1], ['new', 2]], True, 4], 4: [[['b', 1], ['new', 2]], True, 4], 5: [[['b', 1], ['new', 2]], True, 4]}[N])\ncheck('cancel new', solve([7,2,[[\"a\",1]],3,\"new\"]), {1: [[['a', 1]], True, 4], 2: [[['a', 1]], True, 4], 3: [[['a', 1]], True, 4], 4: [[['a', 1]], True, 4], 5: [[['a', 1]], True, 4]}[N])\ncheck('exact available', solve([6,2,[[\"a\",1]],3,\"none\"]), {1: [[['a', 1], ['new', 3]], True, 0], 2: [[['a', 1], ['new', 3]], True, 0], 3: [[['a', 1], ['new', 3]], True, 0], 4: [[['a', 1], ['new', 3]], True, 0], 5: [[['a', 1], ['new', 3]], True, 0]}[N])\ncheck('no claims', solve([N+4,N,[],2,\"none\"]), {1: [[['new', 2]], True, 2], 2: [[['new', 2]], True, 2], 3: [[['new', 2]], True, 2], 4: [[['new', 2]], True, 2], 5: [[['new', 2]], True, 2]}[N])\ncheck('zero permit', solve([4,4,[],0,\"none\"]), {1: [[['new', 0]], True, 0], 2: [[['new', 0]], True, 0], 3: [[['new', 0]], True, 0], 4: [[['new', 0]], True, 0], 5: [[['new', 0]], True, 0]}[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":"f481cc46a6b44e8a2784cb111812e8a1f04e73244ec01aa9a6fb2263d57a1d2b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cap,size,claims,want,cancel=x\n    reserved=sum(c[1] for c in claims)\n    available=cap-size-reserved\n    accepted=want<available\n    active=claims+([['new',want]] if accepted else [])\n    active=[c for c in active if c[0]!=cancel]\n    free=cap-size-sum(c[1] for c in active)\n    return [active,accepted,free]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('reserved blocks grant', solve([8,3,[[\"a\",3]],3,\"none\"]), {1: [[['a', 3]], False, 2], 2: [[['a', 3]], False, 2], 3: [[['a', 3]], False, 2], 4: [[['a', 3]], False, 2], 5: [[['a', 3]], False, 2]}[N])\ncheck('cancel existing', solve([9,2,[[\"a\",2],[\"b\",1]],2,\"a\"]), {1: [[['b', 1], ['new', 2]], True, 4], 2: [[['b', 1], ['new', 2]], True, 4], 3: [[['b', 1], ['new', 2]], True, 4], 4: [[['b', 1], ['new', 2]], True, 4], 5: [[['b', 1], ['new', 2]], True, 4]}[N])\ncheck('cancel new', solve([7,2,[[\"a\",1]],3,\"new\"]), {1: [[['a', 1]], True, 4], 2: [[['a', 1]], True, 4], 3: [[['a', 1]], True, 4], 4: [[['a', 1]], True, 4], 5: [[['a', 1]], True, 4]}[N])\ncheck('exact available', solve([6,2,[[\"a\",1]],3,\"none\"]), {1: [[['a', 1], ['new', 3]], True, 0], 2: [[['a', 1], ['new', 3]], True, 0], 3: [[['a', 1], ['new', 3]], True, 0], 4: [[['a', 1], ['new', 3]], True, 0], 5: [[['a', 1], ['new', 3]], True, 0]}[N])\ncheck('no claims', solve([N+4,N,[],2,\"none\"]), {1: [[['new', 2]], True, 2], 2: [[['new', 2]], True, 2], 3: [[['new', 2]], True, 2], 4: [[['new', 2]], True, 2], 5: [[['new', 2]], True, 2]}[N])\ncheck('zero permit', solve([4,4,[],0,\"none\"]), {1: [[['new', 0]], True, 0], 2: [[['new', 0]], True, 0], 3: [[['new', 0]], True, 0], 4: [[['new', 0]], True, 0], 5: [[['new', 0]], True, 0]}[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":"Offline finite deterministic model; no claim of production implementation or concurrent memory-model conformance. 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":"s3-bounded-deques-capacity-permits-grant-inclusive","generated_at":"2026-09-29T14:44:29.615318+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Controlled bounded deque implementation model with explicit storage and lifecycle observations.","root_cause":"Permit allocator rejects a request that exactly fits.","sha256":"c0ca2bc469b1ce4a38aa876113c53e8a92af63401946debfbc40e59566957d70","title":"Permit allocator rejects a request that exactly fits · 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":43.413,"exit_code":1,"observations":[{"actual":[[["a",3]],false,2],"check":"reserved blocks grant","expected":[[["a",3]],false,2],"passed":true},{"actual":[[["b",1],["new",2]],true,4],"check":"cancel existing","expected":[[["b",1],["new",2]],true,4],"passed":true},{"actual":[[["a",1]],true,4],"check":"cancel new","expected":[[["a",1]],true,4],"passed":true},{"actual":[[["a",1]],false,3],"check":"exact available","expected":[[["a",1],["new",3]],true,0],"passed":false},{"actual":[[["new",2]],true,2],"check":"no claims","expected":[[["new",2]],true,2],"passed":true},{"actual":[[["new",0]],true,0],"check":"zero permit","expected":[[["new",0]],true,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"reserved blocks grant\", \"actual\": [[[\"a\", 3]], false, 2], \"expected\": [[[\"a\", 3]], false, 2], \"passed\": true}, {\"check\": \"cancel existing\", \"actual\": [[[\"b\", 1], [\"new\", 2]], true, 4], \"expected\": [[[\"b\", 1], [\"new\", 2]], true, 4], \"passed\": true}, {\"check\": \"cancel new\", \"actual\": [[[\"a\", 1]], true, 4], \"expected\": [[[\"a\", 1]], true, 4], \"passed\": true}, {\"check\": \"exact available\", \"actual\": [[[\"a\", 1]], false, 3], \"expected\": [[[\"a\", 1], [\"new\", 3]], true, 0], \"passed\": false}, {\"check\": \"no claims\", \"actual\": [[[\"new\", 2]], true, 2], \"expected\": [[[\"new\", 2]], true, 2], \"passed\": true}, {\"check\": \"zero permit\", \"actual\": [[[\"new\", 0]], true, 0], \"expected\": [[[\"new\", 0]], true, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.461,"exit_code":1,"observations":[{"actual":[[["a",3]],false,2],"check":"reserved blocks grant","expected":[[["a",3]],false,2],"passed":true},{"actual":[[["b",1],["new",2]],true,4],"check":"cancel existing","expected":[[["b",1],["new",2]],true,4],"passed":true},{"actual":[[["a",1]],true,4],"check":"cancel new","expected":[[["a",1]],true,4],"passed":true},{"actual":[[["a",1]],false,3],"check":"exact available","expected":[[["a",1],["new",3]],true,0],"passed":false},{"actual":[[["new",2]],true,2],"check":"no claims","expected":[[["new",2]],true,2],"passed":true},{"actual":[[],false,0],"check":"zero permit","expected":[[["new",0]],true,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"reserved blocks grant\", \"actual\": [[[\"a\", 3]], false, 2], \"expected\": [[[\"a\", 3]], false, 2], \"passed\": true}, {\"check\": \"cancel existing\", \"actual\": [[[\"b\", 1], [\"new\", 2]], true, 4], \"expected\": [[[\"b\", 1], [\"new\", 2]], true, 4], \"passed\": true}, {\"check\": \"cancel new\", \"actual\": [[[\"a\", 1]], true, 4], \"expected\": [[[\"a\", 1]], true, 4], \"passed\": true}, {\"check\": \"exact available\", \"actual\": [[[\"a\", 1]], false, 3], \"expected\": [[[\"a\", 1], [\"new\", 3]], true, 0], \"passed\": false}, {\"check\": \"no claims\", \"actual\": [[[\"new\", 2]], true, 2], \"expected\": [[[\"new\", 2]], true, 2], \"passed\": true}, {\"check\": \"zero permit\", \"actual\": [[], false, 0], \"expected\": [[[\"new\", 0]], true, 0], \"passed\": false}], \"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."}}