FA-12271 / Power metering accounting / Open access
Partial demand blocks compete with complete tariff blocks · case 01
Partial demand blocks compete with complete tariff blocks.
ROOT CAUSE
A trailing partial block is treated as a complete demand observation.
VERIFIED REPAIR
Evaluate only complete blocks anchored at sample index zero.
Unsuccessful approach: A rolling-window maximum restores width but violates the tariff block anchors.
Case contract
Integer samples are equal-duration energy slots grouped into anchored blocks of width k. Return largest complete block energy sum. Ignore trailing partial block; return None if none complete. This models fixed blocks, not rolling windows.
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(samples, k):
return max((sum(samples[i:i+k]) for i in range(0,len(samples),k)),default=None)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('trailing spike excluded', solve([N,N,10*N],2),2*N)
check('rolling peak is not block peak', solve([0,5*N,5*N,0],2),5*N)
check('exact block', solve([N,2*N],2),3*N)
check('no complete block', solve([N],2),None)
check('empty', solve([],2),None)
check('unit blocks', solve([N,3*N,2*N],1),3*N)
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 |
|---|---|---|---|
| trailing spike excluded | 10 | 2 | Failed |
| rolling peak is not block peak | 5 | 5 | Passed |
| exact block | 3 | 3 | Passed |
| no complete block | 1 | None | Failed |
| empty | None | None | Passed |
| unit blocks | 3 | 3 | Passed |
SHA-256 / abf91d72570d927683664b6ac8c8e69aabe499dc72f2bdb0b59246a89d25512f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, k):
return max((sum(samples[i:i+k]) for i in range(len(samples)-k+1)),default=None)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('trailing spike excluded', solve([N,N,10*N],2),2*N)
check('rolling peak is not block peak', solve([0,5*N,5*N,0],2),5*N)
check('exact block', solve([N,2*N],2),3*N)
check('no complete block', solve([N],2),None)
check('empty', solve([],2),None)
check('unit blocks', solve([N,3*N,2*N],1),3*N)
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 |
|---|---|---|---|
| trailing spike excluded | 11 | 2 | Failed |
| rolling peak is not block peak | 10 | 5 | Failed |
| exact block | 3 | 3 | Passed |
| no complete block | None | None | Passed |
| empty | None | None | Passed |
| unit blocks | 3 | 3 | Passed |
SHA-256 / 679221cbe278351630cf2be1793dfb67666d44c1aaa08e02dc0062c63393e190
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, k):
return max((sum(samples[i:i+k]) for i in range(0,len(samples)-k+1,k)),default=None)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('trailing spike excluded', solve([N,N,10*N],2),2*N)
check('rolling peak is not block peak', solve([0,5*N,5*N,0],2),5*N)
check('exact block', solve([N,2*N],2),3*N)
check('no complete block', solve([N],2),None)
check('empty', solve([],2),None)
check('unit blocks', solve([N,3*N,2*N],1),3*N)
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 |
|---|---|---|---|
| trailing spike excluded | 2 | 2 | Passed |
| rolling peak is not block peak | 5 | 5 | Passed |
| exact block | 3 | 3 | Passed |
| no complete block | None | None | Passed |
| empty | None | None | Passed |
| unit blocks | 3 | 3 | Passed |
SHA-256 / 7733379ab7496ed37b18d6abb6fb1164e5255f07278f3649d032a133fe872f9f
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.425275+00:00.
Case digest / e5b89ad6c663abf7ca8422d114d2afffee036c072e7aa41ca0502ec2f836fafb