{"abstract":"A register delta loses complete counter revolutions.","category":"Power metering accounting","checks":7,"contract":"Given consecutive readings in [0, modulus) and a nonnegative wrap-count increment, return energy = end-start+wraps*modulus. Inconsistent negative energy returns None. Wrap count is authoritative, including multiple revolutions.","contract_signature":"start, end, wraps, modulus","evaluation_group":"model-2208dda601698f0f","failed_approach":"Adding one modulus whenever the reading decreases still drops multiple wraps and wraps ending above the initial reading.","family":"z-power_metering-wrap-counter","id":"FA-12241","implementations":{"attempt":{"sha256":"18d6f15707af715aff26ff5c31898c2e7bb12847208d8c48f0d684e820cda0e9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(start, end, wraps, modulus):\n    return end-start + (modulus if end < start else 0)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('multiple wraps', solve(8, 2, N+1, 10), 10*(N+1)-6)\ncheck('wrap ending above start', solve(2, 5, N, 10), 10*N+3)\ncheck('ordinary increment', solve(2, 5, 0, 10), 3)\ncheck('one wrap', solve(9, 1, 1, 10), 2)\ncheck('stationary counter', solve(5, 5, 0, 10), 0)\ncheck('full revolution', solve(5, 5, 1, 10), 10)\ncheck('contradiction', solve(9, 1, 0, 10), None)\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":"3b34ee81dc5dd422a6cb388385f182b4f8817fcbc436ebcad8739f874d2c80cf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(start, end, wraps, modulus):\n    return (end-start) % modulus\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('multiple wraps', solve(8, 2, N+1, 10), 10*(N+1)-6)\ncheck('wrap ending above start', solve(2, 5, N, 10), 10*N+3)\ncheck('ordinary increment', solve(2, 5, 0, 10), 3)\ncheck('one wrap', solve(9, 1, 1, 10), 2)\ncheck('stationary counter', solve(5, 5, 0, 10), 0)\ncheck('full revolution', solve(5, 5, 1, 10), 10)\ncheck('contradiction', solve(9, 1, 0, 10), None)\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-wrap-counter","generated_at":"2026-09-29T14:38:55.019176+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":"Modulo subtraction discards complete revolutions recorded by the hardware wrap counter.","sha256":"f3749bf48f2f1b25e83531f3158cc917d7b4122baa5467acf22d71f121a7d088","title":"A register delta loses complete counter revolutions · 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":37.639,"exit_code":1,"observations":[{"actual":4,"check":"multiple wraps","expected":14,"passed":false},{"actual":3,"check":"wrap ending above start","expected":13,"passed":false},{"actual":3,"check":"ordinary increment","expected":3,"passed":true},{"actual":2,"check":"one wrap","expected":2,"passed":true},{"actual":0,"check":"stationary counter","expected":0,"passed":true},{"actual":0,"check":"full revolution","expected":10,"passed":false},{"actual":2,"check":"contradiction","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"multiple wraps\", \"actual\": 4, \"expected\": 14, \"passed\": false}, {\"check\": \"wrap ending above start\", \"actual\": 3, \"expected\": 13, \"passed\": false}, {\"check\": \"ordinary increment\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"one wrap\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"stationary counter\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"full revolution\", \"actual\": 0, \"expected\": 10, \"passed\": false}, {\"check\": \"contradiction\", \"actual\": 2, \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.724,"exit_code":1,"observations":[{"actual":4,"check":"multiple wraps","expected":14,"passed":false},{"actual":3,"check":"wrap ending above start","expected":13,"passed":false},{"actual":3,"check":"ordinary increment","expected":3,"passed":true},{"actual":2,"check":"one wrap","expected":2,"passed":true},{"actual":0,"check":"stationary counter","expected":0,"passed":true},{"actual":0,"check":"full revolution","expected":10,"passed":false},{"actual":2,"check":"contradiction","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"multiple wraps\", \"actual\": 4, \"expected\": 14, \"passed\": false}, {\"check\": \"wrap ending above start\", \"actual\": 3, \"expected\": 13, \"passed\": false}, {\"check\": \"ordinary increment\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"one wrap\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"stationary counter\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"full revolution\", \"actual\": 0, \"expected\": 10, \"passed\": false}, {\"check\": \"contradiction\", \"actual\": 2, \"expected\": null, \"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."}}