Repository navigation
P5 O10 follow-up: the built bundle's ws keeps to its JavaScript paths (masked frames of 48 bytes or more threw) - #301
Merged
Merged
Conversation
…bufferutil broke every masked frame of 48 bytes or more) ws's optional native helpers, bufferutil and utf-8-validate, are installed nowhere; Vite stands an empty object in for each, which ws's try/require takes as present, so mask() and unmask() of a frame of 48 (32) bytes or more call an absent function. Main's remote links bundle ws, so every such frame on them failed. The main build defines WS_NO_BUFFER_UTIL and WS_NO_UTF_8_VALIDATE, so ws keeps to its own code; the bundle guard holds main's graph and mawsd's free of any such stand-in (mawsd's vacuously until O10 M10 bundles ws there). Ported from p5-o10-m10 (37d55fd, 8744e93), these two files byte for byte, so M10 merges over it cleanly; M10's endpoint log-line rewording stays with M10 (master's mawsd graph does not reach it). Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ways The source ws never meets Vite's stand-in for bufferutil, so a suite on source cannot see the bug the defines fix. Each built file of main's graph or mawsd's that carries ws gives up its client and server (its requireWebsocket and requireWebsocketServer and the top-level declarations they reach, run as emitted), and frames of 31 to 70,000 bytes cross each against the source ws, arriving intact. On master's build without the defines both cases fail (bufferUtil$1.mask, and unmask, is not a function); on M10's build the same cases find ws in its shared chunk and pass. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SSFSKIM
added a commit
that referenced
this pull request
Oct 28, 2026
…t paths; a tracker row for the built app's RL2 link Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 28, 2026
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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.
What broke
Main's built bundle carries a broken
ws.wsloads its optional native helpers,bufferutilandutf-8-validate, insidetry { require(...) }, and neither is installed here. electron-vite (Vite) stands an empty object in for each uninstalled optional dependency, so therequiresucceeds andwsbelieves the helper is present. From then on, masking any frame of 48 bytes or more callsbufferUtil.mask, which does not exist, and throwsbufferUtil$1.mask is not a function; unmasking a received frame of 32 bytes or more fails the same way. Every client-to-server frame is masked, so every frame of that size on main's remote links failed. The sourcewsthat the unit tests import never meets the stand-in, which is how the bug got past them. The fix definesws's own switches,WS_NO_BUFFER_UTILandWS_NO_UTF_8_VALIDATE, in main's build, so the builtwskeeps to its JavaScript paths. The bundle guard now fails if any optional-dependency stand-in appears in main's graph or mawsd's. A new guard case runs the emittedwsitself, client and server, against the sourcewswith frames from 31 bytes to 70 KB. It fails on master's build and passes with the defines.This PR is split out of P5 O10 M10 (branch
p5-o10-m10) so that it lands first. M10 carries the same two files byte for byte (git merge-treereports no conflict).Changes
electron.vite.config.ts:WS_NO_BUFFER_UTILandWS_NO_UTF_8_VALIDATEare defined for every bundle (main, mawsd, the hosts). The builtwskeeps to its JavaScriptmask/unmaskand its JavaScript UTF-8 validation, which still rejects malformed input.src/engine-host/bundle-guard.test.ts:__viteOptionalPeerDep_) in main's and mawsd's graphs. On master mawsd's half is vacuous, because mawsd bundles nowsuntil M10.wsagainst the sourcews, both ways, at 31, 32, 47, 48, 64 and 70,000 bytes. It findswsby content, so it holds whetherwsis inlined inout/main/index.jsor sits in a shared chunk, as it does under M10.Files outside
src/endpoint/andapps/org-protocol/: both files.Validation Evidence
__viteOptionalPeerDep_lines inout/main/index.js.TypeError: bufferUtil$1.mask is not a functionatout/main/index.js:5359.bufferUtil$1.unmask is not a function.bundle-guard.test.tspasses 11/11 locally. It also passes 11/11 against M10's build, wherewsis in a chunk shared by main and mawsd.ws:ci-gate --gates static,unit,probes,e2e:machines,e2e:desk-web-hub,e2e:supervisor-daemon,e2e:daemon-unit --class1a pool --runner macos --lane hosted. Result: GREEN, run https://github.com/SSFSKIM/MAWS/actions/runs/40723847211, head 36cced3.flaky:line, and ci-gate gave no coverage warning.requireWebsocket,requireWebsocketServer), so a future layout change would fail loudly rather than pass.Residue
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)