FA-12306 / Battery state accounting / Open access
Removing a module loses charge provenance · case 01
Pack removal subtracts module capacity instead of that module inventory.
ROOT CAUSE
Pack removal subtracts module capacity instead of that module inventory.
VERIFIED REPAIR
Remove the inventory belonging to the named module only.
Unsuccessful approach: Subtracting average inventory assumes equally charged modules.
Case contract
Modules map unique identifiers to [charge,capacity]. Return total remaining charge after removing an existing identifier.
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(modules, removed):
return sum(v[0] for v in modules.values()) - modules[removed][1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low module', solve({'a':[N,10*N],'b':[8*N,10*N]}, 'a'), 8*N)
check('high module', solve({'a':[N,10*N],'b':[8*N,10*N]}, 'b'), N)
check('only module', solve({'a':[N,10*N]}, 'a'), 0)
check('empty removed', solve({'a':[0,10*N],'b':[8*N,10*N]}, 'a'), 8*N)
check('equal', solve({'a':[N,10*N],'b':[N,10*N]}, 'a'), N)
check('three', solve({'a':[N,10*N],'b':[2*N,10*N],'c':[7*N,10*N]}, 'b'), 8*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 |
|---|---|---|---|
| low module | -1 | 8 | Failed |
| high module | -1 | 1 | Failed |
| only module | -9 | 0 | Failed |
| empty removed | -2 | 8 | Failed |
| equal | -8 | 1 | Failed |
| three | 0 | 8 | Failed |
SHA-256 / 05b4be2a5d61c0cb8d07c7c94c39fe0fe2940f0cbdddc8f26649686a2849205a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(modules, removed):
return sum(v[0] for v in modules.values()) * (len(modules)-1)//len(modules)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low module', solve({'a':[N,10*N],'b':[8*N,10*N]}, 'a'), 8*N)
check('high module', solve({'a':[N,10*N],'b':[8*N,10*N]}, 'b'), N)
check('only module', solve({'a':[N,10*N]}, 'a'), 0)
check('empty removed', solve({'a':[0,10*N],'b':[8*N,10*N]}, 'a'), 8*N)
check('equal', solve({'a':[N,10*N],'b':[N,10*N]}, 'a'), N)
check('three', solve({'a':[N,10*N],'b':[2*N,10*N],'c':[7*N,10*N]}, 'b'), 8*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 |
|---|---|---|---|
| low module | 4 | 8 | Failed |
| high module | 4 | 1 | Failed |
| only module | 0 | 0 | Passed |
| empty removed | 4 | 8 | Failed |
| equal | 1 | 1 | Passed |
| three | 6 | 8 | Failed |
SHA-256 / d324aaa5ab08183df454604d96145a8e5f29aeb1a17631749fdfb48ab6967961
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(modules, removed):
return sum(v[0] for k,v in modules.items() if k != removed)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('low module', solve({'a':[N,10*N],'b':[8*N,10*N]}, 'a'), 8*N)
check('high module', solve({'a':[N,10*N],'b':[8*N,10*N]}, 'b'), N)
check('only module', solve({'a':[N,10*N]}, 'a'), 0)
check('empty removed', solve({'a':[0,10*N],'b':[8*N,10*N]}, 'a'), 8*N)
check('equal', solve({'a':[N,10*N],'b':[N,10*N]}, 'a'), N)
check('three', solve({'a':[N,10*N],'b':[2*N,10*N],'c':[7*N,10*N]}, 'b'), 8*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 |
|---|---|---|---|
| low module | 8 | 8 | Passed |
| high module | 1 | 1 | Passed |
| only module | 0 | 0 | Passed |
| empty removed | 8 | 8 | Passed |
| equal | 1 | 1 | Passed |
| three | 8 | 8 | Passed |
SHA-256 / 1ddb4790c20cbce30bca6456f2b1fa75ec2ed86f84a21ba95ec2d05f44d8fc60
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.602870+00:00.
Case digest / 16b299f86f8f2f4f0edafb2081001619471e21827e237f9bf01c60dac659dab0