From 872940e49f41d5e83e32f38f40aa56f0d1cea9fc Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 06:32:46 +0700 Subject: [PATCH 1/7] fix(gui): restore approved MUTE SOLO PFL row in main mixer and SOF --- site/preview-v2/index.html | 63 ++++++-------------------------------- 1 file changed, 10 insertions(+), 53 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index a44442f5c..1fc7f9650 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -698,38 +698,17 @@ code+=sectionFx(t)+sectionSend(t); code+='
PAN'+panLabel(t.pan)+'
'; - // PRE/POST describes the source channel's outgoing parallel WIRE sends - // only. A direct MAIN wire is not a PRE/POST send and cannot light this key. - const parallelSends=wireEdges.filter(e=>e.enabled&&e.sourceId===t.id&&e.kind==='send'&&e.destId!==master.id); - const allSendPost=parallelSends.length>0&¶llelSends.every(e=>e.mode==='send'); - const allSendPre=parallelSends.length>0&¶llelSends.every(e=>e.mode==='split'); - const tapMode=allSendPost?'send':allSendPre?'split':parallelSends.length?'mixed':t.wireTapMode==='split'?'split':'send'; - const nativeTapUnavailable=!!window.__JUCE__?.backend; - // An unpatched channel has a future WIRE default, not an illuminated send. - // Four dedicated PNG frames avoid CSS-faked lighting: PRE, POST idle, POST - // routed, MIX (several outgoing SEND edges with different tap positions). - const tapVisual=nativeTapUnavailable?'idle': - parallelSends.length===0?(tapMode==='split'?'pre':'idle'): - tapMode==='mixed'?'mixed':tapMode==='split'?'pre':'post'; - const tapText=tapVisual==='mixed'?'MIX':tapVisual==='pre'?'PRE':'POST'; - const tapTitle=nativeTapUnavailable?'PRE/POST unavailable until native WIRE tap ACK; routing unchanged': - !parallelSends.length?'No parallel sends · '+(tapMode==='split'?'PRE':'POST')+ - ' is only the future WIRE default; primary MAIN unchanged': - tapMode==='mixed'?'Mixed PRE and POST parallel WIRE sends · click to set all POST': - (tapMode==='send'?'POST follows channel fader':'PRE independent before FX')+ - ' · '+parallelSends.length+' outgoing parallel SEND(s), primary MAIN unchanged'; - // Shared v9 physical keys: MUTE/SOLO in both contexts, PFL only in SOF - // audio channels. PRE/POST remains the normal MAIN MIX routing control. - const sofPfl=sofEnabled&&t.kind==='audio'; - const hasTap=t.kind!=='master'&&!sofEnabled; + // Approved v9 physical row: MUTE / SOLO / PFL on every non-MASTER strip + // in MAIN MIX and SOF. Send tap belongs to the selected WIRE EdgeId + // inspector (and the contextual SOF send panel), never this key row. + const showPfl=t.kind!=='master'; const isNative=!!window.__JUCE__?.backend; const pflTitle=isNative?'PFL unavailable · independent native MONITOR L/R not admitted': 'PFL · visual audition request only; no monitoring audio in browser preview'; - code+='
' + code+='
' +'' +''; - if(hasTap)code+=''; - if(sofPfl)code+=''; + if(showPfl)code+=''; code+='
'; code+=sectionFader(t); code+='
'+(sofEnabled&&t.kind==='audio'?'S ': '')+formatDb(sofEnabled&&t.kind==='audio'?getSofLevel(t):t.level)+'
'; @@ -838,8 +817,8 @@ function toggleSof(force){ sofEnabled=typeof force==='boolean'?force:!sofEnabled; if(sofEnabled&&!sofTarget){sofEnabled=false;say('Create a Bus or FX Return to use Sends on Faders');return;} - // Don't leave a hidden browser-only PFL request armed outside SOF. - if(!sofEnabled){tracks.forEach(channel=>{channel.cue=false;});master.cue=false;} + // PFL is visible in both workspaces; changing fader context must not + // silently clear the channel's browser-only cue selection. const btn=document.getElementById('sofToggle');btn.classList.toggle('active',sofEnabled); btn.setAttribute('aria-pressed',String(sofEnabled));document.querySelector('.console-body').classList.toggle('sends-mode',sofEnabled); render();say(sofEnabled?'SENDS ON FADERS: adjusting '+sofTarget+' send levels · main faders protected':'MAIN MIX: faders control primary channel level'); @@ -2042,36 +2021,14 @@ if(a==='openPlugin'){openFastPicker(t,Number(btn.dataset.slot),btn);return;} if(a==='removeFx'){if(deferNativeFxIntent('Remove FX insert'))return;const i=Number(btn.dataset.slot);t.fx[i]='None';t.slotBypass[i]=false;if(t.fxInsertIds)t.fxInsertIds[i]=null;fxReorderUndo=null;refreshStrip(t);say(t.name+' · cleared FX insert '+(i+1));return;} if(a==='slotPower'){if(deferNativeFxIntent('FX insert bypass'))return;const slot=Number(btn.dataset.slot);if(t.fx[slot]==='None'){say(t.name+': choose an effect before toggling bypass');return;}t.slotBypass[slot]=!t.slotBypass[slot];refreshStrip(t);say(t.name+': FX '+(slot+1)+(t.slotBypass[slot]?' bypassed':' enabled'));return;} - if(a==='tapMode'){ - if(t.kind==='master')return; - // PRE/POST is a structural native DSP tap change, NOT a cosmetic button. - // The current native bridge rejects MODE without verified PCM ACK. Never - // alter the local presentation in native mode until that capability exists. - if(window.__JUCE__?.backend){ - say('PRE/POST is unavailable for this native graph · routing unchanged'); - return; - } - const sends=wireEdges.filter(edge=>edge.enabled&&edge.sourceId===t.id&&edge.kind==='send'&&edge.destId!==master.id); - // Mixed taps resolve predictably to POST on first click; next click selects PRE. - const allPost=sends.length>0&&sends.every(edge=>edge.mode==='send'); - const next=sends.length?(allPost?'split':'send'):(t.wireTapMode==='split'?'send':'split'); - if(sends.length&&!wireGraphCommit(sends.map(edge=>({type:'MODE',sourceId:t.id,edgeId:edge.id,mode:next}))))return; - t.wireTapMode=next; - if(wireSourceId===t.id){wireMode=next;document.getElementById('wireMode').value=next;} - refreshStrip(t);selectTrack(t); - say(t.name+' '+(next==='split'?'PRE (independent pre-FX)':'POST (follow fader)')+ - ' · outgoing parallel WIRE sends '+(sends.length?'updated':'default selected')+ - ' · primary MAIN unchanged · GUI reference only'); - return; - } if(a==='eq')t.eq=!t.eq; else if(a==='fxOn'){if(deferNativeFxIntent('FX chain bypass'))return;t.fxOn=!t.fxOn;} else if(a==='pre'){t.pre=!t.pre;syncActiveSend(t);} else if(a==='sendOn'){say('Legacy SEND disabled; patch via WIRE');return;} else if(a==='cue'){ // Only a browser-reference cue selection; never route to MAIN/audio. - if(!sofEnabled||t.kind!=='audio'||window.__JUCE__?.backend){ - say('PFL requires SOF and an admitted independent native monitor'); + if(t.kind==='master'||window.__JUCE__?.backend){ + say('PFL requires an admitted independent native monitor'); return; } t.cue=!t.cue; From e735169b9c5d307fef78448c1020280c0b48349b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 06:34:05 +0700 Subject: [PATCH 2/7] test(gui): lock main and SOF MUTE SOLO PFL PNG and native guard --- tests/harmonice_v7_keys_contract.py | 109 ++++++++++++---------------- 1 file changed, 45 insertions(+), 64 deletions(-) diff --git a/tests/harmonice_v7_keys_contract.py b/tests/harmonice_v7_keys_contract.py index 4de4ce4f9..414ca1aee 100644 --- a/tests/harmonice_v7_keys_contract.py +++ b/tests/harmonice_v7_keys_contract.py @@ -1,7 +1,7 @@ -"""Harmonice v9 approved PNG button integration — fast source/asset guard. +"""Approved v9 channel keys: MUTE / SOLO / PFL in MAIN MIX and SOF. -Tests one owner, physical PNG, PFL only in SOF (not main), atomic reference tap -transactions and native fail-closed behavior. This is NOT hardware PCM proof. +Checks user-signed PNG bytes and source/native safety contracts. Does not claim +native PFL monitoring, DSP admission, or Windows hardware FAT. """ from pathlib import Path import hashlib @@ -14,76 +14,57 @@ CSS = (OWNER / "mixer-control-keys.css").read_text(encoding="utf-8") BUILD = (ROOT / "scripts/build_pages.py").read_text(encoding="utf-8") BRIDGE = (ROOT / "web/approved-native-bridge.js").read_text(encoding="utf-8") -ASSET = "harmonice-thin-flat-v9-approved-off-shadow-57x30.png" +OLD = "harmonice-thin-flat-v9-approved-off-shadow-57x30.png" +PFL = "harmonice-thin-flat-v9-pfl-font-matched-57x30.png" -class HarmoniceV7KeysTests(unittest.TestCase): - def test_one_png_owner_with_alpha_and_correct_frames(self): - png = (OWNER / ASSET).read_bytes() - self.assertEqual(png[:8], b"\x89PNG\r\n\x1a\n") - self.assertEqual(struct.unpack(">II", png[16:24]), (228, 90)) - self.assertEqual(hashlib.sha256(png).hexdigest(), "3a7b179fd9cc028f988215ea7f3b9e4a73a68031a7051d6e670df01aea940a6a", "PNG must match approved v9 raster, byte for byte") - self.assertIn(png[25], (3, 6)) - if png[25] == 3: - self.assertIn(b"tRNS", png) - self.assertIn('background-image:url("' + ASSET + '")', CSS) - self.assertIn("aspect-ratio:57/30", CSS) +class HarmoniceV9KeysTests(unittest.TestCase): + def test_exact_approved_artwork(self): + original = (OWNER / OLD).read_bytes() + pfl = (OWNER / PFL).read_bytes() + self.assertEqual(original[:8], bytes.fromhex("89504e470d0a1a0a")) + self.assertEqual(struct.unpack(">II", original[16:24]), (228, 90)) + self.assertEqual(hashlib.sha256(original).hexdigest(), + "3a7b179fd9cc028f988215ea7f3b9e4a73a68031a7051d6e670df01aea940a6a") + self.assertEqual(struct.unpack(">II", pfl[16:24]), (114, 30)) + self.assertEqual(pfl[25], 6) + self.assertEqual(hashlib.sha256(pfl).hexdigest(), + "1ede18534fa678461ebcb1a100a61170700d75048b11607600cf09d9de8872fd") + self.assertIn('background-image:url("' + OLD + '")', CSS) + self.assertIn('background-image:url("' + PFL + '")', CSS) self.assertIn("background-size:400% 300%", CSS) - self.assertIn('drop-shadow(0 .8px 1.15px rgba(0,0,0,.42))', CSS) - self.assertIn('drop-shadow(0 1.7px 2.1px rgba(0,0,0,.32))', CSS) - self.assertIn('[data-hw-kind="tap"][data-tap-visual="pre"]::before', CSS) - self.assertIn('[data-hw-kind="mute"][aria-pressed="false"]::before', CSS) - self.assertIn('[data-hw-kind="solo"][aria-pressed="false"]::before', CSS) - for kind, pos in (("tap", "0%"), ("mute", "50%"), ("solo", "100%")): - self.assertIn('data-hw-kind="' + kind + '"]{--mx-native-y:' + pos + '}', CSS) - self.assertIn("sprite='" + ASSET + "'", BUILD) - - def test_three_visible_keys_and_cue_state_kept_hidden(self): - for action in ("mute", "solo", "tapMode"): - self.assertIn('data-action="' + action + '"', HTML) - self.assertNotIn('data-hw-kind="cue"', HTML) - self.assertIn('id="clearCue" hidden disabled', HTML) - self.assertIn('style="display:none"', HTML)\n self.assertNotIn('