5.6 KiB
5.6 KiB
Native 2P Contract Matrix (Join + Mute/Volume)
Sources:
web/ai/native-client-2p-recording/20260228-210957-seth-native-2p-mute-volume.logweb/ai/native-client-2p-recording/20260228-211006-david-native-2p-mute-volume.log
Intent
Define what web-client mode must preserve vs what can diverge while keeping frontend/backend control-plane behavior aligned with native.
Tier A: Must Implement (Behavioral)
These methods/events directly participate in join/session lifecycle, participant presence, and mute/volume controls.
| Surface | Item | Baseline Evidence | Web-client Requirement |
|---|---|---|---|
| jamClient method | JoinSession |
seen once per join | Must execute and transition session state; trigger equivalent downstream flow |
| jamClient method | LeaveSession |
seen on session exit | Must execute and clean state/media |
| jamClient method | SessionPageEnter |
seen on session page load | Must return compatible object shape for existing guards |
| jamClient method | SessionRegisterCallback |
seen before runtime events | Must store callback name/handler and route bridge events |
| jamClient method | RegisterSessionJoinLeaveRequestCallBack |
seen in david run | Must preserve callback registration behavior |
| jamClient method | ParticipantJoined / ParticipantLeft |
seen in session lifecycle | Must keep participant state transitions consistent |
| jamClient method | ClientJoinedSession / ClientLeftSession |
seen in david run | Must preserve per-client lifecycle notifications |
| jamClient method | SessionGetAllControlState |
49/71 calls | Must provide control-state snapshot consumed by UI/stores |
| jamClient method | SessionSetControlState |
54/46 calls | Must apply mute/volume changes and keep UI+server pattern aligned |
| jamClient method | getConnectionDetail |
high-frequency polling | Must provide values needed by connection UI/presence logic |
| jamClient method | P2PMessageReceived |
30/32 calls | Must process incoming signaling/control payloads |
| jamClient method | UpdateSessionInfo |
periodic updates | Must keep session metadata refresh behavior |
| jamClient method | SessionSetConnectionStatusRefreshRate |
seen twice each | Must preserve periodic status cadence behavior |
| REST | POST /api/sessions/:id/participants |
once per join (both logs) | Must remain one POST per join action |
| REST | PUT /api/sessions/:id/tracks |
repeated during mute/volume ops | Must keep same endpoint/method semantics for track control |
| REST | GET /api/sessions/:id |
repeated polling/refresh | Must maintain session refresh cadence compatible with stores |
| REST | GET /api/sessions/:id/history |
seen once | Must preserve join/session hydrate flow |
| REST | DELETE /api/participants/:client_id |
seen once per leave | Must preserve leave teardown semantics |
| websocket receive | PEER_MESSAGE |
dominant event type | Must preserve message class and dispatch path |
| websocket receive | TRACKS_CHANGED |
seen during control updates | Must preserve track refresh trigger behavior |
| websocket receive | SESSION_JOIN / SESSION_DEPART |
seen during presence changes | Must preserve participant presence events |
| websocket send | PEER_MESSAGE |
dominant outbound type | Must preserve signaling/control channel pattern |
Tier B: Must Exist, Stub/Approximation Acceptable
These are invoked but not critical to core web-to-web mute/volume MVP.
IsNativeClient(web mode should returnfalse; callsite guards required)getClientParentChildRole,getParentClientIdSessionSetUserName,LastUsedProfileName,SetLastUsedProfileNameFTUEGetExpectedLatency,FTUEGetChannels,FTUEGetAllAudioConfigurationsFTUEGetGoodAudioConfigurations,FTUEGetConfigurationDevice,FTUEGetChatInputVolumeFTUECurrentSelectedVideoDevice,FTUEGetVideoCaptureDeviceNames,FTUEGetVideoShareEnableFTUEGetStatus,FTUEGetCaptureResolution,FTUEGetCurrentCaptureResolutionGetNetworkTestScore,NetworkTestResult,GetOSAsString,getOperatingModeSessionSetAlertCallback,RegisterVolChangeCallBack,setMetronomeOpenCallbackOnLoggedIn,ClientUpdateVersion,ResetPageCounters,ReloadAudioSystem,SetLatencyTestBlocked,SetVURefreshRate,SetScoreWorkTimingInterval,SessionGetMacHash,IsAudioStarted,IsAppInWritableVolume
Tier C: Deferred / Native-Only (safe to keep null/no-op in web mode)
- VST and MIDI surface:
hasVstAssignment,IsVstLoaded,VSTListSearchPaths,VSTListTrackAssignments,VSTListVsts,VST_GetMidiDeviceList,VST_ScanForMidiDevices
- Legacy recording-manager hooks not needed for current web MVP:
RegisterRecordingCallbacks,RegisterRecordingManagerCallbacks
Parity Rules for Automated Comparison
- Join cardinality: exactly one
join-dedupe.createand one participantPOSTper user join action. - No duplicate in-flight join: no
join-dedupe.reuseduring normal single-click join. - Track-control behavior: mute/volume actions must produce
PUT /api/sessions/:id/tracksupdates and correspondingTRACKS_CHANGED/refresh behavior. - Control-plane continuity: websocket
PEER_MESSAGEsend/receive remains active during session runtime. - Leave behavior: one participant
DELETEon leave and participant/session teardown events observed.
Immediate Build Order
- Implement Tier A
WebJamClientmethods with stable return shapes. - Integrate WebRTC signaling over existing
PEER_MESSAGEpath for web-client mode. - Wire mute/volume UI actions to existing track control flow (
SessionSetControlState-> REST + state updates). - Add parity checks against rules above using collected debug-log artifacts.