fix: address PR #296 code review feedback

- Clamp ML predictions between physics floor (raw airtime) and ceiling
  (worst-case formula) so model can never produce unsafe timeouts
- Replace hourOfDay feature with secondsSinceLastRx for network activity
- Remove unused _ContactStats.stdDev and dead model persistence code
- Debounce observation writes (2s) instead of writing on every delivery
- Skip recording observations when pathLength is null to avoid corrupting
  training data
- Add comment explaining global (not per-contact) RX time tracking
- Remove notifyListeners from retrain to avoid unnecessary widget rebuilds
- Run dart format
This commit is contained in:
zjs81
2026-03-14 17:32:08 -07:00
parent 2ee2358ecc
commit b336aedbc5
6 changed files with 187 additions and 142 deletions
@@ -64,9 +64,9 @@ void main() {
expect(direct4!, greaterThan(direct2!));
expect(direct2, greaterThan(direct0!));
// All should be within the clamp range
expect(direct0, greaterThanOrEqualTo(2000));
expect(direct4, lessThanOrEqualTo(120000));
// All should be positive
expect(direct0, greaterThan(0));
expect(direct4, greaterThan(0));
// Print predictions for visibility
debugPrint('Predictions (with 1.5x safety margin):');