fix(train): no row's ID tells the instance a date: the days' IDs are keyed by the account (ADR 0030, D57)

A day's, night's and heart chunk's ID was a UUID of version 5 of the
person and the date, which the instance can hash for every date itself:
each ID told it which days the band was worn. halkyon_keys' keyedRowId
hashes the name under the account's X25519 secret key (BLAKE2b, a UUID of
version 8), the same on every device of the account and unreadable
without its keys; ContentCipher.rowId and TrainKeys.rowId hand it on.

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-30 16:12:00 +01:00
commit 839d49c4cc
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -185,7 +185,6 @@ void main() {
FakeContentCipher(),
() async => null,
),
person: person.authUserId,
),
plans:
plans ??
@ -538,7 +537,7 @@ void main() {
keys,
person: 'alice',
);
days = DayRepository(MemoryDayGateway(), keys, person: 'alice');
days = DayRepository(MemoryDayGateway(), keys);
platform = FakeLoopPlatform()
..nearby.add(band)
..inReach.add('A1');
@ -1731,7 +1730,7 @@ void main() {
FakeLoopPlatform(),
LoopStore(File('${folder.path}/loop.json')),
ProfileRepository(MemoryProfileGateway(), keys, person: 'alice'),
days: DayRepository(MemoryDayGateway(), keys, person: 'alice'),
days: DayRepository(MemoryDayGateway(), keys),
workouts: workouts,
backgroundLines: File('${folder.path}/loop_days.txt'),
);
@ -1845,7 +1844,7 @@ void main() {
FakeContentCipher(),
() async => FakeAccountCrypto().keysNumbered(1),
);
days = DayRepository(MemoryDayGateway(), keys, person: 'alice');
days = DayRepository(MemoryDayGateway(), keys);
});
tearDown(() => keys.dispose());