Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

docs: record 66eb337 production rollout (#174)

AAA55567839d405
diff --git a/docs/deployment.md b/docs/deployment.md
index 240b50f9..d8c19541 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -20,54 +20,19 @@ tracked coturn example remains `stun-only`; the shared host retains its older
authenticated-relay daemon configuration and firewall range. The application
does not pre-advertise TURN credentials to ordinary peers.
-Production currently runs exact `6ccb516a47261054f91dfa2fafa408d39ced59fc`
-on the existing shared public IP, with local/public health 200 and SQLite v3
-integrity. Its immutable source artifact is 619,674 bytes with SHA-256
-`ec0048023de4b40c32579c31db44cab8746dbae8e67430c16457a5bd437a4885`;
-the locally built dist artifact is 358,621 bytes with SHA-256
-`5d21c11e00e46525afbb40051b5276193f02c511728fce2c1e2df667b035cf73`.
-The 2026-08-21T10:14:26Z UTC cutover held the deployment lock for 2,048 ms;
-local health returned 1,272 ms after service stop (888 ms after the symlink
-switch). Screener, LiveKit, coturn, and nginx are active/running with
-observed `NRestarts=0`. SQLite v3 contains five rooms including room `1`, with the
-service owner/mode `screener:screener`/0600 and SHA-256
-`aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`.
-The immutable release is `/opt/screener/releases/6ccb516a4726`; backup
-`/opt/screener/backups/6ccb516a4726-precutover-20260821T101426Z` preserves the
-database, environment, artifact digests, firewall snapshot, and exact previous
-target. Exact `1331fbddb59fc2b0b99ba9e5ee4848768ae907c8` is the immediate rollback
-target; exact `261e980c3a9ff2d1a6b54ce18cf3daedb491b777` and
-`691863e1720ebbee1b5368f29e94f05b3710ccf8` remain secondary and tertiary.
-This release keeps one stable SFU subscriber stream, clears unavailable SFU
-video state, stays neutral until current media evidence proves P2P or SFU, and
-labels TURN plus a protocol only from actual local relay stats. Routing remains
-automatic across direct/peer and bounded fallback paths. This exact deployed
-release reapplies the selected P2P quality profile after each answer; the
-candidate source removes that answer-time workaround because its confounded
-A/B did not establish causality. Until that candidate is deployed, the browser
-still owns degradation under the exact-release behavior. P2P/browser-relay
-offers prefer H.264 through standard codec ordering, and SFU publication
-requests H.264 with backup codec disabled; the complete browser list retains
-negotiated VP8 fallback. The Host preview notice,
-shared entry/nickname UI, and two
-downstream slots per Web
-relay remain deployed; a third child remains rejected. Production
-STUN/SFU/selected-edge configuration and the database were unchanged.
-One-root healthy-SFU make-before-break reselection is now deployed with its
-revision/session/connection/media-proof and overlap guards; capacity `0 -> 1`,
-multi-root, browser/media, and production-route evidence remain open.
-Fresh exact-source acceptance passed typecheck, 32 test files/489 tests, both
-builds, and repository hygiene. Deployment verified both artifact manifests and
-hashes, one bounded production-only install, runtime imports, `node:sqlite`,
-UTF-8 paths, zero cross-release regular-file inodes, and immutable permissions.
-The public index and all three referenced hashed assets matched the release
-byte-for-byte; the deployment lock was released after the atomic switch.
-This cutover triggered no browser, media, SFU, TURN, or performance canary and
-remains exact-source, build, configuration, and deployment evidence.
-A separate earlier local Screener canary using exact `16f6eab` source and the
-production LiveKit/coturn tuple later proved active Host-ingress relay function
-without using the production application room or database; it is not
-broad-rollout or performance acceptance.
+Production currently runs exact `66eb337171931edaf5d621600c3803a186cf85ac`
+from `/opt/screener/releases/66eb33717193`; immediate rollback is
+`/opt/screener/releases/d315d333e0a8`. Local and public health return 200;
+Screener, LiveKit, coturn, and nginx are active, and Screener reports
+`NRestarts=0`.
+
+The current release deploys the bounded pre-share health/WSS/STUN self-check,
+privacy-safe click-only diagnostic JSON export, room admission default eight
+with explicit limits from one through sixteen, and peer-quality MBB v1. MBB v1
+selects only an ordinary peer-upstream Viewer candidate; Host and SFU-root
+provisional children remain open. Production keeps the two-edge endpoint
+default. The retained sixteen-Viewer and resource runs are ordinary-PC
+functional evidence only and do not justify cap3 or close performance gates.
## Topology and prerequisites
@@ -157,7 +122,7 @@ ICE. The accepted ladder is direct/peer UDP, then the revision-bound SFU/UDP
virtual parent, then optional authenticated TURN for one controller-selected
exceptional edge. LiveKit participants receive only revision-bound `sfu-config`
URL/token messages and negotiate within LiveKit's separate ICE domain. The
-selected-edge TURN config/wire is deployed in the current `6ccb516a` release with one
+selected-edge TURN config/wire is deployed in the current `66eb33717193` release with one
UDP URL and a 120-second credential TTL. It was not exercised by a real media
session during this cutover.
@@ -243,7 +208,7 @@ MAX_SFU_ROOTS_PER_ROOM=2
```
The rejected `PEER_ICE_TURN_*` participant-wide tuple is removed; supplying any
-stale key, even blank, fails startup. The source candidate uses the complete
+stale key, even blank, fails startup. The deployed source uses the complete
`SELECTED_EDGE_TURN_URLS`, `SELECTED_EDGE_TURN_SHARED_SECRET`, and
`SELECTED_EDGE_TURN_CREDENTIAL_TTL_SECONDS` tuple with one explicit TURN/UDP URI,
an independent secret and bounded TTL. The current production tuple uses the
diff --git a/docs/project-memory.md b/docs/project-memory.md
index c2aae4e0..9134fecc 100644
--- a/docs/project-memory.md
+++ b/docs/project-memory.md
@@ -28,7 +28,7 @@ Last updated: 2026-08-22
- Mobile endpoints are Web Viewer-only. Current Android/iOS browsers do not expose Web Host capture; AirPlay/system mirroring is Viewer-local output.
- ADR-0005: direct/peer UDP -> bounded SFU roots -> selected-edge TURN. The deployed controller caps pending/answered `peer-selected` at one per room; Host ingress is independent. A pre-`ecc794d` exact-source/production-media canary proves active Host ingress only. Ordinary peers stay STUN-only.
- `PEER_ASSISTED_MEDIA=true` covers all rooms. One-root healthy-SFU MBB is deployed with retained parent, media proof, Host2/browser1 overlap, cooldown and fresh two-window proof; it excludes `peer-selected`. Active-SFU loss uses normal recovery; the manual control keeps its route: peer restarts its edge, SFU reauthenticates signaling and rebuilds that subscriber. Capacity `0 -> 1`, multi-root/browser gates remain open.
-- C+B stays edge-local: severe and relative relay-FPS evidence give only the triggering child one ordinary peer-upstream Viewer MBB attempt while its old edge remains active; v1 excludes Host/SFU roots. Current-generation RTP, decoded frames, and live video atomically promote the candidate; a ready-then-failed identity survives until active/rollback, and an unrelated authoritative failure preempts the soft probe. Failure, timeout, or no candidate keeps the old edge without SFU/TURN. Sibling MBB remains separate. No score.
+- C+B stays edge-local: deployed MBB v1 gives only the triggering child one ordinary peer-upstream Viewer attempt while its old edge remains active; Host/SFU roots remain excluded. Current-generation RTP, decoded frames, and live video atomically promote the candidate; a ready-then-failed identity survives until active/rollback, and an unrelated authoritative failure preempts the soft probe. Failure, timeout, or no candidate keeps the old edge without SFU/TURN. Sibling MBB remains separate. No score.
- Flagship media is UDP; HTTPS/WSS stays TLS/TCP; the old release remains rollback-only.
- Treat settings as ceilings and degradation as unclassified. Use correlated Host A+B/Viewer C and one-variable evidence; never force AV1, infer by UA, or create a composite score.
- Screen audio: production Web capture requests speech processing off and ideal stereo. Share advanced settings offer 64/128/256 kbps sender ceilings, default 128, and lock the choice for the active share across P2P, browser relay, and SFU. Peer answers permit stereo up to 256 kbps; SFU keeps `forceStereo`, DTX off, and RED retained. Local Viewer details expose non-uploaded A/V playout, jitter-buffer, and concealment evidence. Target-browser/route proof remains open; voice and Native stay separate.
@@ -43,17 +43,17 @@ Last updated: 2026-08-22
## Current Implementation
- The repository is one npm package using Node.js 24, React, TypeScript, Vite, native WebRTC, `ws`, Zod, Vitest, and separate coturn.
-- Production: exact `d315d333e0a829b66e19d07afb7c081dc5a00800`, release `d315d333e0a8`, Web wire `screener-v5`; `083c11143748` is the rollback release.
+- Production: exact `66eb337171931edaf5d621600c3803a186cf85ac`, release `66eb33717193`, Web wire `screener-v5`; `d315d333e0a8` is the rollback release.
- Web keeps one SFU stream, clears unavailable video, exposes evidence-backed routes/transports and paused preview, and drops signals to a grace-retained offline current-edge target. Routing is automatic; entry/nickname UI is live; Native remains source-only.
-- Production Web endpoints use cap2 with one upstream; source supports an explicit deployment cap from one through three without a UA/visibility split.
-- Relay evidence is opt-in; direct proof and selected-pair addresses stay local, never in relayed evidence.
+- Production rooms default to eight Viewers and accept an explicit admission limit from one through sixteen. Web endpoints use cap2 with one upstream; source supports an explicit deployment cap from one through three without a UA/visibility split.
+- Relay evidence is opt-in; direct proof and selected-pair addresses stay local, never in relayed evidence. The deployed pre-share self-check uses disposable health/WSS/STUN probes and reports configured SFU as unverified until a real route. Click-only diagnostic JSON uses a fixed privacy allowlist; neither path uploads or persists a report.
- `screener`, LiveKit, coturn, and nginx are active; `screener` has `NRestarts=0`, local/public health are 200, and the endpoint-cap environment is unset so the parameterized default is two. SQLite v3 has five rooms, SHA-256 `aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`, owner/mode `screener:screener`/0600.
-- Production keeps ordinary ICE STUN-only, SFU roots <=2, selected-edge UDP TTL 120, and one pending/answered `peer-selected` attempt per room excluding Host ingress. This rollout ran no browser/media/SFU/TURN/performance canary; earlier exact-`16f6eab` evidence proves active Host ingress only.
+- Production keeps ordinary ICE STUN-only, SFU roots <=2, selected-edge UDP TTL 120, and one pending/answered `peer-selected` attempt per room excluding Host ingress. A post-deploy no-room browser self-check passed health, unauthenticated WSS open/close, and STUN `srflx` gathering without exposing candidate data; room media, SFU, TURN, and performance remain unverified. Earlier exact-`16f6eab` evidence proves active Host ingress only.
- Production requires independent `SITE_ACCESS_PASSWORD`: its stateless cookie authorizes creation/Host and code-only Viewer attempts; private grants stay direct, while public/private code entry needs site access alone/plus room password. Env/endpoint/cookie/nginx naming migrated atomically; failures remain neutral; there are no accounts/JWT/session rows. Local `gate:access-privacy` proves fragment isolation, site/grant transport-log absence, and raw room-password SQLite absence; room-password WebSocket/log ingress and live/headful evidence remain open.
- Production uses nginx, Node.js 24.19.0, coturn 4.17.2, and LiveKit 1.13.5 on UDP 7882 (TCP fallback off). Ordinary peer ICE receives no TURN; the selected-edge tuple is configured only for the current controller edge, with no credential pre-advertised to ordinary peers. Coturn retains the old authenticated-relay ports. Services are healthy with zero restarts.
- ADR-0005 rejects `PEER_ASSISTED_ROOM_IDS`; `PEER_ASSISTED_MEDIA=true` enables every room and ordinary peers stay STUN-only. Initial or active Host ingress may consume one bound relay-only grant; ready/abort clears it and failure restores peer baseline. Stale room-ID config fails startup. Production and source-only Native use `screener-v5`; Native does not subscribe to Web presence.
- Defaults are balanced with automatic codec and 128 kbps screen audio; clarity/fluid, H.264/VP8, and 64/128/256 kbps audio remain explicit. Codec and audio quality are locked during a share. LiveKit 2.22.0 SFU uses `q,h`; production exposes one Host-local current-`h` A+B snapshot and clears it on publisher identity changes. Target-browser field availability, actual media values, BWE, and route observation remain open.
-- Chrome 151 local functional evidence includes five-Viewer cap2 and sixteen-Viewer cap2/cap3 runs. All Viewers decoded; the sixteen-Viewer runs bounded Host/relay edges at 2/2 and 3/3, but final samples were only 320x180 at 9-10 fps and omitted process resource totals. Resource, visual quality, endurance, and heterogeneous-network behavior remain open.
+- Chrome 151 local functional evidence includes five-Viewer cap2 and sixteen-Viewer cap2/cap3 runs. All Viewers decoded, and a ten-second follow-up recorded guarded sender and aggregate Chromium CPU evidence, but resolution/FPS stayed low and the same-machine ordinary-PC runs do not rank cap2 against cap3 or close resource, visual-quality, endurance, heterogeneous-network, or 20-viewer gates. Production remains cap2.
## Provisional Quality Targets
diff --git a/docs/status.md b/docs/status.md
index e1ddd05a..a44ea2a9 100644
--- a/docs/status.md
+++ b/docs/status.md
@@ -6,19 +6,19 @@ This file is the current execution index. Load [verification status](./verificat
## Production
-- `https://share.bonfire.icu` runs exact `d315d333e0a829b66e19d07afb7c081dc5a00800`, release `d315d333e0a8`, wire `screener-v5`; `083c11143748` is the rollback release.
+- `https://share.bonfire.icu` runs exact `66eb337171931edaf5d621600c3803a186cf85ac`, release `66eb33717193`, wire `screener-v5`; `d315d333e0a8` is the rollback release.
- `screener`, LiveKit, coturn, and nginx are active, local/public health return 200, and `screener` has `NRestarts=0`. SQLite remains schema v3 with five rooms and mode 0600.
-- Ordinary ICE is STUN-only. Production allows SFU roots <=2, one `peer-selected` attempt excluding Host ingress, selected UDP TTL 120, and two downstream edges per Web endpoint. `MAX_PEER_RELAY_DOWNSTREAM_EDGES` is unset, so the parameterized default is active.
-- Stable SFU, route/transport truth, pause notices, entry/nickname UI, selected-edge lease authority, corroborated bad-relay demotion, Share audio presets, and local media-path diagnostics are live. Native remains source-only.
+- Ordinary ICE is STUN-only. Production allows SFU roots <=2, one `peer-selected` attempt excluding Host ingress, selected UDP TTL 120, room admission default eight with explicit limits from one through sixteen, and two downstream edges per Web endpoint. `MAX_PEER_RELAY_DOWNSTREAM_EDGES` is unset, so the parameterized default is active.
+- Stable SFU, route/transport truth, pause notices, entry/nickname UI, selected-edge lease authority, corroborated bad-relay demotion, Share audio presets, local media-path diagnostics, pre-share self-check, privacy-safe diagnostic export, and peer-quality MBB v1 are live. MBB v1 selects only an ordinary peer-upstream Viewer candidate; Host/SFU-root provisional children and sibling MBB remain open. Native remains source-only.
## Current Product Snapshot
- Capture precedes room creation. Balanced, automatic codec, and 128 kbps screen audio are defaults; clarity/fluid, H.264/VP8, and 64/128/256 kbps audio are deployed next-share choices. Codec and audio quality lock during a share.
- Local-only connection details expose current Host SFU sender evidence, actual codec/fmtp and encoder fields, media-source/encode FPS evidence, A/V playout/jitter/concealment evidence, and selected candidate endpoints. These fields do not enter quality signaling, server state, logs, persistence, or route selection.
-- The source candidate adds click-only, versioned JSON export beside expanded connection details. A fixed allowlist excludes candidate addresses/ports, participant and room identity, raw signaling, URLs, and credentials; no report is uploaded or persisted. Production rollout is pending.
+- The deployed pre-share self-check uses disposable, no-room resources for health, WSS, and STUN `srflx` checks and treats configured SFU as unverified until a real route. Expanded connection details provide click-only, versioned JSON export; its fixed allowlist excludes candidate addresses/ports, participant and room identity, raw signaling, URLs, and credentials, and no report is uploaded or persisted.
- Private fragment grants enter directly; code-only Viewers need site access and private rooms additionally need their password. Credentials remain unstored. Web names and presence are session-only; duplicate names alone show an ID suffix.
- Rooms default to eight Viewers and accept an explicit admission limit from one through sixteen. Roots and ordinary Web relays are bounded to two downstream edges, Viewer upstream receive is free, and source permits an explicit endpoint cap from one through three. SFU root capacity remains separate.
-- Relay quality handling compares fresh child FPS with parent input. Two current corroborating children can pause one Viewer relay for 30 seconds and request peer-only reassignment. The source candidate keeps the triggering child's old edge while one ordinary peer-upstream Viewer proves current-generation RTP, decoded frames, and live video; v1 excludes Host/SFU roots, preserves ready-failure identity through commit/rollback, and lets unrelated hard failures preempt the soft probe. Failure, timeout, or no candidate keeps the old edge without SFU/TURN. Sibling MBB remains open.
+- Relay quality handling compares fresh child FPS with parent input. Two current corroborating children can pause one Viewer relay for 30 seconds and request peer-only reassignment. Deployed MBB v1 keeps the triggering child's old edge while one ordinary peer-upstream Viewer proves current-generation RTP, decoded frames, and live video; it excludes Host/SFU roots, preserves ready-failure identity through commit/rollback, and lets unrelated hard failures preempt the soft probe. Failure, timeout, or no candidate keeps the old edge without SFU/TURN. Sibling MBB remains open.
- A generation-bound 15-second initial-connect deadline enters ICE restart. One-root healthy-SFU make-before-break is deployed but media-unverified; capacity `0 -> 1`, multi-root, browser, and mobile gates remain open.
## Active Milestone
diff --git a/docs/verification-status.md b/docs/verification-status.md
index c38d059e..9e7b3ba7 100644
--- a/docs/verification-status.md
+++ b/docs/verification-status.md
@@ -8,15 +8,16 @@ This is the demand-loaded ledger for cross-cutting validation evidence and open
## Deployment Evidence
-- Production runs exact `d315d333e0a829b66e19d07afb7c081dc5a00800`, release `d315d333e0a8`, with `083c11143748` retained for rollback. The current cutover has service/health proof but no browser/media/SFU/TURN/performance canary.
+- Production runs exact `66eb337171931edaf5d621600c3803a186cf85ac`, release `66eb33717193`, with `d315d333e0a8` retained for rollback. A post-deploy no-room Chrome canary passed health, unauthenticated WSS open/close, and STUN `srflx` gathering without logging candidate data; room media, SFU, TURN, and performance remain unverified.
- Local/public health return 200; `screener`, LiveKit, coturn, and nginx are active; `screener` reports zero restarts. SQLite v3 has five rooms, SHA-256 `aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`, owner `screener:screener`, and mode 0600.
-- The endpoint-cap environment is unset, so Web endpoints use the parameterized default of two. Ordinary peer ICE stays STUN-only, SFU roots stay <=2, and selected-edge UDP authority is bounded to one pending/answered `peer-selected` attempt per room excluding Host ingress.
+- Room admission defaults to eight and accepts explicit limits from one through sixteen. The endpoint-cap environment is unset, so Web endpoints use the parameterized default of two. Ordinary peer ICE stays STUN-only, SFU roots stay <=2, and selected-edge UDP authority is bounded to one pending/answered `peer-selected` attempt per room excluding Host ingress.
- Share audio presets and local-only Host SFU, codec/encoder, A/V, and selected-candidate diagnostics are deployed. Their target-browser field availability and actual media values remain unverified.
+- The bounded pre-share self-check, privacy-safe local JSON export, and peer-quality MBB v1 are deployed. MBB v1 accepts only an ordinary peer-upstream Viewer candidate; Host/SFU-root provisional children and sibling MBB remain open. Real-route behavior remains part of the routing gate.
- Earlier exact-`16f6eab` evidence proves active Host ingress only; it does not prove the current release, initial Viewer ingress, healthy reselection, last-mile quality, or TURN performance.
## Retained Functional Evidence
-- Chrome 151 synthetic `1/3/5/8` and 720p30 runs preserved bounded fanout and decoding. A later two-second sixteen-Viewer loopback decoded all Viewers at Host2/relay2 depth four and Host3/relay3 depth three, but ended at only 320x180 and 9-10 fps without process resource totals. These prove function, not sustainable capacity or heterogeneous-network quality. See [peer-assisted media](./research/peer-assisted-media.md).
+- Chrome 151 synthetic `1/3/5/8` and 720p30 runs preserved bounded fanout and decoding. Sixteen-Viewer cap2/cap3 loopbacks decoded all Viewers and a ten-second follow-up recorded guarded sender and aggregate Chromium CPU evidence, but resolution/FPS remained low and the ordinary-PC data cannot rank the caps. These prove function, not sustainable capacity or heterogeneous-network quality, and do not change the production cap2 default. See [peer-assisted media](./research/peer-assisted-media.md).
- Chrome 151 with local LiveKit 1.13.5/client 2.22.0 proved one SFU/UDP root after `q,f` -> `q,h`: decoded frames advanced 3 -> 23, rendered frames reached 26, Host used one edge, leaves were clean, and TURN was absent. This is functional evidence only. See [low-server media routes](./research/low-server-media-routes.md).
- Host A+B and authenticated P2P Viewer C evidence is sanitized, generation-bound, read-only, and closed for stale, ambiguous, or SFU-fed reports. Production can expose a Host-local current SFU `h` snapshot and clears it on publisher identity changes; raw media metadata is not retained. See [realtime quality adaptation](./research/realtime-quality-adaptation.md).
- The built-in peer TURN canary was rejected after allocation passed but the direct Host/Pion Viewer path failed before forced relay. Full rollback restored STUN-only client ICE and zero allocations. See [built-in peer ICE TURN](./research/built-in-peer-ice-turn.md).
diff --git "a/docs/\351\234\200\346\261\202\347\220\206\350\247\243.md" "b/docs/\351\234\200\346\261\202\347\220\206\350\247\243.md"
index 5b5a2fff..6cf5b182 100644
--- "a/docs/\351\234\200\346\261\202\347\220\206\350\247\243.md"
+++ "b/docs/\351\234\200\346\261\202\347\220\206\350\247\243.md"
@@ -53,7 +53,7 @@
- [ ] SFU-root 中央兜底:产品部署目标必须提供经 canary 验收的单节点 SFU 资源;系统在 direct/peer UDP 不可用或明确拓扑预算无法接纳时自动把它作为主要中央兜底,不要求用户选模式。它只向总计一至两个必要 roots 出口;root 优先承担受限 peer descendants,没有可靠 relay root 时必要 viewer 只作为同一总上限内的零 descendants root。已关闭 PR #12 的显式整房 SFU 模式已被取代。room `1` 的历史 smoke 没有 retained SFU media;公网媒体、资源和恢复门禁仍适用于全站路由。
- [ ] 分享端桌面封装:用 Electron 固定 Chromium 版本、改善选源/热键/系统音频体验,同时保留 Web 观看端。
- [ ] Windows 应用音频:Windows 11 Native sender 使用本地 opaque window target 绑定 HWND、PID 与进程创建时间,只捕获所选游戏及其子进程的音频,避免把语音聊天或通知声一并分享;“全部系统声音”只能由分享者显式选择。普通 Windows 10 不具备当前 process-loopback API 门槛,必须明确标为未解决/不支持而不是伪兼容。浏览器无法证明或隔离任意进程音频时必须如实提示,原生捕获失败、无声或进程退出不得静默扩大为整机捕获。
-- [ ] 连接自检:开始分享前的本地自检先用无房间、无媒体、无凭据的临时资源验证站点健康、WSS 握手和当前部署 STUN 是否实际 gathered `srflx`;结果不得显示地址、URL、原始 candidate 或把 candidate gathering 称为带宽、性能或端到端可达。仅配置 SFU 时必须显示“已配置,需实际路由验证”,因为 token-free HTTP 预热不能证明 SFU ICE/UDP,真实 SFU/UDP canary 仍是未完成验收。启用 selected-edge TURN canary 时只报告脱敏的授权阶段与 selected candidate type,不输出 URL、username、credential、地址或原始 candidate;自检只覆盖当前 UDP 媒体梯级。
+- [x] 连接自检:开始分享前的本地自检先用无房间、无媒体、无凭据的临时资源验证站点健康、WSS 握手和当前部署 STUN 是否实际 gathered `srflx`;结果不得显示地址、URL、原始 candidate 或把 candidate gathering 称为带宽、性能或端到端可达。仅配置 SFU 时必须显示“已配置,需实际路由验证”,因为 token-free HTTP 预热不能证明 SFU ICE/UDP,真实 SFU/UDP canary 仍是未完成验收。启用 selected-edge TURN canary 时只报告脱敏的授权阶段与 selected candidate type,不输出 URL、username、credential、地址或原始 candidate;自检只覆盖当前 UDP 媒体梯级。
- [ ] 受限网络增强:短期鉴权 TURN 只能由完整、默认关闭的部署 tuple 与当前 room controller 启用,并且只能在 direct/peer UDP 与 SFU/UDP 均已按有界梯级失败后,向 controller 选中的当前异常 edge 一次性授权。普通 peer PC 从创建起保持 STUN-only;不得向整个 participant、房间或所有 peer connections 预发 TURN candidates。凭据必须绑定当前授权 session 与 route/connection generation、短期有效、内存态、一次性消费且不进入 URL、日志、浏览器持久化或 SQLite。媒体保持 UDP-only,全部路径耗尽后明确失败;TURN 不得被描述为更高清的传输方式。
- [x] Web 编码选择:高级视频设置提供 `自动 | H.264 | VP8`,默认自动使用浏览器/LiveKit 协商;显式选择只在下一次分享前用标准 codec preference 生效。直播中控件锁定并明确提示停止分享后可修改。P2P/浏览器 relay 保留完整 repair 与其他 codec 回退列表,SFU 保持 `backupCodec = false`,不维护第二套应用编码链。实际 codec/profile、encoder implementation 与 stats 是结果真相;H.264 可选不等于浏览器必走硬编,AV1 仍不得仅凭压缩率推断默认启用。
- [x] 诊断导出:Host 与 Viewer 在展开现有连接详情且存在本地 metrics 时可点击下载图标导出版本化 JSON。导出只逐字段白名单包含 route、direction、连接状态、protocol/candidate type、codec、分辨率、帧率、码率、丢包、jitter、RTT、限制、encoder 与音视频播放/修复指标;缺失值为 `null`。禁止导出 local/remote candidate address/port、连接或媒体内部 ID、peer/client/room/name、raw candidate/SDP、STUN/TURN URL、username、credential 或 token。文件只在点击时以本地 Blob 生成并立即回收 URL,不上传或持久化;Host 收到的 peer-relay 数据只可使用已有脱敏 evidence 字段。