Skip to content

feat(steps): hybrid step counting + serial/device fixes + ASK product icon - #27

Merged
abdulsaheel merged 4 commits into
mainfrom
feat/steps-hybrid-device-fixes
Jun 28, 2026
Merged

feat(steps): hybrid step counting + serial/device fixes + ASK product icon#27
abdulsaheel merged 4 commits into
mainfrom
feat/steps-hybrid-device-fixes

Conversation

@abdulsaheel

Copy link
Copy Markdown
Collaborator

Bundles several local-first edge improvements. Also carries the unmerged local-notifications work (that branch had no PR) so it lands on main too.

⚠️ Cross-repo dependency (merge order)

pubspec.yaml pins the local packages to their feature branches:

Before merging this PR: merge #3 and #9, then flip both refs back to main.

Steps — hybrid (real 100 Hz + bounded 1 Hz estimate, no double-count)

  • Real counts win. The live AN-2554 pedometer records the device-time windows it covered in a new live_coverage table (db v13). The derivation excludes those minutes from the 1 Hz estimate and sums real + estimate per day — a minute is counted by 100 Hz or estimated by 1 Hz, never both.
  • 1 Hz estimate = the bounded, calibration-aware model from analytics#9 (fixed gate + continuous cadence). 1 Hz can't peak-count steps (Nyquist); the off-workout part is honestly an estimate.
  • Guided calibration walk (StepCalibrationScreen): a short open-road walk teaches the personal cadence/refEnmo via the live pedometer, anchoring the estimate to the user. Entry from the Steps detail ("Calibrate steps", ~250-step target).
  • Active-minutes removed (replaced by the steps hybrid); active_min / bogus steps series purged in the v12/v13 migrations.
  • Today tile + Steps screen show the hybrid number (est. tag) plus the in-flight live session; kAlgoVersion bumped.

Device identity

  • Serial now read from the HELLO body at its fixed offset (via protocol#3) and overwrites the pairing-time label. A cleanDeviceLabel guard keeps any ?* junk out of the persisted/displayed label. (+ device_label_test.dart)

iOS

  • AccessorySetupKit pairing sheet shows the real strap render (compressed StrapProduct.imageset, 2 MB → 140 KB) instead of the generic Apple Watch SF Symbol.

Notifications (from the folded-in branch)

  • Local OS alerts unified through one center (health/recovery/reminders channels), quiet hours with critical override, scheduled wind-down/recap, tap deep-links.

Tests

flutter analyze clean (2 pre-existing infos); 74 tests green (flutter test --concurrency=1).

🤖 Generated with Claude Code

Steps
- Compose REAL 100 Hz pedometer counts with the bounded 1 Hz estimate, never
  double-counting: live windows are recorded in a new live_coverage table
  (db v13, device-time), and the derivation excludes those minutes from the
  1 Hz estimate, summing real + estimate per day.
- Guided calibration walk (StepCalibrationScreen): a short open-road walk
  teaches the personal cadence/refEnmo via the live pedometer so the off-
  workout estimate anchors to the user. Entry from the Steps detail.
- Drop the active-minutes metric (replaced by the steps hybrid); purge stale
  active_min / bogus steps series in the v12/v13 migrations.
- Today tile + Steps screen show the hybrid number (est. tag) + live in-flight
  session; bump kAlgoVersion.

Device identity
- Serial now comes from the HELLO body (fixed offset, via protocol fix) and a
  cleanDeviceLabel guard keeps any '?*' junk out of the persisted/displayed
  label. (+ device_label_test.dart)

iOS
- AccessorySetupKit pairing sheet shows the real strap render (compressed
  StrapProduct.imageset) instead of the Apple Watch SF Symbol.

pubspec: protocol/analytics pinned to their feature branches (see PR note).
flutter analyze clean; 74 tests green.
The serial-offset (protocol) and step-hybrid (analytics) PRs are merging to
main; pin edge to main rather than the feature branches.
@abdulsaheel
abdulsaheel merged commit 015d00b into main Jun 28, 2026
@abdulsaheel
abdulsaheel deleted the feat/steps-hybrid-device-fixes branch July 12, 2026 05:54
abdulsaheel added a commit that referenced this pull request Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant