From a123fd9775a9013f44f6f1df50305893c734f3d2 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 09:44:33 +0700 Subject: [PATCH 01/14] V61: make accepted cable visible and verify isolated spring in Chromium (#624) * fix(gui): expose selected cable by focusing source after accepted drag or route choice * test(chromium): probe encapsulated motion via exact source and support incoming cable jacket --- site/preview-v2/index.html | 6 ++++-- tests/pages_v60_fader_wire_tactile_smoke.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index 8ca3bf161..8dfc6817d 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -424,7 +424,7 @@ if(type==='CONNECT')op.mode=source.wireTapMode==='split'?'split':'send'; const ok=wireGraphCommit([op]); closeRouteChoice();if(!ok)return false; - render();kickWireSpring(source.id,dest.id); + render();selectTrack(source);kickWireSpring(source.id,dest.id); say(source.name+' → '+dest.name+' · '+(kind==='only'?'ROUTE ONLY':'PARALLEL SEND')+' · reference only'); return true; } @@ -1973,6 +1973,7 @@ if(replugWireEdge(g.sourceId,g.originDestId,snap?.track.id??null)){ wireWsRecord(before); if(!snap)selectedWireEdgeId=null; + else selectTrack(wireSourceTrack(g.sourceId)); // reveal accepted selected cable } } }else{ @@ -1981,7 +1982,8 @@ const target=snap?.track||(input?findTrack(input):null),source=wireSourceTrack(g.sourceId); if(target&&source&&target.id!==source.id){ wireSourceId=source.id;wireSourcePinned=true;wireIntent=true;wireAnchorId=target.id; - requestWireConnection(source,target,input); + if(requestWireConnection(source,target,input)) + selectTrack(source); // a successful OUT drag reveals its selected cable }else say('WIRE drop canceled · release in destination WIRE bay (graph unchanged)'); } renderWireRouting();wireSuppressClick=true; diff --git a/tests/pages_v60_fader_wire_tactile_smoke.py b/tests/pages_v60_fader_wire_tactile_smoke.py index 757e2e758..dc728c601 100644 --- a/tests/pages_v60_fader_wire_tactile_smoke.py +++ b/tests/pages_v60_fader_wire_tactile_smoke.py @@ -177,9 +177,13 @@ def test_wire(page): samples=page.evaluate("window.__v60WireSamples") # Deterministic physical direction: first visible UP kick near IN, # OUT remains quiet initially; then the decayed crest reaches near OUT. - physics=page.evaluate("""()=>{ - const g=wireMotionGeometry.get('1-3'); - if(!g)return null; + # Canonical Pages GUI intentionally encapsulates its lexical graph. + # Probe the exact checked-in motion function without exposing a runtime + # debug global or duplicating the production renderer. + motion=HTML[HTML.index("const WIRE_IMPACT_TRAVEL_MS="): + HTML.index("function kickWireSpring(")] + physics=page.evaluate("()=>{\n"+motion+"""\n + const g=[0,0,180,0,72]; // representative wire with anchored plugs const [x0,y0,x1,y1,limit]=g; const span=Math.abs(x1-x0),ceiling=Math.max(12,Math.min(100,Number(limit)||72)); const sag=Math.max(10,Math.min(ceiling,Math.min(ceiling-5,28+Math.sqrt(span)*1.55))); @@ -219,7 +223,7 @@ def test_wire(page): hit=page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-3"]') assert hit.count()==1 # The newly plugged edge is selected immediately, before the user clicks it. - assert page.locator('#wireLayer path.wire-outgoing-line[data-from="1"][data-to="3"].is-wire-selected').count()==1 + assert page.locator('#wireLayer path.wire-outgoing-line[data-from="1"][data-to="3"].is-wire-selected,#wireLayer path.wire-incoming-line[data-from="1"][data-to="3"].is-wire-selected').count()==1 initial_edge=hit.get_attribute("data-edge-id") mid=point_at_midpoint(hit) page.mouse.click(mid["x"],mid["y"]) From 2740dcf767a24f82c5c0e8a7aa747fd33f8c4165 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 10:14:26 +0700 Subject: [PATCH 02/14] V62: damped WIRE propagation, falling unplug and replug spring (#627) * feat(gui): slower damped WIRE wave and physically falling/reeling unplug with replug animation after render * test(chromium): verify stronger end damping, relocated WIRE spring and physical unplug drop/retraction * fix(gui): draw detached cable synchronously at successful unplug before first RAF --- site/preview-v2/index.html | 114 +++++++++++++++++--- tests/pages_v60_fader_wire_tactile_smoke.py | 87 ++++++++++++++- 2 files changed, 184 insertions(+), 17 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index 8dfc6817d..4e085662f 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -458,7 +458,8 @@ {type:'RETARGET',sourceId,edgeId:edge.id,destId:nextDestId}; if(!wireGraphCommit([op],{record:false}))return false; wireAnchorId=nextDestId;render(); - if(nextDestId!==null&&nextDestId!==master.id)kickWireSpring(sourceId,nextDestId); + // A receiver relocation must kick AFTER its new source-focused SVG exists. + // The pointerup coordinator owns that visual effect, not graph admission. say('WIRE '+(nextDestId===null?'unplugged':'replugged')+' · edge '+edge.id+' · reference only'); return true; } @@ -914,11 +915,10 @@ wireMotionGeometry.set(key,[x0,y0,x1,y1,limit]); return wirePathData(x0,y0,x1,y1,limit,wireMotion.key===key?wireMotion.offset:0); } -/* V61 real cable whip: a short upward flick at the receiving IN socket, - travelling back toward the OUT plug with a damped sinusoidal tail. - Physical plugs stay welded; amplitude and oscillation decay toward OUT. - Only a committed/retargeted cable animates, for a bounded half-second. */ -const WIRE_IMPACT_TRAVEL_MS=330,WIRE_IMPACT_SETTLE_MS=170; +/* V62 damped cable whip: receiving IN flicks upward first, then the sine + travels toward OUT at a readable tempo with much stronger end damping. + No background oscillator, no per-frame DOM rebuild, both plugs stay fixed. */ +const WIRE_IMPACT_TRAVEL_MS=520,WIRE_IMPACT_SETTLE_MS=160; const WIRE_IMPACT_DURATION_MS=WIRE_IMPACT_TRAVEL_MS+WIRE_IMPACT_SETTLE_MS; function wireImpactPathData(x0,y0,x1,y1,limit,elapsedMs){ const span=Math.abs(x1-x0),ceiling=Math.max(12,Math.min(100,Number(limit)||72)); @@ -927,7 +927,7 @@ const u=Math.max(0,Math.min(1,elapsedMs/WIRE_IMPACT_TRAVEL_MS)); // Physical launch occurs at the IN end (t=1), never at OUT (t=0). // Ease-out front makes the receiving plug flick briskly, rather than creep. - const front=1-Math.pow(1-u,1.55); + const front=1-Math.pow(1-u,1.45); const settle=Math.max(0,Math.min(1,(elapsedMs-WIRE_IMPACT_TRAVEL_MS)/WIRE_IMPACT_SETTLE_MS)); const fade=Math.pow(1-settle,2); const strength=Math.min(22,Math.max(14,Math.sqrt(span)*1.6))*fade; @@ -942,8 +942,8 @@ // Finite causal travelling sine: first lobe moves UP at the IN socket, // trailing lobes alternate and decay over time AND along cable length. const wave=passed>0? - -strength*Math.sin(2*Math.PI*passed/.34)* - Math.exp(-2.2*passed-1.35*distance)*tether:0; + -strength*Math.sin(2*Math.PI*passed/.36)* + Math.exp(-2.1*passed-2.9*distance)*tether:0; d+=' L '+x.toFixed(1)+' '+(y+wave).toFixed(1); } return d; @@ -977,6 +977,84 @@ paint(wireImpactPathData(...geometry,0)); requestAnimationFrame(step); } +/* V62 physically unplugged WIRE: graph REMOVE happens first, then a + noninteractive cable jacket falls and reels back to its real OUT jack. + Own overlay SVG is independent of the canonical routing/PCM projection. + A canceled drag cannot call this effect. Reduced-motion skips it. */ +const WIRE_RETRACT_MS=690; +let wireRetractToken=0,wireRetractOverlay=null; +function stopWireRetraction(){ + ++wireRetractToken; + wireRetractOverlay?.remove();wireRetractOverlay=null; +} +function startWireRetraction(sourceId,releasePoint){ + stopWireRetraction(); + if(document.hidden||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches)return; + const viewport=document.getElementById('viewport'),base=document.getElementById('wireLayer'); + const out=viewport?.querySelector('.strip[data-id="'+sourceId+'"] .wire-node-out'); + const source=wireSourceTrack(sourceId),vp=viewport?.getBoundingClientRect?.(); + const jack=wireJackRect(out); + if(!source||!vp?.width||!vp.height||!jack?.width||!releasePoint)return; + const x0=jack.left-vp.left+jack.width*.5,y0=jack.top-vp.top+jack.height*.5; + const rx=Math.max(2,Math.min(vp.width-2,releasePoint.x-vp.left)); + const ry=Math.max(2,Math.min(vp.height-2,releasePoint.y-vp.top)); + const svgNS='http://www.w3.org/2000/svg'; + const svg=document.createElementNS(svgNS,'svg'); + svg.id='wireRetractLayer';svg.classList.add('routing-wire-overlay'); + svg.dataset.wireRetract=String(sourceId); + svg.setAttribute('viewBox','0 0 '+vp.width+' '+vp.height); + // Permit a short visible gravity drop beneath the normal WIRE bay, + // while retaining the original horizontally clipped channel viewport. + const bay=out.closest('.send-section')?.getBoundingClientRect?.(); + if(bay)svg.style.clipPath='inset('+Math.max(0,bay.top-vp.top-5)+'px 0px '+ + Math.max(0,vp.bottom-bay.bottom-48)+'px 0px)'; + svg.style.pointerEvents='none';svg.style.zIndex='4';svg.style.filter='none'; + const mk=(tag,attrs)=>{ + const el=document.createElementNS(svgNS,tag); + for(const [key,value] of Object.entries(attrs))el.setAttribute(key,String(value)); + svg.appendChild(el);return el; + }; + const shadow=mk('path',{'data-wire-retract-shadow':'true',fill:'none', + stroke:'#07151a','stroke-width':5.4,'stroke-linecap':'round',opacity:.5}); + const jacket=mk('path',{'data-wire-retract-jacket':'true',fill:'none', + stroke:source.color||'#8be0ff','stroke-width':3.45, + 'stroke-linecap':'round',opacity:.96}); + const plug=mk('circle',{'data-wire-retract-plug':'true',fill:source.color||'#8be0ff', + stroke:'#102b36','stroke-width':1.2,r:5.2}); + viewport.appendChild(svg);wireRetractOverlay=svg; + const token=wireRetractToken; + let began=null; + function step(now){ + if(token!==wireRetractToken||!svg.isConnected)return; + if(document.hidden||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches){ + stopWireRetraction();return; + } + if(began===null)began=now; + const p=Math.min(1,(now-began)/WIRE_RETRACT_MS); + const falling=Math.min(1,p/.29); + const reel=p<=.29?0:(p-.29)/.71; + const pull=1-Math.pow(1-reel,2.4); + const remaining=1-pull; + const x=x0+(rx-x0)*remaining; + const y=y0+(ry-y0)*remaining+26*falling*falling*remaining+ + 7*Math.sin(Math.PI*reel)*remaining; + const len=Math.hypot(x-x0,y-y0); + const sag=Math.min(43,len*.44)*(1-.45*pull); + const dx=x-x0; + const d='M '+x0.toFixed(1)+' '+y0.toFixed(1)+ + ' C '+(x0+dx*.04).toFixed(1)+' '+(y0+sag).toFixed(1)+ + ', '+(x-dx*.09).toFixed(1)+' '+(y+sag).toFixed(1)+ + ', '+x.toFixed(1)+' '+y.toFixed(1); + shadow.setAttribute('d',d);jacket.setAttribute('d',d); + plug.setAttribute('cx',x.toFixed(1));plug.setAttribute('cy',y.toFixed(1)); + plug.setAttribute('r',Math.max(0,5.2*remaining).toFixed(2)); + if(p<1)requestAnimationFrame(step); + else stopWireRetraction(); // no ghost cable or hitbox after collapse + } + // Paint the first detached frame before returning from pointerup; this + // avoids a blank frame while the old committed path has been removed. + step(performance.now()); +} /* V23 Smart Wire: visible lit socket means preview is center-snapped and mouseup accepts that exact candidate. Moving away releases attraction; the underlying graph changes ONLY on mouseup. No whole-bay snap. */ @@ -1951,6 +2029,7 @@ function finishFaderPointer(ev){ if(wireGesture&&ev.pointerId===wireGesture.pointerId){ const g=wireGesture; + let retractRequest=null,replugRequest=null; const snap=g.active?wireSnapTarget({x:ev.clientX,y:ev.clientY},g.sourceId,g.originDestId,'release'):null; wireGesture=null;setWireSnapTarget(null); consoleBody.querySelector?.('.strip[data-id="'+g.originDestId+'"] .wire-node-in')?.classList.remove('is-replug-origin'); @@ -1972,8 +2051,14 @@ const before=wireWsSnapshot(); if(replugWireEdge(g.sourceId,g.originDestId,snap?.track.id??null)){ wireWsRecord(before); - if(!snap)selectedWireEdgeId=null; - else selectTrack(wireSourceTrack(g.sourceId)); // reveal accepted selected cable + if(!snap){ + selectedWireEdgeId=null; + retractRequest={sourceId:g.sourceId,point:{x:ev.clientX,y:ev.clientY}}; + }else{ + selectTrack(wireSourceTrack(g.sourceId)); // reveal accepted selected cable + if(snap.track.id!==g.originDestId&&snap.track.id!==master.id) + replugRequest={sourceId:g.sourceId,destId:snap.track.id}; + } } } }else{ @@ -1986,7 +2071,12 @@ selectTrack(source); // a successful OUT drag reveals its selected cable }else say('WIRE drop canceled · release in destination WIRE bay (graph unchanged)'); } - renderWireRouting();wireSuppressClick=true; + renderWireRouting(); + // The relinked SVG did not exist during graph admission. Start its wave + // only after final focused render, with the accepted destination geometry. + if(replugRequest)kickWireSpring(replugRequest.sourceId,replugRequest.destId); + if(retractRequest)startWireRetraction(retractRequest.sourceId,retractRequest.point); + wireSuppressClick=true; }else if(g.sourceId){wireSuppressClick=false;} return; } diff --git a/tests/pages_v60_fader_wire_tactile_smoke.py b/tests/pages_v60_fader_wire_tactile_smoke.py index dc728c601..1d2ae229c 100644 --- a/tests/pages_v60_fader_wire_tactile_smoke.py +++ b/tests/pages_v60_fader_wire_tactile_smoke.py @@ -22,7 +22,10 @@ def source_contract(): for text in ("FADER_UNITY_CAPTURE_PX=7,FADER_UNITY_RELEASE_PX=12", "gesture.unityLatched=true", "if(!ev.altKey&&Math.abs", "handleField({target:g.input,type:'change'", - "WIRE_IMPACT_TRAVEL_MS=330,WIRE_IMPACT_SETTLE_MS=170", + "WIRE_IMPACT_TRAVEL_MS=520,WIRE_IMPACT_SETTLE_MS=160", + "const WIRE_RETRACT_MS=690", + "function startWireRetraction(sourceId,releasePoint)", + "if(replugRequest)kickWireSpring(replugRequest.sourceId,replugRequest.destId)", "const distance=1-t; // distance travelled from IN toward OUT", "const wave=passed>0?", "const accepted=ops.filter(op=>['CONNECT','ROUTE_ONLY','RETARGET'].includes(op.type)).at(-1)", @@ -198,13 +201,15 @@ def test_wire(page): }; return { nearInEarly:displaced(45,60),nearOutEarly:displaced(45,10), - nearOutLate:displaced(270,10), + nearOutLate:displaced(420,10), pluggedOut:displaced(0,0),pluggedIn:displaced(45,64) }; }""") assert physics and physics["nearInEarly"]< -2.5,("no upward jerk at receiving IN",physics) assert abs(physics["nearOutEarly"])<.5,("wrong direction: OUT moves first",physics) - assert physics["nearOutLate"]< -1.2,("wave stops before OUT",physics) + assert physics["nearOutLate"]< -1.1,("wave stops before OUT",physics) + assert abs(physics["nearOutLate"])=5,("no finite spring movement",len(samples)) assert any(" L " in x["d"] for x in samples),("no cable impact",len(samples)) @@ -266,6 +271,76 @@ def test_wire(page): page.evaluate("window.__v60Observer.disconnect()") + +def test_replug_and_retract(page): + # All actions are real pointer gestures on the preview mixer. Neither the + # retract overlay nor a wave can create a second graph EdgeId. + src=page.locator('#tracks .strip[data-id="1"] .wire-node-out') + old=page.locator('#tracks .strip[data-id="4"] .wire-node-in') + dst=page.locator('#tracks .strip[data-id="5"] .wire-node-in') + assert src.count()==old.count()==dst.count()==1,"need visible channels in wide bank" + old_edge=page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-4"]') + original_id=old_edge.get_attribute("data-edge-id") + assert original_id + page.evaluate("""()=>{ + window.__v62Relink=[]; + const wire=document.querySelector('#wireLayer'); + window.__v62Obs=new MutationObserver(records=>{ + for(const rec of records){ + const el=rec.target; + if(el.matches?.('path.wire-outgoing-line[data-cable-key="1-5"],path.wire-incoming-line[data-cable-key="1-5"]')) + window.__v62Relink.push(el.getAttribute('d')); + } + }); + window.__v62Obs.observe(wire,{subtree:true,attributes:true,attributeFilter:['d']}); + }""") + a=old.bounding_box() + b=dst.bounding_box() + cx=lambda q:q["x"]+q["width"]/2 + cy=lambda q:q["y"]+q["height"]/2 + page.mouse.move(cx(a),cy(a));page.mouse.down() + page.mouse.move(cx(b),cy(b),steps=12);page.mouse.up() + new_edge=page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]') + assert new_edge.count()==1 and new_edge.get_attribute("data-edge-id")==original_id,\ + "Retarget must preserve the exact selected committed EdgeId" + assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-4"]').count()==0 + page.wait_for_timeout(850) + waves=page.evaluate("window.__v62Relink") + assert len(waves)>=5 and any(" L " in d for d in waves),\ + ("replug did not trigger newly rendered WIRE wavy",waves[:2]) + new_jacket=page.locator('#wireLayer path.wire-outgoing-line[data-cable-key="1-5"],#wireLayer path.wire-incoming-line[data-cable-key="1-5"]').first + assert " C " in new_jacket.get_attribute("d"),"replug must settle to canonical cubic" + + # Pull the receiver out into free space BETWEEN sockets (valid blank + # receiving bay), then release. The graph removes immediately; ONLY + # the nonpainting visual cable falls and reels back to its real OUT. + other=page.locator('#tracks .strip[data-id="4"] .wire-node-in') + t=dst.bounding_box();q=other.bounding_box() + blank_x=(cx(t)+cx(q))/2 + blank_y=cy(t) + page.mouse.move(cx(t),cy(t));page.mouse.down() + page.mouse.move(blank_x,blank_y,steps=12);page.mouse.up() + assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0,\ + "unplug must remove committed graph immediately" + overlay=page.locator('#wireRetractLayer[data-wire-retract="1"]') + assert overlay.count()==1,"accepted unplug must leave transient falling cable" + assert overlay.evaluate("(el)=>getComputedStyle(el).pointerEvents")=="none" + plug=overlay.locator('[data-wire-retract-plug]') + first=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + page.wait_for_timeout(125) + dropped=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + assert dropped[1]>first[1]+3,("unplugged plug did not fall downward",first,dropped) + page.wait_for_timeout(230) + reel=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + start_dist=abs(first[0]-cx(src.bounding_box())) + assert abs(reel[0]-cx(src.bounding_box())) Date: Fri, 13 Nov 2026 10:37:26 +0700 Subject: [PATCH 03/14] V63: natural short WIRE wave and falling-hanging-reeling unplug (#631) * fix(gui): length-adaptive short WIRE whip and true falling-hanging-reeling cable with trailing ripple * test(chromium): length-scaled WIRE amplitudes and real fall-hang-reel timing with trailing flutter --- site/preview-v2/index.html | 103 ++++++++++++-------- tests/pages_v60_fader_wire_tactile_smoke.py | 73 ++++++++++++-- 2 files changed, 129 insertions(+), 47 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index 4e085662f..dd5b8c7ae 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -360,6 +360,8 @@ // Invalid/canceled operations never touch selection. const accepted=ops.filter(op=>['CONNECT','ROUTE_ONLY','RETARGET'].includes(op.type)).at(-1); if(accepted){ + if(String(accepted.sourceId)===wireRetractOverlay?.dataset.wireRetract) + stopWireRetraction(); const committed=accepted.edgeId!=null? wireEdges.find(e=>e.enabled&&e.id===accepted.edgeId&&e.destId===accepted.destId): wireEdges.find(e=>e.enabled&&e.sourceId===accepted.sourceId&&e.destId===accepted.destId); @@ -921,28 +923,32 @@ const WIRE_IMPACT_TRAVEL_MS=520,WIRE_IMPACT_SETTLE_MS=160; const WIRE_IMPACT_DURATION_MS=WIRE_IMPACT_TRAVEL_MS+WIRE_IMPACT_SETTLE_MS; function wireImpactPathData(x0,y0,x1,y1,limit,elapsedMs){ - const span=Math.abs(x1-x0),ceiling=Math.max(12,Math.min(100,Number(limit)||72)); + const span=Math.abs(x1-x0),chord=Math.hypot(x1-x0,y1-y0); + const ceiling=Math.max(12,Math.min(100,Number(limit)||72)); const sag=Math.max(10,Math.min(ceiling,Math.min(ceiling-5,28+Math.sqrt(span)*1.55))); const c=sag*4/3; - const u=Math.max(0,Math.min(1,elapsedMs/WIRE_IMPACT_TRAVEL_MS)); - // Physical launch occurs at the IN end (t=1), never at OUT (t=0). - // Ease-out front makes the receiving plug flick briskly, rather than creep. + // A short physical patch cable has little slack: scale its displacement, + // number of visible lobes AND propagation time, continuously with length. + // Long cables preserve the user-approved V62 520ms whip and end damping. + const length01=Math.max(0,Math.min(1,(chord-95)/300)); + const longMix=length01*length01*(3-2*length01); + const travel=360+160*longMix; + const width=.65-.29*longMix; // broad single curl at short distances + const u=Math.max(0,Math.min(1,elapsedMs/travel)); const front=1-Math.pow(1-u,1.45); - const settle=Math.max(0,Math.min(1,(elapsedMs-WIRE_IMPACT_TRAVEL_MS)/WIRE_IMPACT_SETTLE_MS)); + const settle=Math.max(0,Math.min(1,(elapsedMs-travel)/WIRE_IMPACT_SETTLE_MS)); const fade=Math.pow(1-settle,2); - const strength=Math.min(22,Math.max(14,Math.sqrt(span)*1.6))*fade; + const amplitude=Math.min(22,Math.max(14,Math.sqrt(span)*1.6))* + (.27+.73*longMix)*fade; let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); for(let i=1;i<=64;i++){ const t=i/64,v=1-t; const x=v*v*v*x0+3*v*v*t*x0+3*v*t*t*x1+t*t*t*x1; const y=v*v*v*y0+3*v*v*t*(y0+c)+3*v*t*t*(y1+c)+t*t*t*y1; - const distance=1-t; // distance travelled from IN toward OUT - const passed=front-distance; // material behind the advancing wavefront + const distance=1-t,passed=front-distance; const tether=Math.min(1,t/.025,(1-t)/.025); - // Finite causal travelling sine: first lobe moves UP at the IN socket, - // trailing lobes alternate and decay over time AND along cable length. const wave=passed>0? - -strength*Math.sin(2*Math.PI*passed/.36)* + -amplitude*Math.sin(2*Math.PI*passed/width)* Math.exp(-2.1*passed-2.9*distance)*tether:0; d+=' L '+x.toFixed(1)+' '+(y+wave).toFixed(1); } @@ -981,16 +987,38 @@ noninteractive cable jacket falls and reels back to its real OUT jack. Own overlay SVG is independent of the canonical routing/PCM projection. A canceled drag cannot call this effect. Reduced-motion skips it. */ -const WIRE_RETRACT_MS=690; +const WIRE_RETRACT_FALL_MS=320,WIRE_RETRACT_HANG_MS=150,WIRE_RETRACT_REEL_MS=660; +const WIRE_RETRACT_MS=WIRE_RETRACT_FALL_MS+WIRE_RETRACT_HANG_MS+WIRE_RETRACT_REEL_MS; let wireRetractToken=0,wireRetractOverlay=null; function stopWireRetraction(){ ++wireRetractToken; wireRetractOverlay?.remove();wireRetractOverlay=null; } +// Deterministic three-phase cable physics: first the free plug falls while +// staying at its released X, then a fully slack cable HANGS without reeling. +// Only after the visible pause does the reel pull the plug to the fixed OUT. +function wireRetractPose(x0,y0,rx,ry,drop,elapsedMs){ + const falling=Math.max(0,Math.min(1,elapsedMs/WIRE_RETRACT_FALL_MS)); + const fallEase=falling*falling*(3-2*falling); + const reelT=Math.max(0,Math.min(1, + (elapsedMs-WIRE_RETRACT_FALL_MS-WIRE_RETRACT_HANG_MS)/WIRE_RETRACT_REEL_MS)); + const pull=1-Math.pow(1-reelT,2.15); + const remaining=1-pull; + const x=x0+(rx-x0)*remaining; + const y=y0+(ry-y0+drop*fallEase)*remaining; + const baseSag=Math.min(48,Math.max(12,Math.abs(rx-x0)*.25)); + const hangSag=Math.min(105,Math.max(58,43+Math.abs(rx-x0)*.19)); + const sag=(baseSag*(1-fallEase)+hangSag*fallEase)*remaining; + // Gentle trailing ripple while the reel pulls, never while freely falling + // or paused; both endpoints retain exactly their physical positions. + const wave=5.2*Math.sin(Math.PI*reelT)*Math.pow(remaining,.55)* + Math.min(1,Math.abs(rx-x0)/125); + return {x,y,sag,wave,reelT,phase:reelT>0?'reel':falling<1?'fall':'hang'}; +} function startWireRetraction(sourceId,releasePoint){ stopWireRetraction(); if(document.hidden||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches)return; - const viewport=document.getElementById('viewport'),base=document.getElementById('wireLayer'); + const viewport=document.getElementById('viewport'); const out=viewport?.querySelector('.strip[data-id="'+sourceId+'"] .wire-node-out'); const source=wireSourceTrack(sourceId),vp=viewport?.getBoundingClientRect?.(); const jack=wireJackRect(out); @@ -998,16 +1026,16 @@ const x0=jack.left-vp.left+jack.width*.5,y0=jack.top-vp.top+jack.height*.5; const rx=Math.max(2,Math.min(vp.width-2,releasePoint.x-vp.left)); const ry=Math.max(2,Math.min(vp.height-2,releasePoint.y-vp.top)); + const drop=Math.max(20,Math.min(vp.height-ry-25, + Math.min(100,68+Math.abs(rx-x0)*.07))); const svgNS='http://www.w3.org/2000/svg'; const svg=document.createElementNS(svgNS,'svg'); svg.id='wireRetractLayer';svg.classList.add('routing-wire-overlay'); svg.dataset.wireRetract=String(sourceId); svg.setAttribute('viewBox','0 0 '+vp.width+' '+vp.height); - // Permit a short visible gravity drop beneath the normal WIRE bay, - // while retaining the original horizontally clipped channel viewport. - const bay=out.closest('.send-section')?.getBoundingClientRect?.(); - if(bay)svg.style.clipPath='inset('+Math.max(0,bay.top-vp.top-5)+'px 0px '+ - Math.max(0,vp.bottom-bay.bottom-48)+'px 0px)'; + // V62 clipped everything below the SEND bay after only ~48px: a limp + // hanging cable was therefore impossible to see. Clip only to viewport. + svg.style.clipPath='none'; svg.style.pointerEvents='none';svg.style.zIndex='4';svg.style.filter='none'; const mk=(tag,attrs)=>{ const el=document.createElementNS(svgNS,tag); @@ -1030,29 +1058,26 @@ stopWireRetraction();return; } if(began===null)began=now; - const p=Math.min(1,(now-began)/WIRE_RETRACT_MS); - const falling=Math.min(1,p/.29); - const reel=p<=.29?0:(p-.29)/.71; - const pull=1-Math.pow(1-reel,2.4); - const remaining=1-pull; - const x=x0+(rx-x0)*remaining; - const y=y0+(ry-y0)*remaining+26*falling*falling*remaining+ - 7*Math.sin(Math.PI*reel)*remaining; - const len=Math.hypot(x-x0,y-y0); - const sag=Math.min(43,len*.44)*(1-.45*pull); - const dx=x-x0; - const d='M '+x0.toFixed(1)+' '+y0.toFixed(1)+ - ' C '+(x0+dx*.04).toFixed(1)+' '+(y0+sag).toFixed(1)+ - ', '+(x-dx*.09).toFixed(1)+' '+(y+sag).toFixed(1)+ - ', '+x.toFixed(1)+' '+y.toFixed(1); + const elapsed=Math.min(WIRE_RETRACT_MS,Math.max(0,now-began)); + const pose=wireRetractPose(x0,y0,rx,ry,drop,elapsed); + svg.dataset.wirePhase=pose.phase; + let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); + for(let i=1;i<=40;i++){ + const t=i/40; + const bow=Math.sin(Math.PI*t); + const x=x0+(pose.x-x0)*t; + const curl=pose.wave*bow*Math.sin(2*Math.PI*((1-t)*1.2-pose.reelT*1.7)); + const y=y0+(pose.y-y0)*t+pose.sag*bow+curl; + d+=' L '+x.toFixed(1)+' '+y.toFixed(1); + } shadow.setAttribute('d',d);jacket.setAttribute('d',d); - plug.setAttribute('cx',x.toFixed(1));plug.setAttribute('cy',y.toFixed(1)); - plug.setAttribute('r',Math.max(0,5.2*remaining).toFixed(2)); - if(p<1)requestAnimationFrame(step); - else stopWireRetraction(); // no ghost cable or hitbox after collapse + plug.setAttribute('cx',pose.x.toFixed(1)); + plug.setAttribute('cy',pose.y.toFixed(1)); + plug.setAttribute('r',Math.max(0,5.2*(1-pose.reelT)).toFixed(2)); + if(elapsed0?", "const accepted=ops.filter(op=>['CONNECT','ROUTE_ONLY','RETARGET'].includes(op.type)).at(-1)", "wire-drag-line is-wire-selected", @@ -186,7 +190,7 @@ def test_wire(page): motion=HTML[HTML.index("const WIRE_IMPACT_TRAVEL_MS="): HTML.index("function kickWireSpring(")] physics=page.evaluate("()=>{\n"+motion+"""\n - const g=[0,0,180,0,72]; // representative wire with anchored plugs + const g=[0,0,500,0,72]; // approved long wire with anchored plugs const [x0,y0,x1,y1,limit]=g; const span=Math.abs(x1-x0),ceiling=Math.max(12,Math.min(100,Number(limit)||72)); const sag=Math.max(10,Math.min(ceiling,Math.min(ceiling-5,28+Math.sqrt(span)*1.55))); @@ -195,6 +199,23 @@ def test_wire(page): const v=1-t; return v*v*v*y0+3*v*v*t*(y0+c)+3*v*t*t*(y1+c)+t*t*t*y1; }; + // Same production physics for short and long spans; measure the + // maximum deformation against the natural slack cable at each length. + const peak=span=>{ + const geom=[0,0,span,0,72]; + const sag=Math.max(10,Math.min(72,Math.min(67,28+Math.sqrt(span)*1.55))); + const ctrl=sag*4/3; + let max=0; + for(const ms of [45,85,150,230,300,390,460,520]){ + const pts=wireImpactPathData(...geom,ms).match(/-?\\d+(?:\\.\\d+)?/g).map(Number); + for(let i=1;i<64;i++){ + const t=i/64,v=1-t; + const y=3*v*v*t*ctrl+3*v*t*t*ctrl; + max=Math.max(max,Math.abs(pts[2*i+1]-y)); + } + } + return max; + }; const displaced=(ms,i)=>{ const points=wireImpactPathData(...g,ms).match(/-?\\d+(?:\\.\\d+)?/g).map(Number); return points[2*i+1]-baseline(i/64); @@ -202,7 +223,8 @@ def test_wire(page): return { nearInEarly:displaced(45,60),nearOutEarly:displaced(45,10), nearOutLate:displaced(420,10), - pluggedOut:displaced(0,0),pluggedIn:displaced(45,64) + pluggedOut:displaced(0,0),pluggedIn:displaced(45,64), + tinyPeak:peak(70),shortPeak:peak(170),longPeak:peak(500) }; }""") assert physics and physics["nearInEarly"]< -2.5,("no upward jerk at receiving IN",physics) @@ -211,6 +233,10 @@ def test_wire(page): assert abs(physics["nearOutLate"])=5,("no finite spring movement",len(samples)) assert any(" L " in x["d"] for x in samples),("no cable impact",len(samples)) settled=cable.get_attribute("d") @@ -329,13 +355,44 @@ def test_replug_and_retract(page): first=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") page.wait_for_timeout(125) dropped=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - assert dropped[1]>first[1]+3,("unplugged plug did not fall downward",first,dropped) + assert dropped[1]>first[1]+3,("free plug did not fall",first,dropped) + assert abs(dropped[0]-first[0])<1.2,("reel began while the plug was still falling",first,dropped) + page.wait_for_timeout(220) + hang=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + assert overlay.get_attribute("data-wire-phase")=="hang","no hanging phase" + assert hang[1]>first[1]+38 and abs(hang[0]-first[0])<1.2,\ + ("plug did not remain freely hanging below release",first,hang) + assert overlay.evaluate("(el)=>getComputedStyle(el).clipPath")=="none",\ + "the dangling cable is still clipped to the SEND tray" + sag=overlay.locator('[data-wire-retract-jacket]').evaluate("""el=>{ + const length=el.getTotalLength(),mid=el.getPointAtLength(length/2), + a=el.getPointAtLength(0),b=el.getPointAtLength(length); + return mid.y-(a.y+b.y)/2; + }""") + assert sag>15,("hanging wire lacks a visible slack belly",sag) + page.wait_for_timeout(75) + hold=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + assert abs(hold[0]-hang[0])<1.2 and abs(hold[1]-hang[1])<1.2,\ + ("the wire should pause hanging before reeling",hang,hold) page.wait_for_timeout(230) reel=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") start_dist=abs(first[0]-cx(src.bounding_box())) assert abs(reel[0]-cx(src.bounding_box())){\n"+model+"""\n + const a=wireRetractPose(0,0,300,0,82,180); + const b=wireRetractPose(0,0,300,0,82,400); + const c=wireRetractPose(0,0,300,0,82,680); + return {fall:a,hang:b,reel:c}; + }""") + assert response["fall"]["wave"]==response["hang"]["wave"]==0,response + assert response["reel"]["wave"]>1.2,response + assert response["fall"]["phase"]=="fall" and response["hang"]["phase"]=="hang" and response["reel"]["phase"]=="reel" + assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0 + page.wait_for_timeout(580) assert page.locator('#wireRetractLayer').count()==0,"retraction left a ghost cable" assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0 page.evaluate("window.__v62Obs.disconnect()") @@ -364,7 +421,7 @@ def run(): page.close() finally: browser.close() - print("PASS V62 Chromium: damped IN-to-OUT whip, accepted relocated wavy, falling/unspooling unplug, no ghost graph") + print("PASS V63 Chromium: adaptive 1/2/4-channel waves, real fall-hang-reel with trailing flex, no phantom graph") if __name__=="__main__": From 383cf1927498d9c3f557110d71825363077b5be6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 10:43:47 +0700 Subject: [PATCH 04/14] V63: deterministic proof of stationary hang before automatic reel (#632) --- tests/pages_v60_fader_wire_tactile_smoke.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/pages_v60_fader_wire_tactile_smoke.py b/tests/pages_v60_fader_wire_tactile_smoke.py index 1eb656336..d93e02ed7 100644 --- a/tests/pages_v60_fader_wire_tactile_smoke.py +++ b/tests/pages_v60_fader_wire_tactile_smoke.py @@ -370,10 +370,10 @@ def test_replug_and_retract(page): return mid.y-(a.y+b.y)/2; }""") assert sag>15,("hanging wire lacks a visible slack belly",sag) - page.wait_for_timeout(75) - hold=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - assert abs(hold[0]-hang[0])<1.2 and abs(hold[1]-hang[1])<1.2,\ - ("the wire should pause hanging before reeling",hang,hold) + # CI/browser scheduling can exceed a short hang interval between + # getPointAtLength and a second DOM read. The actual DOM phase above + # proves the hang occurred; check stationary positions at two precise + # timeline samples from the *production function*, not wall-clock sleep. page.wait_for_timeout(230) reel=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") start_dist=abs(first[0]-cx(src.bounding_box())) @@ -384,11 +384,15 @@ def test_replug_and_retract(page): HTML.index("function startWireRetraction(")] response=page.evaluate("()=>{\n"+model+"""\n const a=wireRetractPose(0,0,300,0,82,180); - const b=wireRetractPose(0,0,300,0,82,400); + const b=wireRetractPose(0,0,300,0,82,350); + const held=wireRetractPose(0,0,300,0,82,445); const c=wireRetractPose(0,0,300,0,82,680); - return {fall:a,hang:b,reel:c}; + return {fall:a,hang:b,held,reel:c}; }""") - assert response["fall"]["wave"]==response["hang"]["wave"]==0,response + assert response["fall"]["wave"]==response["hang"]["wave"]==response["held"]["wave"]==0,response + assert abs(response["hang"]["x"]-response["held"]["x"])<.01 and \ + abs(response["hang"]["y"]-response["held"]["y"])<.01,\ + ("production hang pose moved before reel began",response) assert response["reel"]["wave"]>1.2,response assert response["fall"]["phase"]=="fall" and response["hang"]["phase"]=="hang" and response["reel"]["phase"]=="reel" assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0 From e02edddd7ffe847e835f5a38bd42bd74e09fb4fb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 11:14:49 +0700 Subject: [PATCH 05/14] V64: OUT-origin spring wave during immediate WIRE retraction (#637) * fix(gui): OUT-launched damped wave while unplugged cable reels home, no fall or hang * test(chromium): prove OUT-origin reel wave, active shortening and absence of falling/hanging phases --- site/preview-v2/index.html | 87 ++++++++-------- tests/pages_v60_fader_wire_tactile_smoke.py | 107 +++++++++++--------- 2 files changed, 101 insertions(+), 93 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index dd5b8c7ae..7d536e850 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -987,33 +987,47 @@ noninteractive cable jacket falls and reels back to its real OUT jack. Own overlay SVG is independent of the canonical routing/PCM projection. A canceled drag cannot call this effect. Reduced-motion skips it. */ -const WIRE_RETRACT_FALL_MS=320,WIRE_RETRACT_HANG_MS=150,WIRE_RETRACT_REEL_MS=660; -const WIRE_RETRACT_MS=WIRE_RETRACT_FALL_MS+WIRE_RETRACT_HANG_MS+WIRE_RETRACT_REEL_MS; +/* V64 unplug/reel: the OUT socket is the ONLY impulse source. + Unplug removes routing immediately; this detached SVG is visual only. + The free plug is pulled straight home while a damped traveling sine + starts at OUT and crosses the shortening, naturally slack cable. + No falling, hanging pause, constant wobble or phantom input edge. */ +const WIRE_RETRACT_MS=900; let wireRetractToken=0,wireRetractOverlay=null; function stopWireRetraction(){ ++wireRetractToken; wireRetractOverlay?.remove();wireRetractOverlay=null; } -// Deterministic three-phase cable physics: first the free plug falls while -// staying at its released X, then a fully slack cable HANGS without reeling. -// Only after the visible pause does the reel pull the plug to the fixed OUT. -function wireRetractPose(x0,y0,rx,ry,drop,elapsedMs){ - const falling=Math.max(0,Math.min(1,elapsedMs/WIRE_RETRACT_FALL_MS)); - const fallEase=falling*falling*(3-2*falling); - const reelT=Math.max(0,Math.min(1, - (elapsedMs-WIRE_RETRACT_FALL_MS-WIRE_RETRACT_HANG_MS)/WIRE_RETRACT_REEL_MS)); - const pull=1-Math.pow(1-reelT,2.15); - const remaining=1-pull; - const x=x0+(rx-x0)*remaining; - const y=y0+(ry-y0+drop*fallEase)*remaining; - const baseSag=Math.min(48,Math.max(12,Math.abs(rx-x0)*.25)); - const hangSag=Math.min(105,Math.max(58,43+Math.abs(rx-x0)*.19)); - const sag=(baseSag*(1-fallEase)+hangSag*fallEase)*remaining; - // Gentle trailing ripple while the reel pulls, never while freely falling - // or paused; both endpoints retain exactly their physical positions. - const wave=5.2*Math.sin(Math.PI*reelT)*Math.pow(remaining,.55)* - Math.min(1,Math.abs(rx-x0)/125); - return {x,y,sag,wave,reelT,phase:reelT>0?'reel':falling<1?'fall':'hang'}; +function wireRetractPose(x0,y0,rx,ry,elapsedMs){ + const p=Math.max(0,Math.min(1,elapsedMs/WIRE_RETRACT_MS)); + // Continuous winch acceleration/deceleration without a waiting/fall stage. + const pull=p*p*(3-2*p),remaining=1-pull; + const x=x0+(rx-x0)*remaining,y=y0+(ry-y0)*remaining; + const chord=Math.hypot(rx-x0,ry-y0); + // Loose but restrained curve shrinks with available cable length. + const sag=Math.min(48,Math.max(11,Math.sqrt(chord)*2.1))*Math.pow(remaining,.86); + // Propagation from OUT (t=0) toward the moving free plug (t=1). + const front=1-Math.pow(1-Math.min(1,p/.76),1.3); + const amplitude=Math.min(13,Math.max(5,Math.sqrt(chord)*.76))* + Math.pow(remaining,.62)*Math.min(1,p/.08); + return {x,y,remaining,sag,front,amplitude,phase:'reel'}; +} +function wireRetractPathData(x0,y0,rx,ry,elapsedMs){ + const pose=wireRetractPose(x0,y0,rx,ry,elapsedMs); + let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); + for(let i=1;i<=64;i++){ + const t=i/64; + const x=x0+(pose.x-x0)*t; + // Gravity creates gentle static slack, not a falling plug trajectory. + const y=y0+(pose.y-y0)*t+pose.sag*Math.sin(Math.PI*t); + const passed=pose.front-t; // positive only AFTER OUT-origin front passes + const anchor=Math.min(1,t/.035,(1-t)/.035); + const wave=passed>0? + -pose.amplitude*Math.sin(2*Math.PI*passed/.39)* + Math.exp(-1.8*passed-1.45*t)*anchor:0; + d+=' L '+x.toFixed(1)+' '+(y+wave).toFixed(1); + } + return {d,pose}; } function startWireRetraction(sourceId,releasePoint){ stopWireRetraction(); @@ -1026,15 +1040,11 @@ const x0=jack.left-vp.left+jack.width*.5,y0=jack.top-vp.top+jack.height*.5; const rx=Math.max(2,Math.min(vp.width-2,releasePoint.x-vp.left)); const ry=Math.max(2,Math.min(vp.height-2,releasePoint.y-vp.top)); - const drop=Math.max(20,Math.min(vp.height-ry-25, - Math.min(100,68+Math.abs(rx-x0)*.07))); const svgNS='http://www.w3.org/2000/svg'; const svg=document.createElementNS(svgNS,'svg'); svg.id='wireRetractLayer';svg.classList.add('routing-wire-overlay'); svg.dataset.wireRetract=String(sourceId); svg.setAttribute('viewBox','0 0 '+vp.width+' '+vp.height); - // V62 clipped everything below the SEND bay after only ~48px: a limp - // hanging cable was therefore impossible to see. Clip only to viewport. svg.style.clipPath='none'; svg.style.pointerEvents='none';svg.style.zIndex='4';svg.style.filter='none'; const mk=(tag,attrs)=>{ @@ -1059,25 +1069,16 @@ } if(began===null)began=now; const elapsed=Math.min(WIRE_RETRACT_MS,Math.max(0,now-began)); - const pose=wireRetractPose(x0,y0,rx,ry,drop,elapsed); - svg.dataset.wirePhase=pose.phase; - let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); - for(let i=1;i<=40;i++){ - const t=i/40; - const bow=Math.sin(Math.PI*t); - const x=x0+(pose.x-x0)*t; - const curl=pose.wave*bow*Math.sin(2*Math.PI*((1-t)*1.2-pose.reelT*1.7)); - const y=y0+(pose.y-y0)*t+pose.sag*bow+curl; - d+=' L '+x.toFixed(1)+' '+y.toFixed(1); - } - shadow.setAttribute('d',d);jacket.setAttribute('d',d); - plug.setAttribute('cx',pose.x.toFixed(1)); - plug.setAttribute('cy',pose.y.toFixed(1)); - plug.setAttribute('r',Math.max(0,5.2*(1-pose.reelT)).toFixed(2)); + const shape=wireRetractPathData(x0,y0,rx,ry,elapsed); + svg.dataset.wirePhase=shape.pose.phase; + shadow.setAttribute('d',shape.d);jacket.setAttribute('d',shape.d); + plug.setAttribute('cx',shape.pose.x.toFixed(1)); + plug.setAttribute('cy',shape.pose.y.toFixed(1)); + plug.setAttribute('r',Math.max(0,5.2*Math.pow(shape.pose.remaining,.6)).toFixed(2)); if(elapsedgetComputedStyle(el).pointerEvents")=="none" + jacket=overlay.locator('[data-wire-retract-jacket]') plug=overlay.locator('[data-wire-retract-plug]') first=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - page.wait_for_timeout(125) - dropped=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - assert dropped[1]>first[1]+3,("free plug did not fall",first,dropped) - assert abs(dropped[0]-first[0])<1.2,("reel began while the plug was still falling",first,dropped) - page.wait_for_timeout(220) - hang=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - assert overlay.get_attribute("data-wire-phase")=="hang","no hanging phase" - assert hang[1]>first[1]+38 and abs(hang[0]-first[0])<1.2,\ - ("plug did not remain freely hanging below release",first,hang) - assert overlay.evaluate("(el)=>getComputedStyle(el).clipPath")=="none",\ - "the dangling cable is still clipped to the SEND tray" - sag=overlay.locator('[data-wire-retract-jacket]').evaluate("""el=>{ - const length=el.getTotalLength(),mid=el.getPointAtLength(length/2), - a=el.getPointAtLength(0),b=el.getPointAtLength(length); - return mid.y-(a.y+b.y)/2; - }""") - assert sag>15,("hanging wire lacks a visible slack belly",sag) - # CI/browser scheduling can exceed a short hang interval between - # getPointAtLength and a second DOM read. The actual DOM phase above - # proves the hang occurred; check stationary positions at two precise - # timeline samples from the *production function*, not wall-clock sleep. - page.wait_for_timeout(230) - reel=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - start_dist=abs(first[0]-cx(src.bounding_box())) - assert abs(reel[0]-cx(src.bounding_box()))[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + source_x=cx(src.bounding_box()) + assert abs(moved[0]-source_x)getComputedStyle(el).clipPath")=="none" + + # Evaluate the very same committed runtime production math. A wave must + # launch near OUT first and only later reach the moving free end. Both + # physical endpoints must remain welded to their sockets and the source + # of the wave must not reverse into IN->OUT plug-in behavior. + model=HTML[HTML.index("const WIRE_RETRACT_MS=900"): HTML.index("function startWireRetraction(")] - response=page.evaluate("()=>{\n"+model+"""\n - const a=wireRetractPose(0,0,300,0,82,180); - const b=wireRetractPose(0,0,300,0,82,350); - const held=wireRetractPose(0,0,300,0,82,445); - const c=wireRetractPose(0,0,300,0,82,680); - return {fall:a,hang:b,held,reel:c}; + physics=page.evaluate("()=>{\\n"+model+"""\\n + const chord=400; + const deviation=(ms,i)=>{ + const {d,pose}=wireRetractPathData(0,0,chord,0,ms); + const ys=d.match(/-?\\d+(?:\\.\\d+)?/g).map(Number); + const t=i/64; + const baseline=pose.sag*Math.sin(Math.PI*t); + return ys[2*i+1]-baseline; + }; + const early=wireRetractPathData(0,0,chord,0,145); + const middle=wireRetractPathData(0,0,chord,0,570); + const finished=wireRetractPathData(0,0,chord,0,WIRE_RETRACT_MS); + return { + nearOutEarly:deviation(145,8),farEarly:deviation(145,51), + farLater:deviation(570,48),sourceAnchor:deviation(145,0), + freeAnchor:deviation(145,64), + halfwayX:middle.pose.x,earlyX:early.pose.x, + completeX:finished.pose.x,completeY:finished.pose.y, + startPhase:early.pose.phase,finishAmplitude:finished.pose.amplitude + }; }""") - assert response["fall"]["wave"]==response["hang"]["wave"]==response["held"]["wave"]==0,response - assert abs(response["hang"]["x"]-response["held"]["x"])<.01 and \ - abs(response["hang"]["y"]-response["held"]["y"])<.01,\ - ("production hang pose moved before reel began",response) - assert response["reel"]["wave"]>1.2,response - assert response["fall"]["phase"]=="fall" and response["hang"]["phase"]=="hang" and response["reel"]["phase"]=="reel" + assert physics["nearOutEarly"]< -2,("outgoing whip did not launch at OUT",physics) + assert abs(physics["farEarly"])<.4,("wave appears at free end before leaving OUT",physics) + assert physics["farLater"]<-.25,("wavy failed to travel toward moving end",physics) + assert abs(physics["sourceAnchor"])<.25 and abs(physics["freeAnchor"])<.25,\ + ("cable path cannot pull physical sockets off anchor",physics) + assert 0 Date: Fri, 13 Nov 2026 11:20:35 +0700 Subject: [PATCH 06/14] Fix exact-source Chromium probe escaping for V64 (#638) --- tests/pages_v60_fader_wire_tactile_smoke.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pages_v60_fader_wire_tactile_smoke.py b/tests/pages_v60_fader_wire_tactile_smoke.py index 24c7b54ca..a64e147fb 100644 --- a/tests/pages_v60_fader_wire_tactile_smoke.py +++ b/tests/pages_v60_fader_wire_tactile_smoke.py @@ -373,11 +373,11 @@ def test_replug_and_retract(page): # of the wave must not reverse into IN->OUT plug-in behavior. model=HTML[HTML.index("const WIRE_RETRACT_MS=900"): HTML.index("function startWireRetraction(")] - physics=page.evaluate("()=>{\\n"+model+"""\\n + physics=page.evaluate("()=>{\n"+model+"""\n const chord=400; const deviation=(ms,i)=>{ const {d,pose}=wireRetractPathData(0,0,chord,0,ms); - const ys=d.match(/-?\\d+(?:\\.\\d+)?/g).map(Number); + const ys=d.match(/-?\d+(?:\.\d+)?/g).map(Number); const t=i/64; const baseline=pose.sag*Math.sin(Math.PI*t); return ys[2*i+1]-baseline; From 7232c1ebe9e490ed20bcb02cb8cbffcd02e847ed Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 11:47:01 +0700 Subject: [PATCH 07/14] Updater M4: one-click OK consent for background-staged safe Windows upgrade (#628) * feat(updater): gate on-exit upgrades on exact user acknowledgement * feat(updater): nonblocking single-OK acknowledgement after verified staging * test(updater): assert consent gate and safe notification * fix(updater): exact consent, offline policy fixtures, and nonblocking dialog * fix(updater): exact consent, offline policy fixtures, and nonblocking dialog * fix(updater): exact consent, offline policy fixtures, and nonblocking dialog * feat(updater): silent GUI-only post-install probe with no ASIO auto-rearm or surprise relaunch * feat(updater): silent GUI-only post-install probe with no ASIO auto-rearm or surprise relaunch * feat(updater): silent GUI-only post-install probe with no ASIO auto-rearm or surprise relaunch * test(updater): verify probe short-circuit without indentation-sensitive search * fix(updater): nonmodal compact OK window keeps live mixer controls usable * test(updater): require explicit OK and nonmodal no-audio UX * fix(updater): exit safely when WebView2 probe cannot initialize, preserving rollback * test(updater): pre-window GUI probe failures do not strand installer recovery * fix(updater): never dismiss one-click OK until approval is durably saved * test(updater): failed consent write stays visible and offers retry --- installer/ArSonMixAutoUpdate.ps1 | 60 +++++- src/Main.cpp | 221 ++++++++++++++++++++-- tests/windows_installer_contract_test.mjs | 79 +++++++- 3 files changed, 340 insertions(+), 20 deletions(-) diff --git a/installer/ArSonMixAutoUpdate.ps1 b/installer/ArSonMixAutoUpdate.ps1 index 4e955c33c..f50d91824 100644 --- a/installer/ArSonMixAutoUpdate.ps1 +++ b/installer/ArSonMixAutoUpdate.ps1 @@ -18,6 +18,9 @@ $local=$env:LOCALAPPDATA if([string]::IsNullOrWhiteSpace($local)){exit 0} $root=Join-Path $local 'ArSonMix\Updates' $statePath=Join-Path $root 'state.json' +# Consent is a usability acknowledgement, never a cryptographic trust boundary. +# The worker independently verifies both published installers before execution. +$approvalPath=Join-Path $root 'approved.json' $logPath=Join-Path $root 'last-result.txt' $mutex=$null $locked=$false @@ -176,6 +179,17 @@ function Should-RetryInstaller([int]$attempts,[bool]$success,[bool]$oldRemains) # throws and must not spawn a second installer while the first runs. return (-not $success -and $oldRemains -and $attempts -ge 1 -and $attempts -lt 2) } +function Test-UserApproval([object]$approval,[object]$transaction) { + if($null -eq $transaction -or + $transaction.operation -cnotin @('repair','upgrade')) {return $false} + if($transaction.operation -ceq 'repair'){return $true} + # Approval is only a usability gate. It does NOT authenticate publisher. + return ($null -ne $approval -and + [string]$approval.candidateSha -ceq [string]$transaction.candidateSha -and + [string]$approval.previousSha -ceq [string]$transaction.previousSha -and + [string]$approval.candidateTag -ceq [string]$transaction.candidateTag) +} + function Get-InstalledImageStatus([object]$build) { try { $hash=[string]$build.exeSha256 @@ -345,7 +359,7 @@ function Launch-WithHealth([string]$expectedSha) { do { if($process.HasExited){return $false} if(Test-Path -LiteralPath $marker -PathType Leaf) { - if((Get-Content -LiteralPath $marker -Raw).Trim() -ceq 'GUI_READY' -and + if((Get-Content -LiteralPath $marker -Raw).Trim() -ceq 'GUI_READY_NO_AUDIO' -and (Test-InstalledRelease $expectedSha)) { Start-Sleep -Seconds 2 $process.Refresh() @@ -470,6 +484,25 @@ if($PolicySelfTest) { if(Should-RetryInstaller 2 $false $true){throw 'Repeated installer retry accepted'} if(Should-RetryInstaller 1 $false $false){throw 'Missing old version retried'} if(Should-RetryInstaller 1 $true $true){throw 'Successful install retried'} + # Test same-version repair and exact candidate acknowledgement offline. + $transaction=[pscustomobject]@{ + operation='upgrade';candidateSha=('a'*40);previousSha=('b'*40); + candidateTag='v0.5.0-alpha.6'} + $goodAck=[pscustomobject]@{ + candidateSha=('a'*40);previousSha=('b'*40);candidateTag='v0.5.0-alpha.6'} + if(-not (Test-UserApproval $goodAck $transaction)) {throw 'Exact update acknowledgement rejected'} + if(Test-UserApproval $null $transaction) {throw 'Missing acknowledgement accepted'} + $goodAck.candidateSha='c'*40 + if(Test-UserApproval $goodAck $transaction) {throw 'Different release acknowledgement accepted'} + $goodAck.candidateSha='a'*40 + $goodAck.previousSha='c'*40 + if(Test-UserApproval $goodAck $transaction) {throw 'Different baseline acknowledgement accepted'} + $goodAck.previousSha='b'*40 + $goodAck.candidateTag='v0.5.0-alpha.7' + if(Test-UserApproval $goodAck $transaction) {throw 'Different version acknowledgement accepted'} + $transaction.operation='repair' + if(-not (Test-UserApproval $null $transaction)) {throw 'Same-version repair incorrectly gated'} + Write-Output 'ARSONMIX_UPDATER_USER_ACK_POLICY_PASS' Write-Output 'ARSONMIX_UPDATER_EXACT_IMAGE_POLICY_PASS' Write-Output 'ARSONMIX_UPDATER_RETRY_POLICY_PASS' Write-Output 'ARSONMIX_UPDATER_CACHE_AND_RECOVERY_PASS' @@ -669,6 +702,20 @@ try { -not (Test-StagedAsset $oldPath $state.previousAsset)) { Fail 'Offline staged install/rollback bytes not verified' } + # A published upgrade must be acknowledged once by the user in the + # lightweight GUI prompt. A missing/stale/corrupt token defers installation, + # without breaking mixer startup or forcing an active audio session closed. + # Same-release binary repair is separate and does not require this consent. + if($state.operation -ceq 'upgrade') { + $approval=$null + if(Test-Path -LiteralPath $approvalPath -PathType Leaf) { + try {$approval=Read-Json $approvalPath} catch { } + } + if(-not (Test-UserApproval $approval $state)) { + Log-Result 'UPDATE_WAITING_FOR_USER_OK' + exit 0 + } + } # Re-query public release to reject a revoked or replaced candidate. # No network is needed *during* live audio; if offline on close, defer. $headers=@{Accept='application/vnd.github+json';'User-Agent'='ArSonMix-SmartUpdater/1'; @@ -744,6 +791,7 @@ try { $state.blockedTag='' Write-State $state Log-Result ($(if($state.operation -ceq 'repair'){'REPAIRED '}else{'HEALTHY '})+$new.tag_name) + Remove-Item -LiteralPath $approvalPath -Force -ErrorAction SilentlyContinue Clear-StagedVendorFiles $state exit 0 } @@ -755,9 +803,9 @@ try { $state.retryAfterUtc=[DateTime]::UtcNow.AddMinutes(30).ToString('o') Write-State $state Log-Result ('INSTALLER_TRANSIENT_FAILURE_RETRY_NEXT_EXIT '+$new.tag_name) - try {[Diagnostics.Process]::Start($exe) | Out-Null} catch { - Log-Result 'PREVIOUS_EXE_RELAUNCH_FAILED' - } + # Do not surprise the operator by restarting audible audio after Quit. + # The previous verified EXE remains available on next deliberate launch. + Log-Result 'PREVIOUS_EXE_RETAINED_FOR_NEXT_MANUAL_LAUNCH' exit 0 } # An installer failure leaves the previous app intact or may be partial. @@ -770,7 +818,7 @@ try { Write-State $state if($actualSha -ceq $installedSha) { Log-Result ('INSTALLER_FAILED_PREVIOUS_VERSION_RETAINED '+$new.tag_name) - [Diagnostics.Process]::Start($exe) | Out-Null + # A failed post-exit update must not auto-start an audible mixer. exit 0 } foreach($process in [Diagnostics.Process]::GetProcessesByName('ArSonMix')) { @@ -792,7 +840,7 @@ try { $state.phase='rolled-back' Write-State $state Log-Result ('ROLLED_BACK '+$new.tag_name) - [Diagnostics.Process]::Start($exe) | Out-Null + # Restored version is ready for the next deliberate user launch. exit 0 } } diff --git a/src/Main.cpp b/src/Main.cpp index 7fe296f6d..789057f0e 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -228,6 +228,19 @@ class AudioSetupWindow final : public juce::DocumentWindow bool wasVisible_ = false; }; +// A post-install GUI probe must not open the owner's last audio interface, +// restore or overwrite the last .smix, or automatically resume live output. +// Only the supervisor creates the canonical 36-character GUID env token. +static bool isAutoUpdateHealthProbe() +{ +#if defined(_WIN32) + const auto token = juce::SystemStats::getEnvironmentVariable ("ARSONMIX_UPDATE_PROBE", {}); + return token.length() == 36 && juce::Uuid (token).toDashedString() == token; +#else + return false; +#endif +} + class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, private juce::ChangeListener { public: @@ -318,7 +331,8 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr }); restorePlayerLibrary(); // portable, local song paths only; NEVER autoplay on launch catalog_.onChanged = [this] { emitCatalog(); emitScanProgress(); }; - catalog_.scanFactoryIfPresent(); // Only the signed-off local manifest; never global VST scans. + if (!updaterProbeMode_) + catalog_.scanFactoryIfPresent(); // Do not scan even FactoryFX during GUI-only probe. #if defined(_WIN32) // JUCE owns the real window commands; unlike WebView2 JS, these are // synchronous native controls with JUCE's existing resize constrainer. @@ -390,8 +404,9 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr mixerSessionWorker_.finishForShutdown(); logicalVendorEditor_.reset(); const auto lab=engine_.status().getProperty("dryRoutingLab",{}); - if(static_cast(lab.getProperty("nativeChannelIdPcmActive",false)) || - logicalMixer_.loaded()) { + if (!updaterProbeMode_ && + (static_cast(lab.getProperty("nativeChannelIdPcmActive",false)) || + logicalMixer_.loaded())) { const auto error=saveMixerSession(resumeMain); if(error.isNotEmpty()) diagnostics_.record("DYNAMIC_MIXER_EXIT_SAVE_REJECTED",error); @@ -518,6 +533,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr juce::uint32 webViewStartupTick_ = 0; juce::uint32 guiReadyTick_ = 0; bool audioEngineStarted_ = false; + const bool updaterProbeMode_ = isAutoUpdateHealthProbe(); bool setupLaunching_ = false; unsigned int timerTicks_ = 0; // Opt-in and bounded: message-thread timing only, NEVER the audio callback. @@ -6663,8 +6679,9 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr #if defined(_WIN32) // A startup splash can delay HWND creation; attach once the real JUCE // peer exists. Never install a low-level keyboard hook. - if(auto* peer=getPeer()) - hotkeys_.attach(peer->getNativeHandle()); + if (!updaterProbeMode_) + if(auto* peer=getPeer()) + hotkeys_.attach(peer->getNativeHandle()); #endif if(deviceApply_.busy())return; // a vendor modal loop may re-enter JUCE // Always disabled unless the user explicitly starts a bounded trace. @@ -6703,10 +6720,15 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr diagnostics_.record ("WEBVIEW2_GUI_READY_TIMEOUT", "No native ArSonMix UI handshake"); engine_.stop(); if (onStartupStage_) onStartupStage_ (3); // dismiss splash before error dialog - showWebViewStartupError ("The embedded mixer did not initialize in 10 seconds." - " Check the WebView2 Runtime and browser-cache folder permissions."); + if (!updaterProbeMode_) + showWebViewStartupError ("The embedded mixer did not initialize in 10 seconds." + " Check the WebView2 Runtime and browser-cache folder permissions."); return; } + // Health probes verify WebView/native readiness without opening any + // audio device, restoring plugins or writing a replacement .smix. + if (updaterProbeMode_ && audioEngineStarted_) + return; // First visible GUI frame must precede device discovery. Reuse the // existing timer; never add a worker or poll the audio callback. if (!audioEngineStarted_) @@ -6715,6 +6737,12 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr juce::Time::getMillisecondCounter() - guiReadyTick_ < 150u) return; audioEngineStarted_ = true; + if (updaterProbeMode_) + { + diagnostics_.record ("UPDATER_GUI_PROBE", "Native bridge ready; device and session intentionally untouched"); + if (onStartupStage_) onStartupStage_ (2); + return; + } auto saved = juce::XmlDocument::parse ( machineSettingsDirectory().getChildFile ("audio-devices.xml")); startupError_ = engine_.start (saved.get()); @@ -6973,6 +7001,71 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr } }; +#if defined(_WIN32) +// A non-modal desktop notice: no JUCE modal loop, no loss of live mixer controls. +// The close X dismisses without consent; ONLY the OK action writes approval. +// Update installation remains strictly deferred until a normal mixer exit. +class ArSonMixUpdateNotice final : public juce::DocumentWindow +{ +public: + ArSonMixUpdateNotice (const juce::String& tag, std::function onAccept) + : DocumentWindow ("ArSonMix · Update", juce::Colour (0xff141d27), closeButton), + onAccept_ (std::move (onAccept)) + { + panel_.message = "Version " + tag + " is ready.\n" + "It will install automatically after you close ArSonMix.\n" + "Your session and audio will not be interrupted."; + panel_.ok.onClick = [this] + { + // Never say OK succeeded when the per-user approval file is + // unreadable/unwritable: leave this NON-modal window available + // for a retry without interrupting audio. + if (onAccept_ && onAccept_()) + { + setVisible (false); + return; + } + panel_.message = "Could not save update approval.\n" + "Your mixer remains available.\n" + "Check disk permissions, then choose Retry."; + panel_.ok.setButtonText ("Retry"); + panel_.repaint(); + }; + setUsingNativeTitleBar (false); + setTitleBarHeight (31); + setResizable (false, false); + setContentNonOwned (&panel_, false); + centreWithSize (428, 185); + setVisible (true); + toFront (true); + } + void closeButtonPressed() override { setVisible (false); } + +private: + struct Panel final : juce::Component + { + juce::String message; + juce::TextButton ok {"OK"}; + Panel() + { + addAndMakeVisible (ok); + ok.setColour (juce::TextButton::buttonColourId, juce::Colour (0xff377bc7)); + ok.setColour (juce::TextButton::textColourOffId, juce::Colours::white); + } + void resized() override { ok.setBounds (getWidth() - 106, getHeight() - 43, 88, 29); } + void paint (juce::Graphics& g) override + { + g.fillAll (juce::Colour (0xff141d27)); + g.setColour (juce::Colour (0xffe5edf7)); + g.setFont (juce::Font (juce::FontOptions (14.0f))); + g.drawFittedText (message, 20, 15, getWidth() - 40, getHeight() - 69, + juce::Justification::topLeft, 3); + } + } panel_; + std::function onAccept_; +}; +#endif + class ConsoleApp final : public juce::JUCEApplication, private juce::Timer { public: @@ -7003,7 +7096,8 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer #endif // Paint the approved dark native splash BEFORE browser cache I/O, // WebView2 initialization, device scan or native console construction. - splash_ = std::make_unique(); + if (!isAutoUpdateHealthProbe()) + splash_ = std::make_unique(); startTimer (90); // one-shot handoff after Windows first paint } void timerCallback() override @@ -7020,7 +7114,24 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer } #endif if (startupAttempted_) + { +#if defined(_WIN32) + if (isAutoUpdateHealthProbe()) + { + // Give the supervisor time to observe GUI_READY_NO_AUDIO, + // then quit by JUCE's ordinary message-thread teardown. + if (updateProbeCompleteTick_ != 0 && + juce::Time::getMillisecondCounter() - updateProbeCompleteTick_ >= 3500u) + { + systemRequestedQuit(); + return; + } + } + else if (++updatePromptTicks_ % 40 == 0) + serviceSmartUpdateAcknowledgement(); +#endif return; + } startupAttempted_ = true; // Remain active only as a lightweight update handshake (4 Hz). // Do not touch audio-device selection, callback, or GUI geometry. @@ -7029,12 +7140,25 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer if (!folder.createDirectory().wasOk() && !folder.isDirectory()) { splash_.reset(); + // The updater's GUI-only validation must never strand an invisible + // error dialog. Return control to the supervisor, which will keep + // the authenticated rollback installer available. + if (isAutoUpdateHealthProbe()) + { + systemRequestedQuit(); + return; + } showWebViewStartupError ("Cannot create the browser-cache folder: " + folder.getFullPathName()); return; } if (!juce::WebBrowserComponent::areOptionsSupported (webViewOptions())) { splash_.reset(); + if (isAutoUpdateHealthProbe()) + { + systemRequestedQuit(); + return; + } showWebViewStartupError ("The native browser backend could not be initialized on this machine."); return; } @@ -7061,16 +7185,23 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer .getChildFile ("health"); if (healthDir.createDirectory().wasOk()) healthDir.getChildFile (probe + ".ready") - .replaceWithText ("GUI_READY"); + .replaceWithText ("GUI_READY_NO_AUDIO"); } #endif - if (window_) window_->toFront (true); + if (isAutoUpdateHealthProbe()) + { + if (window_) window_->setVisible (false); + updateProbeCompleteTick_ = juce::Time::getMillisecondCounter(); + } + else if (window_) + window_->toFront (true); } }); #if defined(_WIN32) - launchSmartUpdater (false); + if (!isAutoUpdateHealthProbe()) + launchSmartUpdater (false); #endif // Opaque cover exactly matches the large HWND, not a small 740×420 // card leaving white WebView2 edges exposed during first paint. @@ -7083,6 +7214,9 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer void shutdown() override { stopTimer(); +#if defined(_WIN32) + updateNotice_.reset(); +#endif window_.reset(); splash_.reset(); #if defined(_WIN32) @@ -7094,7 +7228,8 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer // Avoid starting setup while Windows is signing out/shutting down: // Windows may terminate installer midway through file replacement. // A staged transaction remains available on the next normal exit. - if (!innoIsClosing && ::GetSystemMetrics (SM_SHUTTINGDOWN) == 0) + if (!innoIsClosing && !isAutoUpdateHealthProbe() && + ::GetSystemMetrics (SM_SHUTTINGDOWN) == 0) launchSmartUpdater (true); if (installerShutdownEvent_ != nullptr) { @@ -7110,6 +7245,64 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer } private: #if defined(_WIN32) + void serviceSmartUpdateAcknowledgement() + { + // The separately running updater has already staged and SHA-checked + // both packages. Never claim a prompt can validate publisher identity. + if (!window_) + return; + const auto local = juce::SystemStats::getEnvironmentVariable ("LOCALAPPDATA", {}); + if (local.isEmpty()) + return; + const auto folder = juce::File (local).getChildFile ("ArSonMix") + .getChildFile ("Updates"); + const auto stateFile = folder.getChildFile ("state.json"); + if (!stateFile.existsAsFile() || stateFile.getSize() > 8192) + return; + const auto state = juce::JSON::parse (stateFile.loadFileAsString()); + const auto* object = state.getDynamicObject(); + if (object == nullptr || object->getProperty ("phase").toString() != "staged" + || object->getProperty ("operation").toString() != "upgrade") + return; + const auto tag = object->getProperty ("candidateTag").toString(); + const auto candidate = object->getProperty ("candidateSha").toString(); + const auto previous = object->getProperty ("previousSha").toString(); + if (tag.length() > 60 || !tag.startsWith ("v") + || candidate.length() != 40 || previous.length() != 40 + || !candidate.containsOnly ("0123456789abcdef") + || !previous.containsOnly ("0123456789abcdef")) + return; + const auto approvalFile = folder.getChildFile ("approved.json"); + if (approvalFile.existsAsFile() && approvalFile.getSize() <= 2048) + { + const auto saved = juce::JSON::parse (approvalFile.loadFileAsString()); + if (const auto* ack = saved.getDynamicObject()) + if (ack->getProperty ("candidateTag").toString() == tag + && ack->getProperty ("candidateSha").toString() == candidate + && ack->getProperty ("previousSha").toString() == previous) + return; // Already acknowledged; no repeat dialog. + } + if (lastUpdatePromptedSha_ == candidate) + return; // Never nag during one mixer session. + if (updateNotice_ && updateNotice_->isVisible()) + return; // Do not open another notice over a currently visible one. + lastUpdatePromptedSha_ = candidate; + // The approved user need not see download progress or installer flags. + // Unlike NativeMessageBox::showAsync, this floating notice is NON-modal: + // a performer can still move faders or patch WIRE during a live session. + updateNotice_ = std::make_unique (tag, + [approvalFile, tag, candidate, previous] + { + auto approval = juce::DynamicObject::Ptr (new juce::DynamicObject()); + approval->setProperty ("candidateTag", tag); + approval->setProperty ("candidateSha", candidate); + approval->setProperty ("previousSha", previous); + // A usability acknowledgement only. PowerShell verifies the + // published release, both installer hashes and process locks. + return approvalFile.replaceWithText ( + juce::JSON::toString (juce::var (approval.get()), false)); + }); + } void launchSmartUpdater (bool applyStaged) { // Windows per-user installation only: independent updater process. @@ -7147,6 +7340,10 @@ class ConsoleApp final : public juce::JUCEApplication, private juce::Timer #if defined(_WIN32) HANDLE updateRunningMutex_ = nullptr; HANDLE installerShutdownEvent_ = nullptr; + int updatePromptTicks_ = 0; + std::unique_ptr updateNotice_; + juce::uint32 updateProbeCompleteTick_ = 0; + juce::String lastUpdatePromptedSha_; #endif std::unique_ptr splash_; std::unique_ptr window_; diff --git a/tests/windows_installer_contract_test.mjs b/tests/windows_installer_contract_test.mjs index 7b1396365..2a630baf2 100644 --- a/tests/windows_installer_contract_test.mjs +++ b/tests/windows_installer_contract_test.mjs @@ -173,7 +173,7 @@ test('Smart Auto Updater uses an independent process and strict release gates', assert.match(native, /getChildFile \("ArSonMixAutoUpdate\.ps1"\)/); assert.match(native, /juce::ChildProcess supervisor/); assert.match(native, /ARSONMIX_UPDATE_PROBE/); - assert.match(native, /GUI_READY/); + assert.match(native, /GUI_READY_NO_AUDIO/); // JUCE 8.0.15 Uuid::toString() is un-dashed; PS .NET Guid.ToString("D") is dashed. assert.match(native, /juce::Uuid \(probe\)\.toDashedString\(\) == probe/); assert.doesNotMatch(native, /juce::Uuid \(probe\)\.toString\(\) == probe/); @@ -315,7 +315,7 @@ test('healthy install, repair and rollback require real EXE SHA, not provenance assert.match(script, /Repair did not restore exact authenticated EXE and source manifest/); assert.match(script, /if\(\$upgradeOK -and \(Test-InstalledRelease/); assert.match(script, /if\(Test-InstalledRelease \$installedSha\)/); - assert.match(script, /GUI_READY' -and\s*\n\s*\(Test-InstalledRelease \$expectedSha\)/); + assert.match(script, /GUI_READY_NO_AUDIO' -and\s*\n\s*\(Test-InstalledRelease \$expectedSha\)/); assert.match(script, /Same source with changed EXE accepted/); assert.match(smoke, /ARSONMIX_UPDATER_EXACT_IMAGE_POLICY_PASS/); }); @@ -380,3 +380,78 @@ test('WebView2 error screen cannot acknowledge healthy GUI; staging retries afte assert.match(script, /\$state\.phase='staged'\s*\n\s*\$state\.lastCheckUtc=\[DateTime\]::UtcNow\.ToString\('o'\)/); assert.match(script, /TotalMinutes -lt 20/); }); + + +test('acknowledged one-click upgrade is deferred until the exact candidate is approved', () => { + const updater = read('installer/ArSonMixAutoUpdate.ps1'); + const native = read('src/Main.cpp'); + assert.match(updater, /\$approvalPath=Join-Path \$root 'approved\.json'/); + assert.match(updater, /UPDATE_WAITING_FOR_USER_OK/); + assert.match(updater, /function Test-UserApproval\(/); + assert.match(updater, /ARSONMIX_UPDATER_USER_ACK_POLICY_PASS/); + assert.match(updater, /if\(-not \(Test-UserApproval \$approval \$state\)\)/); + assert.match(updater, /\$state\.operation -ceq 'upgrade'/); + for (const name of ['candidateSha','candidateTag','previousSha']) + assert.ok(updater.includes('[string]$approval.'+name+' -ceq [string]$transaction.'+name)); + assert.ok(updater.indexOf('UPDATE_WAITING_FOR_USER_OK') < updater.indexOf(" $state.phase='installing'"), + 'consent must gate the installer before any replacement'); + assert.match(native, /void serviceSmartUpdateAcknowledgement\(\)/); + assert.match(native, /if \(\+\+updatePromptTicks_ % 40 == 0\)/); + assert.match(native, /class ArSonMixUpdateNotice final : public juce::DocumentWindow/); + assert.match(native, /juce::TextButton ok \{"OK"\}/); + assert.match(native, /void closeButtonPressed\(\) override \{ setVisible \(false\); \}/); + assert.match(native, /std::make_unique/); + assert.doesNotMatch(native, /juce::NativeMessageBox::showAsync \(options/); + assert.match(native, /approved\.json/); + assert.match(native, /lastUpdatePromptedSha_ == candidate/); + assert.doesNotMatch(updater, /(?:Stop-Process|taskkill|TerminateProcess)/); +}); + +test('GUI-only updater probe does not strand pre-window WebView2 startup failures', () => { + const native = read('src/Main.cpp'); + const startup = native.slice(native.indexOf('void initialise (const juce::String&) override'), + native.indexOf('void shutdown() override', native.indexOf('void initialise (const juce::String&) override'))); + const failures = [ + 'Cannot create the browser-cache folder:', + 'The native browser backend could not be initialized on this machine.' + ]; + for (const message of failures) { + const failureAt = startup.indexOf(message); + assert.ok(failureAt > 0, message); + const preceding = startup.slice(Math.max(0, failureAt - 285), failureAt); + assert.match(preceding, /if \(isAutoUpdateHealthProbe\(\)\)\s*\{\s*systemRequestedQuit\(\);\s*return;\s*\}/); + } +}); + +test('silent post-install GUI probe cannot automatically arm ASIO or save a user session', () => { + const main = read('src/Main.cpp'); + const updater = read('installer/ArSonMixAutoUpdate.ps1'); + assert.match(main, /static bool isAutoUpdateHealthProbe\(\)/); + assert.match(main, /if \(updaterProbeMode_ && audioEngineStarted_\)\s*return;/); + const guard=main.indexOf('diagnostics_.record ("UPDATER_GUI_PROBE"'); + const engine=main.indexOf('startupError_ = engine_.start (saved.get());', guard); + assert.ok(guard >= 0 && engine > guard, 'GUI-only return must precede audio device startup'); + assert.match(main.slice(guard,engine), /return;\s*\}\s*auto saved/); + assert.match(main, /if \(!updaterProbeMode_ &&\s*\(static_cast\(lab\.getProperty/); + assert.match(main, /if \(!isAutoUpdateHealthProbe\(\)\)\s*launchSmartUpdater \(false\)/); + assert.match(main, /if \(!innoIsClosing && !isAutoUpdateHealthProbe\(\) &&/); + assert.match(main, /updateProbeCompleteTick_ >= 3500u/); + assert.match(updater, /GUI_READY_NO_AUDIO/); + assert.match(updater, /PREVIOUS_EXE_RETAINED_FOR_NEXT_MANUAL_LAUNCH/); + // Explicit manual Repair mode may still relaunch on request. + const afterApply = updater.slice(updater.indexOf('# Post-close supervisor')); + assert.doesNotMatch(afterApply, /\[Diagnostics\.Process\]::Start\(\$exe\)/); +}); + +test('updater notice is nonmodal, dismissal cannot approve and shutdown cleans up', () => { + const s=read('src/Main.cpp'); + const notice=s.slice(s.indexOf('class ArSonMixUpdateNotice final'),s.indexOf('class ConsoleApp final')); + assert.match(notice, /juce::DocumentWindow/); + assert.match(notice, /panel_\.ok\.onClick = \[this\]/); + assert.match(notice, /if \(onAccept_ && onAccept_\(\)\)/); + assert.match(notice, /panel_\.ok\.setButtonText \("Retry"\)/); + assert.match(s, /return approvalFile\.replaceWithText \(/); + assert.match(notice, /void closeButtonPressed\(\) override \{ setVisible \(false\); \}/); + assert.doesNotMatch(notice, /enterModalState|runModalLoop|NativeMessageBox/); + assert.match(s, /updateNotice_\.reset\(\);\s*#endif\s*window_\.reset\(\)/); +}); From 227f200f89db2405bd41b42411f6612a5a70d854 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:01:28 +0700 Subject: [PATCH 08/14] V65: fast full-span WIRE reel and flexible free plug (#639) * fix(gui): quick 520ms OUT-origin reel, full jacket whip and physically free oscillating plug * test(chromium): require fast full-jacket wave and free-plug motion during accepted WIRE unplug * test(chromium): normalize Python continuation escapes in V65 assertions * test(ui): update fast source contract to V65 full-cable wavefront --- site/preview-v2/index.html | 61 +++++++++++++-------- tests/pages_v60_fader_wire_tactile_smoke.py | 59 ++++++++++++++------ 2 files changed, 81 insertions(+), 39 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index 7d536e850..ec7f2b30f 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -992,7 +992,11 @@ The free plug is pulled straight home while a damped traveling sine starts at OUT and crosses the shortening, naturally slack cable. No falling, hanging pause, constant wobble or phantom input edge. */ -const WIRE_RETRACT_MS=900; +/* V65 fast elastic cable reel. OUT is the sole impulse source. + Single visual-only transient, no synthetic route or native DSP mutation. + The travelling wave spans the shrinking jacket and the detached plug + is a FREE end: it moves with the final wave rather than being pinned. */ +const WIRE_RETRACT_MS=520; let wireRetractToken=0,wireRetractOverlay=null; function stopWireRetraction(){ ++wireRetractToken; @@ -1000,34 +1004,46 @@ } function wireRetractPose(x0,y0,rx,ry,elapsedMs){ const p=Math.max(0,Math.min(1,elapsedMs/WIRE_RETRACT_MS)); - // Continuous winch acceleration/deceleration without a waiting/fall stage. - const pull=p*p*(3-2*p),remaining=1-pull; + // 42% shorter than V64, brisk at the beginning and softly decelerating. + const remaining=Math.pow(1-p,2.25); const x=x0+(rx-x0)*remaining,y=y0+(ry-y0)*remaining; const chord=Math.hypot(rx-x0,ry-y0); - // Loose but restrained curve shrinks with available cable length. - const sag=Math.min(48,Math.max(11,Math.sqrt(chord)*2.1))*Math.pow(remaining,.86); - // Propagation from OUT (t=0) toward the moving free plug (t=1). - const front=1-Math.pow(1-Math.min(1,p/.76),1.3); - const amplitude=Math.min(13,Math.max(5,Math.sqrt(chord)*.76))* - Math.pow(remaining,.62)*Math.min(1,p/.08); - return {x,y,remaining,sag,front,amplitude,phase:'reel'}; + const length01=Math.max(0,Math.min(1,(chord-85)/270)); + const longMix=length01*length01*(3-2*length01); + // The pulse traverses the *whole* cable before reel-in is over. + // OUT -> FREE end, then leaves a short damped trailing tail. + const front=1.5*(1-Math.pow(1-Math.min(1,p/.55),1.35)); + const width=.62-.25*longMix; // fewer smoother lobes on short cables + const sag=Math.min(46,Math.max(9,Math.sqrt(chord)*2.1))* + Math.pow(remaining,.72); + const amplitude=Math.min(19,Math.max(7,Math.sqrt(chord)*.95))* + (.42+.58*longMix)*Math.pow(remaining,.47)*Math.min(1,p/.095); + return {x,y,remaining,sag,front,width,amplitude,phase:'reel'}; +} +function wireRetractWave(pose,t){ + const passed=pose.front-t; // first near OUT, then all along the cable + if(passed<=0)return 0; + const sourceAnchor=Math.min(1,t/.035); + // Unlike the connected socket, the unplugged end is not tethered: + // the sine displaces the plug itself, so it never looks rigid. + return -pose.amplitude*Math.sin(2*Math.PI*passed/pose.width)* + Math.exp(-1.05*passed-.32*t)*sourceAnchor; } function wireRetractPathData(x0,y0,rx,ry,elapsedMs){ const pose=wireRetractPose(x0,y0,rx,ry,elapsedMs); + const dx=pose.x-x0,dy=pose.y-y0; + const norm=Math.max(1,Math.hypot(dx,dy)); + const nx=-dy/norm,ny=dx/norm; let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); for(let i=1;i<=64;i++){ const t=i/64; - const x=x0+(pose.x-x0)*t; - // Gravity creates gentle static slack, not a falling plug trajectory. - const y=y0+(pose.y-y0)*t+pose.sag*Math.sin(Math.PI*t); - const passed=pose.front-t; // positive only AFTER OUT-origin front passes - const anchor=Math.min(1,t/.035,(1-t)/.035); - const wave=passed>0? - -pose.amplitude*Math.sin(2*Math.PI*passed/.39)* - Math.exp(-1.8*passed-1.45*t)*anchor:0; - d+=' L '+x.toFixed(1)+' '+(y+wave).toFixed(1); + const wave=wireRetractWave(pose,t); + const x=x0+dx*t+nx*wave; + const y=y0+dy*t+pose.sag*Math.sin(Math.PI*t)+ny*wave; + d+=' L '+x.toFixed(1)+' '+y.toFixed(1); } - return {d,pose}; + const endWave=wireRetractWave(pose,1); + return {d,pose:{...pose,tipX:pose.x+nx*endWave,tipY:pose.y+ny*endWave}}; } function startWireRetraction(sourceId,releasePoint){ stopWireRetraction(); @@ -1072,8 +1088,9 @@ const shape=wireRetractPathData(x0,y0,rx,ry,elapsed); svg.dataset.wirePhase=shape.pose.phase; shadow.setAttribute('d',shape.d);jacket.setAttribute('d',shape.d); - plug.setAttribute('cx',shape.pose.x.toFixed(1)); - plug.setAttribute('cy',shape.pose.y.toFixed(1)); + // Visual plug follows the same free endpoint as the final SVG sample. + plug.setAttribute('cx',shape.pose.tipX.toFixed(1)); + plug.setAttribute('cy',shape.pose.tipY.toFixed(1)); plug.setAttribute('r',Math.max(0,5.2*Math.pow(shape.pose.remaining,.6)).toFixed(2)); if(elapsed{ + const path=el.querySelector('[data-wire-retract-jacket]'); + const plug=el.querySelector('[data-wire-retract-plug]'); + const end=path.getPointAtLength(path.getTotalLength()); + return Math.hypot(end.x-Number(plug.getAttribute('cx')), + end.y-Number(plug.getAttribute('cy'))); + }""") + assert tip_gap<.25,("free plug is detached from the wavy jacket",tip_gap) assert jacket.get_attribute("d")!=first_path,"reel never animated the jacket" assert overlay.evaluate("(el)=>getComputedStyle(el).clipPath")=="none" @@ -371,7 +384,7 @@ def test_replug_and_retract(page): # launch near OUT first and only later reach the moving free end. Both # physical endpoints must remain welded to their sockets and the source # of the wave must not reverse into IN->OUT plug-in behavior. - model=HTML[HTML.index("const WIRE_RETRACT_MS=900"): + model=HTML[HTML.index("const WIRE_RETRACT_MS=520"): HTML.index("function startWireRetraction(")] physics=page.evaluate("()=>{\n"+model+"""\n const chord=400; @@ -382,25 +395,37 @@ def test_replug_and_retract(page): const baseline=pose.sag*Math.sin(Math.PI*t); return ys[2*i+1]-baseline; }; - const early=wireRetractPathData(0,0,chord,0,145); - const middle=wireRetractPathData(0,0,chord,0,570); + const early=wireRetractPathData(0,0,chord,0,135); + const middle=wireRetractPathData(0,0,chord,0,220); + const flex=wireRetractPathData(0,0,chord,0,175); const finished=wireRetractPathData(0,0,chord,0,WIRE_RETRACT_MS); + const shortPose=wireRetractPose(0,0,80,0,115); + const longPose=wireRetractPose(0,0,chord,0,115); return { - nearOutEarly:deviation(145,8),farEarly:deviation(145,51), - farLater:deviation(570,48),sourceAnchor:deviation(145,0), - freeAnchor:deviation(145,64), + nearOutEarly:deviation(40,8),farEarly:deviation(40,51), + midAfter:deviation(125,32),farAfter:deviation(155,48), + freeTipWave:deviation(175,64), + sourceAnchor:deviation(175,0), halfwayX:middle.pose.x,earlyX:early.pose.x, - completeX:finished.pose.x,completeY:finished.pose.y, + tipX:flex.pose.tipX,tipY:flex.pose.tipY, + completeX:finished.pose.tipX,completeY:finished.pose.tipY, + shortAmplitude:shortPose.amplitude,longAmplitude:longPose.amplitude, startPhase:early.pose.phase,finishAmplitude:finished.pose.amplitude }; }""") - assert physics["nearOutEarly"]< -2,("outgoing whip did not launch at OUT",physics) - assert abs(physics["farEarly"])<.4,("wave appears at free end before leaving OUT",physics) - assert physics["farLater"]<-.25,("wavy failed to travel toward moving end",physics) - assert abs(physics["sourceAnchor"])<.25 and abs(physics["freeAnchor"])<.25,\ - ("cable path cannot pull physical sockets off anchor",physics) - assert 02,("reel has no abrupt OUT-origin whip",physics) + assert abs(physics["farEarly"])<.4,("free tip moves before OUT-origin front arrives",physics) + assert abs(physics["midAfter"])>2 and abs(physics["farAfter"])>2,\ + ("wavy must travel through the whole jacket, not just near OUT",physics) + assert abs(physics["freeTipWave"])>3,\ + ("loose plug remains rigid when wave arrives",physics) + assert abs(physics["sourceAnchor"])<.25,("OUT socket endpoint shifted",physics) + assert 03,("tip never reacts to wave",physics) assert abs(physics["completeX"])<.01 and abs(physics["completeY"])<.01,physics + assert physics["shortAmplitude"] Date: Fri, 13 Nov 2026 13:06:24 +0700 Subject: [PATCH 09/14] fix(updater): verify old and new release installers at last safe execution point (#641) Bounded release pagination for legacy baseline and exact SHA checks on both staged packages before Inno and rollback; Windows smoke + policy contracts passed. --- installer/ArSonMixAutoUpdate.ps1 | 78 +++++++++++++++++++++-- tests/windows_installer_contract_test.mjs | 34 ++++++++-- 2 files changed, 100 insertions(+), 12 deletions(-) diff --git a/installer/ArSonMixAutoUpdate.ps1 b/installer/ArSonMixAutoUpdate.ps1 index f50d91824..415b87050 100644 --- a/installer/ArSonMixAutoUpdate.ps1 +++ b/installer/ArSonMixAutoUpdate.ps1 @@ -75,6 +75,31 @@ function Find-Asset([object]$release,[string]$name,[int64]$minBytes) { if($items.Count -ne 1){return $null} return $items[0] } +# Older approved installations can fall beyond GitHub's first 100 releases. +# Traverse only bounded pages; fail closed rather than guess the baseline. +function Read-PublishedReleases([hashtable]$headers) { + $result=[Collections.Generic.List[object]]::new() + $tags=[Collections.Generic.HashSet[string]]::new([StringComparer]::Ordinal) + for([int]$page=1; $page -le 10; $page++) { + $uri=if($page -eq 1){$api}else{$api+'&page='+$page} + $batch=Invoke-RestMethod -Uri $uri -Headers $headers -TimeoutSec 25 + if($null -eq $batch){Fail 'GitHub returned no release list'} + $rows=@($batch) + if($rows.Count -gt 100){Fail 'GitHub release page exceeds hard bound'} + foreach($release in $rows) { + if($null -eq $release -or + $null -eq $release.PSObject.Properties['tag_name'] -or + [string]::IsNullOrWhiteSpace([string]$release.tag_name) -or + -not $tags.Add([string]$release.tag_name)){ + Fail 'Invalid or duplicated GitHub release page' + } + $result.Add($release) + } + if($rows.Count -lt 100){return ,$result.ToArray()} + } + Fail 'GitHub release history exceeds 1000 entries; defer rather than guess baseline' +} + function Approved-Installer([object]$release) { if($null -eq $release -or $release.draft -or [string]$release.target_commitish -cnotmatch '^[a-f0-9]{40}$' -or @@ -190,6 +215,12 @@ function Test-UserApproval([object]$approval,[object]$transaction) { [string]$approval.candidateTag -ceq [string]$transaction.candidateTag) } +function Test-InstallableAssetPair([string]$newPath,[object]$newAsset, + [string]$oldPath,[object]$oldAsset) { + return ((Test-StagedAsset $newPath $newAsset) -and + (Test-StagedAsset $oldPath $oldAsset)) +} + function Get-InstalledImageStatus([object]$build) { try { $hash=[string]$build.exeSha256 @@ -284,7 +315,7 @@ function Restore-InstalledRelease([string]$sourceSha) { # than trusting local update state as installation authority. $headers=@{Accept='application/vnd.github+json';'User-Agent'='ArSonMix-SmartUpdater/1'; 'X-GitHub-Api-Version'='2022-11-28'} - $releases=Invoke-RestMethod -Uri $api -Headers $headers -TimeoutSec 25 + $releases=Read-PublishedReleases $headers $sourceRelease=$null foreach($release in $releases) { if([string]$release.target_commitish -ceq $sourceSha -and @@ -480,6 +511,35 @@ if($PolicySelfTest) { $stored.digest='sha256:'+('0'*64) if(Test-CompleteStagedTransaction $transaction){throw 'Corrupted staged transaction reused'} } finally {$root=$previousRoot} + # Last-mile policy: tamper with EITHER installer, not just the candidate. + $pairFolder=Join-Path ([IO.Path]::GetTempPath()) ('ArSonMix-VerifiedPair-'+[guid]::NewGuid().ToString('N')) + try { + [IO.Directory]::CreateDirectory($pairFolder) | Out-Null + $oldSample=Join-Path $pairFolder 'previous.exe' + $newSample=Join-Path $pairFolder 'candidate.exe' + $known=New-Object byte[] 2097152 + [IO.File]::WriteAllBytes($oldSample,$known) + [IO.File]::WriteAllBytes($newSample,$known) + $fingerprint=(Get-FileHash -LiteralPath $newSample -Algorithm SHA256).Hash.ToLowerInvariant() + $identity=[pscustomobject]@{size=2097152;digest='sha256:'+$fingerprint} + if(-not (Test-InstallableAssetPair $newSample $identity $oldSample $identity)){ + throw 'Valid pair rejected' + } + $known[10]=123 + [IO.File]::WriteAllBytes($oldSample,$known) + if(Test-InstallableAssetPair $newSample $identity $oldSample $identity){ + throw 'Tampered rollback accepted' + } + [IO.File]::WriteAllBytes($oldSample,(New-Object byte[] 2097152)) + $known[11]=17 + [IO.File]::WriteAllBytes($newSample,$known) + if(Test-InstallableAssetPair $newSample $identity $oldSample $identity){ + throw 'Tampered candidate accepted' + } + Write-Output 'ARSONMIX_UPDATER_LAST_MILE_PAIR_PASS' + } finally { + Remove-Item -LiteralPath $pairFolder -Recurse -Force -ErrorAction SilentlyContinue + } if(-not (Should-RetryInstaller 1 $false $true)){throw 'First transient retry rejected'} if(Should-RetryInstaller 2 $false $true){throw 'Repeated installer retry accepted'} if(Should-RetryInstaller 1 $false $false){throw 'Missing old version retried'} @@ -609,7 +669,7 @@ try { Write-State $state $headers=@{Accept='application/vnd.github+json';'User-Agent'='ArSonMix-SmartUpdater/1'; 'X-GitHub-Api-Version'='2022-11-28'} - $releases=Invoke-RestMethod -Uri $api -Headers $headers -TimeoutSec 25 + $releases=Read-PublishedReleases $headers $state.lastCheckUtc=[DateTime]::UtcNow.ToString('o') Write-State $state $current=$null @@ -698,8 +758,7 @@ try { $oldPath=Join-Path $stage $oldName # Validate both independently. Do not build nested arrays here: # PowerShell 5.1 pipeline unrolling can flatten the pair boundaries. - if(-not (Test-StagedAsset $newPath $state.newAsset) -or - -not (Test-StagedAsset $oldPath $state.previousAsset)) { + if(-not (Test-InstallableAssetPair $newPath $state.newAsset $oldPath $state.previousAsset)) { Fail 'Offline staged install/rollback bytes not verified' } # A published upgrade must be acknowledged once by the user in the @@ -720,7 +779,7 @@ try { # No network is needed *during* live audio; if offline on close, defer. $headers=@{Accept='application/vnd.github+json';'User-Agent'='ArSonMix-SmartUpdater/1'; 'X-GitHub-Api-Version'='2022-11-28'} - $liveReleases=Invoke-RestMethod -Uri $api -Headers $headers -TimeoutSec 25 + $liveReleases=Read-PublishedReleases $headers $approved=$null $approvedOld=$null foreach($release in $liveReleases) { @@ -776,6 +835,12 @@ try { finally {$process.Dispose()} } if((Read-Json $provenance).sourceCommit -cne $installedSha) {Log-Result 'DEFER_VERSION_CHANGED';exit 0} + # Reverify after GitHub re-query and process-exit waiting, immediately + # before Inno touches installed files. Old rollback bytes are included. + if(-not (Test-InstallableAssetPair $newPath $state.newAsset $oldPath $state.previousAsset)) { + Log-Result 'INSTALLER_BYTES_CHANGED_UPDATE_DEFERRED' + exit 0 + } $state.phase='installing' $state.installAttempts=[int]$state.installAttempts+1 Write-State $state @@ -835,6 +900,9 @@ try { } # Roll back by running the previously authenticated Inno installer, # not by copying arbitrary stale binaries over an installed application. + if(-not (Test-StagedAsset $oldPath $oldAsset)){ + Fail 'Rollback installer modified after verified stage' + } if(Run-Installer $oldPath) { if(Test-InstalledRelease $installedSha) { $state.phase='rolled-back' diff --git a/tests/windows_installer_contract_test.mjs b/tests/windows_installer_contract_test.mjs index 2a630baf2..232438ea7 100644 --- a/tests/windows_installer_contract_test.mjs +++ b/tests/windows_installer_contract_test.mjs @@ -226,8 +226,10 @@ test('Windows updater executes byte-level offline stage integrity fixtures', () const updater = read('installer/ArSonMixAutoUpdate.ps1'); const smoke = read('scripts/test_inno_graceful_update_windows.ps1'); assert.match(updater, /function Test-StagedAsset\(/); - assert.match(updater, /Test-StagedAsset \$newPath \$state\.newAsset/); - assert.match(updater, /Test-StagedAsset \$oldPath \$state\.previousAsset/); + assert.match(updater, /function Test-InstallableAssetPair\(/); + assert.match(updater, /Test-StagedAsset \$newPath \$newAsset/); + assert.match(updater, /Test-StagedAsset \$oldPath \$oldAsset/); + assert.match(updater, /Test-InstallableAssetPair \$newPath \$state\.newAsset \$oldPath \$state\.previousAsset/); assert.doesNotMatch(updater, /foreach\(\$pair in @\(@\(/); assert.match(updater, /Tampered staged EXE accepted/); assert.match(updater, /Short staged EXE accepted/); @@ -361,15 +363,20 @@ test('auto apply authenticates the published rollback asset as well as the new r source.indexOf("$state.phase='installing'")); }); -test('updater enumerates GitHub JSON release arrays correctly in Windows PowerShell 5.1', () => { +test('updater paginates published releases, matching exact legacy source across pages', () => { const script=read('installer/ArSonMixAutoUpdate.ps1'); - assert.doesNotMatch(script, /@\(\s*Invoke-RestMethod -Uri \$api/); - for (const name of ['releases','liveReleases']) { - assert.match(script, new RegExp('\\$'+name+'=Invoke-RestMethod -Uri \\$api')); - } + assert.match(script, /function Read-PublishedReleases\(\[hashtable\]\$headers\)/); + assert.match(script, /for\(\[int\]\$page=1; \$page -le 10; \$page\+\+\)/); + assert.match(script, /\$uri=if\(\$page -eq 1\)\{\$api\}else\{\$api\+'&page='\+\$page\}/); + assert.match(script, /\$batch=Invoke-RestMethod -Uri \$uri/); + assert.match(script, /\$rows=@\(\$batch\)/); + assert.equal(script.split('$releases=Read-PublishedReleases $headers').length - 1, 2); + assert.match(script, /\$liveReleases=Read-PublishedReleases \$headers/); + assert.match(script, /GitHub release history exceeds 1000 entries/); assert.match(script, /foreach\(\$release in \$releases\)/); assert.match(script, /foreach\(\$release in \$liveReleases\)/); }); + test('WebView2 error screen cannot acknowledge healthy GUI; staging retries after 20m', () => { const script=read('installer/ArSonMixAutoUpdate.ps1'); const native=read('src/Main.cpp'); @@ -455,3 +462,16 @@ test('updater notice is nonmodal, dismissal cannot approve and shutdown cleans u assert.doesNotMatch(notice, /enterModalState|runModalLoop|NativeMessageBox/); assert.match(s, /updateNotice_\.reset\(\);\s*#endif\s*window_\.reset\(\)/); }); + +test('updater rechecks both verified installer binaries before execution and rollback', () => { + const script=read('installer/ArSonMixAutoUpdate.ps1'); + assert.match(script, /function Test-InstallableAssetPair\(/); + assert.match(script, /ARSONMIX_UPDATER_LAST_MILE_PAIR_PASS/); + const lastCheck=script.indexOf('# Reverify after GitHub re-query'); + const transition=script.indexOf("$state.phase='installing'",lastCheck); + const execution=script.indexOf('$upgradeOK=Run-Installer $newPath',transition); + assert.ok(lastCheck>=0 && transition>lastCheck && execution>transition); + assert.match(script.slice(lastCheck,transition), /Test-InstallableAssetPair \$newPath \$state.newAsset \$oldPath \$state.previousAsset/); + assert.match(script, /if\(-not \(Test-StagedAsset \$oldPath \$oldAsset\)\)/); + assert.match(script, /INSTALLER_BYTES_CHANGED_UPDATE_DEFERRED/); +}); From 34e1112fbc349003ae33f0fc72836e4a08c1f60d Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:16:19 +0700 Subject: [PATCH 10/14] ci(integration): share one Chromium runner for V65 WIRE + native SOF/SonKu cross-branch visual FAT --- .github/workflows/ui-smoke.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 75231ddc6..d833184cb 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -195,7 +195,7 @@ jobs: needs: quick # Both 8D-SonKu and SOF native-owner PRs share ONE actual Chromium runner. # Preserve fast-only checks for unrelated GUI and engine branches. - if: ${{ (github.event_name == 'pull_request' && (startsWith(github.head_ref, 'feat/8d-sonku-') || startsWith(github.head_ref, 'test/sof-native-'))) || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/feat/8d-sonku-') && inputs.expected_sha != '') }} + if: ${{ (github.event_name == 'pull_request' && (startsWith(github.head_ref, 'feat/8d-sonku-') || startsWith(github.head_ref, 'test/sof-native-') || startsWith(github.head_ref, 'integration/sof-sonku-main-'))) || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/feat/8d-sonku-') && inputs.expected_sha != '') }} runs-on: ubuntu-latest timeout-minutes: 12 steps: @@ -216,6 +216,12 @@ jobs: # job (zero additional browser runners and zero Windows recompiles). - name: Native SOF PRE/POST, SEND ON, EdgeId gain and ACK/readback Chromium run: python tests/approved_native_sof_chromium_smoke.py + - name: Integrated V65 WIRE motion, SOF and actual native WIRE regression + if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/sof-sonku-main-') }} + run: | + python tests/pages_v60_fader_wire_tactile_smoke.py + python tests/approved_native_wire_gain_smoke.py + python tests/sof_contextual_console_smoke.py - name: Render original 8D-SonKu headphone candidate through exact native HRTF run: | g++ -std=c++20 -O2 -Wall -Wextra -pedantic tools/sonku_offline_listening.cpp -o /tmp/sonku-listening @@ -242,7 +248,10 @@ jobs: uses: actions/upload-artifact@v4 with: name: ArSonMix-SOF-PCM-Bridge-${{ github.run_id }} - path: arsonmix-native-sof-*.png + path: | + arsonmix-native-sof-*.png + arsonmix-v60-*.png + native-wire-gain-*.png if-no-files-found: ignore retention-days: 7 From a424dbc5039d940a5569fd297621165c1fbddaec Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:18:46 +0700 Subject: [PATCH 11/14] test(wire): correct bottom-detent -infinity PCM golden to linear zero without disconnect --- tests/approved_native_wire_gain_smoke.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/approved_native_wire_gain_smoke.py b/tests/approved_native_wire_gain_smoke.py index 3bd2071bb..40fb13200 100644 --- a/tests/approved_native_wire_gain_smoke.py +++ b/tests/approved_native_wire_gain_smoke.py @@ -287,7 +287,12 @@ def main(): page.wait_for_function("()=>window.__nativeIntents.length===2") assert page.evaluate("()=>window.__heldWireInput===document.querySelector('#tracks .strip[data-id=\"2\"] .wire-gain')"), "ACK detached held gain control" latest = page.evaluate("()=>window.__nativeIntents.at(-1)") - assert abs(latest["payload"]["gainLinear"] - .001) < 1e-8 + # Native SOF/WIRE policy defines the bottom -60 dB + # detent as -infinity/silence (linear zero), not 0.001. + # The exact SEND EdgeId is retained; this is a scalar + # mute-level gain, NEVER a graph REMOVE/disconnect. + assert latest["payload"]["gainLinear"] == 0, latest + assert latest["payload"]["edgeId"] == SEND, latest state["graph"]["edges"][1]["gainLinear"] = latest["payload"]["gainLinear"] ack(page, state, latest) emit(page, "arMixConsoleSnapshot", state) From eb2dd57265fc8ad3edf94779d89b56557b908f58 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:21:46 +0700 Subject: [PATCH 12/14] test(sof): unity digital gain readout follows approved 0.0 dB formatting --- tests/sof_contextual_console_smoke.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/sof_contextual_console_smoke.py b/tests/sof_contextual_console_smoke.py index 39eadb05e..7195620d6 100644 --- a/tests/sof_contextual_console_smoke.py +++ b/tests/sof_contextual_console_smoke.py @@ -68,7 +68,9 @@ def run() -> None: assert "6.5" in knob.get_attribute("value") or knob.input_value() == "6.5" # Double-click must use the same gain parameter path and restore unity. first.locator(".gain-dial").dblclick() - assert "+0.0 dB" in first.locator(".gain-readout").inner_text() + # The public formatter reserves '+' for strictly + # positive values; gain unity is displayed as 0.0 dB. + assert first.locator(".gain-readout").inner_text().strip() == "0.0 dB" assert knob.input_value() == "0" knob.evaluate("""el => { el.value = '6.5'; From 1f77b89f8f78eb2475322170546a6dce47ef2557 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:25:55 +0700 Subject: [PATCH 13/14] V66: 330ms spring reel and bouncing free WIRE dot (#644) * fix(gui): V66 brisk 330ms reel, amplified full-span OUT whip and freely swinging plug dot * test(chromium): prove 330ms reel, full-span oscillations and free dot whipping both directions * test(gui): update V66 source contract to new OUT-front wave statement --- site/preview-v2/index.html | 64 +++++---- tests/pages_v60_fader_wire_tactile_smoke.py | 140 ++++++++++---------- 2 files changed, 112 insertions(+), 92 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index ec7f2b30f..74c5a5168 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -996,7 +996,11 @@ Single visual-only transient, no synthetic route or native DSP mutation. The travelling wave spans the shrinking jacket and the detached plug is a FREE end: it moves with the final wave rather than being pinned. */ -const WIRE_RETRACT_MS=520; +/* V66 fast, lively elastic recoil: OUT stays fixed while a travelling + whip reaches the entire shrinking cable. The disconnected dot is free: + a damped tip response makes it wobble rather than ride a rigid chord. + Visual-only; graph REMOVE always commits before this animation exists. */ +const WIRE_RETRACT_MS=330; let wireRetractToken=0,wireRetractOverlay=null; function stopWireRetraction(){ ++wireRetractToken; @@ -1004,46 +1008,56 @@ } function wireRetractPose(x0,y0,rx,ry,elapsedMs){ const p=Math.max(0,Math.min(1,elapsedMs/WIRE_RETRACT_MS)); - // 42% shorter than V64, brisk at the beginning and softly decelerating. - const remaining=Math.pow(1-p,2.25); + // Fast pull from the first frame, no preceding fall/hang/idle phase. + const remaining=Math.pow(1-p,2.65); const x=x0+(rx-x0)*remaining,y=y0+(ry-y0)*remaining; const chord=Math.hypot(rx-x0,ry-y0); - const length01=Math.max(0,Math.min(1,(chord-85)/270)); + const length01=Math.max(0,Math.min(1,(chord-90)/270)); const longMix=length01*length01*(3-2*length01); - // The pulse traverses the *whole* cable before reel-in is over. - // OUT -> FREE end, then leaves a short damped trailing tail. - const front=1.5*(1-Math.pow(1-Math.min(1,p/.55),1.35)); - const width=.62-.25*longMix; // fewer smoother lobes on short cables - const sag=Math.min(46,Math.max(9,Math.sqrt(chord)*2.1))* - Math.pow(remaining,.72); - const amplitude=Math.min(19,Math.max(7,Math.sqrt(chord)*.95))* - (.42+.58*longMix)*Math.pow(remaining,.47)*Math.min(1,p/.095); - return {x,y,remaining,sag,front,width,amplitude,phase:'reel'}; + // Front originates at OUT and reaches the loose tip early enough that + // the tip can swing repeatedly BEFORE the wire disappears. + const front=1.42*(1-Math.pow(1-Math.min(1,p/.40),1.35)); + const catchUp=Math.max(0,Math.min(1,(front-.78)/.30)); + const width=.59-.24*longMix; + const sag=Math.min(44,Math.max(10,Math.sqrt(chord)*2.1))* + Math.pow(remaining,.78); + const amplitude=Math.min(32,Math.max(14,Math.sqrt(chord)*1.5))* + (.46+.54*longMix)*Math.pow(remaining,.29)* + Math.min(1,p/.07)*Math.min(1,chord*remaining/55); + const recoil=amplitude*.13*catchUp* + Math.sin(2*Math.PI*Math.max(0,p-.19)/.26); + return {p,x,y,remaining,sag,front,catchUp,width,amplitude,recoil,phase:'reel'}; } function wireRetractWave(pose,t){ - const passed=pose.front-t; // first near OUT, then all along the cable - if(passed<=0)return 0; - const sourceAnchor=Math.min(1,t/.035); - // Unlike the connected socket, the unplugged end is not tethered: - // the sine displaces the plug itself, so it never looks rigid. - return -pose.amplitude*Math.sin(2*Math.PI*passed/pose.width)* - Math.exp(-1.05*passed-.32*t)*sourceAnchor; + const passed=pose.front-t; + const travelling=passed>0? + -Math.sin(2*Math.PI*passed/pose.width)* + Math.exp(-.77*passed-.35*t):0; + // The travelling pulse excites an inertial after-swing at the FREE tip. + // Its influence smoothly increases toward that end, without moving OUT. + const lag=Math.max(0,pose.p-.19); + const tipSwing=1.15*pose.catchUp*Math.sin(2*Math.PI*lag/.26)* + Math.exp(-1.25*lag)*Math.pow(t,1.65); + return pose.amplitude*Math.min(1,t/.04)*(travelling+tipSwing); } function wireRetractPathData(x0,y0,rx,ry,elapsedMs){ const pose=wireRetractPose(x0,y0,rx,ry,elapsedMs); const dx=pose.x-x0,dy=pose.y-y0; const norm=Math.max(1,Math.hypot(dx,dy)); - const nx=-dy/norm,ny=dx/norm; + const nx=-dy/norm,ny=dx/norm,tx=dx/norm,ty=dy/norm; let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); for(let i=1;i<=64;i++){ const t=i/64; const wave=wireRetractWave(pose,t); - const x=x0+dx*t+nx*wave; - const y=y0+dy*t+pose.sag*Math.sin(Math.PI*t)+ny*wave; + const surge=pose.recoil*t*t; + const x=x0+dx*t+nx*wave+tx*surge; + const y=y0+dy*t+pose.sag*Math.sin(Math.PI*t)+ny*wave+ty*surge; d+=' L '+x.toFixed(1)+' '+y.toFixed(1); } const endWave=wireRetractWave(pose,1); - return {d,pose:{...pose,tipX:pose.x+nx*endWave,tipY:pose.y+ny*endWave}}; + return {d,pose:{...pose, + tipX:pose.x+nx*endWave+tx*pose.recoil, + tipY:pose.y+ny*endWave+ty*pose.recoil}}; } function startWireRetraction(sourceId,releasePoint){ stopWireRetraction(); @@ -1091,7 +1105,7 @@ // Visual plug follows the same free endpoint as the final SVG sample. plug.setAttribute('cx',shape.pose.tipX.toFixed(1)); plug.setAttribute('cy',shape.pose.tipY.toFixed(1)); - plug.setAttribute('r',Math.max(0,5.2*Math.pow(shape.pose.remaining,.6)).toFixed(2)); + plug.setAttribute('r',Math.max(0,5.8*Math.pow(shape.pose.remaining,.48)).toFixed(2)); if(elapsed{ + window.__v66ReelFrames=[]; + window.__v66ReelObserver=new MutationObserver(()=>{ + const layer=document.querySelector('#wireRetractLayer'); + const plug=layer?.querySelector('[data-wire-retract-plug]'); + const jacket=layer?.querySelector('[data-wire-retract-jacket]'); + if(!plug||!jacket)return; + const x=Number(plug.getAttribute('cx')),y=Number(plug.getAttribute('cy')); + if(Number.isFinite(x)&&Number.isFinite(y)) + window.__v66ReelFrames.push({x,y,r:Number(plug.getAttribute('r')), + phase:layer.dataset.wirePhase, + d:jacket.getAttribute('d')}); + }); + window.__v66ReelObserver.observe(document.getElementById('viewport'), + {childList:true,subtree:true,attributes:true,attributeFilter:['cx','cy','d']}); + }""") other=page.locator('#tracks .strip[data-id="4"] .wire-node-in') t=dst.bounding_box();q=other.bounding_box() blank_x=(cx(t)+cx(q))/2 blank_y=cy(t) page.mouse.move(cx(t),cy(t));page.mouse.down() page.mouse.move(blank_x,blank_y,steps=12);page.mouse.up() - assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0,\ - "unplug must remove committed edge immediately" - overlay=page.locator('#wireRetractLayer[data-wire-retract="1"]') - assert overlay.count()==1,"accepted unplug must have transient cable" - assert overlay.get_attribute("data-wire-phase")=="reel" - assert overlay.evaluate("(el)=>getComputedStyle(el).pointerEvents")=="none" - jacket=overlay.locator('[data-wire-retract-jacket]') - plug=overlay.locator('[data-wire-retract-plug]') - first=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - first_path=jacket.get_attribute("d") - page.wait_for_timeout(175) - moved=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0, \ + "unplug must REMOVE the graph edge immediately" + page.wait_for_timeout(450) + frames=page.evaluate("window.__v66ReelFrames") source_x=cx(src.bounding_box()) - assert abs(moved[0]-source_x){ - const path=el.querySelector('[data-wire-retract-jacket]'); - const plug=el.querySelector('[data-wire-retract-plug]'); - const end=path.getPointAtLength(path.getTotalLength()); - return Math.hypot(end.x-Number(plug.getAttribute('cx')), - end.y-Number(plug.getAttribute('cy'))); - }""") - assert tip_gap<.25,("free plug is detached from the wavy jacket",tip_gap) - assert jacket.get_attribute("d")!=first_path,"reel never animated the jacket" - assert overlay.evaluate("(el)=>getComputedStyle(el).clipPath")=="none" + assert len(frames)>=6,("fast plug-out never animated in real browser",frames[:2]) + distances=[abs(item["x"]-source_x) for item in frames] + assert distances[0]>max(25,distances[-1]*2.5), \ + ("free plug did not reel briskly toward OUT",distances) + delta=max(item["y"] for item in frames)-min(item["y"] for item in frames) + assert delta>12,("plug dot did not visibly swing with the WIRE",delta) + assert frames[-1]["r"]OUT plug-in behavior. - model=HTML[HTML.index("const WIRE_RETRACT_MS=520"): + # Exact production code evaluated in Chromium: a strong pulse starts at + # OUT, travels through the middle and far cable, then throws the loose + # plug from side to side. It fades to zero as remaining length runs out. + model=HTML[HTML.index("const WIRE_RETRACT_MS=330"): HTML.index("function startWireRetraction(")] physics=page.evaluate("()=>{\n"+model+"""\n const chord=400; @@ -392,45 +397,46 @@ def test_replug_and_retract(page): const {d,pose}=wireRetractPathData(0,0,chord,0,ms); const ys=d.match(/-?\d+(?:\.\d+)?/g).map(Number); const t=i/64; - const baseline=pose.sag*Math.sin(Math.PI*t); - return ys[2*i+1]-baseline; + return ys[2*i+1]-pose.sag*Math.sin(Math.PI*t); }; - const early=wireRetractPathData(0,0,chord,0,135); - const middle=wireRetractPathData(0,0,chord,0,220); - const flex=wireRetractPathData(0,0,chord,0,175); + const early=wireRetractPathData(0,0,chord,0,50); + const middle=wireRetractPathData(0,0,chord,0,120); + const crest=wireRetractPathData(0,0,chord,0,135); const finished=wireRetractPathData(0,0,chord,0,WIRE_RETRACT_MS); - const shortPose=wireRetractPose(0,0,80,0,115); - const longPose=wireRetractPose(0,0,chord,0,115); + const shortPose=wireRetractPose(0,0,80,0,95); + const longPose=wireRetractPose(0,0,chord,0,95); + const tip=ms=>wireRetractPathData(0,0,chord,0,ms).pose.tipY; + const svgTip=crest.d.match(/-?\d+(?:\.\d+)?/g).map(Number).slice(-2); return { - nearOutEarly:deviation(40,8),farEarly:deviation(40,51), - midAfter:deviation(125,32),farAfter:deviation(155,48), - freeTipWave:deviation(175,64), - sourceAnchor:deviation(175,0), - halfwayX:middle.pose.x,earlyX:early.pose.x, - tipX:flex.pose.tipX,tipY:flex.pose.tipY, + nearOut:deviation(20,8),farEarly:deviation(20,51), + middleSwing:deviation(60,32),farSwing:deviation(80,48), + tipFirst:tip(100),tipRebound:tip(135), + sourceAnchor:deviation(135,0),earlyX:early.pose.x, + middleX:middle.pose.x,tipX:crest.pose.tipX, + tipY:crest.pose.tipY,svgTip, completeX:finished.pose.tipX,completeY:finished.pose.tipY, shortAmplitude:shortPose.amplitude,longAmplitude:longPose.amplitude, startPhase:early.pose.phase,finishAmplitude:finished.pose.amplitude }; }""") - assert abs(physics["nearOutEarly"])>2,("reel has no abrupt OUT-origin whip",physics) - assert abs(physics["farEarly"])<.4,("free tip moves before OUT-origin front arrives",physics) - assert abs(physics["midAfter"])>2 and abs(physics["farAfter"])>2,\ - ("wavy must travel through the whole jacket, not just near OUT",physics) - assert abs(physics["freeTipWave"])>3,\ - ("loose plug remains rigid when wave arrives",physics) - assert abs(physics["sourceAnchor"])<.25,("OUT socket endpoint shifted",physics) - assert 03,("tip never reacts to wave",physics) + assert abs(physics["nearOut"])>3 and abs(physics["farEarly"])<.4, \ + ("impulse must start at OUT, not at the free plug",physics) + assert abs(physics["middleSwing"])>7 and abs(physics["farSwing"])>9, \ + ("wave fails to excite the entire shortening cable",physics) + assert abs(physics["tipFirst"])>10 and abs(physics["tipRebound"])>17, \ + ("dot/loose plug does not swing enough",physics) + assert physics["tipFirst"]*physics["tipRebound"]<0, \ + ("free dot must whip back in the opposite direction",physics) + assert abs(physics["sourceAnchor"])<.25,"source OUT socket cannot move" + assert 0 Date: Fri, 13 Nov 2026 13:27:12 +0700 Subject: [PATCH 14/14] test(sof): navigate real More menu before filtering BUS and restoring All in Chromium --- tests/sof_contextual_console_smoke.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/sof_contextual_console_smoke.py b/tests/sof_contextual_console_smoke.py index 7195620d6..0b248ec65 100644 --- a/tests/sof_contextual_console_smoke.py +++ b/tests/sof_contextual_console_smoke.py @@ -119,7 +119,20 @@ def run() -> None: # Rename the selected BUS in the native-style identity card. # SOF selection must follow its ID, not jump back to Bus A. - page.locator("#viewFilter").select_option("bus") + # VIEW & SELECTION was deliberately moved under the + # compact More menu. Exercise its visible operator path; + # do not force a hidden