{"abstract":"The prepared recovery operation is admitted even though prepared data becomes visible after losing its write locks.","category":"Concurrency","checks":9,"contract":"Return a Boolean admission decision for resolve a prepared participant after recovery. The record r must satisfy all of: r['decision_known'] in ['commit','abort']; r['transaction_identity'][0] == r['transaction_identity'][1]; r['prepare_record'] is True; r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]; set(r['locks_retained'][0]) <= set(r['locks_retained'][1]). Extra tracing fields are ignored; validation does not mutate the record.","evaluation_group":"xd-prepared-recovery","failed_approach":"Adding the locks retained check repairs the reported defect, but replacing the adjacent decision known check loses that independent invariant.","family":"xd-prepared-recovery-locks_retained","id":"FA-1496","implementations":{"attempt":{"sha256":"67520ce943cd50c6ca66130d7e489d7f48b79714fec4ab46562738e376c1dde2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['prepare_record'] is True) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}\ncheck('valid operation', solve(r), True)\ncheck('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)\ncheck('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)\ncheck('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)\ncheck('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)\ncheck('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\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":"ba468643603fecf0db0e6473449485f99ad0ff6b485df9531f5cdc0164d4a84c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['decision_known'] in ['commit','abort']) and (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['prepare_record'] is True) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}\ncheck('valid operation', solve(r), True)\ncheck('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)\ncheck('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)\ncheck('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)\ncheck('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)\ncheck('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\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":"1bd48187b34651f0009e09de89e21e7f581688e1ac9f289c816366708eeb4900","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['decision_known'] in ['commit','abort']) and (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['prepare_record'] is True) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}\ncheck('valid operation', solve(r), True)\ncheck('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)\ncheck('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)\ncheck('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)\ncheck('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)\ncheck('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\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":"xd-prepared-recovery-locks_retained","generated_at":"2026-09-29T14:37:02.962759+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic local contract for concurrency. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.","repair":"Require set(r['locks_retained'][0]) <= set(r['locks_retained'][1]) together with every other stated precondition before accepting the operation.","root_cause":"The admission path omits the locks retained invariant while validating the other operation preconditions.","sha256":"9113ed0d6b8ff076bcd657a2e8dc25abfa2f32146309e0e2edf7519f21ac3b8a","title":"Resolve a prepared participant after recovery: Prepared data becomes visible after losing its write locks · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":33.858,"exit_code":1,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":true,"check":"An uncertain participant guesses commit without evidence","expected":false,"passed":false},{"actual":false,"check":"Recovery applies another transaction decision","expected":false,"passed":true},{"actual":false,"check":"Recovery commits a transaction with no durable prepare record","expected":false,"passed":true},{"actual":false,"check":"Recovery reverses a previously recorded final decision","expected":false,"passed":true},{"actual":false,"check":"Prepared data becomes visible after losing its write locks","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"An uncertain participant guesses commit without evidence\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"Recovery applies another transaction decision\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery commits a transaction with no durable prepare record\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery reverses a previously recorded final decision\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Prepared data becomes visible after losing its write locks\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":35.314,"exit_code":1,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"An uncertain participant guesses commit without evidence","expected":false,"passed":true},{"actual":false,"check":"Recovery applies another transaction decision","expected":false,"passed":true},{"actual":false,"check":"Recovery commits a transaction with no durable prepare record","expected":false,"passed":true},{"actual":false,"check":"Recovery reverses a previously recorded final decision","expected":false,"passed":true},{"actual":true,"check":"Prepared data becomes visible after losing its write locks","expected":false,"passed":false},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"An uncertain participant guesses commit without evidence\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery applies another transaction decision\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery commits a transaction with no durable prepare record\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery reverses a previously recorded final decision\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Prepared data becomes visible after losing its write locks\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":32.808,"exit_code":0,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"An uncertain participant guesses commit without evidence","expected":false,"passed":true},{"actual":false,"check":"Recovery applies another transaction decision","expected":false,"passed":true},{"actual":false,"check":"Recovery commits a transaction with no durable prepare record","expected":false,"passed":true},{"actual":false,"check":"Recovery reverses a previously recorded final decision","expected":false,"passed":true},{"actual":false,"check":"Prepared data becomes visible after losing its write locks","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"An uncertain participant guesses commit without evidence\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery applies another transaction decision\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery commits a transaction with no durable prepare record\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Recovery reverses a previously recorded final decision\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Prepared data becomes visible after losing its write locks\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}