{"abstract":"Expired export-credit lots reduce current import charges.","category":"Power metering accounting","checks":6,"contract":"Lots [expiry_period, energy] are export credits. At billing period p, keep only expiry>=p, consume oldest-expiring lots first against nonnegative import need, and return [uncovered need, remaining energy by ascending expiry]. Expired lots vanish; zero remainders are omitted.","contract_signature":"lots, period, need","evaluation_group":"model-9ff8c73a25c71bc0","failed_approach":"Filtering expired lots but consuming newest first strands older credits that expire sooner.","family":"z-power_metering-export-credit-expiry","id":"FA-12281","implementations":{"attempt":{"sha256":"f91867feb9fdd52992e3541d5cdf38319256c54a1a26a3a35488cfa940a55af3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lots, period, need):\n    out=[]\n    for expiry,energy in sorted(lots,reverse=True):\n        if expiry<period: continue\n        used=min(need,energy); need-=used\n        if energy>used: out.append([expiry,energy-used])\n    return [need,sorted(out)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('expired credit', solve([[1,N]],2,N),[N,[]])\ncheck('oldest spent first', solve([[3,N],[2,N]],2,N),[0,[[3,N]]])\ncheck('inclusive expiry', solve([[2,N]],2,N),[0,[]])\ncheck('partial credit', solve([[2,3*N]],2,N),[0,[[2,2*N]]])\ncheck('uncovered import', solve([[2,N]],2,3*N),[2*N,[]])\ncheck('zero import still expires lots', solve([[1,N],[3,N]],2,0),[0,[[3,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":"5dab0d05c2f8ad86a16c1d37b144273cab1f4c7b98d3be5f13bd37b42fd326f5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lots, period, need):\n    out=[]\n    for expiry,energy in sorted(lots):\n        used=min(need,energy); need-=used\n        if energy>used: out.append([expiry,energy-used])\n    return [need,out]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('expired credit', solve([[1,N]],2,N),[N,[]])\ncheck('oldest spent first', solve([[3,N],[2,N]],2,N),[0,[[3,N]]])\ncheck('inclusive expiry', solve([[2,N]],2,N),[0,[]])\ncheck('partial credit', solve([[2,3*N]],2,N),[0,[[2,2*N]]])\ncheck('uncovered import', solve([[2,N]],2,3*N),[2*N,[]])\ncheck('zero import still expires lots', solve([[1,N],[3,N]],2,0),[0,[[3,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":"Simplified integer-energy accounting model; no hardware protocol, legal tariff, measurement uncertainty, or live grid behavior is represented. 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-power_metering-export-credit-expiry","generated_at":"2026-09-29T14:38:55.552157+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Meter settlement depends on explicit register and tariff policies; this controlled model makes that policy observable.","root_cause":"Expired lots remain spendable against the current bill.","sha256":"39a058a6b9121c6bd6d2d09ab1069d1ff16f51bf0da88669b3f71e18f85baef8","title":"Expired export-credit lots reduce current import charges · 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":41.062,"exit_code":1,"observations":[{"actual":[1,[]],"check":"expired credit","expected":[1,[]],"passed":true},{"actual":[0,[[2,1]]],"check":"oldest spent first","expected":[0,[[3,1]]],"passed":false},{"actual":[0,[]],"check":"inclusive expiry","expected":[0,[]],"passed":true},{"actual":[0,[[2,2]]],"check":"partial credit","expected":[0,[[2,2]]],"passed":true},{"actual":[2,[]],"check":"uncovered import","expected":[2,[]],"passed":true},{"actual":[0,[[3,1]]],"check":"zero import still expires lots","expected":[0,[[3,1]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"expired credit\", \"actual\": [1, []], \"expected\": [1, []], \"passed\": true}, {\"check\": \"oldest spent first\", \"actual\": [0, [[2, 1]]], \"expected\": [0, [[3, 1]]], \"passed\": false}, {\"check\": \"inclusive expiry\", \"actual\": [0, []], \"expected\": [0, []], \"passed\": true}, {\"check\": \"partial credit\", \"actual\": [0, [[2, 2]]], \"expected\": [0, [[2, 2]]], \"passed\": true}, {\"check\": \"uncovered import\", \"actual\": [2, []], \"expected\": [2, []], \"passed\": true}, {\"check\": \"zero import still expires lots\", \"actual\": [0, [[3, 1]]], \"expected\": [0, [[3, 1]]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.921,"exit_code":1,"observations":[{"actual":[0,[]],"check":"expired credit","expected":[1,[]],"passed":false},{"actual":[0,[[3,1]]],"check":"oldest spent first","expected":[0,[[3,1]]],"passed":true},{"actual":[0,[]],"check":"inclusive expiry","expected":[0,[]],"passed":true},{"actual":[0,[[2,2]]],"check":"partial credit","expected":[0,[[2,2]]],"passed":true},{"actual":[2,[]],"check":"uncovered import","expected":[2,[]],"passed":true},{"actual":[0,[[1,1],[3,1]]],"check":"zero import still expires lots","expected":[0,[[3,1]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"expired credit\", \"actual\": [0, []], \"expected\": [1, []], \"passed\": false}, {\"check\": \"oldest spent first\", \"actual\": [0, [[3, 1]]], \"expected\": [0, [[3, 1]]], \"passed\": true}, {\"check\": \"inclusive expiry\", \"actual\": [0, []], \"expected\": [0, []], \"passed\": true}, {\"check\": \"partial credit\", \"actual\": [0, [[2, 2]]], \"expected\": [0, [[2, 2]]], \"passed\": true}, {\"check\": \"uncovered import\", \"actual\": [2, []], \"expected\": [2, []], \"passed\": true}, {\"check\": \"zero import still expires lots\", \"actual\": [0, [[1, 1], [3, 1]]], \"expected\": [0, [[3, 1]]], \"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."}}