docs(train): the Loop's days and nights (ADR 0030, D37)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-28 19:13:22 +01:00
commit ab627efe2c
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -1,9 +1,9 @@
# ADR 0030: Halkyon Train, what it does and where its data comes from
- **Status:** decided 27–28 Oct 2026, by the developer (D1–D36 below). The shell (D12)
- **Status:** decided 27–28 Oct 2026, by the developer (D1–D37 below). The shell (D12)
is built; recording (D13–D28) is built on Android, iOS waiting for a Mac; Health
Connect (D29–D31) is built; the Loop's setup and keeping (7a, D34–D36) is built, its
daily data (7b) comes next.
daily data (7b, D37) is being built.
- **Numbering:** 0025 is held by the federation draft (stashed), 0026–0029 by the .NET
rewrite on the local branch `rewrite-dotnet`, abandoned on 27 Oct; Train takes the next
free number so that neither is ever read as this one.
@ -628,6 +628,28 @@ Strava. What was found, 27 Oct:
`verification-metadata.xml` as JitPack served them on 28 Oct, every other group
trusted as before. Not yet tried with a Loop.
- **D37 The Loop's days and nights** (recommended, the developer's; 28 Oct): what Polar's
SDK reads of each day (its summary: steps, distance, calories of activity, training
and rest, time in each activity class; its 24/7 heart rate; its sleep with phases,
cycles, rating and skin temperature; Nightly Recharge; skin temperature) kept as
Train's own models, as workouts are (over the band's raw files sealed as they come,
which other devices could read only with Polar's protobuf definitions, under Polar's
licence, and over summaries alone): one sealed, synced `day` per date (summary,
Nightly Recharge, skin temperature), one `night` per sleep (its phases), and the day's
heart rate in chunks (`day_series`, as a workout's series), each versioned JSON,
gzipped and sealed. The band is read while Train is open and also in the background
(over only while open): a WorkManager job every few hours connects and reads the days
since the last read into a plain file of the person's folder (app-private, as
`recording.txt`), which the app seals and syncs as it opens, since only the Dart side
holds the person's key. Train deletes nothing on the band (over deleting the days
kept), whose memory is taken to roll over by itself until a real band shows. Home
gains *Days*: each day's steps and active time with the night before's sleep and
Nightly Recharge, a day's page its heart rate as a chart, the night's phases and its
skin temperature. Steps, sleep and heart rate to Health Connect wait (D31 writes
workouts). D35 stays: the SDK's low-level `writeFile` could write the figures alone
(`PHYSDATA.BPB`) without a new user identifier, to be weighed once a real band shows
what a new identifier does.
## Consequences
- Train's sensors are one pattern: open profiles read by the app itself, on the phone;