Comment mode for live apps (embedded browser)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
One route: commenting on the running real app inside the live session. No paste, no mock, no rebuild, no extension. A reviewer opens a live document, gets a real browser on SupaCloud’s side and sees the app over WebRTC — clicks, drags, types, hears it, with their own account. “Comment” pins the element under the pointer in the running app and records the moment as data.
Streaming: Neko, not our own screencast
Section titled “Streaming: Neko, not our own screencast”Pixels, audio and input come from Neko (github.com/m1k1o/neko), a WebRTC virtual browser. We
build only the session broker and the CDP evidence side. A hand-rolled
Page.startScreencast was rejected: the pilot (Venman’s set-cut editor) needs audio and precise
dragging — the worst case for JPEG frames.
- Apache-2.0;
ghcr.io/m1k1o/neko/chromium:3.2.0(GHCR, multi-arch), pinned by digest at deploy;--shm-size=2g; configured byNEKO_*and/etc/neko; Chromium runs--no-sandboxinside, accepted only because each session is its own container. One container per reviewer session, created and killed by the broker; Neko’s client is the stage; WebRTC carries pixels, audio and input. The same Chromium binds DevTools to127.0.0.1:9223inside the session container, and the only path to it is the relay: the server dialsSUPACLOUD_LIVE_RELAY_URL, the relay’s signal listener forwards to the address it currently has registered for that session, and a forwarder on the session’s live-network address:9222(socat,range=<relay .2>/32) reaches loopback9223. The relay forwards only port9222and only two upstream shapes:GET /json/list(body capped) and the WebSocket upgrade to/devtools/page/<id>; both carry the samesignal:v1MAC as Neko’s signalling, so an unregistered or swept session is refused by name (live_devtools_unregistered), as are/json/version,/devtools/browser/*and an unauthenticated call. Source-address trust on that bridge is sound only because every live session drops ALL capabilities (noNET_RAW): the guard admitsCapDropexactly["ALL"]and nothing else (server/crates/sc-docker-guard/src/policy.rs:140-142,check_container_create), so a review browser cannot spoof the relay’s address. Two further guards cover the reviewed PAGE: Chromium bypasses--proxy-serverfor loopback by default, so a page could otherwise dial the DevTools listener on127.0.0.1:9223itself; the launcher passes--proxy-bypass-list=<-loopback>, which sends loopback through the reviewed proxy (it refuses it), and it never passes--remote-allow-origins, so Chromium’s WebSocket Origin check stays armed. The spec pins both (the flag present, the origin override absent). The broker dials that session’s ONE page target (GET /json/list,type == "page"; zero or more than one is refused by name), because the browser target answers none of the page-domain commands, and it keeps checking that the advertised socket still names the session’s OWN address before it dials the relayed page id.
The DevTools channel’s closed command set
Section titled “The DevTools channel’s closed command set”The server holds ONE DevTools WebSocket per live session, dialled on first use. Its command
vocabulary is closed: DOM.getDocument, DOM.describeNode, DOM.getNodeForLocation,
DOM.getBoxModel, DOM.querySelector, DOM.enable, Page.getLayoutMetrics,
Page.getNavigationHistory, Page.enable, Network.enable, Runtime.enable,
Log.enable, Accessibility.getPartialAXTree. Runtime.enable is the ONE Runtime command
in the set: the console and exception events do not exist without it, and it evaluates
nothing. Runtime.evaluate is absent by design (no injected script, nothing evaluates in
the reviewed page) and Page.navigate is absent because it is the one command that could
reach file:// or chrome:// around the proxy. The five enables (DOM, Page,
Network, Runtime, Log) are sent ONCE on the fresh page session, before any call asks
for evidence: an event that arrives before its domain is enabled is never delivered, and
re-sending the enables on every click would cost two round trips per call.
A click’s selector ancestry comes from the DOM PATH Chromium pushes, not from a document
read: after the shallow DOM.getDocument {depth: 0} and DOM.getNodeForLocation, the page
session emits DOM.setChildNodes events for the located node’s path, and each pushed node
carries parentId, backendNodeId, nodeType, nodeName and its attributes, while each
event carries the parent’s parentId and its nodes. Those events precede the hit answer on
the same socket, so the server reads them with no timer: the channel keeps a per-epoch index
keyed by node id, and the click walks it to the document node (nodeType 9), bounded by
MAX_ANCESTRY_STEPS. The index is cleared when the click’s OWN DOM.getDocument answer
arrives — Chromium resets its node bindings there and re-pushes the next click’s path, and
the recording shows both clicks pushing 43 events with different node ids — and on
DOM.documentUpdated, so a navigation cannot leave a stale tree behind. Every map of the
index (nodes, parent_of, children_of) is bounded by MAX_DOM_NODES, one parent’s
children by MAX_DOM_CHILDREN (a wider push is not stored), and the TOTAL child entries
across all parents by MAX_DOM_CHILD_ENTRIES, so many wide parents cannot hold millions of
node clones. Eviction is oldest-first and counts LIVE entries (a stale stamp does not count and can never
push a live node out); each entry carries a stamp so a re-push is O(1), a stale stamp is
skipped rather than honoured, and the order/parents deques are compacted when they reach
twice the live bound, keeping the amortised cost per push O(1). A re-pushed node keeps its
newest shape, and a node without a positive id is skipped. A path that does not reach the document node refuses by
name; the selector’s nth-of-type position matches the child by its stable backendNodeId.
DOM.describeNode was measured for this and carries NO parentId on a real Chromium, which
is why it is not the ancestry source. Every call has a deadline,
every frame is capped before it is parsed, and the socket is capped when it is dialled. A
closed socket (browser restart, over-cap frame) and the page session’s own end signals mark
the channel closed, and the next call re-dials ONCE under the session’s live-slot check
rather than answering Closed forever. The end-of-channel set is Inspector.detached
(closed, or navigated away by DevTools), Inspector.targetCrashed and
Target.targetDestroyed: on a page-target connection Chromium never sends the last one
unless target discovery was enabled, which it is not, so it stays in the set only for the
browser target.
A resolve is route-pinned: each anchor carries the route it was stored on, the server
reads the current page URL once per call, and it compares the origin exactly and the
concrete path against the stored pattern (:id matches exactly one non-empty segment; no
query, no prefix match, no trailing-slash tolerance). An anchor from another route is
reported as off_route and its selector is never queried, so a same-selector element on a
different page can never receive its pin. Page.navigate stays out of the command set:
the rail scrolls and pulses on the current route, and another route is named, not
navigated.
Reused pieces (unchanged)
Section titled “Reused pieces (unchanged)”| Piece | Path |
|---|---|
| Thread model, rail, resolve/reopen | web/src/lib/components/artifacts/CommentRail.svelte |
| Share door and share gate | web/src/routes/share/[token]/+page.svelte, sc-iface-http-artifacts/.../artifact_share_access.rs, sc-svc-substrate/.../share_gate.rs |
Selector store and validate_in |
sc-artifact-custody-models/src/artifact_selectors.rs |
| Anchors, comments, versions, envelope | sc-svc-substrate/.../documents/{anchor.rs,reanchor_hook.rs}, sc-persistence/src/queries/artifact_*, sc-svc-platform/src/artifact_delivery/{inputs.rs,envelope.rs} |
| Attachment assets and retention | sc-artifact-storage-models/src/artifact.rs, sc-svc-substrate/.../artifacts/retention.rs |
| Egress classifier | sc-ssrf/src/{allowlist,resolver,outbound}.rs |
New pieces
Section titled “New pieces”1. Document type live (DocType, sc-artifact-storage-models/src/artifact_types.rs): a
version’s descriptor with target_url, allowed_origins[] and auth_origins[]; no structure table,
no extraction hook.
- An origin is exact (
https://stage.venman.app) or a one-level subdomain pattern under an explicitly named host (https://*.stage.venman.app) — no bare*, no public suffix; anauth_originsentry declares an IdP separately (navigation-only, still SSRF-checked). - The instance environment bounds the target: the instance carries
review_target_suffixesand an origin must match both its own pattern and that list; a production host is refused. - First configuration: SupaCloud
https://app.stage.supacloud.run, PharmHubhttps://stage.pharmhub.de, Venmanhttps://*.stage.venman.app; Stage suffixes.stage.supacloud.run,.stage.pharmhub.de,.stage.venman.app.
Data comparability precondition (per product, before its first real comment round). The default
target is the product’s Stage, on condition that Stage carries data comparable with Prod — a
precondition, not something the mode builds: the mode reads a per-target note and shows it; it never
copies, seeds or syncs data (that is the product’s db-ops). The note names who measured it,
when, and which counts (metric, Prod, Stage), plus comparability. A round starting against a
target without such a note shows a visible warning (“Stage data is not verified comparable
with production”) and requires an explicit acknowledgement on the consent screen — never a silent
pass. First measurement (owner/Venman, 12.11.2026, Prod vs Stage): sales last 90 days 29549 vs 0,
accounting_entries 275 vs 0, future events 24 vs 16, recordings about two-thirds of
Prod’s, staff/organization/events last 90 days equal. Venman’s Stage is NOT yet comparable;
Venman raises the level through its own db-ops, and SupaCloud builds nothing for it.
2. Session broker (ours). One Neko session per reviewer, bound to the document and share role;
idle 10 min / absolute 60 min (both settable from outside, see the environment reference); no
persisted profile, cookies or credentials; the container goes with the session. SupaCloud stores a
session id and the binding only. A session is a 4 GiB Chromium container, so open sessions are
blocked at 4 per workspace and 8 per instance (both settable, see the environment reference);
the count and the row insert share one transaction under a per-workspace and one instance-wide
advisory lock, so parallel opens cannot both pass the count. A refused open says
live_session_capacity and starts no container.
Media path
Section titled “Media path”Target media path (owner decision 2026-11-17). The hub serves TURN itself: turn-rs runs inside the supacloud-server process and listens on one port, 3478 UDP and TCP. The reviewer’s browser reaches it at the hub’s existing public origin (
PUBLIC_URL); the review session reaches it through the relay’s TURN forwarder on the runner’s existing outbound connection. Signalling and DevTools do not use TURN at all — they ride the existing hub WebSocket and the runner gRPC tunnel. There is no coturn container, no second host, no certificate export and no deployment fact: nothing asks Infra for a host, DNS name, port or rollout. The coturn material below is the design history that produced the credential derivation (M1) and the closed-peer requirement (M2); where it names a coturn artifact, a TURN/TLS listener or an Infra deployment, the in-process listener above supersedes it.
The session container publishes no port and sits on the supacloud-live network with
Internal: true; only the egress proxy and the media relay are its other members. The browser
still needs a path to the session’s WebRTC media, and Neko’s own documentation is explicit that
HTTP ingress cannot provide it:
“WebRTC does not use the HTTP protocol, therefore it is not possible to use nginx or other reverse proxies to forward the WebRTC traffic. If you only have exposed port
443on your server, you must expose as well the WebRTC ports or use a TURN server.” — Neko WebRTC configuration
Candidates considered:
- TURN relay reached over the live network (recommended). Coturn’s TURN REST API
(
--use-auth-secret/--static-auth-secret) accepts time-limited credentials derived from a shared secret: “the username is the expiry timestamp followed by the session ID (<unix-timestamp>:<session-id>), and the credential is the Base64 encoded HMAC-SHA1 of the username keyed with the secret” (Neko’s Time-limited TURN credentials, neko.m1k1o.net; coturn documents the same derivation, coturn turnserver wiki, TURN REST API). Neko can mint those credentials itself from a configuredsecret, but that would place the long-lived secret inside every session container. M1 has the broker mint them instead and hands Neko only the static pair for that one session.- What the reviewer’s browser must reach: the hub’s own public origin on
3478/udpand3478/tcp— the in-process turn-rs listener. Nothing on the session container. Noturns:/5349listener exists:443belongs to the hub’s HTTPS front entrypoint, and signalling and DevTools ride the hub WebSocket and the runner tunnel, not TURN. - Guard/network impact: none on the container shape (still no published port, still only
the live network); the listener is part of the hub process, so no container joins the live
network for it. The session’s
NEKO_ICESERVERSvalue is one of the guard’s exact env keys. - No deployment fact: the listener uses the hub’s existing public origin and serves the
generated TURN secret in-process. The earlier coturn deployment (a TURN host, a public
port set, a
5349certificate, a rendered peer block and a fixed relay range) was the design history for this step; it is not part of the product. - A share-door guest behind a corporate firewall: TURN/TCP on
3478is the path when UDP is blocked. A network that permits only outbound TCP443cannot reach the relay: no TURN listener exists on443, and the session cannot stream there. A network that only permits an HTTP proxy breaks WebRTC entirely — those limits are stated, not solved.
- What the reviewer’s browser must reach: the hub’s own public origin on
- One TCP mux port per session host behind a Traefik TCP entrypoint. Neko can multiplex all
TCP peer connections on one port (
webrtc.tcpmux, same page). Traefik can forward a TCP entrypoint to a backend, but “only TLS routers will be able to specify a domain name with that rule” and a non-TLS router is a singleHostSNI('*')catch-all (Traefik TCP routing rules). Plain ICE-TCP carries no SNI, so sessions cannot share one Traefik port; each session host needs its own exposed mux port.- Browser reaches that mux port directly; the session container still publishes nothing, but the host now has one hole per session host.
- Guard/network impact: the session keeps the live network; the host-level TCP port is outside the container policy and needs its own firewall/Traefik entrypoint per host.
- Infra must provide: the entrypoint(s), a fixed
NEKO_WEBRTC_NAT1TO1hostname per host, and the port range; UDP is not available through Traefik. - Guest behind a corporate firewall: only TCP; blocked when the network refuses non-HTTP ports.
- Ephemeral UDP range or UDP mux.
webrtc.eprorudpmuxrequire a published UDP range or port (“This port should be open on the server’s firewall”, same page). Traefik does not route UDP, so this is a host firewall hole and the worst fit for the “no published port” rule. - ICE Lite on a public IP.
webrtc.iceliteis for a server on a public IP; Neko warns “When using ICE Servers, ICE Lite must be disabled” (same page), and it still exposes a media port. It cannot coexist with candidate 1.
Recommendation: candidate 1, TURN relay with per-session, broker-minted credentials. The
session container stays portless on the Internal live network, the hub serves TURN itself on
3478 UDP and TCP, and the credentials are per session and expire.
M1 — the long-lived TURN secret never enters a session container. A session container runs a
browser an outside reviewer drives; a container escape or a Neko bug must not hand out the key that
mints credentials for every session. So the shared secret stays in the broker: generated
once per instance (32 random bytes, AES-256-GCM under the credential-encryption key, stored in
instance_live_secrets), or taken from the environment/OpenBao override (M6); never a
Komodo variable or a container env. The broker mints ONE credential per
session with the TURN REST derivation:
username = "<expiry-unix>:<session-id>", credential = base64(HMAC-SHA1(secret, username)), and
expiry = session creation + the absolute limit + a 300 s margin. NEKO_ICESERVERS carries only the
static urls/username/credential pair for that session — Neko’s own secret/ttl minting mode is
never used. The guard keeps NEKO_ICESERVERS as an exact key and additionally refuses a value whose
JSON contains a secret field (or any key outside urls/username/credential). Trade-off, stated:
a session can refresh its relayed allocation only until its own deadline plus the margin — never
beyond. That is the point, not a limitation to work around.
M2 — TURN is an SSRF surface; its closure is a requirement, not a side effect. A TURN relay forwards to whatever address it can route to, so an unrestricted relay would let a reviewer’s browser use it to reach the platform’s own networks. The listener’s controls:
- every allocation needs a current per-session credential derived from the instance TURN secret, so an unauthenticated client gets no relay at all;
- both ends are configured relay-only, so the intended peer of a session’s allocation is the other allocation of the same session;
- TURN still lets a credentialed client request another address, so the listener must carry a peer policy that refuses the live network, the session host, the platform and cloud-metadata addresses. That policy is part of the turn-rs integration (being built); it does not follow from the port being open;
- the listener joins no second network: it is the hub process, not a member of the live network.
The earlier coturn peer rules (an allowed-peer-ip for exactly the session range with a deny-all
underneath) were the design history for the same property; the in-process listener does not use a
rendered coturn artifact. A live subnet inside 192.168.0.0/16 is still refused outright (Docker
networks never allocate there on our hosts).
M4/M9 — the closed property is tested where it now lives. The coturn artifact and its renderer are gone, so the byte-for-byte configuration test is gone with them. What remains asserted:
- the TURN URL derivation emits exactly the hub host on 3478 for
udpandtcp, and never aturns:URL (sc_config::live_turn_urls); - the broker mints one credential per session with the TURN REST derivation
(
username = "<expiry>:<session-id>", HMAC-SHA1 keyed with the secret), the expiry is the session’s absolute deadline plus a 300 s margin, and the session’sNEKO_ICESERVERScarries onlyurls/username/credential; - the guard keeps
NEKO_ICESERVERSas an exact key and refuses a value carrying asecretfield or any key outside that trio, so Neko’s own minting mode can never be switched on by a value.
M4b — the derived browser image (P4/P6). The pinned upstream launcher resets
CHROMIUM_FLAGS and sources only /etc/chromium.d/*; the supervisor command has no URL
argument. The repo therefore derives exactly one image, docker/live-session/Dockerfile,
FROM ghcr.io/m1k1o/neko/chromium:3.2.0@sha256:270face8…, changing only:
/etc/chromium.d/supacloud-live, which readsSUPACLOUD_LIVE_PROXY(exactlyhttp://<host>:<port>) andSUPACLOUD_LIVE_START_URL(https://, a non-empty host before the first/, and only the characters the launcher’s UNQUOTED$CHROMIUM_FLAGSexpansion can pass as data: ASCII letters and digits plus. _ ~ : / % - + = , ;), appends both toCHROMIUM_FLAGS, and exits non-zero before exec if either is missing or malformed. The start URL is an allowlist, not a refusal list: a space,@,?,#,*,[,],\, quote, backtick or$fails before the browser starts, so no glob or expansion character reaches the launcher. The guard’sLIVE_START_URL_CHARSis the identical literal set, andthe_start_url_allowlist_is_the_launcher_snippet_setreads the snippet’ssupacloud_live_url_charsassignment, so the guard never admits a value the launcher then refuses at browser start;- the managed Chromium policy key
WebRtcIPHandling=disable_non_proxied_udp(Chrome Enterprise policy WebRtcIPHandling) merged into the existingpolicies.json, keeping every upstream key. Page WebRTC can then not reach the live subnet around the proxy (P6); socatfor the DevTools forwarder: Chromium binds loopback and the forwarder on the session’s own address accepts only the relay;- the Debian security updates of every installed package, which the upstream layers lack; and
/usr/bin/nekorebuilt from the same upstream commit (thev3.2.0tag) with a current Go toolchain and the fixedgolang.org/xmodules. Neko 3.2.0 ships no plugins, so no plugin has to match the new build.
The guard pins the derived image by DIGEST through SUPACLOUD_DOCKER_GUARD_LIVE_IMAGE
(<registry path>@sha256:<64 hex>; a tag-only or digest-less value is refused at boot,
absent makes live sessions unavailable with a named boot line). The reviewed proxy is
SUPACLOUD_DOCKER_GUARD_LIVE_PROXY. The build follows
.forgejo/workflows/build-agent.yml (prepare-cicd-base → validate → build → Trivy →
sha-pinned push → SBOM → cosign sign/attest/verify) in
.forgejo/workflows/build-live-session.yml; the first build’s digest goes into the two
containers’ SUPACLOUD_DOCKER_GUARD_LIVE_IMAGE. The session env list is exact:
NEKO_SERVER_BIND, NEKO_DESKTOP_SCREEN, NEKO_PLUGINS_ENABLED=false (nothing in a
review session needs plugins), NEKO_DESKTOP_UPLOAD_DROP=false,
NEKO_DESKTOP_FILE_CHOOSER_DIALOG=false, NEKO_FILETRANSFER_ENABLED=false,
NEKO_MEMBER_PROVIDER=object, one validated NEKO_MEMBER_OBJECT_USERS entry,
NEKO_ICESERVERS, SUPACLOUD_LIVE_PROXY, SUPACLOUD_LIVE_START_URL,
SUPACLOUD_LIVE_CDP=<this session's live-network address>:9222,
SUPACLOUD_LIVE_DEVTOOLS_SOURCE=<the relay's fixed .2 of the live subnet> (the forwarder’s
only admitted source; the guard refuses any other value). http_proxy,
https_proxy, no_proxy and CHROMIUM_FLAGS are refused by name. The JSON-in-env form
of the object provider is proven only by the Stage end-to-end case; the docs show the
env form without a sample value. Uploads, downloads and file transfer are off by the
approved boundary (“no multi-tab, uploads, downloads or video”). The clipboard is off in
this step because copying out of the review browser is a data path nobody has decided and
a reviewer types credentials; that is not a claim about any earlier row.
LB18 — the connect path (P1–P3/P5). The browser holds exactly one SupaCloud secret:
the short-lived WS ticket. POST .../live-sessions/{session_id}/connect (member) or
POST /api/shares/{token}/live-sessions/{session_id}/connect (share door) mints it after
the same holder, share and deadline checks as touch; the ticket is returned in the JSON
body and presented ONLY as a Sec-WebSocket-Protocol value
(supacloud-live.v1, ticket.v1.<workspace>.<session>.<expiry>.<holder tag>.<mac>). It is
never a URL, cookie or localStorage value. Its HMAC covers the workspace, session, expiry
and the keyed LD6 holder tag; the WS door re-reads the row and compares the tag, so a
ticket for one guest cannot open another guest’s session. It lives 60 seconds; the socket
it opens outlives it.
Two listeners belong to the relay sidecar (live_relay): the internal signalling/control
listener (SUPACLOUD_LIVE_RELAY_SIGNAL_BIND, required explicit server-network address)
and the live-network forward proxy (SUPACLOUD_LIVE_RELAY_PROXY_BIND, required explicit
live-network address; no 0.0.0.0). The server authenticates to
/signal and its three DevTools routes (/devtools/{session}/json/list,
/devtools/{session}/devtools/page/{target}) with a per-session signal:v1 HMAC; the relay
then performs Neko’s login ITSELF
against supacloud-live-<session id>:8080 with the per-session member. The member password
is derived from SUPACLOUD_LIVE_RELAY_SECRET and the session id by both the server runtime
and the relay; it is never returned to the browser. Neko’s login response (id, token,
profile, state) stays on the relay: the browser receives only the post-login Neko WS
protocol (system/init, signal/*, control/*) that Neko’s client needs, and the Neko
session id in system/init dies with the container. The forward proxy identifies a session
by the live-network source IP the server registers BEFORE that container is created
(POST /sessions, body-MAC covered with a SHA-256 digest), gates every CONNECT through the same
egress::check_outbound, resolves the address once and tunnels to the resolved IP — no
second resolution. The reviewed target is https, so plain-HTTP proxying is refused with a
named 501 instead of being forwarded. No member password, Neko token, TURN secret or relay
secret is held by the browser; its long-lived value is the app session cookie, plus the
ephemeral WS/WebRTC state and the Neko session id.
The viewer’s browser half is web/src/lib/live/relay-viewer.ts with the pure
relay-input.ts and the DOM relay-input-controller.ts: it POSTs the connect door,
offers the ticket as the two subprotocol values, speaks the post-login Neko protocol over
WebRTC (init, signal offer/answer/candidates, heartbeat), and sends letterbox-aware
pointer/keyboard input. The member page is /live/{document_id}/{session_id}; the guest
view is on the share page (ShareLiveReview.svelte, the share token route) with the
anonymous holder secret kept in component memory. The member’s consent lives in
LiveDocumentEntry.svelte (LiveConsent.svelte); the guest reuses that same consent component
before the session starts. The viewer touches the session’s touch door at most once per
30 s while pointer or key input happened (never for a merely watched stream); it starts
muted with an explicit unmute and a click-to-start when autoplay is blocked; held keys and
buttons are released on blur, a hidden tab and close; and Ctrl+Alt+Shift+Esc leaves the
keyboard (shown in the visible hint and the video description, never forwarded). Member
and guest both render the stream through LiveViewerSurface.svelte. The sidecar runs
from the server image as live_relay, with its signal listener on the internal network
and its proxy listener on the dedicated live network; the deployment’s own values name those
two addresses.
LF1 — an anonymous share is bounded per share. A public link mints a fresh holder
secret on every open, so the one-open index covers only signed-in holders. The broker
therefore bounds the share’s anonymous slots (the LC2 unit: the container may still
exist) at SUPACLOUD_LIVE_SESSION_SHARE_ANONYMOUS_MAX (built-in 2, floor 1), inside the
same locked open transaction and BEFORE the workspace/instance counts, so the refusal is
live_session_capacity naming the share bound instead of silently spending the
workspace’s last slot; a signed-in member of the same workspace still opens. The route
POST /api/shares/{token}/live-sessions (artifact_live_sessions.rs:472, merged by
artifact_share_access.rs:416) has no route-specific limiter; the global /api per-IP
governor (server/src/lib.rs:329-332; tier selection api_governor.rs:168-189,
enforcement :277-292) covers it: an anonymous POST carries no credential and rides the
strict 5/s, burst-200-per-IP bucket, while the share bound is the durable, cross-IP
limit.
The server assigns the address, and the registration precedes the container (LI1). The
live network is the fixed subnet SUPACLOUD_LIVE_SUBNET names: the Docker gateway at .1,
the relay at .2, sessions at .3 upward. The broker takes the instance lock inside the
reservation transaction and derives the session’s address from its deployment-wide slot
ordinal there, so two sessions can never be created with one address. The runtime then
registers (session, address, descriptor, deadline) at the relay’s internal listener
(POST /sessions, body-MAC covered) BEFORE it creates the container with
NetworkingConfig.EndpointsConfig[<live network>].IPAMConfig.IPv4Address. The guard admits
exactly that field, only for a live-session container, only on the live network and only
inside the subnet; it refuses it on every other container and endpoint, and it refuses a
second IPAM field, an IPv6 address and endpoint aliases. A failed registration starts
nothing. That closes the window in which a crashed or OOM-killed container’s freed address
could reach the next container while the registry still named the dead session: the
address’s entry is replaced before that container exists. Because registration never lags a
start, the proxy looks the source address up immediately — an unknown address is a named
403, and nothing waits for a registration to arrive.
Relay lifetime and the end of an open socket (LG1/LG2/LG4). A session’s egress
registration is DEREGISTERED before its container is removed: the runtime sends
DELETE /sessions/{id} with a control:v1 MAC over the EMPTY body, then removes the
container, and only then is the LC4 removal receipt (container_removed_at) stored, which
retires the slot. A failed deregistration keeps the container and the LD1 slot obligation
for the sweep to retry. A registration for an address replaces whatever was there, so the
new session’s reviewed origins are the only ones its browser may reach. The registry is in
the relay’s memory: ONE relay instance serves a deployment. A relay restart forgets
every entry; the 60-second leased sweep (background_live_sessions.rs:21) re-registers every
open, ready session at its slot’s STORED address on each tick, so a restart costs at most one
sweep interval of refused loads. The sweep also asks the daemon whether each ready session’s
container still runs; a container that does not exist or is not running (a crash, an OOM
kill, a daemon restart) is deregistered, ended container_gone and its slot released on that
same tick. A tick reads its work list, ends that transaction, and only then makes the relay
calls: the round is bounded and stops at the first transport failure, so a down relay cannot
hold a pooled connection or a lease for sessions × 10 s (LI2). A share that is revoked,
expires or drops below commenter is ended by the sweep’s own open_share_sessions_all /
share_ineligible leg on the next tick (broker_lifecycle.rs, sweep_overdue) and its
container is removed in the same tick, which closes the open signalling socket; the idle
deadline (SUPACLOUD_LIVE_SESSION_IDLE_SECONDS, default 600 s) is the outer fallback while no
sweep runs or a removal is being retried.
Listener networks (LG5). Both listener binds are REQUIRED explicit interface addresses;
an unspecified address (0.0.0.0, ::) is refused at boot. The signal/control listener
binds the server-side address and the forward proxy binds the live-network address (the
stack fragment is docs/ops/live-relay/compose.fragment.yml), so a session container can
never reach /signal, /sessions or the DevTools routes. The HMAC is still the wall: an
unauthenticated /signal, /sessions or /devtools/..., a DevTools path whose session is
not the MAC’s session, and a registration whose MAC covers another body, all answer 401. The
proxy never reaches the relay’s own address or the live subnet: egress::check_outbound →
check_address (egress.rs:54-59) passes an EMPTY internal allowlist to
sc_ssrf::validate_with_allowlist, which refuses loopback, RFC1918, CGNAT, link-local and
metadata targets even if a descriptor origin resolved there (egress_tests.rs:61-78).
Signalling bounds and the MAC window (LG7/LG11). The browser socket, the relay’s
signalling upgrade and both client dials cap a signalling message at 256 KiB
(LIVE_SIGNAL_MAX_BYTES); a Chromium SDP offer/answer for one video + audio m-line is a few
KiB (typically 4–8 KiB), and the Stage probe records the exact size. The DevTools tunnel is
capped separately and higher: a CDP frame or message is at most 4 MiB (MAX_FRAME_BYTES) on
both the relay’s upgrade and the server’s dial, and the relayed /json/list body at most
256 KiB (MAX_DISCOVERY_BYTES). signal:v1 and
control:v1 are MACs with a 30-second clock window, so they are replayable within it by
anything on the server→relay path; that path is one private network, and an https relay
URL (the server dials wss) is the documented way to cross an untrusted one.
M5 — no relay port block exists. The fixed 100-port range was a coturn firewall
requirement; the in-process turn-rs listener needs no published relay block, so
SUPACLOUD_LIVE_TURN_MIN_PORT / _MAX_PORT and the -X NAT question are gone with coturn.
The only port a deployment carries for TURN is 3478 UDP and TCP.
M6 — the secret path is generated in the hub. The instance TURN secret is generated once
per instance by the hub, 32 random bytes, AES-256-GCM-encrypted in instance_live_secrets
under the same envelope as the relay secret, and read back on every boot. An environment value
or the OpenBao map supacloud/app under SUPACLOUD_LIVE_TURN_SECRET overrides it (env first,
then the map), so an env-only install without OpenBao still works. The value never rides a
Komodo variable, a rendered artifact, a job row, a log line or a session container env; it is
handed only to the listener inside the hub process. Without a credential-encryption key the hub
refuses to generate one and every open refuses with live_media_not_configured.
M7 - the open-session authority, the self-authenticating username, and the vendored peer filter
(2026-11-17). The listener’s credential check asks the PERSISTED session row, not process
memory: sc_live_turn::sessions::OpenSessions is implemented in the composition root over
artifact_live_sessions (sc-persistence, artifact_live_session_turn::open_created_at), so a
hub restart, a deploy and a second replica all admit a credential whose row is open, and a row
that has ended is refused on the very next request - not when the credential’s own expiry
happens to pass. There is no positive cache: the question is asked once per Allocate/Refresh
(a few times a minute per allocation), so a cache would buy microseconds and cost the immediate
end semantics.
The username is SELF-AUTHENTICATING. turn-rs asks the hook for the password BEFORE it verifies
MESSAGE-INTEGRITY, so without a tag any internet client could send Allocates with a well-formed
future expiry and a random UUID and make every one of them cost a session lookup. The username is
"<expiry>:<session>.<tag>", where the tag is 16 base64url characters of
HMAC-SHA256(instance secret, "<expiry>:<session>"); sc_live_turn::credential::claims verifies
it in constant time before the expiry is read and before the row is asked, so a forged or altered
username is refused in memory. The TURN REST password keeps its shape
(base64(hmac-sha1(secret, full username))), so a browser follows the standard unchanged. The
remaining cost of a caller that CAN tag (a leaked credential) is bounded too: a source address
that misses the row 20 times in 10 seconds receives 401 without a lookup for the rest of that
window (sc_live_turn::rate_limit), and only misses are counted - an open session’s Allocate and
Refresh are never throttled.
One library gap is closed by a vendored patch, not by a workaround. turn-rs 4.1.5 filters a peer
by ALLOCATION (SessionManager::create_permission, src/service/session/mod.rs:642), accepts any
relay port except the caller’s own (:655-658), and its bind_channel writes the channel mapping
BEFORE it asks create_permission - so one session’s credential could address another session’s
relayed port and have the server forward media into it. server/vendor/turn-server carries ONE
additive patch (peers_share_session, called from create_permission and from bind_channel
before any mapping is written) that refuses a peer allocation whose username names a DIFFERENT
session; VENDOR-PATCH.md beside it holds the exact change, the provenance and the upstream
issue text, and the directory is deleted once a release offers the hook. The integration tests
a_credential_cannot_address_another_sessions_relayed_port (403) and
only_an_allocation_on_this_server_is_an_allowed_peer (same-session relay still works) are the
contract in both directions.
Exact changes this recommendation needs: NEKO_ICESERVERS is one of the guard’s exact env keys
with the no-secret rule (implemented); the broker resolves SUPACLOUD_LIVE_TURN_URLS /
SUPACLOUD_LIVE_TURN_SECRET once and mints per session (implemented); the hub derives the URLs
from PUBLIC_URL and serves TURN in-process on 3478/udp and 3478/tcp; the relay’s TURN
forwarder carries the session’s traffic to the hub’s listener. Nothing else changes in the guard
policy or the live network.
3. Selector kind live_element (ours). A comment stores, as data: route (origin +
path_pattern on an allowed origin, never a query), element (selector, text, role),
position (fractional x/y in the element’s box), viewport + theme, and session_role — who
is looking: a workspace member, or a share guest in the link’s role, declared by the reviewer from
ONE closed vocabulary (member, share_commenter, share_editor); the server bounds the word
without choosing it. Console and network of that moment ride the evidence attachment. artifact_selectors.rs
validates the route (allowed origin, path pattern, no query/fragment/concrete id), the CSS selector
and the position (finite, 0..1).
4. Overlay resolver (ours). The rail asks the session for the page it is on
(Page.getNavigationHistory) and compares it with each anchor’s route — origin plus path pattern.
On the anchor’s own route, DOM.querySelector + DOM.getBoxModel give the element’s current box, and
the pin is drawn as a DOM overlay over the stream at box + position·box_size. The overlay is
positioned on the rect the stream actually occupies inside the stage — the video is object-fit: contain, so it is scaled and centred and the bars around it are not the page: a click on a bar
yields no point, and no pin is offset by a bar. The reviewer’s own input to the stage — a wheel
turn, a pointer release, a key — re-resolves the box and moves the pin, as does a window resize and
a slow poll of a visible session; the SupaCloud page’s own scrolling is not a trigger, because the
reviewer scrolls the REMOTE page and this window never scrolls. The pin is anchored to the element,
never to the picture. Two states are kept apart:
- Detached: the element cannot be found on its own page. The rail keeps the anchor with its last known box and last evidence, never silently dropped.
- Off-route: the page the session shows right now is not the anchor’s route. No box is drawn, and the anchor is not detached — the element may be perfectly present on its own page. The rail row names the route (origin + pattern) and says that the page must be opened in the session to see the pin.
A rail click never navigates the session. An anchor stores a route PATTERN (:id, no query), so
there is no exact URL a rail click could open, and Page.navigate is deliberately not in the
surface’s command set — it is the one command that could reach file:// or chrome://. A click on
an anchor of the current route scrolls the stage to its box and pulses it; an anchor of another
route is named, not navigated. The reviewer moves the session by using the streamed app, exactly as
they would in their own browser.
A click in comment mode is input, and the trail carries the session’s own actions. Clicking the
stage posts a point to the session’s element-at door and stores the returned live_element anchor
with the comment; the click is pointer input to the reviewed page, not a comment record, and the
trail cannot tell a pick from an ordinary click. The evidence trail lists what the session did
(navigations, clicks, typing, scrolling, with a password field redacted) — it is not a log of the
reviewer’s comments.
5. Evidence attachment live.evidence/v1 (ours). The freeze happens only at the moment of
commenting — masked screenshot, console errors, scrubbed network failures, trail, build fingerprint
— and is an attachment of the comment, for the agent and the record, not the anchor. url and
failed_requests are scrubbed to origin, method, path and status (never query, fragment, body or
header — a recording code is an access token); console text is untrusted, ≤ 2 KiB per entry and ≤ 50
entries; build is the sorted hashed asset names seen on the wire — zero app changes, and a later
evidence with a different set proves the fix is live. A blur tool runs before sending.
6. Comment door (slice 2). artifact.comment.reply and artifact.comment.resolve are on the §29
door today as PROJECT-BOUND tools: policy in sc-types/src/project_authority/capability.rs:267-268 and
Baseline in tool_policy.rs:59-60, dispatched over
sc-iface-http-artifacts/.../artifact_document_comments.rs, advertised to a credential that carries
artifacts:comment, and pinned by server/tests/external_mcp_project_comment/{reply,resolve,catalog}.rs
(own project succeeds; a foreign project or a held thread answers like an absent id). A workspace token
gets project_credential_required, naming the credential and the capability. Slice 2 completes the
round trip — the agent replays the trail and replies with its after-shot; the lifecycle renders in
threads.
Security boundaries
Section titled “Security boundaries”- Ephemeral: one container per session, no host mounts or shared volumes, no persisted cookie/credential/profile; removed at the deadlines above.
- Egress only through the broker’s proxy: every request resolves and is refused by
sc_ssrffor a blocked host/IP and for an origin outsideallowed_origins ∪ auth_origins; no internal, link-local or metadata endpoints. - TURN peers (M2/M4/M9): the listener is credential-gated and both ends are relay-only, so
the intended peer of a session’s allocation is the other allocation of that session. A
credentialed client can still ask TURN for another address, so the listener must refuse the
live network, the session host, the platform and cloud-metadata addresses; that peer policy
is part of the turn-rs integration (being built). The earlier coturn
--ip-rangeallow/deny block was the design history for the same property and is no longer part of the product. Without that closure the relay would be an SSRF path into the platform or an open relay to the public internet. - TURN secret (M1/M6): generated once per instance by the hub and stored encrypted in
instance_live_secrets; an environment value orsupacloud/appkeySUPACLOUD_LIVE_TURN_SECREToverrides it (env-firstresolve_secret). A session container receives a static<expiry>:<session-id>/ HMAC-SHA1 credential valid until that session’s absolute deadline plus the margin; the shared secret never enters a container, a log line, a rendered artifact or an artifact upload. - Browser sandbox (P4): upstream Chromium starts with
--no-sandbox; the container is therefore the only sandbox. The guard’s shape (CapDrop ALL, no-new-privileges, read-only root, internal network, blocking limits) is not negotiable. - No TURN/TLS port (M3): there is no
5349listener and noturns:URL. Signalling and DevTools ride the hub WebSocket and the runner tunnel, not TURN.443on the Stage address belongs to Traefik; a guest network that allows only outbound443cannot reach the TURN listener and cannot stream. - Login pitfall, stated honestly: credentials and second factors are typed into a browser on our servers; some IdPs block data-centre or automated sign-ins; passkeys are impossible (device-bound). The viewer names the reviewed origin and “browser run by SupaCloud” and takes consent before the first input. For our own tools and project participants this is a limit, not a blocker; password and SSO work.
- Evidence is production data: scrubbed, truncated, blur-tooled; retention class
live_evidence, default 30 days, swept by the existing hourly artifact sweep. - Share door: a share-opened session is bound to that one document, its
target_urland ONE holder — the signed-in viewer’s user id, or a one-time secret returned in the open response and kept in the tab’s memory (sent as a header, never a URL or localStorage); another guest on the same link gets 404, and that holder binding also covers the three DevTools doors (element-at,resolve,evidence-facts): a second guest who knows the session id gets 404, never another guest’s DOM, accessibility tree or console facts. The holder’s current role is the share door’s ownaccess_decision(a users share’s grant), not the share row’s default; a lowered/removed grant or a revoked/expired share ends the session. Input is never logged beyond the trail (a password-field keystroke is{"redacted":true}); no bodies, no headers.
Lifecycle (slice 2)
Section titled “Lifecycle (slice 2)”On the existing thread states — comment status open/resolved (resolved_at,
resolved_by_kind), delivery pending/delivered (delivered_task_id): open → taken →
fixed in commit → live since deploy (a new evidence build differs) → confirmed by the
reporter (resolve). Detached anchors stay in the rail alongside these states.
Build slices
Section titled “Build slices”- Pin, stream, share door.
livetype + descriptor and the first three configurations; broker + one Neko session; consent screen (with the comparability warning when the target has no note);live_elementset by pointer (route, locator, position, session role); pin over the stream on the anchor’s own route (overlay, re-resolved on scroll/resize); detached andoff_routestates; a click on a rail row scrolls to the pin and pulses it, and a row on another route is named rather than navigated; evidence attachment; share-door commenter session scoped to its document; phone touch path (one fixed portrait viewport, stream scaled). The idle and absolute deadlines are configured withSUPACLOUD_LIVE_SESSION_IDLE_SECONDS/..._ABSOLUTE_SECONDS; this slice’s broker reads them when it constructs and ticks sessions — they take effect with the broker, not at server boot. - Reply door, fingerprint lifecycle, replay. The two comment tools are already on the §29 door as project-bound tools (see Comment door (slice 2) above); what remains is the agent replaying the trail and replying with the after-shot, and the lifecycle rendering in threads.
- Pool hardening and scale. Quotas, session audit, failure screenshots, idle tuning, broker
runbook. The per-project session and evidence-byte quotas, the session audit rows and the
masked failure screenshot of a session that had started and then failed are in force
(
docs/admin/how-to/operate-live-review-sessions.mdx, “Failure screenshots”). The mask is decided by one pierced DOM walk and covers every text-entry field (a missing or emptytypecounts astext), everyiframe/frame/embed/objectwhole (a cross-origin document is unreachable from the hub) and the whole box of a closed shadow root’s host; an open shadow root’s fields are masked individually, auser-agentroot is the browser’s own rendering and is left to the element’s own rule, and nothing is masked for being empty. A tree past 20 000 nodes or a page needing more than 128 masks is refused asunmaskable, never stored half-masked.
Decisions
Section titled “Decisions”- The comment lives on the element, not on a picture (owner: “screenshots können alle”). The anchor
is
live_element; the screenshot is evidence attached to the comment. This keeps the thread meaningful after the app changes and lets a fix be verified on the live element. - Reused vs new: thread model, rail, share door, anchor store and envelope unchanged; new are the selector kind + its validation, the overlay resolver and the evidence attachment.
- Broker: runner fleet beside Neko (SC-13 host binding chooses only an egress host); a dedicated browser-host pool is a later option.
Not building
Section titled “Not building”No recorded-state type, harness or emitter; no own screencast or audio pipeline; no injected script; no paste, mock or rebuilt copy of an app; no passkeys; no multi-tab, uploads, downloads or video in slice 1; no CDP attach to the reviewer’s own browser. A browser extension is not part of this plan and comes only if a concrete app needs passkeys or is IdP-blocked.