Commit Graph
697 Commits
  • docs(adr): start topology improvement offline and decide moves by comparison
    The implementer's measurements and a reading of the tree change the proposal. A report every second is not free: every reported state change sends a full snapshot to every session, the room authority would hold private path facts, and Native lacks several counters. Frame counts are not comparable across layers or re-encoding. Stage 0 is therefore offline replay on exported diagnostics, a move is decided by comparing a candidate with the incumbent, observations open a comparison without deciding it, and capacity grows only on unmet demand with sibling proof. The wait after a silent parent death stays an open measurement.
  • docs(adr): propose quiet topology improvement
    The canon asks for a topology that keeps improving by itself without disturbing what works, and that nobody tunes. ADR-0018 proposes how: records and a shadow planner first, direct voice, capacity learned from what a node carried, placement by proved facts, and one proved move at a time for repair and promotion, with each later stage justified by the records of the first.
    
    It rests on two surveys of primary sources and on three designers who worked from the requirements, the canon and the verified evidence without reading the repository; the evidence note records where they agree, where they differ and which measurements are still missing. The three earlier rules stay: no weighted score, no media probe of an idle pair, no periodic re-solve.
  • docs(design): consolidate the founding model and public contract proposal
    Integrate the revised canon and proposed ADR-0017 from the cross-review queue. Preserve current instruction authority and limit a design hold to its dependent change. Correct the research scope for UDP collision probabilities and distinguish existing revocation from a proposed heartbeat lease.
    
    The public-contract ADR remains proposed. Implemented strict room commits and terminal-result validation have their own code commits and verification. Continuous topology improvement remains design work, supported by the existing stay/switch, idle-pair and voice controls.
  • docs(adr): separate what is settled before release from what waits
    ADR-0017 took the implementer's nine outcomes after the disputed facts were checked against the code. Five contracts are settled before the first public release, each with the reason it is costly to change later, and four wait for a consumer. The blanket claim that none could be corrected after release is gone.
    
    The design review corrects its description of the tree: the routing shape, the fanout range, the existing control-plane tests, the room writer written twice with no reachable difference, and the scope of the three NAT measurements. A full history page is 101 signed replies, which conversation.rs asserts.
  • merge: take the implementer's line through 35034f34
    The instruction file keeps the implementer's corrected precedence and gives the canon its place in the first layer. Below that layer a standard governs what it owns, so a principle that seems to contradict one is a reason to propose a change and not to set the standard aside.
  • docs(watch): explain who receives a shared video link
    State the existing direct-source sharing scope at selection: authorized room members receive the video link, and App delivery uses the sharer upload. The source website controls the lifetime of that link. This clarifies the accepted source model without changing media grants or forwarding policy.
  • docs(canon): state the founding design in one place
    The owner asked for one place that holds the core design ideas, extracted from the existing records and stated generally, so that a founding idea is not read with the same weight as a default or a dated decision beside it.
    
    docs/canon.md states them, as extracted from every ADR, standard and 3.0 design document and corrected by the owner statement by statement. AGENTS.md puts the canon in the first layer beside the invariants and links it from Product in place of the sentences it repeated. The design review's dated list of decisions becomes a pointer to the canon. TODO gains the two pieces of work this leaves: a design for quiet topology improvement, and separating the canon from derived design in the documents.
  • docs(research): record the owner's four product decisions
    The design review left four questions with the owner. All are answered: the
    tunnel stays and IPv6 and port mapping are used alongside it; a Browser may
    relay by re-encoding under the present pool design, only when needed, by the
    same rule as every node; the room link is not end-to-end encrypted now,
    because the signed opaque payload lets it be added later behind a
    capability; and the desktop shell uses the system web view where it has
    WebRTC and the system browser otherwise, as the tree already does.
    
    Also record what the exchange established: P2P-first and keeping load off a
    single machine are founding decisions, and a change at that level is
    confirmed with the owner before anything else changes.
  • docs(research): record why direct paths matter and correct the review
    The owner stated the purpose behind P2P-first: Piik is meant to be
    decentralized and usable by anyone, and no single machine should have to
    carry a room. AGENTS.md now says so in its product section, so that a relay
    is read as the fallback and effort on difficult NATs as part of the product.
    
    The review said all three clean-room designs rejected port prediction and
    left the decision open. Reading the designs again, none argued that
    prediction is unreliable. Each relied on a forwarder always being reachable,
    and the brief they were given allowed the site to forward without stating
    the decentralization goal. The review now says that, gives the measurements
    for the cases the techniques target (carrier-grade NAT port allocation from
    Richter et al., prediction success from Guha and Francis, search odds from
    Tailscale's analysis), and records the owner's decision. What it keeps from
    the designs is the shape: a found address is a candidate for the one ICE
    agent.
  • docs(adr): propose the contracts that must be fixed before release
    3.0 is unpublished, so a wire or storage shape can still be replaced without
    aliases or migrations. Two defects contradict what versioning promises and
    cannot be corrected once an App or a room store is in the field: Join
    requires one exact protocol number while readers reject unknown fields, and
    a room store opens only at one exact schema version with no upgrade path.
    
    ADR-0017 proposes nine decisions: a compatibility rule of matching major
    plus additions behind capabilities with tolerant readers, one schema source
    with generated declarations, one reply shape that tells a rejection from an
    unknown outcome, a state revision, commands addressed by scope with one
    activity envelope, storage versions with forward migrations, a room store's
    epoch and change sequence, one set of history rules with a durable Browser
    commit, and one encoding for bytes. It leaves the serialization format,
    SQLite in the Browser and the client engine's place to later decisions.
    
    The evidence is recorded as research: three designs written from the
    requirements alone, none of which saw the repository, set beside three
    audits of the tree. The review also records where the tree knows more than
    the designs, chiefly how a home-run site behind carrier-grade NAT is
    reached, and four product decisions that stay with the owner.
  • fix(app): use native window activity for attended actions
    WebView can retain document focus after another Windows application becomes
    foreground. Project each Piik window's actual activation into its document
    and share that fact across message feedback, read markers, shortcut ownership
    and remote-input reset. Keep media visibility and room grants independent.
    
    The same real foreground-window transition reproduces silence and premature
    read advancement on beta.53, then triggers cues and preserves unread position
    on the candidate. Returning to Piik advances the cursor. Audio output was
    muted in the experiment; oscillator execution and completion were measured.
    All 2315 Web tests, TypeScript and the Windows capture-enabled App check pass.
  • docs(network): record distinct-port search and retirement controls
    The current Native kernel-NAT run confirms distinct targets on the wire,
    completion of the original pair and socket release on withdrawal. Preserve
    the earlier 256-target evidence and the distinction between controlled
    mechanism checks and a population connection-success rate.
  • docs(architecture): record the 3.0 core and answer cross-review
    Adopt the shared Rust core decision as the existing 3.0 architecture record,
    separating domain rules from its optional SQLite implementation and keeping
    user/accepted design authority above implementation evidence. Scope the replaced
    Go-backend decision to 3.0; public 2.x remains separately accepted.
    
    Answer every third-round item and request a failure snapshot from the machine
    that reproduces RTP lease reuse. Clarify that the earlier shared-future checks
    were local mechanism experiments rather than retained App integration tests.
    Keep unfinished package and field validation in the existing TODO.
  • fix(watch): retain confirmed source handoffs across reconnects
    The room retains the original source and current successor for its subscribed
    viewers. Ordinary snapshots project that typed predecessor, including when a
    viewer misses more than one replacement. Local playback and receiving-method
    choices remain with the Browser.
    
    Remove one-shot channel event decoration. Joining, leaving, access loss and
    session expiry retire the room record. A leave for an already-retired screen
    is routed only through that viewer's authorized pending handoff.
    
    Core regressions exercise both cross-kind chains, session recovery, revocation,
    fresh sessions and independent viewer exits. Shared Web schemas and Native
    constructors use the same pending Domain 46 contract. The existing network
    design owns the lifecycle; no persisted-data format changes.
  • refactor(review): integrate the independently reviewed 3.0 queue
    Accept the shared byte-distribution owner, supervised transport retirement,
    distinct random-port probes, software keyframe interval and lazy-load retry.
    Preserve the review branch's commits and authorship.
    
    Use the one-writer cross-review mailboxes. Narrow the proposed lifetime rules
    to demonstrated ownership problems rather than requiring a universal interface
    or a restructure after every repeated fix. ADR-0015 remains proposed.
    
    Use the active prototype as its explicitly scoped pre-cutover base and invoke
    the vcpkg bootstrap by a fixed relative path. Independent trace reviews and
    the queue's recorded controls support these choices; combined checks follow
    with the concrete mailbox fixes on the same development branch.
  • fix(watch): prepare a new player without retiring the active webpage
    Keep a borrowed page and its active media reader alive while the host inspects
    another player. Commit the candidate only after the room accepts it, then retire
    the previous reader through the page owner. The native caption reopens the same
    source chooser without navigating the logged-in page.
    
    Validation: 2298 Web tests, TypeScript, Windows same-page A/B cancellation and
    commit controls, 41 current Windows page tests, Linux page tests and both Android
    ABIs. Two cancellation assertions were updated to expect the released empty slot.
    The ownership and source-selection contract is in channel-network-design.md.
  • fix(native): probe distinct ports in the random UDP search
    The searching side of a random-port preparation sent 512 requests but
    cycled twice over the same 256 ports. Coverage, not the number of requests,
    sets the chance that a probe reaches one of the peer's 256 mappings: with M
    mappings and N distinct targets in a pool of R ports the idealized hit
    probability is 1 - exp(-M*N/R), as docs/research/nat-traversal.md records.
    For M = 256 and R = 64,512 that is 63% at N = 256 and 87% at N = 512, for
    the same packets, pacing and deadline.
    
    A second pass over one set only protects against a lost request, and it
    loses to distinct targets at any loss rate: at 30% loss the repeated set
    covers about 233 ports and the distinct set about 358. The peer signals
    Ready after its mappings exist, so a first probe is not early.
    
    The request budget stays 520 and the pool side is unchanged. Lab evidence
    in nat-traversal.md was taken with 256 targets and is not re-measured here.
    
    Reference: https://tailscale.com/blog/how-nat-traversal-works (birthday
    search against a hard NAT).
  • fix(app)!: bind Android capture confirmation to its request
    Present the Android confirmation entry only after its capture is registered, and keep late intents scoped to that capture. Rejected desktop preparations no longer cancel another pending OBS source.
    
    BREAKING CHANGE: Internal Web and App builds must use App Control protocol 24. Domain protocol and saved-data formats are unchanged.
  • feat(transport): reuse native sockets and support TURN streams
    Native peers can use configured TURN over TCP or TLS and share ordinary IPv4 sockets within their endpoint runtime. Retire the last socket and gateway owner without interrupting sibling paths. Preserve explicit viewer playback errors, bound desktop decoder inputs, and stop copying cancelled retained files.
  • fix(routing)!: recover constrained paths through the shared pool
    Room planners describe authorized missing connections, and channel admission tries alternatives when a preferred peer is full. Retain completed pairs until payload grants take over, bound discovery advice by the existing frame limit, and detach retained file bytes before temporary cleanup.
    
    BREAKING CHANGE: Internal participants must use Domain protocol 44.
  • fix(app): preserve room navigation and reconcile local activity state
    Keep launch metadata in the room fragment so same-site invitations retain the document and active sharing. Preserve confirmed microphone state during capture permission, acknowledge confirmed empty history, and retire local watch intent through writer recovery. Consolidate actionable App guidance and distinguish local and invitation addresses. Move signed payloads without copying and import only the semver functions used.
  • fix(media): complete late IPv6 discovery and clarify input failures
    Start the existing NAT64 lookup when initial ICE gains its first usable IPv6 address, and retire it at nomination. Distinguish unsupported OBS offers from observed SPS limits. Keep invitations bound to their room and preserve usable playback controls in short windows.
  • feat(channel)!: improve retained previews and enforce one data owner
    Retain image previews up to 1280 pixels within the existing message budget, supplied by the shared Core limit. Require Domain 43 for new image writes while preserving App Control 23 and existing storage and backup formats. Hold the channel directory lock with its last writer and remove redundant storage locking. Align compact header branding and reuse the shared native drag region.
  • refactor(runtime): consolidate media and conversation ownership
    Keep applied Browser quality in the media owner and submit each Native domain view to the RTC driver once. Propagate shared signaling failures to carrier recovery, bound Node history by the Core page contract, and reuse unchanged voice-level samples. Clarify room-writer and version-specific presentation responsibilities.
  • fix(media): preserve selected paths and aligned source data
    Clear obsolete ICE send errors on path selection and check source assignment through an OS bind. Include queued microphone frames before mixing, preserve live HLS time anchors, and refresh path-scoped cookies across media redirects. Keep authorized physical connections visible during signaling recovery and clarify endpoint roles in the shared graph.
  • feat(app): add voice shortcuts and scoped recovery controls
    Share selected video URLs for independent browser playback while retaining explicit byte forwarding. Bring original-page sharing into the player list, verify workspace destinations, and keep local startup independent of external site checks.
    
    Reuse voice actions for page and Windows background shortcuts, derive troubleshooting from current operation facts, and keep floating tools below the native caption.
  • perf(channel): admit concurrent connections and reuse interface state
    Bound in-flight work per channel and endpoint while preserving shared paths, recovery precedence and current connection proof. Reuse the runtime interface monitor instead of scanning before every peer, and remove one RTP payload copy.
  • feat(channel): pool connections and isolate activity lifetimes
    Reuse bounded channel connections for independently authorized room activities and retire the shared room-tree bootstrap. Keep current physical proof separate from recovery history and activity delivery proof.
    
    Preserve operation ownership across room replacement, source selection, microphone changes and native window retirement. Bound data sends before the channel is installed and recheck room grants at the final write.
  • refactor(channel)!: separate connection and delivery lifetimes
    Build shared connections from authorized intent before preparing payloads. Select source paths independently for media, files and webpage bytes, retaining healthy leases through handoff and signaling recovery.
    
    Channel protocol 39 adds the required screen-helper intent projection. App control and persisted formats keep their existing identities.
  • fix(core): keep independent operations recoverable
    Scope file failures to their requests, preserve accurate route failures and validate Server settings before initialization. Repair source capability and observation lifetimes, restart failed WASM loading, and align playback, input and read-marker state with the owning operation.
  • docs: align test guides with the shared help layout
    Reuse the published help navigation and theme while preserving 3.0 workflows. Record matched webpage retry and OBS restart acceptance at their existing evidence owners.