docs: expand protocol coverage and clarify WHOOP 4/5 compatibility - #2183
Conversation
6c214f9 to
177a4aa
Compare
|
Sharing in case this helps with your ongoing work: @Zebsi235 — the expanded ECG documentation covers session control, output switches, and raw/filtered record layouts, which may be useful for #1969 and the planned ECG probes. @UtkuDenizAltiok — the haptics and history/recovery sections may help with the double-tap and buzz handling in #2099. Feel free to use whichever parts are useful. Remaining unknowns are marked in the docs. |
37e8faa to
8ffa4fc
Compare
8ffa4fc to
6eda97e
Compare
|
Reviewed at e30d4ea. Careful work, and the things I most expected to go wrong in a reorganisation this size did not. One thing to sort before it goes in. What I checked rather than took on trustProvenance survives, which mattered more here than anywhere else. This codebase is not clean-room and says so, so a 3,400-line protocol rewrite is exactly where attribution gets quietly lost. It did not: the per-fact credits table in It really is docs-only. Every path is under The split does not contradict the shipped decoders, which was my main worry with a WHOOP 5/MG catalog sitting beside WHOOP 4 code. I went at it from the direction most likely to break: command 7 is marked U, and NOOP reads WHOOP 4 firmware from The validator passes, run here rather than believed: PASS across the constructed bounds, signed values, contact boundaries, clipping, RR arithmetic and request cases, with its own coverage line stating it proves field arithmetic and not CRC, device or calibration. The one thing to sortNothing runs It needs a job that runs it, ideally path-filtered to Not blockingThe scope statements are the part I would keep hardest in any later edit. "Defined does not mean fully decoded, available on every variant, permitted in every state, or successfully exercised on a device" is the sentence that keeps this catalog honest, and it would be easy to erode in a future pass. Thanks @bhelm. Wire the validator up and this is good to go. |
…cy-cleanup Conflict in docs/WHOOP5_DEEP_DATA.md: keep main's new "Console record sequencing and text reassembly" section verbatim, placed ahead of this branch's "Existing public sources" heading. The old "The frame format" heading stays replaced by the branch's pointer section (its anchor is kept there).
docs/protocol-examples/validate_examples.py was referenced from the protocol docs but nothing executed it. Run it as one extra step in the existing Source Hygiene job, which already runs on every pull request and on push to main. Tradeoff: no docs/** path filter. A workflow-level filter on Source Hygiene would stop the doc-comment lint from running on non-docs changes, and GitHub has no native per-job path filter, so a filter would mean a new workflow or runner. The script is stdlib-only and finishes in well under a second, so the unfiltered step inside an already-running job adds no runner and effectively no time.
|
|
|
Reviewed again at 10b1f47. The one thing I asked for is done, and the three things I went looking for all hold. Taking it. The CI wiring
I also checked it can actually fail, since a validator that always passes is worse than none: injecting a single false assertion makes it exit non-zero with the message. It is a real gate, not a decorative one. Its own output is honest about what it is, which I want to quote because it is the right way to describe a partial check:
Anchors, all 79 of themThis is where a 3,400-line restructure usually bleeds, so I checked every intra-repo markdown link carrying an anchor across Worth saying how I got there, because I was twice wrong before I was right. My first pass reported 19 broken; that was my own slug rule collapsing runs of whitespace where GitHub does not, so So: no broken anchors, and the preservation mechanism is better than a link appendix would have been. The merge you didYou merged Provenance, againSame conclusion as last time and still the thing I care most about in a protocol rewrite of this size. The per-fact credits in One note, no actionYour comment pointing @Zebsi235 at the ECG sections for #1969 and @UtkuDenizAltiok at the haptics and history sections for #2099 is the sort of thing that makes a docs PR worth more than its diff. Worth knowing that #2099's double-tap work has since landed its own de-duplication, so that section may now be describing behaviour they have already had to reason about independently. |
…rce-reference check (#2310) From @bhelm. Follows #2183. Brings the WHOOP 4 side of the protocol reference to the depth WHOOP 5/MG already had, and turns the protocol pages into a wire reference: NOOP's own implementation now lives in PROTOCOL_IMPLEMENTATION.md and is linked by file and symbol, rather than being scattered across the profile and topic pages. Every topic chapter carries a WHOOP 4 and a WHOOP 5/MG section, renamed headings keep their old anchors, and 57 contracts are mapped to the Swift and Android symbol that implements each one, with a dash where a platform does not. Several corrections to the merged reference come with it. Spot-checked two against the source rather than taking them on trust: GET_DATA_RANGE at `cmdOff + 12/16/24` is stated verbatim at DataRange.swift:67, and command 97 (exitHighFreqSync) has exactly one sender, inside checkStrapLiveness() behind the stuck branch, so "watchdog, not every connect" is right. Adds docs/protocol-examples/check_source_references.py, stdlib-only, as a step in Source Hygiene on every PR. File-plus-symbol references rot silently when code moves, because nobody re-reads documentation during a Swift rename, so there is no docs/** filter: the trigger is a CODE change, which is exactly what a docs-path filter would miss. Under a second to run. Verified the gate is not decorative by breaking a reference two ways: [Reassembler](.../NoSuchFile.swift) FAIL file does not exist [TotallyBogusSymbolXYZ](.../Framing.swift) FAIL symbol not found and confirmed its clean run matches the claim, 163 references across 46 files with 0 failures, plus six unit tests. The core Tools floor moves 108 to 114, exactly the six tests added; the margin between the floor and the 130 now collected is pre-existing and unchanged by this.
What this PR does
Expands and consolidates the existing protocol reference so developers can construct more WHOOP 5/MG requests, decode sensor records, and implement session and recovery behavior with fewer assumptions.
Adds concrete WHOOP 5/MG request layouts for at least 30 additional command IDs, including nine image-transfer and certificate/authorization commands with documented request and response bodies. This counts distinct command IDs with newly explicit request layouts, rather than repeated mentions or relocated content; the nine paired request/response contracts are included in the 30. It measures documentation additions, not newly supported application commands or a percentage of the entire protocol.
This is a documentation-only contribution with executable documentation examples. Application behavior, the BLE command allowlist, and existing capture/analysis tools are unchanged. Legacy tool assumptions that differ from the reference are explicitly qualified.
Remaining limits are stated in the relevant chapters: absolute ECG sample-rate/voltage calibration, some format/quality semantics, and complete update acceptance still need additional validation. This does not claim complete protocol coverage or a tested update installation.
Type of change
How it was tested
python3 docs/protocol-examples/validate_examples.pypasses. These are constructed field-arithmetic examples covering ECG bounds, padding and signed values, contact boundaries, sensor clipping, RR arithmetic, and selected response/configuration rules; they do not validate CRC framing, device behavior, or calibration.Checklist
swift testinPackages/<name>) — N/A; no packages changed.android/(./gradlew testFullDebugUnitTest) — N/A; Android unchanged.StrandDesigntokens — no hardcoded colors, fonts, or spacing — N/A; no UI changes.docs/CONTRIBUTING.md.Strand.xcodeproj/) or any secrets/keystores.Related issues
No issue is closed by this PR.