{"abstract":"Replacing entry tags leaves obsolete reverse-index membership.","category":"Caching","checks":4,"contract":"Return tag-to-sorted-unique-keys index after replacing one key tags; drop empty buckets and preserve associations belonging to other keys.","evaluation_group":"xc-tag-index-replacement","failed_approach":"Rebuilding only from the changed key discards unrelated reverse-index memberships.","family":"xc-tag-index-replacement","id":"FA-10461","implementations":{"attempt":{"sha256":"f39c6bc3a84b56cb94bedbc2b896f9dbedd34acd7f71420c65931074ddaec379","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(index, key, new_tags):\n    return {tag:[key] for tag in sorted(set(new_tags))}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'old': ['a'], 'shared': ['a', 'b']}, 'a', ['new'])), {'shared': ['b'], 'new': ['a']})\ncheck('fixture 2', solve(*({'x': ['a', 'b']}, 'a', ['x'])), {'x': ['a', 'b']})\ncheck('fixture 3', solve(*({}, 'a', [])), {})\ncheck('fixture 4', solve(*({'x': ['a'], 'y': ['b']}, 'a', [])), {'y': ['b']})\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":"e8d9fdf8e305bbfc3f06c7078a5ee1a96ebb5eca195ff9fa271d114ded7b218e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(index, key, new_tags):\n    out={tag:list(keys) for tag,keys in index.items()}\n    for tag in new_tags: out.setdefault(tag,[]).append(key)\n    return {tag:sorted(set(keys)) for tag,keys in out.items() if keys}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'old': ['a'], 'shared': ['a', 'b']}, 'a', ['new'])), {'shared': ['b'], 'new': ['a']})\ncheck('fixture 2', solve(*({'x': ['a', 'b']}, 'a', ['x'])), {'x': ['a', 'b']})\ncheck('fixture 3', solve(*({}, 'a', [])), {})\ncheck('fixture 4', solve(*({'x': ['a'], 'y': ['b']}, 'a', [])), {'y': ['b']})\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":"5df1df6a3c1479c081d9ebb059ea9b342b4be6a5370eae514f0a88646452fbb9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(index, key, new_tags):\n    out={tag:set(keys)-{key} for tag,keys in index.items()}\n    for tag in new_tags: out.setdefault(tag,set()).add(key)\n    return {tag:sorted(keys) for tag,keys in out.items() if keys}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'old': ['a'], 'shared': ['a', 'b']}, 'a', ['new'])), {'shared': ['b'], 'new': ['a']})\ncheck('fixture 2', solve(*({'x': ['a', 'b']}, 'a', ['x'])), {'x': ['a', 'b']})\ncheck('fixture 3', solve(*({}, 'a', [])), {})\ncheck('fixture 4', solve(*({'x': ['a'], 'y': ['b']}, 'a', [])), {'y': ['b']})\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":"xc-tag-index-replacement","generated_at":"2026-09-29T14:38:39.267011+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic cache state transformation. Inputs are copied or treated as immutable; no remote storage, real clock, or concurrent interleaving is simulated.","repair":"Preserve the cache-state invariant: Return tag-to-sorted-unique-keys index after replacing one key tags; drop empty buckets and preserve associations belonging to other keys.","root_cause":"Tag updates add new associations without removing previous associations for the key.","sha256":"e0f09743fbd7983e30985df9c9ea30521535f62f5799f1dc325ad048416e4d54","title":"Replacing entry tags leaves obsolete reverse-index membership · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.238,"exit_code":1,"observations":[{"actual":{"new":["a"]},"check":"fixture 1","expected":{"new":["a"],"shared":["b"]},"passed":false},{"actual":{"x":["a"]},"check":"fixture 2","expected":{"x":["a","b"]},"passed":false},{"actual":{},"check":"fixture 3","expected":{},"passed":true},{"actual":{},"check":"fixture 4","expected":{"y":["b"]},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"new\": [\"a\"]}, \"expected\": {\"shared\": [\"b\"], \"new\": [\"a\"]}, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": {\"x\": [\"a\"]}, \"expected\": {\"x\": [\"a\", \"b\"]}, \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": {}, \"expected\": {\"y\": [\"b\"]}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.17,"exit_code":1,"observations":[{"actual":{"new":["a"],"old":["a"],"shared":["a","b"]},"check":"fixture 1","expected":{"new":["a"],"shared":["b"]},"passed":false},{"actual":{"x":["a","b"]},"check":"fixture 2","expected":{"x":["a","b"]},"passed":true},{"actual":{},"check":"fixture 3","expected":{},"passed":true},{"actual":{"x":["a"],"y":["b"]},"check":"fixture 4","expected":{"y":["b"]},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"old\": [\"a\"], \"shared\": [\"a\", \"b\"], \"new\": [\"a\"]}, \"expected\": {\"shared\": [\"b\"], \"new\": [\"a\"]}, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": {\"x\": [\"a\", \"b\"]}, \"expected\": {\"x\": [\"a\", \"b\"]}, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": {\"x\": [\"a\"], \"y\": [\"b\"]}, \"expected\": {\"y\": [\"b\"]}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.119,"exit_code":0,"observations":[{"actual":{"new":["a"],"shared":["b"]},"check":"fixture 1","expected":{"new":["a"],"shared":["b"]},"passed":true},{"actual":{"x":["a","b"]},"check":"fixture 2","expected":{"x":["a","b"]},"passed":true},{"actual":{},"check":"fixture 3","expected":{},"passed":true},{"actual":{"y":["b"]},"check":"fixture 4","expected":{"y":["b"]},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"shared\": [\"b\"], \"new\": [\"a\"]}, \"expected\": {\"shared\": [\"b\"], \"new\": [\"a\"]}, \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": {\"x\": [\"a\", \"b\"]}, \"expected\": {\"x\": [\"a\", \"b\"]}, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": {\"y\": [\"b\"]}, \"expected\": {\"y\": [\"b\"]}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}