Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
cde5c8c
refactor(mvvm): add pure native device endpoint presentation ViewModel
masarray Nov 17, 2026
31e0d9d
refactor(mvvm): use pure device ViewModel for native I/O menus and re…
masarray Nov 17, 2026
1c585b4
build(native): embed device ViewModel before approved bridge, keep re…
masarray Nov 17, 2026
4a50d1c
test(mvvm): native endpoint ViewModel readback, missing pins, ACK-onl…
masarray Nov 17, 2026
2b636ff
test(bundle): prove native-only Device VM reversible injection, embed…
masarray Nov 17, 2026
50a9bdb
test(mvvm): adapt native bridge harness and structural expectations t…
masarray Nov 17, 2026
64d3a53
test(mvvm): include injected Device ViewModel in held-fader WebView h…
masarray Nov 17, 2026
7004db0
refactor(mvvm): give native Device Setup a pure ACK/readback lifecycle
masarray Nov 17, 2026
5fc210e
refactor(mvvm): replace native Audio I/O dialog ACK-only acceptance w…
masarray Nov 17, 2026
bd9791e
test(mvvm): positive/negative native Device Setup ACK, epoch, timeout…
masarray Nov 17, 2026
b9b428a
test(mvvm): replace stale dialog assertions with Device Setup VM inva…
masarray Nov 17, 2026
7beed2f
fix(mvvm): reject same-ID device ACK for older generation or wrong ph…
masarray Nov 17, 2026
b40281e
test(mvvm): reject same-request stale-generation and substituted ASIO…
masarray Nov 17, 2026
e716545
test(mvvm): require subsequent schema-v6 readback to settle native Au…
masarray Nov 17, 2026
1e3ecf4
fix(mvvm): require post-ACK device generation evidence without reject…
masarray Nov 17, 2026
c0a56a5
fix(mvvm): distinguish verified device Apply from unadmitted ChannelI…
masarray Nov 17, 2026
07d6066
chore(mvvm): reconcile latest main spatial distribution audit without…
masarray Nov 17, 2026
5d6ec4a
chore(mvvm): reconcile concurrent spatial closure documentation from …
masarray Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/build_approved_native_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CANONICAL = ROOT / "site" / "preview-v2"
NATIVE_ADAPTER = ROOT / "web" / "approved-native-bridge.js"
ADAPTER_MARKER = ('<script defer src="assets/approved-native-contract.js"></script>\n'
'<script defer src="assets/approved-device-view-model.js"></script>\n'
'<script defer src="assets/approved-native-bridge.js"></script>\n'
'<script defer src="assets/approved-native-context-menu.js"></script>\n'
'<script defer src="assets/approved-native-legal.js"></script>\n')
Expand Down Expand Up @@ -359,6 +360,8 @@ def stage(out: Path) -> dict:
out / "assets" / "approved-native-legal.js")
shutil.copy2(ROOT / "web" / "approved-native-contract.js",
out / "assets" / "approved-native-contract.js")
shutil.copy2(ROOT / "web" / "approved-device-view-model.js",
out / "assets" / "approved-device-view-model.js")
native = native_html(approved.decode("utf-8")).encode("utf-8")
(out / "index.html").write_bytes(native)
files = [out / "index.html", *sorted(p for p in (out / "assets").rglob("*") if p.is_file())]
Expand Down
72 changes: 57 additions & 15 deletions tests/approved_native_cold_start_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,35 @@ def main():
assert progress.locator('svg animate').count()==4
assert progress.locator('svg').evaluate('(svg)=>svg.animationsPaused()')==(width==1920)
assert page.locator('[data-audio-close]').is_disabled()
# The transient request lives in the ViewModel, not in a DOM attribute.
apply_calls=[0]
def wait_apply():
pending=page.locator('.armix-audio-shade').get_attribute('data-pending-request')
assert pending
page.wait_for_function("""id=>window.__events.some(e=>
e.payload?.action==='audioDeviceApply'&&e.payload.requestId===id)""",arg=pending)
apply_calls[0]+=1
page.wait_for_function("""count=>window.__events.filter(e=>
e.name==='arMixAction'&&e.payload?.action==='audioDeviceApply').length===count""",
arg=apply_calls[0])
assert page.evaluate('()=>window.__applyPainted')

def emit_device_readback(actual, epoch):
# Native schema-v6 device proof without an installed PCM graph.
fresh=copy.deepcopy(json.loads(
(ROOT/'integration/console-v6/fixtures.json').read_text())['g0'])
inputs=actual['enabledInputs']
outputs=actual['enabledOutputs']
fresh['device'].update(
epoch=str(epoch),backend=actual['backend'],
captureDevice=actual['captureDevice'],
playbackDevice=actual['playbackDevice'],
sampleRate=actual['rate'],bufferFrames=actual['buffer'],
enabledInputs=inputs,enabledOutputs=outputs,
inputEndpoints=[dict(id=f'in:{pin}',port=pin,callback=i,
label=f'IN {pin+1}',active=True)
for i,pin in enumerate(inputs)],
outputEndpoints=[dict(id=f'out:{pin}',port=pin,callback=i,
label=f'OUT {pin+1}',active=True)
for i,pin in enumerate(outputs)],
outputArmed=False)
emit(page,'arMixConsoleSnapshot',fresh)
wait_apply()
request=page.evaluate("""()=>window.__events.filter(e=>
e.payload?.action==='audioDeviceApply').at(-1)?.payload""")
Expand All @@ -111,12 +134,15 @@ def wait_apply():
assert request['config']['enabledInputs']==[]
assert request['config']['enabledOutputs']==[]
out_active={**io_inventory['active'],'captureDevice':'',
'inputNames':[],'enabledInputs':[],
'inputNames':[],'enabledInputs':[],'deviceGeneration':70,
'outputNames':['WDM L','WDM R','Realtek L','Realtek R']}
emit(page,'arMixAudioDeviceApplyAck',{
'requestId':request['requestId'],'ok':True,
'state':'ACCEPTED_MUTED','active':out_active,
'outputMuted':True,'mixerBound':True})
assert progress.is_visible() and apply.is_disabled(), (
'ACK-only must never announce an installed playback device')
emit_device_readback(out_active,'70')
assert page.locator('.armix-audio-shade').is_hidden()
page.locator('.command-bar [data-native-io]').click()
io_inventory['active']=out_active
Expand All @@ -138,12 +164,16 @@ def playback_pin(index):
assert repatch['config']['assignSelectedPlaybackPinsToMain'] is True
assert repatch['config']['enabledOutputs']==[2,3]
assert repatch['config']['enabledInputs']==[]
main_active={**out_active,'deviceGeneration':71,'enabledOutputs':[2,3]}
emit(page,'arMixAudioDeviceApplyAck',{
'requestId':repatch['requestId'],'ok':True,
'state':'ACCEPTED_MUTED','active':{**out_active,'enabledOutputs':[2,3]},
'outputMuted':True,'mixerBound':True})
'state':'ACCEPTED_MUTED','active':main_active,
'outputMuted':True,'mixerBound':False})
assert progress.is_visible() and apply.is_disabled()
emit_device_readback(main_active,'71')
assert page.locator('.armix-audio-shade').is_hidden()
g0=json.loads((ROOT/'integration/console-v6/fixtures.json').read_text())['g0']
g0['device']['epoch']='72'
g0['mixerSession']={'authority':'NONE','deviceEpoch':g0['device']['epoch'],'channels':[]}
g0['legacyM4']={'active':True,'routeAccepted':False,'routingRevision':'1'}
emit(page,'arMixConsoleSnapshot',g0)
Expand Down Expand Up @@ -234,7 +264,8 @@ def show_select(value):
assert page.locator('.console-pane').is_visible()
assert not page.evaluate('()=>window.__nativeIntents.length')
state=snapshot()
state['device'].update(enabledInputs=[],inputEndpoints=[])
state['device'].update(epoch='72',enabledInputs=[],inputEndpoints=[])
state['mixerSession']['deviceEpoch']='72'
state['graph']['edges'].pop(1) # genuinely no existing channel send
state['graph']['capabilities']['supportedOps'] += ['LOAD_INSERT']
for ident, role, name in [('101','GROUP','Vocal Group'),
Expand Down Expand Up @@ -349,7 +380,7 @@ def show_select(value):
page.locator('[data-native-io]').click()
backend='Windows Audio'
active={'backend':backend,'captureDevice':'New Capture','playbackDevice':'New Playback',
'open':True,'authorized':True,'deviceGeneration':12,'rate':48000,'buffer':256,
'open':True,'authorized':True,'deviceGeneration':92,'rate':48000,'buffer':256,
'inputNames':['Input 1'],'outputNames':['Output 1','Output 2'],
'enabledInputs':[0],'enabledOutputs':[0,1],'rates':[48000],'buffers':[256]}
emit(page,'arMixAudioDeviceInventory',{'active':active,'types':[
Expand All @@ -365,17 +396,23 @@ def show_select(value):
'active':active,'canReusePins':True})
assert progress.is_visible() and apply.is_disabled()
assert remap.is_hidden()
applied={**active,'deviceGeneration':93}
emit(page,'arMixAudioDeviceApplyAck',{'requestId':opened['requestId'],'ok':True,
'state':'ACCEPTED_LIVE','active':active,'mixerBound':True,'outputMuted':False})
assert page.locator('.armix-audio-shade').is_hidden()
'state':'ACCEPTED_LIVE','active':applied,'mixerBound':True,'outputMuted':False})
assert progress.is_visible() and apply.is_disabled()
rebound=copy.deepcopy(state)
rebound['device'].update(epoch='93',outputArmed=True,
enabledInputs=g0['device']['enabledInputs'],inputEndpoints=g0['device']['inputEndpoints'])
rebound['device'].update(epoch='93',backend=backend,
captureDevice=active['captureDevice'],playbackDevice=active['playbackDevice'],
sampleRate=48000,bufferFrames=256,outputArmed=True,
enabledInputs=active['enabledInputs'],enabledOutputs=active['enabledOutputs'],
inputEndpoints=g0['device']['inputEndpoints'])
rebound['graph']['revision']='6'
rebound['graph']['capabilities']['supportedOps'].append('CREATE_CHANNEL')
rebound['mixerSession'].update(deviceEpoch='93',routeRevision='6')
monitor_events=page.evaluate('()=>window.__events.filter(e=>e.payload?.action==="monitor").length')
emit(page,'arMixConsoleSnapshot',rebound)
assert page.locator('.armix-audio-shade').is_hidden(), (
'correlated installed PCM readback must settle device apply')
page.wait_for_function('()=>window.__ARMIX_NATIVE_M2__.state().current?.admitted')
assert page.locator('[data-native-monitor]').is_enabled()
assert page.locator('[data-native-monitor]').get_attribute('data-armed')=='true'
Expand Down Expand Up @@ -405,14 +442,19 @@ def show_select(value):
wait_apply()
repeated=page.evaluate(read_apply)
assert repeated['requestId']!=rejected['requestId']
next_active={**active,'deviceGeneration':94}
emit(page,'arMixAudioDeviceApplyAck',{'requestId':repeated['requestId'],'ok':True,
'state':'ACCEPTED_LIVE','active':active,'mixerBound':True,'outputMuted':False})
'state':'ACCEPTED_LIVE','active':next_active,'mixerBound':True,'outputMuted':False})
assert progress.is_visible() and apply.is_disabled()
rebound['device']['epoch']='94'
rebound['mixerSession']['deviceEpoch']='94'
emit(page,'arMixConsoleSnapshot',rebound)
assert page.locator('.armix-audio-shade').is_hidden()
assert page.evaluate('()=>window.__events.filter(e=>e.payload?.action==="monitor").length')==monitor_events
add_track.click()
request=page.evaluate(create)[-1]['payload']
assert (request['deviceEpoch'],request['graphRevision'],request['rosterRevision'])==(
'93','6',rebound['graph']['rosterRevision'])
'94','6',rebound['graph']['rosterRevision'])
assert add_track.is_disabled()
created_id='9007199254740997'
emit(page,'arMixNativeBusAck',{'requestId':request['requestId'],
Expand Down
12 changes: 12 additions & 0 deletions tests/approved_native_gui_bundle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ def test_native_is_exact_assembled_public_pages_plus_nonvisual_native_seam(self)
self.assertEqual(manifest["approvedPagesHtmlSha256"], bundle.sha256((source / "index.html").read_bytes()))
self.assertNotEqual(native, (ROOT / "web/index.html").read_text("utf-8"))
self.assertIn("approved-native-bridge.js", native)
# Native-only pure Device Setup VM must load BEFORE the approved
# bridge and must never change the public /preview/ HTML.
self.assertIn('assets/approved-device-view-model.js', native)
self.assertNotIn('assets/approved-device-view-model.js', approved)
self.assertLess(native.index('assets/approved-native-contract.js'),
native.index('assets/approved-device-view-model.js'))
self.assertLess(native.index('assets/approved-device-view-model.js'),
native.index('assets/approved-native-bridge.js'))
vm_source = (ROOT / "web/approved-device-view-model.js").read_bytes()
self.assertEqual((out / "assets/approved-device-view-model.js").read_bytes(),
vm_source)
self.assertIn("approved-native-context-menu.js", native)
context_menu = (out / "assets/approved-native-context-menu.js").read_text("utf-8")
self.assertIn('document.addEventListener("contextmenu"', context_menu)
Expand Down Expand Up @@ -134,6 +145,7 @@ def test_manifest_reproducibility_and_byte_map(self):
self.assertIn("BinaryData::mixercontrolkeys_css", header)
self.assertIn("BinaryData::arsonmixapprovedruntime_css", header)
self.assertIn("BinaryData::mixercontrolkeys_js", header)
self.assertIn("BinaryData::approveddeviceviewmodel_js", header)
self.assertIn('"/assets/mixer-keys-thin-flat-v9-approved-off-shadow-57x30.png"', header)
for entry in first["files"]:
self.assertEqual(bundle.sha256((a / entry["path"]).read_bytes()), entry["sha256"])
Expand Down
Loading
Loading