FA-12286 / Power metering accounting / Open access
A replacement meter opening register becomes billed energy · case 01
A replacement meter opening register becomes billed energy.
ROOT CAUSE
Subtracting endpoints joins unrelated register origins across a meter exchange.
VERIFIED REPAIR
Accumulate deltas only when adjacent readings belong to the same meter.
Unsuccessful approach: Clamping negative cross-meter deltas handles low replacement baselines but bills high replacement baselines.
Case contract
Rows [meter_id, cumulative] are chronological readings. Each meter identifier appears in one contiguous run. Return sum of within-meter consecutive increases; first reading of each meter is a baseline. Readings never decrease within a meter.
Why this case matters
Meter settlement depends on explicit register and tariff policies; this controlled model makes that policy observable.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows):
return rows[-1][1]-rows[0][1] if rows else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('high replacement baseline', solve([['a',N],['a',2*N],['b',100*N],['b',103*N]]),4*N)
check('low replacement baseline', solve([['a',100*N],['a',102*N],['b',0],['b',N]]),3*N)
check('one meter', solve([['a',N],['a',4*N]]),3*N)
check('baseline only', solve([['a',N]]),0)
check('exchange without deltas', solve([['a',N],['b',10*N]]),0)
check('empty', solve([]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| high replacement baseline | 102 | 4 | Failed |
| low replacement baseline | -99 | 3 | Failed |
| one meter | 3 | 3 | Passed |
| baseline only | 0 | 0 | Passed |
| exchange without deltas | 9 | 0 | Failed |
| empty | 0 | 0 | Passed |
SHA-256 / 9d9b3d0c90a25d01c4e55ce86000449475d89244470c87758ca1ab3ecbad148b
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows):
return sum(max(b[1]-a[1],0) for a,b in zip(rows,rows[1:]))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('high replacement baseline', solve([['a',N],['a',2*N],['b',100*N],['b',103*N]]),4*N)
check('low replacement baseline', solve([['a',100*N],['a',102*N],['b',0],['b',N]]),3*N)
check('one meter', solve([['a',N],['a',4*N]]),3*N)
check('baseline only', solve([['a',N]]),0)
check('exchange without deltas', solve([['a',N],['b',10*N]]),0)
check('empty', solve([]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| high replacement baseline | 102 | 4 | Failed |
| low replacement baseline | 3 | 3 | Passed |
| one meter | 3 | 3 | Passed |
| baseline only | 0 | 0 | Passed |
| exchange without deltas | 9 | 0 | Failed |
| empty | 0 | 0 | Passed |
SHA-256 / bd050c0c4ce03faeb90e70a5f8635106dd8788612072f59da3780cccdda210f6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows):
return sum(b[1]-a[1] for a,b in zip(rows,rows[1:]) if a[0]==b[0])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('high replacement baseline', solve([['a',N],['a',2*N],['b',100*N],['b',103*N]]),4*N)
check('low replacement baseline', solve([['a',100*N],['a',102*N],['b',0],['b',N]]),3*N)
check('one meter', solve([['a',N],['a',4*N]]),3*N)
check('baseline only', solve([['a',N]]),0)
check('exchange without deltas', solve([['a',N],['b',10*N]]),0)
check('empty', solve([]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| high replacement baseline | 4 | 4 | Passed |
| low replacement baseline | 3 | 3 | Passed |
| one meter | 3 | 3 | Passed |
| baseline only | 0 | 0 | Passed |
| exchange without deltas | 0 | 0 | Passed |
| empty | 0 | 0 | Passed |
SHA-256 / b70e710d7cdc1ada918dcb41cc402e88c50d572dbfb5da7cde9ed7fe31e7ac52
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:55.550156+00:00.
Case digest / cafd42f029ec1b2f551e08ddc1a964637eb60a3802643a30119fdd969b45beba