Skip to content

Accuracy check grades past days too - #92

Merged
gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd
Nov 18, 2026
Merged

gabrielbr merged 1 commit into
mainfrom
ccr-67ccb970-dqwwqd

Conversation

@gabrielbr

Copy link
Copy Markdown
Owner

The owner asked for historical data to count. Until now a check graded only from the moment it started.

What changes

  • Start dialog: a new "Include past days" chip row (None / 7 / 14 / 30, default 14).
  • Running check: a one-tap "Include past days" button on its card. Once used, the card says "Also grading the days since [date]".
  • Both rings and the reference: past days are graded from data already stored. That means the main ring's DB, comparison_readings for the second ring, and Health Connect for the watch.

How it works

  • New column: AccuracyCheckEntity.historyFrom (DB v39, MIGRATION_38_39). The scorer uses gradeFrom.
  • What stays put: startedAt, the day count and every pausedFrom stay at the real start, so the export pause doesn't change.
    • The reference reads filter on DataOrigin, so PulseLoop's own past exports can't come back as the reference.
  • Never before the ring was paired: grading can't start earlier than the ring's createdAt, because ring rows carry no device id.
  • Re-scoring: the report re-scores when gradeFrom changes.
  • Bigger reads: the Health Connect page cap rose from 40 to 150 pages, so 30 days of samples fit.
  • Backup: historyFrom rides in the archive.

Checks

  • New AccuracyHistoryStartTest. The accuracy, archive and comparison tests pass locally.
  • Audit: audits/2026-11-18-accuracy-past-days.md. It covers the four skills, with impeccable run on renders at 1.0× and 1.3×.
  • Docs: docs/ring-comparison.md, and an AGENTS.md rule.

Design canvas: the boards still need updating. That is owed, as on the earlier PRs.


Generated by Claude Code

A check can reach back 7, 14 or 30 days (14 by default) over what the app,
the second ring and Health Connect already hold, from the start dialog or
on a running check. Grading moves (historyFrom, DB v39); the check's start,
day count and export pause do not. Never before the ring was paired.

Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w
@gabrielbr
gabrielbr merged commit e2aada5 into main Nov 18, 2026
1 check passed
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.

2 participants