Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ce37710
feat(UX): reuse existing DAW-style IN field for all ten native hardwa…
masarray Nov 5, 2026
11a9b3e
fix(UX): connect existing IN dropdown to native 10CH route controller…
masarray Nov 5, 2026
8e0dc9d
fix(audio): one input choice resumes monitoring only after exact nati…
masarray Nov 5, 2026
0b2bfc9
test(DAW): assert existing IN source, custom setup and verified ACK path
masarray Nov 5, 2026
f4d0ca5
test(DAW): assert existing IN source, custom setup and verified ACK path
masarray Nov 5, 2026
a166096
build(gui): regenerate source-owned standalone mixer I/O JS exactly f…
masarray Nov 5, 2026
a518e6a
ux: hide duplicate patch and arm wizard under advanced diagnostics, k…
masarray Nov 5, 2026
beb2249
feat(native): expose authoritative ten-channel M4 controls and peaks …
masarray Nov 5, 2026
f99e2bb
feat(audio): make approved 10-channel fader pan mute solo control act…
masarray Nov 5, 2026
3427df3
fix(audio): wire master fader and master mute to existing native MAIN…
masarray Nov 5, 2026
72fb81a
test(M4): only verified ten-strip native readback controls fader/pan/…
masarray Nov 5, 2026
f338e76
test(DAW): verify ten-channel M4 fader mute pan readback and single n…
masarray Nov 5, 2026
5902aa1
test(DAW): validate G0 native gesture gate without assuming single-li…
masarray Nov 5, 2026
a525190
refactor: keep legacy renderer unchanged; native approved /preview/ o…
masarray Nov 5, 2026
b440a87
refactor: keep legacy renderer unchanged; native approved /preview/ o…
masarray Nov 5, 2026
1416279
refactor: keep legacy renderer unchanged; native approved /preview/ o…
masarray Nov 5, 2026
d487067
feat(native): expose authoritative M4 source mapping for all ten stri…
masarray Nov 5, 2026
404172b
fix(native GUI): route actual /preview/ data-id strip IN to installed…
masarray Nov 5, 2026
4016825
fix(DAW): one user IN selection confirms exact CH source ACK then saf…
masarray Nov 5, 2026
8584cb7
test(native approved): validate real /preview/ IN dispatch, not absen…
masarray Nov 5, 2026
cc5e1c1
feat(DAW): compact in-mixer Audio I/O preferences with verified JUCE …
masarray Nov 5, 2026
b377f0d
safety: block one-click self-loop when VB-Cable capture and render ar…
masarray Nov 5, 2026
d0ddb04
test: assert approved native Audio I/O rather than unbundled legacy m…
masarray Nov 5, 2026
47e8e22
test/native: use truth-guarded source ACK and support minimal DOM tes…
masarray Nov 5, 2026
8ca3aac
test/native: use truth-guarded source ACK and support minimal DOM tes…
masarray Nov 5, 2026
e87d2b0
test(UX): expect direct channel IN rejection label instead of retired…
masarray Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions integration/ApprovedNativeRuntimeSnapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,70 @@ inline bool publishVerifiedFirstSoundState(juce::var& snapshot,
boolIs(route,"hasAcceptedRoute",true));
firstSound->setProperty("routingRevision",physicalReady
?juce::String(static_cast<juce::int64>(revision)):juce::String("0"));
// The default GUI IN selector must reflect the ACTUAL accepted or
// verified prepared M4 topology, never the Pages demo route string.
// All ten lanes are independently selectable (including sparse ASIO pins).
if(physicalReady) {
const auto topology=boolIs(route,"hasAcceptedRoute",true)
?route.getProperty("acceptedRoute",{})
:route.getProperty("preparedM4Route",{});
const auto sourceRows=topology.getProperty("channels",{});
const auto* entries=sourceRows.getArray();
bool valid=entries && entries->size()==10;
if(valid)for(const auto& row:*entries) {
const auto mode=row.getProperty("mode",{}).toString();
if(!row.isObject()||
(mode!="NONE"&&mode!="MONO"&&mode!="STEREO"&&mode!="BUS")) {
valid=false;break;
}
if(mode=="MONO"||mode=="STEREO") {
const auto left=row.getProperty("left",{}),right=row.getProperty("right",{});
if(!left.isInt() && !left.isInt64()){valid=false;break;}
if(mode=="STEREO" && !right.isInt() && !right.isInt64()) {
valid=false;break;
}
}
}
if(valid)firstSound->setProperty("channelSources",sourceRows);
}
// G0 may still have the genuine 10-strip M4 DSP callback. Export its
// existing atomic control readback without falsely admitting ChannelId.
// A fresh/unpatched device must NEVER display pseudo-active controls.
if(physicalReady && boolIs(route,"hasAcceptedRoute",true) &&
!boolIs(route,"nativeChannelIdPcmActive",true)) {
const auto controls=route.getProperty("channelControls",{});
const auto levelsL=route.getProperty("channelPeaksL",{});
const auto levelsR=route.getProperty("channelPeaksR",{});
const auto* ctl=controls.getArray();
const auto* left=levelsL.getArray();
const auto* right=levelsR.getArray();
bool valid=ctl && left && right && ctl->size()==10 &&
left->size()==10 && right->size()==10;
if(valid)for(int i=0;i<10;++i) {
const auto c=ctl->getReference(i);
double db=0.,pan=0.,peakL=0.,peakR=0.;
if(!c.isObject()||
!nativeV8Number(c.getProperty("db",{}),db) ||
!nativeV8Number(c.getProperty("pan",{}),pan) ||
!nativeV8Number(left->getReference(i),peakL) ||
!nativeV8Number(right->getReference(i),peakR) ||
db < -60.01 || db > 10.01 || pan < -100.01 || pan > 100.01 ||
peakL < 0. || peakR < 0. ||
!c.getProperty("mute",{}).isBool() ||
!c.getProperty("solo",{}).isBool()) {valid=false;break;}
}
if(valid) {
firstSound->setProperty("channelControls",controls);
firstSound->setProperty("channelPeaksL",levelsL);
firstSound->setProperty("channelPeaksR",levelsR);
double masterDb=0.;
if(nativeV8Number(live.getProperty("masterDb",{}),masterDb) &&
masterDb>=-60.01 && masterDb<=12.01)
firstSound->setProperty("masterDb",masterDb);
const auto muted=live.getProperty("masterMute",{});
if(muted.isBool())firstSound->setProperty("masterMute",muted);
}
}
// Do not write the route to the graph or change native capability flags.
snapshot.getDynamicObject()->setProperty("legacyM4",juce::var(firstSound.release()));
return physicalReady;
Expand Down
31 changes: 28 additions & 3 deletions tests/approved_native_m2_contract.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,29 @@ test("native signal evidence is produced from measured engine fields, never JS s
assert.doesNotMatch(transport,/setProperty \("rawCapturePeak", 0\.0\)/);
assert.match(bridge,/protocol\.diagnoseFirstSound/);
});
test("DAW-style all-channel IN / M4 fader mute pan use real native control and readback, never mock PCM",()=>{
const bridge=read("web/approved-native-bridge.js");
const io=read("web/mixer-io.js");
const producer=read("integration/ApprovedNativeRuntimeSnapshot.h");
const engine=read("src/LiveDryRoutingLab.h");
const nativeMain=read("src/Main.cpp");
assert.match(bridge,/select\[data-field="input"\]/);
assert.match(bridge,/function chooseNativeStripInput\(select\)/);
assert.match(bridge,/field==="input"/);
assert.match(bridge,/chooseNativeStripInput\(el\)/);
assert.match(bridge,/function paintM4Readback\(next\)/);
assert.match(bridge,/channelControls/);
assert.match(bridge,/parameter,channel:channel\+1,value/);
assert.match(bridge,/routeEpoch:safeNativeCounter/);
assert.match(bridge,/m4StripIndex\(event\.target\)>=0/);
assert.match(producer,/firstSound->setProperty\("channelControls",controls\)/);
assert.match(producer,/firstSound->setProperty\("channelPeaksL",levelsL\)/);
assert.match(engine,/publisher_\.updateActiveControl\(expectedEpoch,expectedRevision/);
assert.match(nativeMain,/engine_\.setDryRoutingLabParameter\(channel-1,epoch,revision/);
assert.doesNotMatch(bridge,/const audioContext=new AudioContext/);
assert.doesNotMatch(bridge,/function synthesizePCM/);
assert.match(bridge,/action:"audioSetup"/);
});
test("strict producer rejects JS Number identities, invalid hardware pins and fake LIVE",()=>{
const cases=[
s=>{s.device.epoch=69;},
Expand Down Expand Up @@ -433,7 +456,9 @@ test("native Windows operator can explicitly patch first physical input, arm and
const main=read("src/Main.cpp");
const engine=read("src/LiveAudioEngine.h");
assert.match(js,/REAL AUDIO · FIRST SOUND/);
assert.match(js,/action:"audioSetup"/);
assert.match(js,/function installNativeIo\(/);
assert.match(js,/action:"audioDeviceApply"/);
assert.match(js,/backend\.emitEvent\("arMixAction",\{action:"audioSetup"\}\)/);
assert.match(js,/d\.inputEndpoints\.filter\(p=>/);
assert.match(js,/d\.enabledInputs\.includes\(p\.port\)/);
assert.match(js,/action:"routingSourceSwitch",requestId:pendingSourceId/);
Expand All @@ -443,8 +468,8 @@ test("native Windows operator can explicitly patch first physical input, arm and
assert.match(js,/expectedEpoch:epoch,expectedRevision:revision/);
assert.match(js,/arMixSourceSwitchAck/);
assert.match(js,/arMixAudioArmAck/);
assert.match(js,/if\(ack\.ok===true\)/);
assert.match(js,/NATIVE PATCH REJECTED:/);
assert.match(js,/ack\?\.ok===true/);
assert.match(js,/INPUT REJECTED/);
assert.match(js,/NO VERIFIED AUDIO DEVICE/);
assert.match(js,/NATIVE PCM · HARDWARE FAT PENDING/);
assert.match(js,/MAIN ARMED · PCM NOT YET ADMITTED/);
Expand Down
56 changes: 56 additions & 0 deletions tests/approved_native_v8_projection_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,61 @@ static void firstSoundMeasuredSignalEvidenceRegression() {
assert(!static_cast<bool>(signal(live,true,true).getProperty("captureObserved",true)));
}

// G0 must expose actual installed M4 controls (not imaginary ChannelId)
// only while a verified direct, routed ten-channel callback exists.
static void firstSoundM4ConsoleControlsRegression() {
auto snap=canonicalSnapshot();
auto* dev=snap.getProperty("device",{}).getDynamicObject();
dev->setProperty("epoch","7");
dev->setProperty("sampleRate",48000.0);
dev->setProperty("bufferFrames",128);
juce::Array<juce::var> in,out;
in.add(0);out.add(0);out.add(1);
dev->setProperty("enabledInputs",juce::var(in));
dev->setProperty("enabledOutputs",juce::var(out));
auto live=parse(R"JSON({
"connected":true,"directRouteAuthorized":true,"adaptiveClockActive":false,
"masterDb":-6.0,"masterMute":false,
"dryRoutingLab":{"active":true,"ready":true,"topologyFault":false,
"hasAcceptedRoute":true,"nativeChannelIdPcmActive":false,
"epoch":7,"revision":12,"channelControls":[],
"channelPeaksL":[],"channelPeaksR":[]}
})JSON");
auto route=live.getProperty("dryRoutingLab",{});
juce::Array<juce::var> controls,left,right;
for(int i=0;i<10;++i) {
auto* c=new juce::DynamicObject;
c->setProperty("db",i==4?-12.0:0.0);
c->setProperty("pan",0.0);
c->setProperty("mute",false);
c->setProperty("solo",false);
controls.add(juce::var(c));left.add(0.2);right.add(0.1);
}
route.getDynamicObject()->setProperty("channelControls",juce::var(controls));
route.getDynamicObject()->setProperty("channelPeaksL",juce::var(left));
route.getDynamicObject()->setProperty("channelPeaksR",juce::var(right));
assert(publishVerifiedFirstSoundState(snap,live));
auto m4=snap.getProperty("legacyM4",{});
assert(m4.getProperty("channelControls",{}).getArray()->size()==10);
assert(static_cast<double>(m4.getProperty("channelControls",{})[4]
.getProperty("db",{}))==-12.0);
assert(static_cast<double>(m4.getProperty("masterDb",{}))==-6.0);
assert(!static_cast<bool>(snap.getProperty("graph",{})
.getProperty("capabilities",{}).getProperty("callbackOwnsChannelIds",true)));
// Bad controls are not published despite a prepared device.
controls.removeLast();
route.getDynamicObject()->setProperty("channelControls",juce::var(controls));
assert(publishVerifiedFirstSoundState(snap,live));
assert(snap.getProperty("legacyM4",{})
.getProperty("channelControls",{}).isVoid());
// Hotplug/stale epoch removes all previously displayed live controls.
controls.add(juce::var(new juce::DynamicObject));
route.getDynamicObject()->setProperty("epoch",8);
assert(!publishVerifiedFirstSoundState(snap,live));
assert(snap.getProperty("legacyM4",{})
.getProperty("channelControls",{}).isVoid());
}

int main() {
auto snap=canonicalSnapshot();
auto bus=realBusReadbackFixture();
Expand Down Expand Up @@ -490,6 +545,7 @@ int main() {
controlIntentTranslationCases(snap,bus);
installedCallbackAdmissionRegression(bus);
firstSoundRouteAdmissionRegression();
firstSoundM4ConsoleControlsRegression();
firstSoundMeasuredSignalEvidenceRegression();

auto missingMain=realBusReadbackFixture();
Expand Down
Loading
Loading