Index
battery-health.habitats.ai / Battery Health

Battery Health

@Source Code
PR #284 · merged · 12m ago · 3 members · 18 runs
⊕ Invite
Friday · 5/2
Ben P. created this Habitat and connected github.com/gigalytics-org/battery-health
SC
Source Code Agent 2:14 PM

PR #281 · "Add SoC delta logging to telemetry stream" just merged to main. 4 files (+82 / −12). Adds a per-second SoC delta channel for downstream regression — teed up the cold-soak instrumentation we'll need for the next wave of fixes.

tool github.pulls.get(repo='battery-health', pr=281) ✓ 4 files · merged
WS
Will S. Battery Health 5:48 PM

Good — that's the channel we need. FYI I caught a cold-soak edge case last weekend on the test fleet: SoC reads negative for ~3s after a sub-zero boot, then snaps back. Opening #312 with the trace.

Tuesday · 5/5
SC
Source Code Agent 3:42 PM

On it — Milos just pushed to main. Pulling the diff, reading the commit messages, and cross-referencing the linked issues so the summary lands with everything you need to discuss inline.

tool github.pulls.get(repo='battery-health', pr=284) ✓ 7 files
tool github.commits.list(pr=284) ✓ 6 commits
tool github.issues.linked(pr=284) ✓ #312, #318 closed
Source Code finished PR #284 summary · 7 files · 4m 48s
SC
Source Code Agent 3:47 PM

PR #284 · "Fix charge curve on cold-soak start" just merged to main. 7 files (+312 / −98), most of it in charging/curve.ts and tests/coldSoak.test.ts. Closes #312 (negative SoC reading after <−10°C boot — Will's catch) and #318 (charge-rate clamp ignored on first cycle). One follow-up: rate-limit logic still hard-codes 250kW — flagged as a TODO in the diff.

DIFF
battery-health · PR #284.diff
7 files · +312 / −98 · 6 commits · 2 issues closed
Open ›
Changed files · 7
Mcharging/curve.ts  +128 / −42
Mcharging/clamp.ts  +64 / −18
+tests/coldSoak.test.ts  +86 / −0
Mtelemetry/socReader.ts  +18 / −24
+ 3 more · CHANGELOG, types, tests/setup · open the diff to view all hunks

// TODO(milos): rate clamp still hard-coded to 250kW — promote to config

WS
Will S. Battery Health 3:51 PM

Cold-soak path is the right call — that matches the trace I posted in #312. Did the new clamp actually fire on the test fixture, or is the test only asserting on the SoC snap-back?

BP
Ben P. Owner · Battery Health 3:54 PM

Good question. @Source Code show me the test fixture from PR #284 plus the assertion that catches the clamp.

SC
Source Code Agent 3:54 PM

Pulling tests/coldSoak.test.ts from PR #284 — the new file, 86 added lines. Two test cases: boots clean from −15°C with no negative SoC and clamps charge rate to 80kW until pack ≥ 0°C. The second one is the clamp assertion Will's asking about.

tool github.contents.get('tests/coldSoak.test.ts', pr=284) ✓ 86 lines
test('clamps charge rate to 80kW until pack ≥ 0°C', async () => {
  const pack = await coldSoakPack({ tempC: -15 });
  const session = chargeUntil(pack, { targetSoc: 0.5 });

  expect(session.peakKw).toBeLessThanOrEqual(80);
  expect(session.warmupCurve).toMatchSnapshot();
  expect(pack.tempC).toBeGreaterThanOrEqual(0);  // pack warmed before unclamping
});

Yes — assertion is on session.peakKw. The clamp fires; without it the snapshot test catches the SoC snap-back too.

MR
Milos R. Battery Health 3:58 PM

Re: the rate-limit TODO — let's open #285 for that, not bury it in this PR. The 250kW number is going to bite us when the V4 supercharger lands.

BP
Ben P. Owner · Battery Health 4:01 PM

+1 on opening #285. Also want a dashboard regression test for cold-soak — Will, can you scope that? We should be alerting before a customer files a ticket.

WS
Will S. Battery Health 4:04 PM

On it — I'll spec out the dashboard regression test today. Spinning the metrics off the new SoC delta channel from PR #281 so we don't double-instrument.

Posting to Battery Health ⌘ ↵