From 320bf04d0b6eac6fa88fbe0897dbfc988412e522 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:17:40 +0700 Subject: [PATCH 01/11] refactor(gui G-MV36): pure exact FX HWND dispatch and correlated ACK lease policies --- web/approved-fx-rack-view-model.js | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/web/approved-fx-rack-view-model.js b/web/approved-fx-rack-view-model.js index c1a551758..c0da00858 100644 --- a/web/approved-fx-rack-view-model.js +++ b/web/approved-fx-rack-view-model.js @@ -388,6 +388,39 @@ Object.keys(current.lease).every(key=>current.lease[key]===lease[key]); } + // G-MV36: physical ChannelId VST3 / ImmerSIB editors use the original + // JUCE HWND only when the EXACT G-MV31 accepted instance lease survives. + // Logical .smix and native built-in /preview/ editor owners stay separate. + function nativeEditorDispatchPlan(snapshot,lease,{hardwareConfiguration}={}){ + if(lease?.authority!=="CHANNEL_ID"|| + !editorNavigationLeaseMatches(snapshot,lease,{hardwareConfiguration})) + return {kind:"UNAVAILABLE"}; + return {kind:"READY",action:"routingFxEditor", + payload:{channelId:lease.channelId,slot:lease.slot, + instanceId:lease.instanceId,deviceEpoch:lease.deviceEpoch, + revision:lease.graphRevision}}; + } + // One pure HWND ACK policy for M4 and ChannelId: transport requestId AND + // installed FX instance must match, and the current accepted hardware, + // route, roster, catalog and owner must still hold the exact click lease. + // Called with ack=null by the controller on every accepted PCM snapshot; + // this retires stale HWND requests even if the native host never responds. + function nativeEditorAckResult(pending,ack,snapshot,{ + verifiedM4=false,offline=false,hardwareConfiguration}={}){ + if(!pending)return "IGNORE"; + const lease=pending.lease; + const valid=pending.authority==="CHANNEL_ID"? + lease?.authority==="CHANNEL_ID"&& + editorNavigationLeaseMatches(snapshot,lease,{hardwareConfiguration}): + pending.authority==="M4"&& + m4EditorDispatchLeaseMatches(snapshot,lease,{ + verifiedM4,offline,hardwareConfiguration}); + if(!valid)return "STALE"; + if(!ack||ack.requestId!==pending.requestId)return "IGNORE"; + if(ack.instanceId!==lease.instanceId||ack.ok!==true)return "REJECTED"; + return "ACKED"; + } + // G-MV34: one physically admitted ChannelId FX owner for bypass/insert. // The bridge supplies the canonical existing native device fingerprint. // Historical pure/partial fixtures without the optional fingerprint stay @@ -599,6 +632,7 @@ return Object.freeze({powerReadback,mountedRackMatches, m4Presentation,nativePowerSettlement,m4PowerPlan,m4RackAckResult, m4RackSettlement,m4EditorDispatchPlan,m4EditorDispatchLeaseMatches, + nativeEditorDispatchPlan,nativeEditorAckResult, m4InsertPlan,m4InsertAckResult,m4InsertReadbackSettlement, editorNavigationPlan,editorNavigationLeaseMatches,m4EditorPlan, nativeInsertPlan,nativeEditPlan,nativeInsertSettlement, From c6d81a38152fc617e4b30d6c26ce864156254ed9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:18:13 +0700 Subject: [PATCH 02/11] refactor(gui G-MV36): one fenced FX editor IPC and one-shot native ACK lifecycle --- web/approved-native-bridge.js | 54 ++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 109d16152..81f726510 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -1307,6 +1307,7 @@ return true; } let pendingFxInsert=null,fxRequestSerial=0,nativeCatalog=new Map(); + let pendingFxEditorAck=null,fxEditorSerial=0; // HWND feedback, never PCM owner // One pending M4 insert is owned by the bridge until ACK AND independent // accepted Console-v6 snapshot. A stale/superseded ACK can never open HWND. function reconcileM4FxInsertReadback(snapshot){ @@ -1330,6 +1331,31 @@ return decision; } + // One original native editor transport for M4 and ChannelId vendor FX. + // The publisher's accepted lease is checked again BEFORE calling this. + function dispatchPhysicalFxEditor(plan,lease,authority){ + const requestId="fx-editor-"+(++fxEditorSerial); + pendingFxEditorAck={requestId,authority,lease}; + backend.emitEvent("arMixAction",{action:plan.action,requestId,...plan.payload}); + window.setTimeout(()=>{ + if(pendingFxEditorAck?.requestId===requestId)pendingFxEditorAck=null; + },8000); + } + function openChannelIdFxEditor(lease){ + if(lease?.authority!=="CHANNEL_ID")return false; + const accepted=controller?.state()?.current; + const plan=fxRackVM.nativeEditorDispatchPlan(accepted,lease,{ + hardwareConfiguration:protocol.nativeHardwareConfiguration(accepted?.device)}); + if(plan.kind!=="READY")return false; + window.queueMicrotask(()=>{ + const current=controller?.state()?.current; + if(fxRackVM.nativeEditorDispatchPlan(current,lease,{ + hardwareConfiguration:protocol.nativeHardwareConfiguration(current?.device)}).kind!=="READY") + return; // reject stale same-epoch pin/roster/FX replacements + dispatchPhysicalFxEditor(plan,lease,"CHANNEL_ID"); + }); + return true; + } function openRoutedFxEditor(lane,slot,instanceId,deviceEpoch,revision, hardwareConfiguration){ const accepted=controller?.state()?.current; @@ -1347,7 +1373,7 @@ verifiedM4:m4Verified(current),offline:!!logicalView, hardwareConfiguration:protocol.nativeHardwareConfiguration(current?.device)})) return; - backend.emitEvent("arMixAction",{action:plan.action,...plan.payload}); + dispatchPhysicalFxEditor(plan,lease,"M4"); }); return true; } @@ -2723,6 +2749,7 @@ activeNativeSource=null;nativeUiSourcePending=null;pendingSourceId=0; pendingOutputPatch=null;pendingNativeFxPower=null;pendingGlobalFx=null; pendingBusCreate=null;pendingTrackDelete=null;pendingFxInsert=null; + pendingFxEditorAck=null; // expire old native HWND on device owner change startupWire=null;activeWireAttempt=null;pendingNativeGainIntent=false; pendingWireGains.clear();pendingNativeControl.clear(); liveFaderVisualTargets.clear();lastNativeControlSent.clear(); @@ -3006,6 +3033,11 @@ emit:(name,payload)=>backend.emitEvent(name,payload), onAccepted:(next,confirmed)=>{ onNativeReadback(next,confirmed); + const accepted=controller?.state()?.current; + if(fxRackVM.nativeEditorAckResult(pendingFxEditorAck,null,accepted,{ + verifiedM4:m4Verified(accepted),offline:!!logicalView, + hardwareConfiguration:protocol.nativeHardwareConfiguration(accepted?.device)})==="STALE") + pendingFxEditorAck=null; syncGlobalFxReadback(); }, onStatus:state=>{ @@ -3232,11 +3264,16 @@ controller?.subscribe(); }); backend.addEventListener("arMixRoutingFxEditorAck",ack=>{ - if(ack?.ok!==true) - nativeToast(ack?.error||"FX editor could not open"); - // A successful native HWND is its own feedback. Do not send a - // generic status("... editor opened") that the UI translates to - // the misleading "Effect settings updated" toast. + const accepted=controller?.state()?.current; + const verdict=fxRackVM.nativeEditorAckResult(pendingFxEditorAck,ack,accepted,{ + verifiedM4:m4Verified(accepted),offline:!!logicalView, + hardwareConfiguration:protocol.nativeHardwareConfiguration(accepted?.device)}); + if(verdict==="IGNORE")return; // obsolete, duplicate or unrelated ACK + pendingFxEditorAck=null; // first ACK wins; no accepted PCM mutation + if(verdict==="REJECTED") + status("FX editor rejected ยท "+String(ack?.error||"native editor unavailable")); + // Original JUCE emitNotice reports errors. Its HWND controls success. + // Never show the misleading generic "Effect settings updated" toast. }); backend.addEventListener("arMixRoutingFxInsertAck",ack=>{ const verdict=fxRackVM.m4InsertAckResult(pendingFxInsert,ack); @@ -3647,10 +3684,7 @@ } else { // Both vendor VST3 and ImmerSIB retain their exact real // JUCE HWND path; no parallel WebView editor authority. - backend.emitEvent("arMixAction",{action:"routingFxEditor", - channelId:editor.channelId,slot:editor.slot, - instanceId:editor.instanceId,deviceEpoch:editor.deviceEpoch, - revision:editor.graphRevision}); + openChannelIdFxEditor(editor); } }else nativeToast("This FX is held with the disconnected audio session"); return true; From b0b1d1060997c369c6d513464a701071ba6e471a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:18:33 +0700 Subject: [PATCH 03/11] fix(native gui G-MV36): echo FX editor requestId with real JUCE HWND ACK --- src/Main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index 51c1c95b4..fd6faf8ff 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -6272,6 +6272,9 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr ack->setProperty("ok",opened); ack->setProperty("error",error); ack->setProperty("instanceId",token); + // G-MV36: correlate the HWND result to its exact GUI click. + // The requestId is feedback only; it is not installed PCM proof. + ack->setProperty("requestId",args.getProperty("requestId",juce::var())); if(browser_.loaded)browser_.emitEventIfBrowserIsVisible( "arMixRoutingFxEditorAck",juce::var(ack.release())); if(opened)diagnostics_.record("ROUTED_FX_EDITOR_OPENED", From 9013aadfa53d29d8f5da7f688f03ae4ead89997e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:19:01 +0700 Subject: [PATCH 04/11] test(gui G-MV36): assert ChannelId editor reuses correlated pure lease dispatch --- tests/approved_native_m2_contract.test.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index 7471f7d41..a8cec58aa 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -3618,7 +3618,9 @@ test("ImmerSIB opens the exact native ChannelId HWND, survives VST3 editor, no s assert.match(bridge,/fxRackVM\.editorNavigationPlan\(current,/); assert.match(editorVM,/view\.raw\?\.mixerSession\?\.authority==="CHANNEL_ID"/); assert.match(bridge,/else \{\s*\/\/ Both vendor VST3 and ImmerSIB retain their exact real/); - assert.match(bridge,/backend\.emitEvent\("arMixAction",\{action:"routingFxEditor",\s*channelId:editor\.channelId,slot:editor\.slot,/); + assert.match(bridge,/openChannelIdFxEditor\(editor\)/); + assert.match(bridge,/fxRackVM\.nativeEditorDispatchPlan\(current,lease,/); + assert.match(bridge,/dispatchPhysicalFxEditor\(plan,lease,"CHANNEL_ID"\)/); assert.match(bridge,/else if\(editor\.authority==="LOGICAL"\)/); assert.match(bridge,/action:"logicalVendorFxEditor"/); assert.doesNotMatch(bridge,/else status\("Native VST3 editor opened"\)/); From de20deb3770967a0704be57e3c019045f3938c8a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:19:50 +0700 Subject: [PATCH 05/11] test(gui G-MV36): physical FX editor and native ACK regressions across M4 and ChannelId --- tests/approved_native_m2_contract.test.cjs | 133 +++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index a8cec58aa..650007978 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -6400,3 +6400,136 @@ test("G-MV35 native MOVE/REMOVE FX demands installed ChannelId hardware owner",( assert.match(bridge,/fxRackVM\.nativeEditPlan\(current,/); assert.doesNotMatch(pure,/backend\.emitEvent|document\.|window\.|setTimeout/); }); + +test("G-MV36 ChannelId vendor FX editor dispatch retains exactly one physical instance lease",()=>{ + const channelId="9007199254740993",epoch="31",revision="45",rosterRevision="18"; + const device={epoch,sampleRate:48000,bufferFrames:256, + enabledInputs:[0,1],enabledOutputs:[0,1]}; + const hardwareConfiguration=protocol.nativeHardwareConfiguration(device); + const snap={admitted:true,retained:false,device,raw:{ + mixerSession:{authority:"CHANNEL_ID",deviceEpoch:epoch}},graph:{ + revision,rosterRevision,capabilities:{callbackOwnsChannelIds:true}, + channels:[{id:channelId,role:"INPUT",inserts:[ + {id:"vst3-instance",catalogId:"vendor.alpha",bypassed:false}]}] + }}; + const original=JSON.stringify(snap); + const navigation=fxRackVM.editorNavigationPlan(snap,{ + channelId,slot:0,hardwareConfiguration}); + assert.equal(navigation.kind,"OPEN"); + assert.equal(navigation.lease.authority,"CHANNEL_ID"); + const plan=(snapshot=snap,lease=navigation.lease,hw=hardwareConfiguration)=> + fxRackVM.nativeEditorDispatchPlan(snapshot,lease,{hardwareConfiguration:hw}); + assert.deepEqual(plan(),{kind:"READY",action:"routingFxEditor",payload:{ + channelId,slot:0,instanceId:"vst3-instance",deviceEpoch:epoch,revision}}); + assert.equal(Object.isFrozen(navigation.lease),true); + for(const bad of [null,{}, {...navigation.lease,authority:"LOGICAL"}, + {...navigation.lease,workspaceToken:"other"}, {...navigation.lease,slot:1}]) + assert.equal(plan(snap,bad).kind,"UNAVAILABLE"); + for(const mutate of [ + s=>{s.device.epoch="32";},s=>{s.device.enabledInputs=[2,3];}, + s=>{s.raw.mixerSession.authority="M4";}, + s=>{s.raw.mixerSession.deviceEpoch="32";}, + s=>{s.admitted=false;},s=>{s.retained=true;}, + s=>{s.graph.revision="46";},s=>{s.graph.rosterRevision="19";}, + s=>{s.graph.capabilities.callbackOwnsChannelIds=false;}, + s=>{s.graph.channels[0].inserts[0].id="replacement";}, + s=>{s.graph.channels[0].inserts[0].catalogId="vendor.beta";}, + s=>{s.graph.channels[0].inserts=[];} + ]){ + const next=clone(snap);mutate(next); + assert.equal(plan(next,navigation.lease, + protocol.nativeHardwareConfiguration(next.device)).kind,"UNAVAILABLE"); + } + assert.equal(plan(snap,navigation.lease,"wrong-device").kind,"UNAVAILABLE"); + assert.equal(JSON.stringify(snap),original,"pure editor plan never writes PCM"); +}); +test("G-MV36 correlated FX HWND ACK guards request, device, roster, and plugin instance",()=>{ + const channelId="9007199254740993",epoch="51",revision="46"; + const device={epoch,sampleRate:48000,bufferFrames:256, + enabledInputs:[0,1],enabledOutputs:[0,1]}; + const hardwareConfiguration=protocol.nativeHardwareConfiguration(device); + const native={admitted:true,retained:false,device,raw:{ + mixerSession:{authority:"CHANNEL_ID",deviceEpoch:epoch}},graph:{ + revision,rosterRevision:"19",capabilities:{callbackOwnsChannelIds:true}, + channels:[{id:channelId,role:"INPUT",inserts:[ + {id:"native-fx-8",catalogId:"vendor.vst3"}]}] + }}; + const nav=fxRackVM.editorNavigationPlan(native,{ + channelId,slot:0,hardwareConfiguration}); + assert.equal(nav.kind,"OPEN"); + const pending={authority:"CHANNEL_ID",requestId:"fx-editor-7",lease:nav.lease}; + const verdict=(p=pending,ack=null,snapshot=native,hw=hardwareConfiguration)=> + fxRackVM.nativeEditorAckResult(p,ack,snapshot,{ + hardwareConfiguration:hw,verifiedM4:true}); + assert.equal(verdict(null,{requestId:pending.requestId, + instanceId:"native-fx-8",ok:true}),"IGNORE"); + assert.equal(verdict(),"IGNORE"); + assert.equal(verdict(pending,{requestId:"old",instanceId:"native-fx-8", + ok:false}),"IGNORE"); + assert.equal(verdict(pending,{requestId:pending.requestId, + instanceId:"wrong",ok:true}),"REJECTED"); + assert.equal(verdict(pending,{requestId:pending.requestId, + instanceId:"native-fx-8",ok:false}),"REJECTED"); + assert.equal(verdict(pending,{requestId:pending.requestId, + instanceId:"native-fx-8",ok:true}),"ACKED"); + assert.equal(verdict(pending,{instanceId:"native-fx-8",ok:true}),"IGNORE"); + for(const mutate of [ + s=>{s.graph.rosterRevision="20";}, + s=>{s.graph.revision="47";}, + s=>{s.graph.channels[0].inserts[0].id="retired";}, + s=>{s.raw.mixerSession.authority="M4";}, + s=>{s.device.enabledOutputs=[2,3];} + ]){ + const updated=clone(native);mutate(updated); + const hw=protocol.nativeHardwareConfiguration(updated.device); + assert.equal(verdict(pending,null,updated,hw),"STALE"); + assert.equal(verdict(pending,{requestId:pending.requestId, + instanceId:"native-fx-8",ok:true},updated,hw),"STALE"); + } + const m4Device={epoch:"55",sampleRate:48000,bufferFrames:256, + enabledInputs:[0,1],enabledOutputs:[0,1]}; + const m4Hw=protocol.nativeHardwareConfiguration(m4Device); + const m4={admitted:false,retained:false,device:m4Device,raw:{ + mixerSession:{authority:"M4",deviceEpoch:"55",routeRevision:"12", + channels:Array.from({length:10},()=>({role:"INPUT"}))}, + legacyM4:{active:true,routeAccepted:true,nativeBusStructural:false, + routingRevision:"12",fxInstances:Array.from({length:10},()=>[])} + }}; + m4.raw.legacyM4.fxInstances[4][0]={ + instanceId:"m4-fx",catalogId:"vendor.m4",bypassed:false}; + const accepted=fxRackVM.m4EditorDispatchPlan(m4,{ + channel:4,slot:0,instanceId:"m4-fx",deviceEpoch:55,revision:12, + verifiedM4:true,hardwareConfiguration:m4Hw}); + assert.equal(accepted.kind,"READY"); + const m4Pending={requestId:"fx-editor-9",authority:"M4",lease:accepted.lease}; + const m4Result=(p=m4Pending,ack=null,snapshot=m4,hw=m4Hw)=> + fxRackVM.nativeEditorAckResult(p,ack,snapshot,{ + verifiedM4:true,hardwareConfiguration:hw}); + assert.equal(m4Result(),"IGNORE"); + assert.equal(m4Result(m4Pending,{requestId:"fx-editor-7", + instanceId:"m4-fx",ok:true}),"IGNORE"); + assert.equal(m4Result(m4Pending,{requestId:"fx-editor-9", + instanceId:"m4-fx",ok:true}),"ACKED"); + const replacement=clone(m4); + replacement.raw.legacyM4.fxInstances[4][0].catalogId="other"; + assert.equal(m4Result(m4Pending,null,replacement),"STALE"); + assert.equal(m4Result(m4Pending,null,m4,"old-hardware"),"STALE"); + assert.equal(m4Result({...m4Pending,authority:"LOGICAL"}),"STALE"); +}); +test("G-MV36 one correlated native editor transport and JUCE echo, no duplicate toast",()=>{ + const bridge=read("web/approved-native-bridge.js"), + main=read("src/Main.cpp"),viewmodel=read("web/approved-fx-rack-view-model.js"); + assert.match(main,/if \(action == "routingFxEditor"\) \{/); + assert.match(main,/ack->setProperty\("requestId",args\.getProperty\("requestId",juce::var\(\)\)\);/); + assert.match(main,/ack->setProperty\("instanceId",token\);/); + assert.match(bridge,/function dispatchPhysicalFxEditor\(plan,lease,authority\)/); + assert.match(bridge,/backend\.emitEvent\("arMixAction",\{action:plan\.action,requestId,\.\.\.plan\.payload\}\);/); + assert.match(bridge,/dispatchPhysicalFxEditor\(plan,lease,"M4"\)/); + assert.match(bridge,/dispatchPhysicalFxEditor\(plan,lease,"CHANNEL_ID"\)/); + assert.match(bridge,/pendingFxEditorAck=null; \/\/ expire old native HWND/); + assert.match(bridge,/fxRackVM\.nativeEditorAckResult\(pendingFxEditorAck,ack,accepted,/); + assert.match(bridge,/if\(verdict==="IGNORE"\)return; \/\/ obsolete, duplicate or unrelated ACK/); + assert.match(bridge,/fxRackVM\.nativeEditorAckResult\(pendingFxEditorAck,null,accepted,/); + assert.doesNotMatch(bridge,/if\(ack\?\.ok!==true\)\s*nativeToast\(ack\?\.error\|\|/); + assert.doesNotMatch(viewmodel,/backend\.emitEvent|document\.|window\.|setTimeout/); +}); From 498a60a11f149d5a9781673c8f1ea914c296758e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:20:25 +0700 Subject: [PATCH 06/11] test(gui G-MV36): align M4 vendor editor contract with one typed dispatch --- tests/approved_native_m2_contract.test.cjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index 650007978..6ed4364bb 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -2193,7 +2193,8 @@ test("P0 real slot VST3 power and native editor use verified instance tokens",() assert.match(bridge,/requestAdmittedFxPower\(t,action,btn\)/); assert.match(bridge,/FX rack unchanged/); assert.match(bridge,/pendingM4RackPowers/); - assert.match(bridge,/action:"routingFxEditor"/); + assert.match(read("web/approved-fx-rack-view-model.js"),/action:"routingFxEditor"/); + assert.match(bridge,/dispatchPhysicalFxEditor\(plan,lease,"M4"\)/); assert.match(bridge,/action:plan\.action,requestId,\.\.\.plan\.payload/); assert.match(read("web/approved-fx-rack-view-model.js"), /action:"routingFxBypass"/); From e419d7e31f529f846b6ca384cc2731fbddba83d1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:22:21 +0700 Subject: [PATCH 07/11] test(gui G-MV36): preserve accepted global FX readback while retiring editor ACK lease --- tests/approved_native_m2_contract.test.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index 6ed4364bb..b1d50d37d 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -4983,7 +4983,9 @@ test("MV-9B bridge uses only accepted native snapshots for global FX, fences M4 "globalPowerSettlement","m4SlotPowerAckResult","m4SlotPowerSettlement"]) assert.match(bridge,new RegExp("fxRackVM\\."+name+"\\(")); assert.match(bridge,/const current=controller\?\.state\(\)\?\.current;\s*const button=document\.getElementById\?\.\("globalFxToggle"\)/); - assert.match(bridge,/onAccepted:\(next,confirmed\)=>\{\s*onNativeReadback\(next,confirmed\);\s*syncGlobalFxReadback\(\);/); + assert.match(bridge,/onAccepted:\(next,confirmed\)=>\{\s*onNativeReadback\(next,confirmed\);/); + assert.match(bridge,/fxRackVM\.nativeEditorAckResult\(pendingFxEditorAck,null,accepted,/); + assert.match(bridge,/pendingFxEditorAck=null;\s*syncGlobalFxReadback\(\);/); assert.match(bridge,/const apply=\(\)=>controller\.onSnapshot\(snapshot\);/); assert.doesNotMatch(bridge,/controller\.onSnapshot\(snapshot\);syncGlobalFxReadback/); assert.doesNotMatch(bridge,/const actual=snapshot\?\.globalFxBypassed;/); From 7bf0719028fba5346d94b85e1366932fe67aad74 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:22:38 +0700 Subject: [PATCH 08/11] test(imersip G-MV36): verify real routed JUCE editor through correlated ChannelId owner --- tests/imersip_p92_catalog_contract_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/imersip_p92_catalog_contract_test.py b/tests/imersip_p92_catalog_contract_test.py index e5f88c8b3..07c5fdeac 100644 --- a/tests/imersip_p92_catalog_contract_test.py +++ b/tests/imersip_p92_catalog_contract_test.py @@ -13,11 +13,11 @@ def test_immersib_rack_opens_real_native_editor_without_fake_toast(self): host=source("src/Main.cpp") self.assertIn("fxRackVM.editorNavigationPlan(current,",bridge) self.assertIn('view.raw?.mixerSession?.authority==="CHANNEL_ID"',editor_vm) - self.assertRegex(bridge, - r'backend\.emitEvent\("arMixAction",\{action:"routingFxEditor",\s*' - r'channelId:editor\.channelId,slot:editor\.slot,\s*' - r'instanceId:editor\.instanceId,deviceEpoch:editor\.deviceEpoch,\s*' - r'revision:editor\.graphRevision\}\)') + self.assertIn("openChannelIdFxEditor(editor)",bridge) + self.assertIn("fxRackVM.nativeEditorDispatchPlan(current,lease,",bridge) + self.assertIn('dispatchPhysicalFxEditor(plan,lease,"CHANNEL_ID")',bridge) + self.assertIn('action:"routingFxEditor"',editor_vm) + self.assertIn('ack->setProperty("requestId",args.getProperty("requestId",juce::var()))',host) self.assertNotIn('else status("Native VST3 editor opened")',bridge) self.assertIn("ImerSipP92Editor*>(editor)",host) self.assertIn("std::make_unique",host) From e364e62590ba117a0b5acb6bf9a4e94a76e6d148 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:26:01 +0700 Subject: [PATCH 09/11] fix(gui G-MV36): reject physical editor lease when offline .smix takes UI authority --- web/approved-fx-rack-view-model.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/approved-fx-rack-view-model.js b/web/approved-fx-rack-view-model.js index c0da00858..a8b643485 100644 --- a/web/approved-fx-rack-view-model.js +++ b/web/approved-fx-rack-view-model.js @@ -391,8 +391,9 @@ // G-MV36: physical ChannelId VST3 / ImmerSIB editors use the original // JUCE HWND only when the EXACT G-MV31 accepted instance lease survives. // Logical .smix and native built-in /preview/ editor owners stay separate. - function nativeEditorDispatchPlan(snapshot,lease,{hardwareConfiguration}={}){ - if(lease?.authority!=="CHANNEL_ID"|| + function nativeEditorDispatchPlan(snapshot,lease,{ + hardwareConfiguration,offline=false}={}){ + if(offline||lease?.authority!=="CHANNEL_ID"|| !editorNavigationLeaseMatches(snapshot,lease,{hardwareConfiguration})) return {kind:"UNAVAILABLE"}; return {kind:"READY",action:"routingFxEditor", @@ -410,7 +411,7 @@ if(!pending)return "IGNORE"; const lease=pending.lease; const valid=pending.authority==="CHANNEL_ID"? - lease?.authority==="CHANNEL_ID"&& + !offline&&lease?.authority==="CHANNEL_ID"&& editorNavigationLeaseMatches(snapshot,lease,{hardwareConfiguration}): pending.authority==="M4"&& m4EditorDispatchLeaseMatches(snapshot,lease,{ From 4ee448650d9d64537d7c5083fe56740154c1169b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:26:20 +0700 Subject: [PATCH 10/11] fix(gui G-MV36): fence queued native editor after offline workspace switch --- web/approved-native-bridge.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 81f726510..ca4b9854c 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -1342,16 +1342,18 @@ },8000); } function openChannelIdFxEditor(lease){ - if(lease?.authority!=="CHANNEL_ID")return false; + if(lease?.authority!=="CHANNEL_ID"||logicalView)return false; const accepted=controller?.state()?.current; const plan=fxRackVM.nativeEditorDispatchPlan(accepted,lease,{ - hardwareConfiguration:protocol.nativeHardwareConfiguration(accepted?.device)}); + hardwareConfiguration:protocol.nativeHardwareConfiguration(accepted?.device), + offline:!!logicalView}); if(plan.kind!=="READY")return false; window.queueMicrotask(()=>{ const current=controller?.state()?.current; - if(fxRackVM.nativeEditorDispatchPlan(current,lease,{ - hardwareConfiguration:protocol.nativeHardwareConfiguration(current?.device)}).kind!=="READY") - return; // reject stale same-epoch pin/roster/FX replacements + if(logicalView||fxRackVM.nativeEditorDispatchPlan(current,lease,{ + hardwareConfiguration:protocol.nativeHardwareConfiguration(current?.device), + offline:!!logicalView}).kind!=="READY") + return; // same-epoch hardware/FX replacement or offline .smix switch dispatchPhysicalFxEditor(plan,lease,"CHANNEL_ID"); }); return true; From f6506598e6c9dd2da16610eb9a8f59cf06ab9aeb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 20 Nov 2026 07:26:41 +0700 Subject: [PATCH 11/11] test(gui G-MV36): offline switch retires queued editor and stale HWND feedback --- tests/approved_native_m2_contract.test.cjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index b1d50d37d..ae54eb079 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -6444,6 +6444,8 @@ test("G-MV36 ChannelId vendor FX editor dispatch retains exactly one physical in protocol.nativeHardwareConfiguration(next.device)).kind,"UNAVAILABLE"); } assert.equal(plan(snap,navigation.lease,"wrong-device").kind,"UNAVAILABLE"); + assert.equal(fxRackVM.nativeEditorDispatchPlan(snap,navigation.lease,{ + hardwareConfiguration,offline:true}).kind,"UNAVAILABLE"); assert.equal(JSON.stringify(snap),original,"pure editor plan never writes PCM"); }); test("G-MV36 correlated FX HWND ACK guards request, device, roster, and plugin instance",()=>{ @@ -6476,6 +6478,8 @@ test("G-MV36 correlated FX HWND ACK guards request, device, roster, and plugin i assert.equal(verdict(pending,{requestId:pending.requestId, instanceId:"native-fx-8",ok:true}),"ACKED"); assert.equal(verdict(pending,{instanceId:"native-fx-8",ok:true}),"IGNORE"); + assert.equal(fxRackVM.nativeEditorAckResult(pending,null,native,{ + hardwareConfiguration,offline:true}),"STALE"); for(const mutate of [ s=>{s.graph.rosterRevision="20";}, s=>{s.graph.revision="47";}, @@ -6529,6 +6533,7 @@ test("G-MV36 one correlated native editor transport and JUCE echo, no duplicate assert.match(bridge,/backend\.emitEvent\("arMixAction",\{action:plan\.action,requestId,\.\.\.plan\.payload\}\);/); assert.match(bridge,/dispatchPhysicalFxEditor\(plan,lease,"M4"\)/); assert.match(bridge,/dispatchPhysicalFxEditor\(plan,lease,"CHANNEL_ID"\)/); + assert.match(bridge,/if\(logicalView\|\|fxRackVM\.nativeEditorDispatchPlan\(current,lease,/); assert.match(bridge,/pendingFxEditorAck=null; \/\/ expire old native HWND/); assert.match(bridge,/fxRackVM\.nativeEditorAckResult\(pendingFxEditorAck,ack,accepted,/); assert.match(bridge,/if\(verdict==="IGNORE"\)return; \/\/ obsolete, duplicate or unrelated ACK/);