Commit Graph
95 Commits
  • feat(protocol)!: use product versions for Domain and App admission
    Declare major and minor once at admission and preserve each session's numbers
    beside its signing key. Equal majors admit different minors; incompatible
    majors reject before consuming launch authority and identify the older side.
    App discovery, Native readiness and Web diagnostics keep that direction.
    
    Resolve build identity before compilation. Browser values and displayed version
    share the same build input; the Node SDK reads its actual WASM version. Remove
    the two private wire identifiers without aliases for obsolete internal builds.
    
    Basis: the accepted compatibility rule in Versioning and ADR-0017. Validated
    Core, Web/WASM, Windows reader and App discovery controls. Real packaged SDK
    3.0 and 3.1 each completed signed conversation and private-room history against
    the other Linux Server minor. Browser/App mixed-artifact acceptance remains open.
  • feat(protocol)!: separate App creation inputs and extensible readers
    Create room policies at the authenticated writer from allocated IDs and user
    settings. Confirm typed opened results; cancel reservations only on a definite
    settings rejection. Ignore harmless App extensions without retiring unrelated
    requests, while keeping stored rows strict at their consuming boundary.
    
    Let text participants select a conversation snapshot at Join, and repair an
    unsupported host turn through the existing synchronization owner. This replaces
    the private App open request and result shape; matching internal artifacts are
    required until the first public contract is frozen.
    
    Basis: ADR-0017 and the interface extension contract; same-connection App,
    SQLite/WASM, signed history and standalone Server controls. Combined Web tests,
    focused Native tests, and TypeScript checks passed after correcting obsolete
    fixtures. The affected App storage-collision integration cases were not rerun.
  • feat(protocol): unify Domain outcomes and selected history parts
    All Domain terminal results use one correlated reply carrier; observer notifications cannot settle waiters. Hosted storage keeps its internal completion until commit, and unknown registration outcomes do not cancel possibly committed rooms. History requests select inline images before page budgeting and replies report actual coverage, so text-only consumers save transfer without erasing cached images. The exact staged tree passed complete Core SQLite checks (341 plus one release-only ignore), fresh-WASM Web checks (2567 tests), Windows Native and Server builds and 17 runtime controls. Chrome IndexedDB controls separately verified selective paging and clearing. Private aliases and extra capability flags were not retained.
  • fix(access): space failed password retries per room member
    After a wrong password, the host waits two seconds before hashing another guess from that member. Other members, existing grants and valid invitations remain independent. Transient host memory survives command rollback but is not persisted; no configurable or permanent lockout is added. The complete Core suite, actual Native restore/admission, and Chrome WASM/IndexedDB 1999ms/2000ms boundary controls pass.
  • refactor(nat): prepare candidates on the original RTC connection
    Start bounded Native preparation beside ordinary ICE on the Core-authorized pair, with both ordered STUN surveys running concurrently. Adopt the authenticated socket and its reader into the same Runtime turn, preserve ICE/DTLS identity and existing deadlines, and retire only optional preparation on refusal, failure or queue pressure. Remove the replacement-attempt state, deferred normal signaling and old prepared-socket constructor.
    
    Domain 54 rejects mismatched private clients because initial UDP signaling and failure semantics change. Rust and Web constants move together; App 27 and stored formats do not change. The equal-step classifier, packet/socket budgets and ordinary routing policy are retained. TURN provenance remains bounded unknown when it cannot be proved.
    
    The matched sequential-NAT control delivers H.264, Opus and a verified file on the original pair. Core, Native, Server, Web/WASM and protocol gates pass; Android ARM64 and x86_64 JNI compile/link and ELF checks pass. The real Native Session fixture now acknowledges actual binding/revision output rather than waiting again for an already received sibling reply. The full Web suite passes 2451 checks. Established TURN migration and public network rates remain explicit acceptance work.
  • fix(watch): preserve viewing across webpage source changes
    Keep the original-page group and watching intent when its selected player disappears; retire that candidate's grants and pending work, freeze the existing playback clock, and replace the next explicit source through the existing handoff. Native candidate identity owns the containing-page address and sample events, so a popup or prepared player cannot inherit another player's URL or buffering state.
    
    Separate an optional navigable website locator from the existing byte-source capability. Opaque indexed and MPD media remain forwardable without exposing a private manifest or inventing a root URL. Original-page entry and recovery use the actual locator. Private Domain 52 and App 27 change together; persisted room data and backup formats do not change.
    
    Independent red/green controls cover popup identity, opaque forwarding and candidate event isolation. The integrated Web suite passes 2433 checks and the complete Rust/WASM/protocol gate passes. The final retained-viewer recovery has 67 focused presentation checks and two producer-to-view controls. Native Page checks pass with the existing GUI test ignored; actual member websites and window interaction remain package acceptance work.
    
    The existing App cancellation test now checks its actual sole-waiter scope; the separate multi-reader Session regression proves that canceling one borrower preserves the others. No timeout was enlarged or failing assertion suppressed.
  • refactor(app): let the Domain initialize its own authority
    Generate the local owner key only when creating the Domain checkpoint. App settings keep their permission namespace and stop creating a duplicate secret. Existing and restored Domain keys remain authoritative; explicit Server seed configuration is unchanged. Focused startup, consent, restore and ticket controls and the full Rust/Server/protocol gate pass.
  • fix(server): refuse recognized 2.x startup configuration
    Both official 2.x Compose definitions inject PIIK_ENV. Refuse that configuration before frontend loading, listening or data initialization, with a clear version-specific remedy. A bounded actual-executable test verifies refusal and untouched data; Rust/Web/WASM/protocol integration checks pass. Unmarked manual legacy setups are not detected by this guard.
  • refactor(storage): persist domain identities as individual rows
    Keep Identity as the authority, while a Domain SQLite transaction writes the admitted user and conditionally updates the small domain header. Normal startup hydrates the same model without rewriting it. This removes full-history profile rewrites and preserves recovery of a previously uncommitted room directory without a dirty-state mechanism.
    
    The private Domain physical format is 1; Room SQLite remains 10 and portable archives and wire versions are unchanged. Unsupported old private databases remain untouched. A matching old build can export the existing domain archive for import into a fresh directory.
    
    Paired local Release controls at 2000 retained identities measured join 17.78 to 4.17 ms and rename 7.75 to 4.02 ms. Full Rust, Native, WASM, protocol and 2394 Web checks pass. Actual old-Linux-export/new-Windows-import preserves credentials and records; real Browser hosting verifies storage scope and byte-bounded signed history across five pages. Correct obsolete fixture assumptions about standby pairs and private room admission.
  • feat(forwarding): make Server forwarding an operator-controlled fallback
    The owner decided how a Server forwards. Forwarding spends the operator's
    bandwidth, so the operator offers it and it is off by default. Once offered,
    rooms use it without a second switch, a room manager can decline it, and the
    service ranks after participant paths (canon: P2P first, load is shared, the
    same rule for every node, automatic).
    
    a. Operator switches. PIIK_CHANNEL_SERVICE_TRANSIT is the master switch, off
    by default. PIIK_CHANNEL_SERVICE_TRANSIT_SCREEN, _VOICE and _FILES default to
    true and each turns one kind off. Files include original video forwarded for
    watching together. With the master switch off nothing is offered. The offer
    reaches room hosts with the service socket. The room removes the service from
    the relays of a kind it does not offer, and the channel rejects a projection
    that gives the service such a kind as site transit. A service that offers no
    kind reads as unavailable.
    
    b. A new room allows the service. Creation paths apply only an explicit
    choice, so Browser, App and Server-hosted rooms and room copies take the
    default, and a stored false stays false. The setting reads as declining a
    default, and its note says the site forwards only the kinds its operator
    offers, in all five locales.
    
    c. The planner names the service as the fallback. When a route is assigned it
    first extends the tree with participant relays only, then lets the service
    reach the receivers still waiting. It keeps that tree unless the joint tree,
    where the service may take a scarce output, serves more receivers, so ties go
    to participants. A strict participant-first pass could spend the source's
    outputs on direct listeners and leave those reachable only through the
    service unserved; a test reproduces that. The ranking among participants is
    unchanged.
    
    The rule applies when a route is assigned. A receiver already served through
    the service keeps that route until it fails or demand ends, even if a
    participant path appears later. A screen viewer can still make the usual move
    to a direct path from the person sharing.
    
    Left open: in a public room the service's session has ordinary read access,
    so a modified room host can list it as a plain participant relay, without the
    transit view that carries the room's choice and the operator's kinds, even
    when forwarding is off. Closing it needs the channel to recognise the
    Server's own session by identity in rooms that session does not host.
    
    Tests added in channel-core: a participant wins over the service; the service
    serves only receivers no participant path reaches; the service takes a scarce
    source output when that serves more receivers; a moved child takes a ready
    participant before the service; the service carries only the kinds its
    operator offers; a service that offers no kind reads as unavailable; a new
    room uses the offered service until its manager declines. Expectations
    changed for the new default in host_review, service_transit, stored_room and
    the first test of tests/service-transit-wasm.test.ts.
    
    Verified on the lane: cargo test for piik-channel-core with and without
    sqlite, cargo check for channel-server and channel-browser, the
    room_creation_policy test, a rebuilt WASM package, tsc -b, the whole vitest
    suite and the docs check. The channel-native suites were not run.
  • fix(app): exchange one-use tickets for local owner entry
    Chrome retained the original fragment URL in its persistent History database even after replaceState. App-owned navigation now issues a short-lived single-use ticket; the existing local Join consumes it under the domain lock. Ready, launcher links and terminal reopening no longer carry the durable bootstrap seed. Personal credentials keep their current reconnect and storage behavior.
    
    The ticket follows the short-lived, single-use bearer principle described in RFC 6749 section 4.1.2; this is an internal local bootstrap, not a new OAuth implementation. No public Join field or saved-data format changes. Full Rust, real Native session, Browser/WASM and protocol checks plus 2342 Web tests pass. Matching Windows WebView package acceptance remains in TODO.
  • test(runtime): coordinate races and allocate UDP independently
    Use request barriers to select the updater provider instead of millisecond
    sleep races. Allocate the integration test's UDP port through UDP rather than
    assuming the OS accepts the separately allocated TCP port.
    
    Refresh RTP baselines at the actual warm switch and compare modular progress.
    Keep media reuse deadlines and add failing phase/cycle context. This improves
    test causality without claiming the reported intermittent capture failure fixed.
  • fix(native): isolate individual room storage failures
    Opening or installing one room must not retire independently hosted siblings.
    Handle that failure at the existing room operation, retain global directory
    and identity failures as host failures, and report the failed CLI room ID.
    
    Session and real Server tests cover a locked room, creation installation
    failure, healthy sibling chat/history, recovery after unlocking and a second
    process that cannot steal an existing binding. Invalid global layout still
    ends the HTTP service and leaves the data unchanged.
  • 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(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.
  • fix(runtime): serialize room views and preserve active encoders
    Read Browser room summaries after their storage turn, enqueue authority fanout in order, and validate ICE configuration before first-start persistence. Retain derived encoding incumbents during original-source handoff. Cancel attachment preparation promptly, refresh device choices on entry, and restore the complete known profile directory after reconnect.
  • fix(runtime): preserve source intent and isolate scoped failures
    Keep media selections explicit across refreshed catalogs and let page playback commands progress while buffering. Align file availability with eligible sources, restore independent rooms after policy refusal, and retain pending Unicode releases. Correct Android root failure reporting, bookmark refresh, lazy-module guidance and compact playback feedback; use the shared native modal backdrop for the title bar.
  • 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.
  • feat(channel): host rooms and reuse verified relay connections
    Apply channel creation and moderation rules at the room and directory owners. Reuse confirmed connections across sources, admit forwarding per payload, and preserve a working subscription when a relay leaves.
    
    Private builds use channel protocol 31, App control protocol 21 and the versioned room history format.
  • fix(app): restore approved connections and refine shared playback
    Preserve explicit App approval, expose playback and transfer progress, and keep shared identity and native window presentation coherent. Retain terminal fallback, cancel external input safely, and reject withdrawn UDP preparation before adoption.
    
    Reuse exact Web artifacts across matched targets and extend the existing text participant with typed history, replies and reactions. Verified Rust/WASM/protocol checks, 1614 Web tests, Windows capture compilation and five external input lifecycle tests.
  • fix(app): initialize TLS before webpage resource reads
    Install the configured ring provider at shared App service startup. Keep a fresh-process regression that reproduces the first-reader panic without prior HTTPS or WSS initialization.
  • feat(watch): control webpage players through the desktop App
    Keep webpage playback in an isolated Windows WebView profile and bind its lifetime to the approved App connection. Browser viewers use an available media URL directly; other viewers explicitly open the original webpage through their App. Advance private domain/App protocols to 19/10 without storage changes.
  • fix(backup): preserve committed restore outcomes on reconnect failure
    Report room and domain restores that reached durable storage separately from subsequent registration failures. Keep the restored identity, remove the repeated-restore confirmation, and preserve pre-commit rollback and ordinary room-open errors.