Repository navigation
Socket peer authentication on the client-mode relay; the #95 spec (board #95) - #104
Merged
Merged
Conversation
…s to cua's client-mode relay, roots as process instances, peer re-read, eager load, packaged proof, the tracker row amended not closed
…amed, the engine stub for scene 7, no host-loss clearing, Linux skips, the sitting after the merges)
… the Interfaces, the anchor spawn's file, the SIGUSR1 residual's general form
… byte-identical to MAWS's, scripts/build-peer-auth.sh, node-api-headers, native/ shipped), the loader and policy in src/chrome/peer.mjs with Acceptance 1 and 2
…ss tree (runHost's authorize, pauseOnConnect, one refusal line per peer, fail closed without the addon), peerCheck in the status file, cua doctor's maws.hosts row and the maws_unreachable text, --disable-sigusr1 on the plugin's server and the runtime anchor with engines.node >=22.14, plugin 0.7.0, README For MAWS, Acceptance 7 tests
… README state Node 22.14, which the anchor's --disable-sigusr1 needs
…authentication spec (dated inline pointer and Decision Log entry; both sockets check the peer by ancestry, the Chrome-route host unchanged)
… lack --disable-sigusr1) in engines, the lockfile, the cloud-VM install condition, the README, the cua-remote skill and the cloud-VM README
…in and the supervisor
… main and the supervisor
…flag, main's startup window) in the Decision Log and the report
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.
Board ticket: #95 (the board closes it after the owner's sitting). This PR carries the spec and cua's side of socket peer authentication:
docs/doperpowers/specs/2026-10-09-maws-socket-peer-auth-design.md, along with its living sections and its Outcomes. MAWS's side is SSFSKIM/MAWS#7. Merge order: SSFSKIM/MAWS#7 first, then this PR. After both merge, the owner's live sitting (Acceptance 8) runs once the installed plugin is updated to 0.7.0.What changes
In client mode,
cua serveopens a relay socket ($CUA_HOME/chrome/m/<name>-<pid>.sock) for the vendor service and the trusted worker. That relay now admits a peer only if two things hold:cua serveprocess instance.The check runs at accept, before any read (
pauseOnConnect). A refused peer is destroyed and writes one diagnostics line:relay <name>: refused peer pid <pid> (<reason>). Without the addon, every peer is refused.native/peer-auth/: the N-API addon. Its C source and darwin-arm64 prebuild are byte-identical to MAWS's copies.scripts/build-peer-auth.shrebuilds it, andnative/is added topackage.jsonfiles.src/chrome/peer.mjs: the loader and the ancestry policy.runHosttakes anauthorizeoption, andconnector()passes it. The Chrome-route host (src/chrome/host.mjs, launched by Chrome's native messaging) passes nothing and behaves as before. Its status file only gainspeerCheck: 'off'.peerCheck: 'on' | 'off' | 'unavailable'.cua doctor'smaws.hostsrow reports a missing addon as blocked, and themaws_unreachablereason text says why.spawnUpstream's anchor run with--disable-sigusr1.^22.14 || >=23.7, the first releases that have that flag. It is updated inengines, the cloud-VM install condition, the README, the cua-remote skill and the cloud-VM README.Validation Evidence
HOME=$(mktemp -d) npm testgives# pass 1071,# fail 0,# skipped 1(a pre-existing Linux-only skip). Run at c43d479.npm run test:modsgives32 pass,0 fail.claude plugin validate .reports✔ Validation passed with warnings, the same warnings as on main.test/chrome-peer.test.mjs, 15/15):serve-mawsandchrome-client-mode.peerCheckis written to the status file.unavailablewhen the loader points at a missing file.--disable-sigusr1opens no inspector on SIGUSR1.tabs.createarrived) and nothing was refused.diffofMAWS-wt-95/native/peer-auth/peer-auth.candcua-wt-95/native/peer-auth/peer-auth.cprints nothing, andcmpof the two prebuilds prints nothing. SHA-256: 5c94d2b4… (source), 9de92f2c… (prebuild).reviewer-medium, the whole branch byreviewer-high, all on opus. Every verdict was correct. Two P3 findings were fixed and re-reviewed:Residue
cua servestarts the vendor runtime under its bundled stock Node (cua_node/bin/node). That process opens an inspector on 127.0.0.1:9229 when it receives SIGUSR1, so any same-user process can run code inside the relay's admitted tree. Node accepts--disable-sigusr1inNODE_OPTIONS, butlaunch.mjsstripsNODE_OPTIONSand the vendor runtime stays unmodified (the spec owner's ruling), so nothing was applied. This would close only if the vendor's own launch gains the flag.