{"abstract":"A shared efficiency transform shrinks both incoming and outgoing charge.","category":"Battery state accounting","checks":6,"contract":"Return initial plus half of incoming minus outgoing; incoming is even, all balances remain nonnegative.","evaluation_group":"model-fea1ed5a8dac37a5","failed_approach":"Applying loss to net flow cancels physically separate bookkeeping entries.","family":"z-battery_models-directional-loss","id":"FA-12291","implementations":{"attempt":{"sha256":"7eaa89ce18557f772d76f3e7b1036275a23dd16ed52ac01bd55c2ee18253b726","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, incoming, outgoing):\n    return initial + (incoming - outgoing) // 2\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('withdrawal', solve(20*N, 0, 4*N), 16*N)\ncheck('charge', solve(20*N, 8*N, 0), 24*N)\ncheck('both', solve(20*N, 8*N, 4*N), 20*N)\ncheck('empty', solve(0, 0, 0), 0)\ncheck('odd withdrawal', solve(20*N, 2, 3), 20*N-2)\ncheck('full withdrawal', solve(20*N, 0, 20*N), 0)\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":"c7eaa021aef95e0ba69492ff6d434c5840ea318fd280bd2ee099d1bca008cdf3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, incoming, outgoing):\n    return initial + incoming // 2 - outgoing // 2\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('withdrawal', solve(20*N, 0, 4*N), 16*N)\ncheck('charge', solve(20*N, 8*N, 0), 24*N)\ncheck('both', solve(20*N, 8*N, 4*N), 20*N)\ncheck('empty', solve(0, 0, 0), 0)\ncheck('odd withdrawal', solve(20*N, 2, 3), 20*N-2)\ncheck('full withdrawal', solve(20*N, 0, 20*N), 0)\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":"639483ae990bcf4c027f9cc6c97c11d8194790379d24ce712ec0f990e7b1af50","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, incoming, outgoing):\n    return initial + incoming // 2 - outgoing\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('withdrawal', solve(20*N, 0, 4*N), 16*N)\ncheck('charge', solve(20*N, 8*N, 0), 24*N)\ncheck('both', solve(20*N, 8*N, 4*N), 20*N)\ncheck('empty', solve(0, 0, 0), 0)\ncheck('odd withdrawal', solve(20*N, 2, 3), 20*N-2)\ncheck('full withdrawal', solve(20*N, 0, 20*N), 0)\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":"Integer toy accounting with declared loss rules; no electrochemistry, hardware behavior, or safety claims. 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":"z-battery_models-directional-loss","generated_at":"2026-09-29T14:38:55.592980+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An explicit synthetic battery bookkeeping model isolates this state-accounting error; it is not an engineering prediction or safety procedure.","repair":"Apply the declared half-efficiency only to incoming charge.","root_cause":"A shared efficiency transform shrinks both incoming and outgoing charge.","sha256":"fdb4d4c919517fc56f7732c712ff4ca38569bee0e1dce9c58823cd5845666fe5","title":"Charging loss is applied to withdrawals · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.915,"exit_code":1,"observations":[{"actual":18,"check":"withdrawal","expected":16,"passed":false},{"actual":24,"check":"charge","expected":24,"passed":true},{"actual":22,"check":"both","expected":20,"passed":false},{"actual":0,"check":"empty","expected":0,"passed":true},{"actual":19,"check":"odd withdrawal","expected":18,"passed":false},{"actual":10,"check":"full withdrawal","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"withdrawal\", \"actual\": 18, \"expected\": 16, \"passed\": false}, {\"check\": \"charge\", \"actual\": 24, \"expected\": 24, \"passed\": true}, {\"check\": \"both\", \"actual\": 22, \"expected\": 20, \"passed\": false}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"odd withdrawal\", \"actual\": 19, \"expected\": 18, \"passed\": false}, {\"check\": \"full withdrawal\", \"actual\": 10, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.241,"exit_code":1,"observations":[{"actual":18,"check":"withdrawal","expected":16,"passed":false},{"actual":24,"check":"charge","expected":24,"passed":true},{"actual":22,"check":"both","expected":20,"passed":false},{"actual":0,"check":"empty","expected":0,"passed":true},{"actual":20,"check":"odd withdrawal","expected":18,"passed":false},{"actual":10,"check":"full withdrawal","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"withdrawal\", \"actual\": 18, \"expected\": 16, \"passed\": false}, {\"check\": \"charge\", \"actual\": 24, \"expected\": 24, \"passed\": true}, {\"check\": \"both\", \"actual\": 22, \"expected\": 20, \"passed\": false}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"odd withdrawal\", \"actual\": 20, \"expected\": 18, \"passed\": false}, {\"check\": \"full withdrawal\", \"actual\": 10, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.395,"exit_code":0,"observations":[{"actual":16,"check":"withdrawal","expected":16,"passed":true},{"actual":24,"check":"charge","expected":24,"passed":true},{"actual":20,"check":"both","expected":20,"passed":true},{"actual":0,"check":"empty","expected":0,"passed":true},{"actual":18,"check":"odd withdrawal","expected":18,"passed":true},{"actual":0,"check":"full withdrawal","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"withdrawal\", \"actual\": 16, \"expected\": 16, \"passed\": true}, {\"check\": \"charge\", \"actual\": 24, \"expected\": 24, \"passed\": true}, {\"check\": \"both\", \"actual\": 20, \"expected\": 20, \"passed\": true}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"odd withdrawal\", \"actual\": 18, \"expected\": 18, \"passed\": true}, {\"check\": \"full withdrawal\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}