Skip to content

v1.1.0 — Battery Budget, Carbon Estimator, Delta Encoding, R-Tree, Compliance Reports

Choose a tag to compare

@GalacticTitan GalacticTitan released this 13 Mar 22:24
· 3269 commits to main since this release

Highlights

This release introduces 5 new algorithms, a GDPR/CCPA compliance report API, 12 new configuration fields, and critical infrastructure upgrades (melos 7.x + Dart pub workspaces).


New Algorithms

BatteryBudgetEngine

A pure-Dart feedback control loop that automatically adjusts distanceFilter, desiredAccuracy, and periodic interval to maintain a configurable battery budget (batteryBudgetPerHour, typical 1.0–5.0 %/hr). Measures actual battery drain every ~5 minutes and compares against target — tightening or relaxing tracking parameters to meet the budget. Accuracy levels cycle through: high → medium → low → veryLow → passive.

CarbonEstimator

Per-trip and cumulative CO₂ emission calculator using EU EEA 2024 mode-specific emission factors (gCO₂/km): car = 192, bus = 89, train = 41, walking/cycling = 0. Integrates with activity recognition to track distance per transport mode via Haversine. Returns TripCarbonSummary with total emissions, distance, breakdown by mode, and dominant transport mode.

DeltaEncoder

Batch location compression codec achieving 60–80% payload reduction. First location transmitted in full; subsequent positions encoded as deltas with shortened field names (la, lo, t, s, h, a, al, b). Coordinate precision configurable (5 ≈ 1.1m, 6 ≈ 0.11m). Triple implementation: Dart, Kotlin (Android), and Swift (iOS) for native encoding during HTTP sync.

RTree<T>

Generic R-tree spatial index enabling O(log n) geofence proximity queries (vs O(n) linear search). Supports queryCircle() and queryBBox() with Haversine-verified results. Handles 10,000+ geofences with sub-millisecond lookup times.

ComplianceReport

GDPR Article 30 / CCPA data processing inventory. Tracelet.generateComplianceReport() auto-generates a structured snapshot covering: data inventory (stored/synced counts, retention policy, timestamp bounds), privacy measures (zones, encryption, permissions), data destinations (sync URL, auto-sync state), audit trail status, and tracking configuration. Exports to JSON and Markdown.


New Configuration Fields

Field Type Default Description
batteryBudgetPerHour double 0.0 Target max battery drain (%/hr). Enables BatteryBudgetEngine when > 0.
enableSparseUpdates bool false App-level location deduplication at persistence layer.
sparseDistanceThreshold double 50.0 Min distance (m) before persisting new location.
sparseMaxIdleSeconds int 300 Max seconds between forced "still here" updates.
enableDeadReckoning bool false Inertial navigation when GPS lost.
deadReckoningActivationDelay int 10 Seconds of GPS absence before activating.
deadReckoningMaxDuration int 120 Max IMU duration before stopping.
enableAdaptiveMode bool false Dynamic sampling by activity + battery + charging state.
enableDeltaCompression bool false Delta encoding for HTTP batch syncs.
deltaCoordinatePrecision int 6 Coordinate precision for delta encoding.
disableAutoSyncOnCellular bool false WiFi-only auto-sync.
Periodic mode fields various — periodicLocationInterval, periodicDesiredAccuracy, periodicUseForegroundService, periodicUseExactAlarms

Bug Fixes

  • FIX: generateComplianceReport() and getHealthCheck() no longer crash with type 'Map<Object?, Object?>' is not a subtype of type 'Map<String, Object?>' errors from platform channels.

Infrastructure

  • Melos 7.x migration: All configuration moved from melos.yaml to pubspec.yaml under melos: key. 13 scripts available via melos run <name>.
  • Dart pub workspaces: Root pubspec.yaml declares workspace: with 6 packages. Removed pubspec_overrides.yaml files.
  • Melos dependency: Upgraded from ^6.0.0 to ^7.0.0.

Packages Published

Package Version
tracelet_platform_interface 1.1.0
tracelet_android 1.1.0
tracelet_ios 1.1.0
tracelet_web 1.1.0
tracelet 1.1.0