WHOOP HCI-capture extraction + CSV ground-truth correlation (#103)#133
Open
digitalerdude wants to merge 1 commit into
Open
WHOOP HCI-capture extraction + CSV ground-truth correlation (#103)#133digitalerdude wants to merge 1 commit into
digitalerdude wants to merge 1 commit into
Conversation
Two stdlib tools in Tools/linux-capture that turn a WHOOP data export into leverage for the un-decoded deep-record layouts tracked in ryanbr#103: - hci_extract.py: parse a phone Bluetooth HCI capture (iOS .pklg / Android btsnoop) of the official app, reassemble L2CAP/ATT, and emit the CRC-valid WHOOP frames as the project's capture.json. Only WHOOP streams reach the output. - correlate_ground_truth.py: known-plaintext field search. Cross-reference capture records against the official per-night values in a WHOOP CSV export (reusing the Swift importer's localized header aliases) to locate each biometric's byte offset + encoding. Distribution-overlap scoring (recall + precision) rejects constants and coincidences. Prints offsets only, so the output is safe to post on ryanbr#103 while health data stays local. Docs: new README sections + a ground-truth-correlation note in WHOOP5_DEEP_DATA.md. 25 new stdlib tests; full suite 129 green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was & warum
Zwei stdlib-Tools in
Tools/linux-capture/, die einen WHOOP-Datenexport nutzbar machen, um die un-dekodierten Deep-Record-Layouts aus #103 zu knacken (type-0x2F, 5/MG-History-Typen — siehedocs/WHOOP5_DEEP_DATA.md).Der Import dieses CSV-Formats ist bereits vollständig gelöst (inkl. lokalisierter DE/ES-Header, #3). Die offene Lücke laut #103 ist das Decoding — und genau dafür ist ein eigener Export das ideale Known-Plaintext-Material.
Tools
hci_extract.py— parst ein Phone-Bluetooth-HCI-Capture der offiziellen App (iOS.pklg/ Androidbtsnoop_hci.log), reassembliert L2CAP/ATT und gibt die CRC-validen WHOOP-Frames als das projekteigenecapture.json-Format aus. Nur WHOOP-Streams landen im Output (Frames anderer Geräte fallen weg). App-Writes werden alsdir:txmitgeschnitten (die Enable-Sequenz).correlate_ground_truth.py— Known-Plaintext-Feldsuche. Kreuzt Capture-Records gegen die offiziellen Nacht-Werte eines WHOOP-CSV-Exports (HRV, Ruhe-HF, Hauttemperatur, SpO₂, Atemfrequenz) und findet pro Biometrie das Byte-Offset + Encoding + Scale. Die lokalisierten Header-Aliase sind aus dem Swift-Importer (CSVParsing.swift) gespiegelt. Distribution-Overlap-Scoring (Recall + Precision) verwirft Konstanten und Zufallstreffer.Privacy
Beide Tools laufen lokal;
correlategibt nur Offsets/Encodings aus, nie Gesundheitswerte. So können 5/MG-Besitzer eine bestätigte Feld-Zuordnung auf #103 beitragen, ohne Capture oder Datenexport zu posten.Verifikation
hci_extract(331 type-47 Frames) →correlategewinnt Ruhe-HF (Offset 10, u8) und Hauttemperatur (Offset 14, float32) exakt zurück.Mapped Offsets folgen weiterhin der Projektregel real captures, never invented offsets, bevor sie in
parseFrameWhoop5/whoop_protocol.jsonlanden.🤖 Generated with Claude Code