Commit Graph
821 Commits
  • perf(wasm): transfer delivery bytes without JSON expansion
    Return FileDelivery and WatchDelivery effects in their existing order with owned Uint8Array payloads. Serialize only metadata through the original JSON path, retaining its integer semantics. Switch all attachment and watch consumers together, including failures and projection; no Cargo dependency or wire-format change.
    
    Validation: matched release-WASM controls measured 64 KiB Watch at 2.60 to 1.13 ms and 1 MiB File at 27.73 to 3.90 ms median local CPU. Actual Chrome production consumers verified OPFS/Watch hashes and a terminal outcome for a range beyond JS safe integers. The integrated 700 consumer tests and TypeScript passed. Compressed WASM grew 4146 bytes; no remote-throughput claim.
  • fix(protocol): validate terminal results at their waiting operation
    A matching room reply must carry the outcome expected by the original operation. Browser and Node reject unknown results locally while ignoring observers and wrong-room IDs. Preserve invitation payload events followed by done, and distinguish joining Watch from leaving it. Core dispatch explicitly matches its current result variants.
    
    Validation: corrected three old Watch mocks that returned watch_ready to a leave operation; all 617 Browser/Node tests passed independently. The integrated delivery and interaction consumer run passed 700 tests and both TypeScript projects compiled. No new wire field or enum generator is added.
  • fix(protocol): accept additive watch activity metadata
    Strip unknown descriptive fields on the watch activity envelope, matching the ordinary state readers and shared Core. Keep playback field validation and source-kind/source-field checks strict; no command or wire version changes.
    
    Validation: the new display-label control failed before the change and all 12 image/wire checks passed after it. The combined client check passed 640 tests and TypeScript.
  • fix(interactions): bind readiness to its current request
    Integrate the reviewed interaction follow-up with exact subscription correlation. Unknown and late replies cannot close or activate another owner. Delivery failures preserve the logical reaction request and nonce, including retries, while a signed writer rejection retains its distinct meaning.
    
    Accept the instruction layering with scoped corrections: current user authorization remains authoritative within system/developer bounds, failure recovery is distinct from feature state, and Core extraction must reduce ownership cost. Fresh old/new policy evaluations chose the same six outcomes; this supports clarity, not a claim that the prior rules caused over-handling.
    
    Validation: two new counterexamples failed on the incoming interaction commit; the corrected client suites and wire metadata control passed 640 tests and TypeScript. Policy and documentation checks run through the repository hook.
  • fix(interactions): settle a refused reply at the room's interaction owner
    The domain now tells a waiting reader when it refused to relay the writer's
    signed reply: a room_reply error under the room and the original request id,
    room_busy while the read floor is pending and room_access_required for a
    confirmed denial. Ordinary requests settle through the session's request
    table. Room interactions do not use that table. The readiness handshake and
    reactions belong to RoomInteractionSession, so the handler found no request
    and dropped the refusal. A refused readiness reply left the room's
    interactions unready until something else rebuilt them, and a refused
    reaction waited out its five-second timer.
    
    A writer's signed error means the operation was rejected. A refused reply
    means the outcome is unknown, because the operation may have committed. The
    session keeps that difference: an undelivered reaction becomes unconfirmed at
    once and keeps its request id and nonce, so the same reaction retries under
    that nonce and a committed nonce settles without replaying the effect.
    
    settleInteraction is now the one place an interaction request ends without
    its reply: the signed error record, the refused relay and a failed local
    send all go through it. A subscription that did not complete closes the
    owner, and the existing readings sync subscribes a replacement.
  • fix(conversation): return refused replies to their waiting reader
    After validating the current writer, signed scope and visible recipient, deliver permission-gate refusals through the existing room-scoped reply. Use room_busy while the read floor is pending and preserve room_access_required for confirmed denial. Existing client request owners ignore observer copies and cross-room IDs; the Node pending request records its room scope.
    
    The deterministic SQLite control previously left a committed chat retry waiting while the refusal went only to the writer. Core SQLite passed 316 checks with one separate release-capacity check ignored; 612 Browser/Node checks and Node type checking passed. Browser explicit same-draft retry retained its nonce. This adds no wire field or authority queue; the independent Browser interaction handshake remains open.
  • fix(markdown): leave incomplete external links as text
    Keep the existing external-scheme boundary and validate authored destinations with the URL constructor before creating a link. A missing HTTPS host now preserves the label. Use the constructor available at the browser build baseline instead of introducing URL.canParse.
    
    Validation: the malformed-link regression and the shared chat/release-note suites passed all 12 checks; TypeScript passed. No new URL normalization, protocol or link-fetch behavior was added.
  • fix(launcher): cancel state reads superseded by a command
    The launcher now retires its old GET when a setting command starts or the component unmounts, so focus can fetch the current state without waiting for an obsolete request. One abort controller replaces the parallel reading flag and revision counter; command ownership remains separate.
    
    Validation: the five stale-read controls failed before the change; 56 focused tests, TypeScript and a real Chromium/HTTP held-response control passed. The same fix is applied to the maintenance launcher.
  • perf(input): reuse the current authority snapshot serialization
    ChannelInput keeps one JSON representation of its current snapshot and session.
    Every frame still reads the current context and is validated by Core. Replacing
    the snapshot, changing session or resetting the owner invalidates the cache.
    
    For 1000 frames on the large legal fixture, serialization falls from 1000 calls
    to two across one authority change. Real WASM routing still switches the first
    updated frame and rejects the first revoked frame. The retained entry-point
    regression and all 28 scoped input tests pass, as does TypeScript.
  • fix(preview): honor native activity in optional preview pausing
    Use the same document-activity fact as other attended actions when automatic
    preview pause is enabled. Preserve manual pause and picture-in-picture behavior;
    the capture and independent consumers retain their own lifetimes.
    
    Focused tests and Chromium React controls cover native deactivation with stale
    DOM focus, restoration, explicit disablement, manual pause and the PiP exception.
  • fix(app): cancel an individual shared source-list reader promptly
    Each caller owns its cancellation result while the catalog request remains
    shared. Aborting one reader rejects it immediately; only the last cancelled
    reader aborts the underlying App request. The regression checks cancellation
    before a response while another reader still awaits the shared catalog.
  • fix(sdk): retire failed connections before returning to callers
    Handshake and initial room selection share one acquisition boundary. On failure,
    terminate the owned WebSocket and await its existing close cleanup before
    returning the original error. The participant keeps its signer for a retry;
    stop remains its terminal owner.
    
    Real loopback WebSocket controls confirm immediate retry after both rejection
    points. Existing stop and SDK tests pass; no parallel request teardown is added.
  • 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.
  • refactor(watch): name the uncommitted native candidate explicitly
    The pending Native resource can be absent while the selector already names a
    player, and is cleared on promotion while the selection remains visible.
    Name it pendingCandidateId instead of conflating it with watchSources' selected
    candidate. Existing selection/cancellation regressions and full Web checks pass.
  • fix(playback): read output failure from the actual video sink
    PageSuppliedMedia wraps an HTMLVideoMedia player, so a source-level optional
    failure flag missed its underlying output. Query the shared playback-output
    owner with the actual video element and remove the extra media-adapter field.
    
    The wrapper regression fails on the previous candidate and passes with this
    change. The production 320-pixel preview exposes device recovery and preserves
    the chosen output; 100 focused tests and the full TypeScript check pass.
  • Merge remote-tracking branch 'origin/feat/channel-prototype' into refactor/claude-review
    Three documents conflicted where both sides recorded ADR-0016 as accepted
    for 3.0 in different words (its status line, ADR-0012's status and the
    documentation owner map). The implementer's versions are taken; they also
    carry its factual corrections to the record. session.ts merged cleanly
    with the history owner.
  • refactor(channel): give a room's history window one owner
    A room's chat history lived in three places: the view's messagesByRoom,
    historyByRoom and historyChangesByRoom, which the history code read back as
    its own state; a PendingHistory riding inside the generic request records;
    and three loops that walked every pending request to patch pages under
    assembly. Each transition had to carry the others' state by hand, which is
    where the repeated "keep/preserve history across X" fixes landed.
    
    RoomHistory in room-history.ts now owns, for one room under its current
    binding, the confirmed window, its paging facts, the removal markers and
    the pages being assembled, keyed by request id. It is pure: the page
    construction from request(), the history_message and history_end assembly,
    and the state parts of applyHistoryRemovals, applyReactionSnapshot,
    applyHistory and applyMessage moved into it, together with
    withReactionSnapshot and the exported HistoryRefresh type. The session keeps
    request correlation, authorization and binding checks, every effect,
    follow-latest, the interaction session and read markers.
    
    The three view fields keep their shape and content but are now projections
    of the RoomHistory objects with one writer, historyView. Every place a
    request leaves the request map goes through retireRequest, which drops its
    page in the same step. applyState drops a room's RoomHistory where it
    dropped the three maps; retireReadings resets the window and keeps the
    removal markers, as before.
    
    Behaviour is unchanged; the existing suite passes without edits, and
    tests/room-history.test.ts drives the new owner directly.
  • fix(delivery): release a runtime whose first projection fails
    Free the constructed WASM delivery before propagating an initial projection
    failure. Subsequent demand still uses the existing retry and lifetime owner.
    The regression fails without the release and passes alongside attachment tests.
  • fix(playback): retain picture-in-picture through source handoff
    Stage owns the retained window while existing players release their media.
    Follow an authorized typed successor only after subscription and video readiness;
    retain an empty window for the existing waiting card. User close, dismissal and
    access revocation release the window without reopening it.
    
    Shared PiP and fullscreen controls use the video's actual document, including
    same-origin floating windows. React regressions and real Chromium controls cover
    delayed and cross-kind handoffs, marker removal, waiting, close and revocation.
    Native video PiP remains an empty window while no video is available.
    
    The document and activation boundary follows https://w3c.github.io/picture-in-picture/.
  • fix(playback): expose output device failures at the waiting player
    Track failed sinks at the shared output owner, so a healthy player does not
    inherit another player's failure. Reuse the playback-device selector in the
    waiting surface and keep the user's explicit choice until they change it.
    
    Detached sinks release their failure state. Device recovery and sibling output
    tests pass, and a 320-pixel production preview verifies one concise status and
    the existing device control. Static rendering has a client-capability snapshot.
  • fix(watch): give the source chooser its own page lease
    An active player ending must not close a page still used by its source chooser.
    The chooser holds and releases its own page reference; an accepted player holds
    the successor reference. Keep Native candidate identity separate from lifetime.
    
    Pass candidate confirmation with the commit operation rather than retaining
    the callback in retryable selection state. Regressions cover original-page
    and forwarded sources ending before chooser cancellation, with one final close.
  • 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.
  • fix(watch): clear a retired source from its pending replacement
    If the old player ends while the source chooser is preparing another video,
    the request must no longer name that retired activity as its predecessor.
    Clear the matching selection reference at the player's existing retirement owner.
    
    The regression reproduces watch_identity_conflict before the fix and starts
    the replacement afterward. Full Web verification passes on the integrated tree.
  • 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.
  • Merge remote-tracking branch 'origin/feat/channel-prototype' into refactor/claude-review
    room.rs conflicted where the active line added Watch.replace_id beside the
    parents and refused fields that the queue moved into ByteTree. Both are
    kept: Watch carries replace_id and one ByteTree.
  • fix(channel): retry a failed delivery runtime load on the next demand
    FileDelivery and WatchDelivery memoized the promise that loads the WASM
    runtime with `??=` and cleared it only on session reset. A rejected load
    therefore stayed cached for the whole session, and because the data paths
    swallow that rejection, file transfer and forwarded watch bytes stopped
    silently until the page reconnected.
    
    A failed load is not a runtime. Clear the cached promise when it rejects,
    checking that it is still the current one, so the next plan update, read
    or incoming message loads again. This is the rule initializeRuntime in
    room-host.ts already follows.
  • fix(media): preserve shared encoding through pause and resume
    Read the negotiated codec separately from active allocation so pausing a sender does not permanently disable shared encoding. Refresh native page placement when pixel density changes and refresh selected-source labels when their title attributes change.
  • fix(ui): keep drafts and operation feedback in their room
    Retire quoted content after explicit access revocation without dropping drafts during a room writer restart. Bind a pending file picker to its original conversation, keep room record actions independent, and clarify narrow terminal help and local-network troubleshooting.
  • fix(watch): preserve sync intent and retire pending players
    Distinguish local timeline changes from autoplay refusal and present the matching recovery action. Stop YouTube, MP4 and native HLS acquisition after their owner closes. Remove repeated screen-selection cleanup and clarify the remaining RTC consent acceptance boundary.
  • fix(app): preserve action feedback and software video color
    Keep room deletion failures with their initiating surface and retain room identity after that surface closes. Recover local autoplay guidance when the owner pauses, preserve narrow playback focus, and remove duplicate SDK shutdown cleanup. Declare the software encoder output color from its configured SDR contract.