Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d9f73fd
feat(m2): publish actual JUCE device pins with strictly empty unadmit…
masarray Nov 4, 2026
cb23d15
feat(m2): native-accepted snapshot and ACK transaction controller, no…
masarray Nov 4, 2026
ef39aac
feat(m2): subscribe native v6, enforce ACK/snapshot, block demo audio…
masarray Nov 4, 2026
03e79aa
feat(m2): wire genuine native v6 subscribe/snapshot/rejected intent A…
masarray Nov 4, 2026
c5dee11
build(m2): embed deterministic native transaction controller beside e…
masarray Nov 4, 2026
d440b24
build(m2): track native snapshot gate and full bundle SHA resources
masarray Nov 4, 2026
2d99a87
build(m2): track native snapshot gate and full bundle SHA resources
masarray Nov 4, 2026
c0fa3f7
build(m2): track native snapshot gate and full bundle SHA resources
masarray Nov 4, 2026
e7881a2
build(m2): track native snapshot gate and full bundle SHA resources
masarray Nov 4, 2026
44e715b
test(m2): prove exact ACK→snapshot commit, stale epoch rejection, rea…
masarray Nov 4, 2026
dbf8e44
test(m2): ensure embedded native gate is honest, never fabricated liv…
masarray Nov 4, 2026
df9788a
ci(m2): exact-head Windows validates native state gate, request ACK s…
masarray Nov 4, 2026
9f066e5
test(ci): M2 native transport and ACK tests must trigger Windows on P…
masarray Nov 4, 2026
2b15eeb
test(m2): update native exact-Pages contract to truthful ACK-gated stage
masarray Nov 4, 2026
d82e2e1
test(m2): assert live getter derives exclusively from accepted native…
masarray Nov 4, 2026
b69db05
fix(m2): source native callback ordinal from epoch-verified JUCE regi…
masarray Nov 4, 2026
0b6a7ba
fix(m2): report exact JUCE active pin masks, expose actionable endpoi…
masarray Nov 4, 2026
aaf305d
fix(m2): bounded pending intent timeout invalidates state until fresh…
masarray Nov 4, 2026
bb5f096
feat(m2): explicit native lock feedback and bounded ACK-timeout recov…
masarray Nov 4, 2026
28862dd
test(m2): missing ACK cannot promote graph or permit retry until nati…
masarray Nov 4, 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
8 changes: 7 additions & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'integration/console-v6/**'
- 'src/**'
- 'web/approved-native-bridge.js'
- 'web/approved-native-m2-state.js'
- 'tests/approved_native_m2_contract_test.cjs'
- 'scripts/build_approved_native_gui.py'
- 'tests/approved_native_gui_bundle_test.py'
- 'engine/**'
Expand All @@ -32,6 +34,8 @@ on:
- 'integration/console-v6/**'
- 'src/**'
- 'web/approved-native-bridge.js'
- 'web/approved-native-m2-state.js'
- 'tests/approved_native_m2_contract_test.cjs'
- 'scripts/build_approved_native_gui.py'
- 'tests/approved_native_gui_bundle_test.py'
- 'web/bridge.js'
Expand Down Expand Up @@ -91,7 +95,7 @@ jobs:
run: |
# Do not hide earlier Node failures with the exit code of the LAST
# command. One Node invocation also avoids repeated startup costs.
foreach ($file in @('web/bridge.js', 'web/plugin-ui.js', 'web/monitor.js', 'web/app.js', 'web/mixer-io.js', 'web/mixer-layout.js')) {
foreach ($file in @('web/bridge.js', 'web/plugin-ui.js', 'web/monitor.js', 'web/app.js', 'web/mixer-io.js', 'web/mixer-layout.js', 'web/approved-native-bridge.js', 'web/approved-native-m2-state.js')) {
node --check $file
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
Expand Down Expand Up @@ -120,6 +124,8 @@ jobs:
)
node --test $contracts
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
node --test tests/approved_native_m2_contract_test.cjs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Configure Windows x64
shell: pwsh
run: >
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ file(GLOB_RECURSE ARMIX_APPROVED_GUI_SOURCE_INPUTS CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/site/preview-buttons/assets/*")
list(APPEND ARMIX_APPROVED_GUI_SOURCE_INPUTS
"${CMAKE_CURRENT_SOURCE_DIR}/web/approved-native-bridge.js"
"${CMAKE_CURRENT_SOURCE_DIR}/web/approved-native-m2-state.js"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/build_approved_native_gui.py")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${ARMIX_APPROVED_GUI_SOURCE_INPUTS})
execute_process(
Expand Down
8 changes: 5 additions & 3 deletions scripts/build_approved_native_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
ROOT = Path(__file__).resolve().parents[1]
CANONICAL = ROOT / "site" / "preview-v2"
NATIVE_ADAPTER = ROOT / "web" / "approved-native-bridge.js"
ADAPTER_MARKER = '<script defer src="assets/approved-native-bridge.js"></script>'
SCHEMA = "arsonmix.approved-native-pages-bundle.v2"
M2_STATE = ROOT / "web" / "approved-native-m2-state.js"
ADAPTER_MARKER = '<script defer src="assets/approved-native-m2-state.js"></script>\n<script defer src="assets/approved-native-bridge.js"></script>'
SCHEMA = "arsonmix.approved-native-pages-bundle.v3"


def sha256(data: bytes) -> str:
Expand Down Expand Up @@ -110,6 +111,7 @@ def stage(out: Path) -> dict:
shutil.rmtree(out)
out.mkdir(parents=True)
shutil.copytree(pages / "assets", out / "assets")
shutil.copy2(M2_STATE, out / "assets" / "approved-native-m2-state.js")
shutil.copy2(NATIVE_ADAPTER, out / "assets" / "approved-native-bridge.js")
native = native_html(approved.decode("utf-8")).encode("utf-8")
(out / "index.html").write_bytes(native)
Expand All @@ -128,7 +130,7 @@ def stage(out: Path) -> dict:
"approvedPagesHtmlSha256": sha256(approved),
"nativeHtmlSha256": sha256(native),
"adapter": "web/approved-native-bridge.js",
"adapterState": "SCAFFOLD_ONLY__NOT_LIVE_PCM",
"adapterState": "M2_NATIVE_ACK_SNAPSHOT_GATED__PCM_NOT_CERTIFIED",
"files": [{"path":p.relative_to(out).as_posix(), "sha256":sha256(p.read_bytes())} for p in files],
}
(out / "approved-gui-manifest.json").write_text(
Expand Down
4 changes: 2 additions & 2 deletions scripts/package_native_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $approvedGuiManifestPath = Join-Path $approvedGuiDir "approved-gui-manifest.json
$approvedGui = Get-Content -LiteralPath $approvedGuiManifestPath -Raw -Encoding UTF8 | ConvertFrom-Json
if ($approvedGui.authoritativePagesRoute -ne "/preview/" -or
$approvedGui.authoritativePagesOutput -ne "preview/index.html" -or
$approvedGui.adapterState -ne "SCAFFOLD_ONLY__NOT_LIVE_PCM") {
$approvedGui.adapterState -ne "M2_NATIVE_ACK_SNAPSHOT_GATED__PCM_NOT_CERTIFIED") {
throw "Native GUI bundle does not match approved Pages renderer and truthful M1 status"
}
New-Item -ItemType Directory -Force -Path $OutputDir | Out-Null
Expand Down Expand Up @@ -114,7 +114,7 @@ $manifest = [ordered]@{
approvedGuiManifestSha256 = (Get-FileHash -LiteralPath $approvedGuiManifestPath -Algorithm SHA256).Hash.ToLowerInvariant()
approvedGuiResourceCount = @($approvedGui.files).Count
approvedGuiSource = "site/preview-v2 DOM + site/preview-buttons approved PNG skin (deterministic JUCE BinaryData)"
approvedGuiAdapterStatus = "SCAFFOLD_ONLY__NOT_LIVE_PCM"
approvedGuiAdapterStatus = "M2_NATIVE_ACK_SNAPSHOT_GATED__PCM_NOT_CERTIFIED"
guiCalibration = "APPROVED_PAGES_VISUAL_PROVENANCE_ONLY__M1_NOT_PRODUCT_READY"
fatStatus = "EXPERIMENTAL_NOT_HARDWARE_QUALIFIED"
note = "No assertion of clean 0-FX sound, measured round-trip latency or native render-hardware XRUN."
Expand Down
4 changes: 2 additions & 2 deletions scripts/verify_native_windows_artifact.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if ($manifest.approvedGuiManifestSha256 -ne $approvedHash -or
$manifest.approvedGuiPagesSha256 -ne $approved.approvedPagesHtmlSha256 -or
$manifest.approvedGuiNativeHtmlSha256 -ne $approved.nativeHtmlSha256 -or
$manifest.approvedGuiCanonicalSha256 -ne $approved.canonicalSourceSha256 -or
$manifest.approvedGuiAdapterStatus -ne "SCAFFOLD_ONLY__NOT_LIVE_PCM" -or
$manifest.approvedGuiAdapterStatus -ne "M2_NATIVE_ACK_SNAPSHOT_GATED__PCM_NOT_CERTIFIED" -or
$manifest.guiCalibration -ne "APPROVED_PAGES_VISUAL_PROVENANCE_ONLY__M1_NOT_PRODUCT_READY" -or
$manifest.approvedGuiResourceCount -ne @($approved.files).Count) {
throw "REJECT: native release provenance does not match the approved Pages GUI"
Expand Down Expand Up @@ -133,7 +133,7 @@ foreach ($item in $approved.files) {
}
}
if ($embeddedText.IndexOf('APPROVED_PAGES_PREVIEW_BUTTONS', [StringComparison]::Ordinal) -lt 0 -or
$embeddedText.IndexOf('M1_VISUAL_BUNDLE_ONLY__NOT_AUDIO_READY', [StringComparison]::Ordinal) -lt 0 -or
$embeddedText.IndexOf('M2_NATIVE_READBACK_ONLY', [StringComparison]::Ordinal) -lt 0 -or
$embeddedText.IndexOf('WEBVIEW2_GUI_READY_TIMEOUT', [StringComparison]::Ordinal) -lt 0 -or
$embeddedText.IndexOf('AUDIO_GLITCH_WINDOW', [StringComparison]::Ordinal) -lt 0) {
throw "REJECT: approved GUI bridge or native device safety markers absent"
Expand Down
127 changes: 127 additions & 0 deletions src/ApprovedConsoleM2Snapshot.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include <juce_core/juce_core.h>
#include <cmath>
#include <cstdint>

// M2 bridge: the installed M4 callback is NOT yet a universal ChannelId
// renderer. Publish only the real active JUCE pins/telemetry, with an EMPTY
// ChannelId graph. No ordinal-to-ChannelId conversion, fictional capabilities,
// duplicate DSP/audio callback, or implicit hardware arming.
namespace armix::console::approvedM2 {
inline juce::String decimal (const juce::var& v) {
if (v.isInt() || v.isInt64()) {
const auto n=static_cast<juce::int64>(v);
return n > 0 ? juce::String(n) : juce::String("1");
}
if (v.isString()) {
const auto t=v.toString();
if (t.isNotEmpty() && t.length()<=20 && t.containsOnly("0123456789")
&& t[0]!='0') return t;
}
return "1"; // UNREADY control session, not a hardware epoch or real pin.
}
inline juce::var build (const juce::var& installed,
const juce::var& actualDevice) {
auto result=std::make_unique<juce::DynamicObject>();
result->setProperty("schemaVersion",6);
result->setProperty("productionCallbackLive",false);
const auto route=installed.getProperty("dryRoutingLab",juce::var());
auto device=std::make_unique<juce::DynamicObject>();
device->setProperty("epoch",decimal(route.getProperty("epoch",juce::var())));
device->setProperty("backend",actualDevice.getProperty("backend",""));
device->setProperty("captureDevice",actualDevice.getProperty("captureDevice",""));
device->setProperty("playbackDevice",actualDevice.getProperty("playbackDevice",""));
device->setProperty("sampleRate",actualDevice.getProperty("rate",0));
device->setProperty("bufferFrames",actualDevice.getProperty("buffer",0));
const bool open=static_cast<bool>(actualDevice.getProperty("open",false));
device->setProperty("outputArmed",open &&
!static_cast<bool>(actualDevice.getProperty("outputMuted",true)));
juce::Array<juce::var> inputPorts,outputPorts,inputEndpoints,outputEndpoints;
// Correlate active JUCE mask with the EXACT callback ordinal published
// by LiveDryRoutingLab's verified per-epoch registry. A mask alone does
// not prove ordinal packing after device switch; no guessing allowed.
const auto verifiedInputs=route.getProperty("ports",juce::var());
const auto verifiedOutputs=route.getProperty("outputPorts",juce::var());
const auto addPorts=[&](const char* enabledName,const char* labelsName,
const char* prefix,const juce::var& verified,
juce::Array<juce::var>& ports,
juce::Array<juce::var>& endpoints) {
const auto enabled=actualDevice.getProperty(enabledName,juce::var());
const auto labels=actualDevice.getProperty(labelsName,juce::var());
const auto* indices=enabled.getArray();
const auto* names=labels.getArray();
const auto* actualCallbacks=verified.getArray();
if (!open || !indices || !names || !actualCallbacks) return;
for (const auto& value:*indices) {
if (!value.isInt()) continue;
const int pin=static_cast<int>(value);
if (pin<0 || pin>=names->size() || pin>255) continue;
int callback=-1;
for(int i=0;i<actualCallbacks->size();++i) {
const auto& row=actualCallbacks->getReference(i);
if(juce::String(prefix)=="in") {
const auto actualPin=row.getProperty("port",juce::var());
const auto actualCallback=row.getProperty("callback",juce::var());
if(actualPin.isInt() && actualCallback.isInt() &&
static_cast<int>(actualPin)==pin)
callback=static_cast<int>(actualCallback);
} else if(row.isInt() && static_cast<int>(row)==pin) {
callback=i;
}
}
if(callback<0 || callback>255)continue; // no native proof => no endpoint
const auto label=names->getReference(pin).toString();
if (label.isEmpty()) continue;
auto entry=std::make_unique<juce::DynamicObject>();
entry->setProperty("id",juce::String(prefix)+":"+juce::String(pin));
entry->setProperty("port",pin);
entry->setProperty("callback",callback);
entry->setProperty("label",label);
entry->setProperty("active",true);
ports.add(pin);
endpoints.add(juce::var(entry.release()));
}
};
addPorts("enabledInputs","inputNames","in",verifiedInputs,
inputPorts,inputEndpoints);
addPorts("enabledOutputs","outputNames","out",verifiedOutputs,
outputPorts,outputEndpoints);
// Physical masks are always the active JUCE device's truth, even when
// callback-registry proof has not yet arrived. Unverified pins simply
// have NO corresponding actionable endpoint until registry validation.
device->setProperty("enabledInputs",actualDevice.getProperty(
"enabledInputs",juce::var(juce::Array<juce::var>())));
device->setProperty("enabledOutputs",actualDevice.getProperty(
"enabledOutputs",juce::var(juce::Array<juce::var>())));
device->setProperty("inputEndpoints",juce::var(inputEndpoints));
device->setProperty("outputEndpoints",juce::var(outputEndpoints));
result->setProperty("device",juce::var(device.release()));

auto graph=std::make_unique<juce::DynamicObject>();
graph->setProperty("revision","0");
graph->setProperty("rosterRevision","0");
graph->setProperty("channels",juce::var(juce::Array<juce::var>()));
graph->setProperty("destinations",juce::var(juce::Array<juce::var>()));
auto caps=std::make_unique<juce::DynamicObject>();
for (const char* field: {"callbackOwnsChannelIds","fullVendorFxMigration",
"showAndOutputParity","physicalCaptureMapped","dynamicChannels",
"groups","fxReturns","monitor","sendsOnFaders"})
caps->setProperty(field,false);
caps->setProperty("supportedOps",juce::var(juce::Array<juce::var>()));
graph->setProperty("capabilities",juce::var(caps.release()));
result->setProperty("graph",juce::var(graph.release()));

auto telemetry=std::make_unique<juce::DynamicObject>();
const auto peak=static_cast<double>(installed.getProperty("inputPeak",0.0));
const double safePeak=std::isfinite(peak) && peak>=0.0 ? peak : 0.0;
telemetry->setProperty("rawCapturePeak",safePeak);
telemetry->setProperty("rawCapturePresent",open && !inputPorts.isEmpty() &&
static_cast<double>(installed.getProperty("callbackCount",0.0))>0.0 &&
safePeak>0.0005);
telemetry->setProperty("mainPcmPresent",false); // No accepted ChannelId MAIN.
telemetry->setProperty("monitorPcmPresent",false);
result->setProperty("telemetry",juce::var(telemetry.release()));
return juce::var(result.release());
}
} // namespace armix::console::approvedM2
46 changes: 46 additions & 0 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <BinaryData.h>
#include "ApprovedGuiResources.h"
#include "LiveAudioEngine.h"
#include "ApprovedConsoleM2Snapshot.h"
#include "ArSonMixStartupSplash.h"
#include "VstOrbitController.h"
#include "../engine/core/OrbitDistanceMapping.h"
Expand Down Expand Up @@ -195,6 +196,37 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
})
.withEventListener ("arMixParameter", [this] (juce::var args) { onParameter (args); })
.withEventListener ("arMixAction", [this] (juce::var args) { onAction (args); })
.withEventListener ("arMixConsoleSubscribe", [this] (juce::var args)
{
if (args.getProperty("protocol","").toString()!="v6" ||
static_cast<int>(args.getProperty("schemaVersion",0))!=6) return;
m2ConsoleSubscribed_ = true;
emitApprovedM2Snapshot();
})
.withEventListener ("arMixConsoleIntent", [this] (juce::var args)
{
// Native M4 does not own the v8 universal ChannelId graph.
// Explicit REJECTED ACK: NEVER mutate an ordinal route through
// an unadmitted operation and NEVER claim audio success.
const auto id=args.getProperty("requestId",{}).toString();
if(id.isEmpty()||id.length()>128)return;
const auto snapshot=armix::console::approvedM2::build(
engine_.status(),currentDeviceSnapshot());
const auto device=snapshot.getProperty("device",{});
const auto graph=snapshot.getProperty("graph",{});
auto ack=std::make_unique<juce::DynamicObject>();
ack->setProperty("requestId",id);
ack->setProperty("status","REJECTED");
ack->setProperty("deviceEpoch",device.getProperty("epoch","1"));
ack->setProperty("graphRevision",graph.getProperty("revision","0"));
ack->setProperty("rosterRevision",graph.getProperty("rosterRevision","0"));
ack->setProperty("errorCode","NATIVE_CHANNELID_CALLBACK_NOT_ADMITTED");
if(browser_.loaded) {
browser_.emitEventIfBrowserIsVisible("arMixConsoleAck",
juce::var(ack.release()));
emitApprovedM2Snapshot();
}
})
.withResourceProvider (assetFor))
{
settingsDirectory().createDirectory();
Expand Down Expand Up @@ -259,6 +291,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
std::unique_ptr<AudioSetupWindow> audioSetupWindow_;
juce::String startupError_, lastAudioXml_;
bool initialStateSent_ = false;
bool m2ConsoleSubscribed_ = false;
bool webViewPeerWarmed_ = false;
bool webViewStartupNoticeSent_ = false;
juce::uint32 webViewStartupTick_ = 0;
Expand Down Expand Up @@ -467,6 +500,14 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
emitNotice ("Device interrupted. DIRECT restore is retrying with bounded backoff.", true);
}

void emitApprovedM2Snapshot()
{
if (!browser_.loaded || !m2ConsoleSubscribed_) return;
browser_.emitEventIfBrowserIsVisible("arMixConsoleSnapshot",
armix::console::approvedM2::build(engine_.status(),
currentDeviceSnapshot()));
}

void emitNotice (const juce::String& message, bool error = false)
{
auto o = std::make_unique<juce::DynamicObject>();
Expand Down Expand Up @@ -2542,6 +2583,11 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
if (startupError_.isNotEmpty() && !bool (state.getProperty ("connected", false)))
state.getDynamicObject()->setProperty ("error", startupError_);
browser_.emitEventIfBrowserIsVisible ("arMixStatus", state);
// Control-thread native readback. Same existing 12 Hz timer; no
// callback allocations or a second polling worker. One Hz is enough
// for topology/device invalidation, not for audio metering.
if(m2ConsoleSubscribed_ && timerTicks_ % 12 == 0)
emitApprovedM2Snapshot();
}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/approved_native_gui_bundle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_native_is_exact_assembled_public_pages_plus_nonvisual_native_seam(self)
manifest = bundle.stage(out)
self.assertEqual(manifest["authoritativePagesRoute"], "/preview/")
self.assertEqual(manifest["authoritativePagesOutput"], "preview/index.html")
self.assertEqual(manifest["adapterState"], "SCAFFOLD_ONLY__NOT_LIVE_PCM")
self.assertEqual(manifest["adapterState"], "M2_NATIVE_ACK_SNAPSHOT_GATED__PCM_NOT_CERTIFIED")
approved = (source / "index.html").read_text("utf-8")
native = (out / "index.html").read_text("utf-8")
self.assertEqual(native.replace(bundle.ADAPTER_MARKER + "\n", ""), approved)
Expand Down
Loading
Loading