feat: coded-word ultrasonic signaling and full-depression trigger - #26
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- SymbolSet: 4 linear chirps (2 bands x 2 directions), the single air-gap contract shared by Flasher and the decoder - SymbolDetector: heterodyne (exact 64-sample carriers) -> polyphase 64-tap FIR decimation 48k->3k -> sliding normalized complex correlation; symbol fires on dominant peak. Pilot lock, level calibration, plausibility floor, beaconSensed ported from v1. - Flasher writes symbol WAVs (config toneFrequencies legacy-ignored) - GoertzelDetector + its heuristic pile + v1 tone fixtures DELETED (hard cutover per Josh; the v1 waveform is now an adversary test) - Suite: all pair codes, acquisition lifecycle, deep SNR (trigger at -8dB broadband SNR — ~2x below v1's floor), legacy-tone/sibilance/ percussion/glide adversaries, 60s noise soak. 248 assertions. NOT yet live-tested on hardware — needs Flash EP + power cycle + the dev.sh loop with Josh before any merge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
joshuagruenstein
marked this pull request as draft
July 12, 2026 03:37
The white press was the protocol's only lone-symbol event, and it was never serialized: it came from STOCK sample playback (outside the chirp queue), so it could interleave with an in-flight beacon pair and misdecode as green/orange (~30% of presses near a beacon), or pay the full 350ms lone-resolution wait (~500ms perceived latency, reported intermittent by Josh). - Payload: white down is no longer chained to stock (its only stock action was the unserialized playback); it queues (sam, sam) like every other event. White up chains nothing (gate-off of a oneshot is a no-op). - Decoder: (N,N) pair -> whitePress; lone symbols are no longer events at all (a lone is a degraded pair or noise: logged, dropped). The beacon-cadence rescue for degraded beacons stays. - Latency: white fires at pair completion (~250ms total), beacon collisions structurally impossible (device queue serializes). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… law Every event is a four-symbol codeword: 25ms chirp symbols (two disjoint ultrasonic bands x two sweep directions) at ~29ms spacing, coded with a Reed-Solomon [4,2] code over GF(4) — minimum distance 3, so the decoder corrects any single corrupted symbol and rejects anything further. A word occupies ~110ms on the wire. Noise cannot turn one button into another by construction. The trigger fires on full depression via TE's processed handle signal, with a rate-based fast path for mashes (the processed signal is rate-limited ~0.35/s and lags a fast squeeze by ~300ms — measured): press at handle>=0.90 or switch+sustained-climb (~45ms after the physical click); release below 0.60 only while genuinely descending (a mash's mid-climb stall must not read as release) or fully returned. Docs (README, DESIGN.md, CLAUDE.md) rewritten to describe the current system; payload is pure ASCII (serial-write deploys drop non-ASCII). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
joshuagruenstein
marked this pull request as ready for review
July 12, 2026 04:57
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.
The system
SymbolSet.swiftis the air-gap contract shared by the flasher and the decoder.Verification
🤖 Generated with Claude Code