FAILURE MAP
← Case archive

FA-12256 / Power metering accounting / Open access

An interval end label selects the next tariff period · case 01

An interval end label selects the next tariff period.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The interval end timestamp is used as the tariff effective timestamp.

VERIFIED REPAIR

Resolve the tariff using the interval start slot.

Unsuccessful approach: Treating only the boundary-ending interval as low assigns every earlier interval the high rate.

Case contract

Rows [end, energy] represent one-slot intervals (end-1,end]. A tariff changes at boundary b: intervals starting below b cost low, others high. Return integer charge; all labels and boundaries are integer slots.

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, boundary, low, high):
    return sum(e*(low if end < boundary else high) for end,e in rows)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ends at transition', solve([[10,N]],10,2,7),2*N)
check('starts at transition', solve([[11,N]],10,2,7),7*N)
check('strictly earlier', solve([[8,N]],10,2,7),2*N)
check('mixed intervals', solve([[9,N],[10,N],[11,N]],10,2,7),11*N)
check('empty', solve([],10,2,7),0)
check('zero priced period', solve([[10,N]],10,0,7),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 fixtureActualExpectedOutcome
ends at transition72Failed
starts at transition77Passed
strictly earlier22Passed
mixed intervals1611Failed
empty00Passed
zero priced period70Failed

SHA-256 / 89e4806ff9d1ba6eda3413c4cdab6ee3efa11b6de306a08ad2d3bedcb923ea6f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows, boundary, low, high):
    return sum(e*(low if end == boundary else high) for end,e in rows)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ends at transition', solve([[10,N]],10,2,7),2*N)
check('starts at transition', solve([[11,N]],10,2,7),7*N)
check('strictly earlier', solve([[8,N]],10,2,7),2*N)
check('mixed intervals', solve([[9,N],[10,N],[11,N]],10,2,7),11*N)
check('empty', solve([],10,2,7),0)
check('zero priced period', solve([[10,N]],10,0,7),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 fixtureActualExpectedOutcome
ends at transition22Passed
starts at transition77Passed
strictly earlier72Failed
mixed intervals1611Failed
empty00Passed
zero priced period00Passed

SHA-256 / d67220dc3895719aa4a7455cdf3ee39d143faab2e691ce0edfbcdf3015f019bf

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows, boundary, low, high):
    return sum(e*(low if end-1 < boundary else high) for end,e in rows)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ends at transition', solve([[10,N]],10,2,7),2*N)
check('starts at transition', solve([[11,N]],10,2,7),7*N)
check('strictly earlier', solve([[8,N]],10,2,7),2*N)
check('mixed intervals', solve([[9,N],[10,N],[11,N]],10,2,7),11*N)
check('empty', solve([],10,2,7),0)
check('zero priced period', solve([[10,N]],10,0,7),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 fixtureActualExpectedOutcome
ends at transition22Passed
starts at transition77Passed
strictly earlier22Passed
mixed intervals1111Passed
empty00Passed
zero priced period00Passed

SHA-256 / 567a82f0d131b5306782a0b65fd3f5f9b792baac05a000cf83ad90705ffe77f9

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.321996+00:00.

Case digest / 57cc3a7397e2d2639211dcc0efc6927525c9e6f2d6a72c448e685081823c775b