From 1d733ef19231c4da3131cc33bdf43769f08d33b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 23 Aug 2026 19:42:45 +0200 Subject: [PATCH] Let a German verdict reach the classifier the merge gave it The two halves of the ECG fix were built apart. One taught the parser Apple's full English verdict set; the other taught it the metadata keys and verdict wording a German watch writes. Each was correct alone, and each left "Sinusrhythmus" unresolved for a different reason. Together they meet: the alias table translates the wording onto Apple's own English, and the classifier decides what it means. One place still owns the meaning, which is what stops a per-language verdict table from drifting the first time Apple adds a case. The test that expected null was pinning the gap between the branches rather than a decision about German. It now expects NOT_DETECTED, and a French verdict takes over the null case, because four of the six languages genuinely have no observed key map yet. --- .../__tests__/apple-health-ecg-import.test.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/measurements/__tests__/apple-health-ecg-import.test.ts b/src/lib/measurements/__tests__/apple-health-ecg-import.test.ts index f89025fc8..d3a34f38c 100644 --- a/src/lib/measurements/__tests__/apple-health-ecg-import.test.ts +++ b/src/lib/measurements/__tests__/apple-health-ecg-import.test.ts @@ -363,8 +363,15 @@ describe("Apple Health HKElectrocardiogram CSV parser", () => { // Apple's own "this device does not know this verdict". Deliberately NOT // INCONCLUSIVE — the device did not fail to classify the waveform. ["Unrecognized", null], - // A verdict from a German watch. Still null, and still the open half. - ["Sinusrhythmus", null], + // A verdict from a German watch. This asserted `null` while the two + // halves of the fix lived on separate branches: the classifier gained + // Apple's full English set without knowing any German, so a German + // verdict was still unreachable. Together they meet — the alias table + // translates the wording, the classifier decides the meaning — and the + // old expectation was pinning the gap rather than a decision. + ["Sinusrhythmus", "NOT_DETECTED"], + // Four of the six languages are still unmapped, so this stays true. + ["Fibrillation auriculaire", null], ["Some verdict this parser has never seen", null], ])("passes through device classification %s only", async (raw, expected) => { await expect(