fix: don't end a steady-current run on a ramp-up overshoot - #32
Merged
Merged
Conversation
The first live calibration probe held 32.5 A for forty minutes and its window was never fitted. The car's ramp read 6, 15, 24, 31, 32.6, 32.7, 32.9, then 37.6 and 43.3 - two samples overshooting toward the 48 A it was headed for, in the seconds before the probe cap took effect - and then 32.5 A for the rest of the hold. The steady-prefix finder treats the first out-of-band sample after a run has started as that run ending, so it kept a four-sample, six-second window and lost the real one at the very next gate. Every probe lands mid-ramp, so every probe would have been lost the same way. A run that leaves the band within its first minute is now discarded and restarted rather than ended; a current change after that still ends it. On the production database the probe now fits (32.5 A, 18.7 C of rise, free-running, RMSE 0.26) and joins the current-exponent fit as its first 32 A point: n moves from 1.20 to 1.56 +/- 0.09. The drift verdict is unchanged. One earlier session whose ramp wobbled the same way (s41, a regulated window) is admitted too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The first live calibration probe (session 80, 2026-09-14) held 32.5 A for forty minutes and its window was never fitted — even after a forced refit. The car's ramp-up read 6 → 15 → 24 → 31 → 32.6, 32.7, 32.9, then 37.6, 43.3 (two samples overshooting toward the 48 A it was headed for, in the seconds before the probe cap took effect at +37 s), then 32.5 A for the rest of the hold.
_steady_current_prefixtreats the first out-of-band sample after a run has started as "the steady run ended", so it kept a 4-sample, 6-second window that failed the very next gate (span >= 1.8 τ).Every probe lands mid-ramp (the controller caps a few seconds after charging starts), so every probe would have been lost the same way — which defeats both the degradation watch's fixed-condition comparison and the current-exponent fit that #31 added.
Code touched
wallmonitor/thermal.py:PREFIX_SETTLE_S = 60. In_steady_current_prefix, an out-of-band sample within the first minute of a run discards the run and restarts it instead of ending it. A current change after that still ends it. Docstring + constant comment explain the incident.tests/test_wallmonitor.py: direct test on the prefix finder with the exact ramp from session 80 (600-sample window recovered, starting at 32.5 A), and a settled run that a later current change still ends.Left alone:
i_ref(median of the first 10 min), the band, the span cap, sag / free-plateau detection.Risk
free_plateau, admitted to the τ/rise medians, where it movesrise_ref_c36.3 → 36.1).compromised_byempty.Verification
uv run pytest: 152 passed (one new).span >= 1.8 τFalse. Raw vitals dump confirmed the overshoot pattern above.Deploy: pull +
sudo systemctl restart wallmonitor.service. The probe's fit appears retroactively — no new charging session needed.🤖 Generated with Claude Code