Skip to content

battery: define a source-grounded state-of-charge model before wiring status #877

Description

@forkwright

Finding

Phase-07 planning and the compiled-only BatteryMonitor use conflicting voltage-to-percentage curves: the plan states 3.7 V = 50% and 3.4 V = 10%, while source maps them to roughly 30% and 5%. Neither is tied to a qualified cell, load, temperature, PMIC ADC source, hysteresis, or uncertainty model.

Evidence

  • crates/thumos/src/battery.rs: the hard-coded piecewise curve maps 3700 mV and 3400 mV differently from Phase-07 REQ-13.
  • docs/capability-inventory.toml: BatteryMonitor is compiled-only and status-bar battery is still a placeholder.
  • Phase-07 decisions correctly say calibration belongs on the M7, contradicting its own fixed generic points.

Why this matters

A fabricated percentage can trigger premature shutdown, conceal low charge, mislead field use, and invalidate power profiling. Hardware measurement should calibrate a defined software model, not choose silently between contradictory constants.

Done when

  • Identify the stock/replacement cell and source-ground the MT6357 ADC/charger/fuel-gauge inputs, units, scaling, error/status bits, and read schedule.
  • Define a versioned SoC model with load/temperature/charge-state handling, smoothing/hysteresis, uncertainty, stale/unavailable behavior, and safe low-voltage policy.
  • Put all constants behind one configuration/model owner; UI reports unknown rather than a guessed 0% or stale value.
  • Host tests cover boundary/noise, charge/discharge, stale/error, calibration migration, and shutdown thresholds.
  • After software/source acceptance and kernel: tracking anchor for the compiled-but-unwired surface #753 integration, an operator-owned M7 session may calibrate/validate the curve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions