[MERGED STACK] Single source-of-truth#167
Merged
sastraxi merged 33 commits intoJun 10, 2026
Merged
Conversation
Makes WS-driven bypass changes (snapshot/web/MIDI) visible on v1/v2. refresh_plugins only repushed zone bitmaps; the bypass line is now redrawn from a tracked plugin list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mod-ui broadcasts param_set :bypass during snapshot_load, drained on the 10ms tick, so the per-plugin pi_stomp_get poll in preset_change_plugin_update is redundant. Removed it from the snapshot path (modhandler + mod); pedalboard load still seeds bypass from the parsed TTL. Authoritative reseed (reconnect add-dump) is branch 5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # pistomp/handler.py
rreichenbach
approved these changes
Jun 10, 2026
rreichenbach
left a comment
Collaborator
There was a problem hiding this comment.
This seems great. I love seeing MOD-UI and the LCD in perfect sync. Finally!!!
I tested:
- Snapshot and Pedalboard changes via MOD-UI, Nav Encoder and footswitches
- Plugin Bypass via MOD-UI, footswitches and clicking the encoder block
- MIDI USB mapping, bypass
- DIN MIDI mapping, bypass
- Expression pedal mapping
- Tweak encoder changes value on MOD-UI (Finally!)
Everything I tested seems rock solid. This Rocks!
This was referenced Jun 10, 2026
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.
Collapse pi-Stomp's dual ownership of live state into a single source of truth — mod-ui — and make the WebSocket the read-side that keeps piStomp's mirror current in real time.
Previously, we held bypass/parameter state locally and re-derived it by polling REST after every change. Two writers, racing, reconciled by timing. This stack removes pi-Stomp as a writer of live values: it emits intent over the WS, and treats mod-ui's echo as the authoritative update. We're a controller: command, then mirror what the server actually did.
Sources of truth (LLM-generated)
Concretely, the websocket handler only acts on three things:
Everything else is either dropped or flows through a different channel:
A deeper dive
poll_modui_changes.refresh_plugins()can redraw bypass indicators on inbound updates — the v1/v2 equivalent of the v3 LCD's existing path.The payoff is correctness with minimal impact to responsiveness: indicators update from any source (footswitch, MOD-UI, snapshot, external) in ~10ms with no polling, and no state divergence. In practice, the WS bridge has been stable in production. This PR series depends on that continuing to be the case. If a disconnect does happen, we automatically reconnect with exponential backoff. sastraxi#36 documents a subtle correctness concern that probably doesn't matter in practice.
Individual PRs
This PR is a merged stack of all the PRs below. 99% of the UX is solved by the first, as it's very hard to hit footswitches fast enough to trigger the "echo" bug at 10ms. The rest simplify the architecture.
adddump sastraxi/pi-stomp#36