Room defaults and personal relay limits now use the existing route controller. Hosts can set the room default; viewers can follow it or select a lower or higher personal limit, including zero. Lowering a limit uses the existing handoff, and retired connection attempts no longer consume a later viewer's opportunity. The candidate also preserves native sharing when its local preview fails, prefers a preview-compatible codec in Auto mode when the App supports it, and improves terminal shutdown, input failure feedback and attached-menu positioning. Validation: Web type checks, 1,936 frontend tests and the production Web build pass. Server, routing, Native host and media-edge tests and vet pass. Real three-viewer browser checks cover default/override synchronization, receive-only, signaling reconnect, downscaling to a chain and automatic recovery after increasing an exhausted route's limit. Narrow-screen, theme and visual-mode control previews were inspected. Current field investigations remain open: the niri-specific capture failure (#499), the Windows input-refusal trigger (#502), the UU title-only load report and the older capture/source-cadence reports. These are not claimed fixed by this release. ## Release notes **Piik, now in your pocket.** Piik App supports Android screen sharing, with touch controls for a friend's computer. **手机,也能开播。** Piik App 支持 Android 屏幕分享,也能用手机控制朋友的电脑。 ### English - Set a room-wide default relay limit. Viewers can follow it or set their own higher or lower limit; zero receives without forwarding. Limits still follow each device's capability, and route selection remains automatic. - Improve connection recovery when viewers join during route preparation or a peer connection is rebuilt. Canceled connection attempts no longer prevent later retries, and rebuilt routes require fresh media before showing as ready. - Keep native sharing active when the host's local preview cannot play. Automatic selection prefers a codec the browser can preview when the App supports it, and restoring a preview preserves its playback state. - Improve App shutdown when its terminal closes and complete macOS permission descriptions. - Retain useful remote-input failure feedback while pending key releases clear. Fix attached-menu scroll jumps, invisible tooltips intercepting clicks and volume guidance when source sound is unavailable. This update preserves the existing 2.x compatibility baseline. The new relay settings require an updated site; older pages retain their previous relay behavior. ### 中文 - 房主可以设置房间默认转发上限。观众可跟随默认,也可自行调高或调低;设为 0 时只接收、不转发。实际额度仍受设备能力约束,线路继续自动安排。 - 改善观众在建立线路期间加入,以及连接重建后的恢复。取消连接尝试后,后续连接仍可正常重试;重建后的线路收到新画面才会显示就绪。 - 房主本地预览无法播放时,原生分享继续。App 支持时,自动选择优先采用浏览器可预览的编码,恢复预览时保留原有播放状态。 - 改善终端关闭时 App 的退出流程,补齐 macOS 权限用途说明。 - 释放待处理按键期间保留远控失败提示;修复附属菜单导致的滚动跳动、不可见提示拦截点击,以及没有分享声音时的音量说明。 本次更新保持现有 2.x 兼容约定。新的转发设置需要更新站点,旧页面保留原有转发行为。
7.6 KiB
Project Memory
Last updated: 2026-11-06
Piik is private, low-latency screen sharing for one Host and up to 20 authenticated friends. The current product surface is Web Host, Web Viewer, and Browser relay; desktop and mobile Browsers are Viewer targets. Browser hosting uses the capture capabilities available on the device. It is not a public broadcast service. Hosted and App run one shared Go core (ADR-0012); Node and Vite build the Browser UI and are not a runtime. Desktop and Android Apps run that same core in a self-contained Local deployment or supply native capability to explicitly approved Sites through the system Browser and shared Web UI. Each App's Go process starts the loopback capability service before room selection. The persistent launcher offers Local and temporary public-link choices and manages per-Site local approval and one starred startup Site. Site use can remain on standby without a Local room service; native media still belongs to the participant's Web UI. Room source and media implementation are independent: a topology may mix Browser and Native peers without changing participant, signaling, capacity, or route identity. Local is LAN-first; explicit one-link mode exposes that same authority through a temporary public control tunnel while media remains P2P. Host authority belongs to a tab, with one separate persistent origin resume hint. The desktop App admits two independent native control sessions under its one loopback service.
The Hosted Go process embeds Binding-only STUN and optional SFU forwarding. Native and SFU use one shared Pion/LiveKit media adapter. Native parents reuse encoded outputs and derive missing lower outputs from direct-child demand; adaptation preserves the source and higher sibling outputs. Eligible Browser capture and relay share local WebRTC producers under ADR-0014, with ordinary senders as fallback. Platform producers share the encoded-frame boundary and Host quality controls. Source replacement preserves route and connection identity.
Product Map
- Rooms and access owns room codes, invitations, code entry, credentials, room interactions and lightweight/SQLite persistence.
- Routing and transport owns P2P-first distribution, endpoint capacity, SFU fallback, recovery, and privacy limits.
- Capture and media quality owns Browser capture, profiles, codec selection, audio, and framework adaptation.
- Presentation and lifecycle owns Host and Viewer workflows, playback authority, roster, state, and Browser lifecycle.
ADRs own architecture decisions; research owns measurements and platform limits. Engineering maps and source index locate implementation owners and their module, interface and lifecycle boundaries.
Core Invariants
- Rooms use random four-digit codes, exact Host ownership, room-scoped Viewer
invitations and independent
open | privatecode entry. Room authority ends through replacement/deletion, with separate invitation rotation or revocation. Hosted operators may opt into empty-room expiry and capacity reclamation; the default retains rooms indefinitely. Hosted defaults to SQLite, with explicit process-memory opt-out; App Local remains process-only, with an optional site-access password. Site access has a separate 24-hour idle cookie lifetime within one service run. Production persists SQLite room authority; live participants, routes, and media remain process-only. - Media is automatic and distributed. Ordinary peers are STUN-only and prefer direct/peer UDP. A deployment may enable same-host auxiliary STUN for bounded, room-wide, connection-local NAT prediction; current pages use it automatically when available, and anonymous provenance distinguishes ordinary from predicted selected paths. The configuration default remains stock ICE. The only application fallback is one bounded embedded SFU/UDP publication; Piik configures no TURN or TCP media route. Hosted operators may require SFU-only media through the same controller. On P2P-first sites, a pre-share peer-only policy can exclude that SFU suffix for one share generation.
- Endpoint limits follow the room default or the Viewer's personal choice, bounded by actual capability under the capacity owner. One room controller owns one committed graph, one reconcile loop, and one serial child operation. First decoded frame commits picture availability work; accepted quality work adds native edge proof before commit in that operation.
- Browser WebRTC and the shared Pion/LiveKit media adapter own congestion control, media adaptation, pacing and layer selection. Parent demand is local to direct children and never a room-wide minimum or topology rebalance. Current source defaults persistent native-edge local P2P convergence on, with a pre-share Host opt-out. SFU quality work is limited to multi-root Host fanout relief; each Viewer must prove candidate non-regression before commit. One bounded same-parent regeneration may repair a persistently limited edge through that same operation; the routing owner defines its eligibility and damping. No weighted score, all-pairs probe, general parent-wide prediction, or periodic rebalance is accepted.
- Browser video uses
motion; each share chooses H.264 with VP8 fallback through an actual sender probe unless the Host explicitly selects VP8 or H264. Screen audio retains its compact presets and 128 kbps default. The 2.0 contract separates numeric bitrate requests from those UI shortcuts; implementation limits and admission remain in the media-quality owner. - Viewer playback uses one native video element. Presentation and recovery are fenced by current route/media identity and current-frame proof; hidden-page time alone is not media-failure evidence or a keepalive guarantee.
Current Snapshot
Room voice shares room authority and one route controller with picture sharing. Picture generations and explicitly joined voice publications have separate lifetimes. Optional source commentary belongs to the share and runs independently of room voice. Room media owns these lifecycles.
Optional attended input follows the committed media route back to the native Host. One grant covers keyboard/mouse and an optional gamepad. Control starts with one grantee; the Host may allow simultaneous approved Viewers for that source. Older published clients retain exclusive keyboard/mouse control. Source change, stop and revocation retire the affected grants. It adds no separate connection planner or listener. Viewer playback preferences and the combined interaction window remain local presentation owners under the existing 2.x compatibility boundary.
The current contract tuple is owned by status. Embedded SFU SDP/ICE and demand use the authenticated room WebSocket. Deployment owns rollback with matching Browser and App artifacts.
Unfinished work is owned by the TODO ledger. Status indexes delivery; verification status summarizes evidence boundaries. Configuration and self-hosting own environment and services. Release descriptors and deployment records own exact deployed identity; Git and pull requests own completed history.