FA-12326 / Battery state accounting / Open access
Idle loss is charged once per observation · case 01
Repeated observations accumulate loss regardless of elapsed model time.
ROOT CAUSE
Repeated observations accumulate loss regardless of elapsed model time.
VERIFIED REPAIR
Settle loss from the last settlement time and advance that timestamp.
Unsuccessful approach: Charging from the original timestamp on every observation double bills elapsed intervals.
Case contract
Return final charge under a constant integer loss of one unit per tick and ordered observation timestamps at or after start; settle each elapsed interval once, floor at zero.
Why this case matters
An explicit synthetic battery bookkeeping model isolates this state-accounting error; it is not an engineering prediction or safety procedure.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(charge, start, times):
return max(0,charge-len(times))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeated timestamp', solve(20*N,0,[N,N,2*N]), 18*N)
check('one observation', solve(20*N,0,[3*N]), 17*N)
check('no observation', solve(20*N,0,[]), 20*N)
check('zero interval', solve(20*N,N,[N,N]), 20*N)
check('offset clock', solve(20*N,10*N,[11*N,13*N]), 17*N)
check('exhaustion', solve(N,0,[2*N,4*N]), 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 |
|---|---|---|---|
| repeated timestamp | 17 | 18 | Failed |
| one observation | 19 | 17 | Failed |
| no observation | 20 | 20 | Passed |
| zero interval | 18 | 20 | Failed |
| offset clock | 18 | 17 | Failed |
| exhaustion | 0 | 0 | Passed |
SHA-256 / d264454d53e7232378dbf7c3576c7734f25f726e2c777ef7a63fad5788bdd50f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(charge, start, times):
for t in times:
charge=max(0,charge-(t-start))
return charge
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeated timestamp', solve(20*N,0,[N,N,2*N]), 18*N)
check('one observation', solve(20*N,0,[3*N]), 17*N)
check('no observation', solve(20*N,0,[]), 20*N)
check('zero interval', solve(20*N,N,[N,N]), 20*N)
check('offset clock', solve(20*N,10*N,[11*N,13*N]), 17*N)
check('exhaustion', solve(N,0,[2*N,4*N]), 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 |
|---|---|---|---|
| repeated timestamp | 16 | 18 | Failed |
| one observation | 17 | 17 | Passed |
| no observation | 20 | 20 | Passed |
| zero interval | 20 | 20 | Passed |
| offset clock | 16 | 17 | Failed |
| exhaustion | 0 | 0 | Passed |
SHA-256 / e3c9242a8fa442006a513b87ce9c4058303d1bb37fbb81376da4a9f6cc0848ec
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(charge, start, times):
for t in times:
charge=max(0,charge-(t-start))
start=t
return charge
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeated timestamp', solve(20*N,0,[N,N,2*N]), 18*N)
check('one observation', solve(20*N,0,[3*N]), 17*N)
check('no observation', solve(20*N,0,[]), 20*N)
check('zero interval', solve(20*N,N,[N,N]), 20*N)
check('offset clock', solve(20*N,10*N,[11*N,13*N]), 17*N)
check('exhaustion', solve(N,0,[2*N,4*N]), 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 |
|---|---|---|---|
| repeated timestamp | 18 | 18 | Passed |
| one observation | 17 | 17 | Passed |
| no observation | 20 | 20 | Passed |
| zero interval | 20 | 20 | Passed |
| offset clock | 17 | 17 | Passed |
| exhaustion | 0 | 0 | Passed |
SHA-256 / 16c8c7804866db984608765814884d5863bc80b3675dc5a6934588bb7acac417
Verification & scope
Integer toy accounting with declared loss rules; no electrochemistry, hardware behavior, or safety claims. 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.933445+00:00.
Case digest / e836c3543b4ec84db29c21640ef8ef6c56de43d487b862fd3b0a68463c7ed2aa