Browser members: Noise beside TLS, CORS on the mesh surface, the JS SDK in a page #516
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.73) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 589 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.382
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #516"
general
weight: 0.35
aojea
A member of the mesh can now be a browser page. Seven commits, each standing on its own:
1. router, node: accept Noise after TLS.
libp2p.Security(noise.ID, noise.New)after TLS onsam-routerandsam-node. TLS first: Go peers and the Node/Python SDKs land on it. Noise is what a browser can speak; both bind the connection to the peer ID.TestNoiseOnlyPeerjoins a Noise-only host through the router and reaches a node's service over the relay; removing Noise from the node makes the relayed dial fail. No newgo.modentry (flynn/noisewas already indirect). Docs (networking concept, SDK design, host comments) no longer say TLS only.2. controlplane: answer the mesh protocol's endpoints for any origin.
/info,/keys,/enroll,/enroll/status,/register,/refresh,/policiesanswer a preflight and setAccess-Control-Allow-Origin:. They authenticate by what the request carries (token in the body, biscuit as a bearer), never by a cookie, so a page on another origin can send nothing a program could not already./admin/,/user/(cookie-authenticated) and/routers/leaseget no such header;TestMeshSurfaceCORSpins both sides.3. sdk/js: identity and encodings without node:crypto and Buffer. Ed25519 from
@noble/curves(what libp2p uses in a browser), RFC 8032 verification as Go and node:crypto apply it; hex/base64/base64url fromuint8arrays, named by alphabet and padding to match each Go decoder. Both were already installed through libp2p and are now declared. Cross-checked against node:crypto in both directions.4. sdk/js: speak /libp2p-http on the stream itself. A small HTTP/1.1 codec (
http1.ts: Content-Length, chunked, until-close, heads capped at 64 KiB) replaces Node'shttpover a Duplex forsession.fetch()/fetchOverStreamand for thehandler/urlingress; a streamingResponsebody goes out chunk by chunk, so SSE works. The Nodelistener(Express) path keeps Node's parser inlibp2p-http-node.tsand shares admission (admitIngress), so authorization is written once. Codec unit tests feed it byte by byte; the ingress tests add a fetch handler with a streaming body and Node's own client reading the chunked response.5. sdk/js: one SDK for Node and the browser. Four platform pairs under
src/platformwith.browser.tstwins mapped bypackage.json'sbrowserfield: transports (TCP+WS with TLS then Noise / WS with Noise via@chainsafe/libp2p-noise), state (owner-only files / IndexedDB), the biscuit WASM loader, the ingress.scripts/bundle-browser.mjs(esbuild, devDependency) bundles for a page and fails if the browser graph reaches anode:module.6. sdk: a browser page as a member of a sam-one mesh, tested.
sdk/js/examples/browseris the Echo agent in a page (A2A SDK'sJsonRpcTransportHandlerbehind a fetch handler, the verified peer as the A2A user, IndexedDB state so a reload resumes the same peer without a token).tests/ui/browser-sdk.spec.jsdrives it in Chromium againstbin/sam-onedirectly and behind a TLS-terminating edge reached by name (thesam-one --tunneltopology, router advertised aswss): the page enrolls cross-origin, joins overws/wss+ Noise (verified:enc: "/noise",wss://localhost:<edge>), a Node member calls the page's agent through the relay, the page calls a Node agent.run.shbuilds the SDK, examples and the page;make ui-testruns it. Three fixes the page surfaced: the Node and Python SDKs must also accept Noise beside TLS (else a relayed connection from a browser member has no security protocol in common); a browser'sfetchmust not be stored as a method; js-libp2p in a browser denies loopback and plainws://addresses by default, which is what sam-one on the same machine advertises, so the host's gater judges peers, not address shapes.7. docs: the JS SDK in a browser. "In a browser" section in the Native SDKs guide; the browser non-goal is gone from
sdk/README.mdand the guide; the npm page points at the guide.Decisions: CORS
on the mesh surface only; a hand-written codec rather than a dependency; Node keepsnode:httpforlistener/url; TLS first and Noise accepted everywhere; FIPS parked until a concrete customer need.Validation:
make build,go vet ./...,hack/lint.sh(0 issues),go test ./...(incl.TestNoiseOnlyPeer,TestMeshSurfaceCORS,TestNativeSDKsMesh,TestNativeSDKA2A,TestNativeSDKExamples,TestSDKCanaryScript,TestStandaloneSDKAgents*),npm test(77),npm run build/examples,npm cifrom the lockfile,pytest(82),hack/verify-sdk-generated.sh,hack/verify-secrets.sh,make ui-test(20 passed, both browser topologies included).