Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3802fbe
feat(m2): exact uint64 native v6 snapshot and ACK-later-readback JS r…
masarray Nov 4, 2026
7d65e0c
feat(m2 native): publish actual JUCE device pins and explicit non-adm…
masarray Nov 4, 2026
073ffe2
feat(m2): wire actual JUCE snapshot/explicit REJECTED intent/subscrib…
masarray Nov 4, 2026
c800385
build(m2): add pure state protocol before existing nonvisual JUCE bri…
masarray Nov 4, 2026
cf87668
feat(m2 pages): preserve approved DOM; native hook intercepts all phy…
masarray Nov 4, 2026
56e9841
feat(m2): bind approved GUI controls to native intent gate, ACK snaps…
masarray Nov 4, 2026
42980f2
fix(m2): freeze unacknowledged source projection and bound native int…
masarray Nov 4, 2026
4be2137
fix(m2): bounded native ACK/readback timeout retains last accepted GUI
masarray Nov 4, 2026
1fe8075
test(m2): deterministic uint64, stale/reject, accepted ACK + later sa…
masarray Nov 4, 2026
1a20686
test(m2): check explicit fail-closed initial authority flags in updat…
masarray Nov 4, 2026
1a25670
test(m2): check explicit fail-closed initial authority flags in updat…
masarray Nov 4, 2026
97aa0ce
ci(m2): cover actual native transport JS and contract replay in exist…
masarray Nov 4, 2026
3135b08
ci(m2 browser): run pure readback/ACK replay next to existing UI test…
masarray Nov 4, 2026
dd1574f
test(m2): unadmitted device switch drops stale MAIN graph identity
masarray Nov 4, 2026
f82b556
test(ci): M2 native JS and replay tests trigger only existing relevan…
masarray Nov 4, 2026
fdff3b5
fix(test m2): count subscribe/intent event names in the exact protoco…
masarray Nov 4, 2026
43ff9c3
fix(m2): keep approved public /preview/ HTML byte-identical; native-o…
masarray Nov 4, 2026
741530e
fix(m2): instrument control hooks in generated native-only HTML; reta…
masarray Nov 4, 2026
6e09c72
test(m2): enforce exact unchanged public Pages and reversible native-…
masarray Nov 4, 2026
13271dd
test(m2): enforce exact unchanged public Pages and reversible native-…
masarray Nov 4, 2026
f818a44
fix(m2 win): use mutable JUCE AudioIODevice pointer for non-const SDK…
masarray Nov 4, 2026
904345f
fix(m2): require exactly one native MAIN identity and explicit edge r…
masarray Nov 4, 2026
94d8654
fix(m2): block unprojected native intents, refresh same-revision cont…
masarray Nov 4, 2026
b963342
M2: separate accepted PCM graph from product LIVE and verify native A…
masarray Nov 4, 2026
2590660
M2: read actual native meter telemetry and stage PCM graph separately…
masarray Nov 4, 2026
f1657b0
M2 tests: reject ACK without applied PCM controls or EdgeId route and…
masarray Nov 4, 2026
0659f69
M2 release guard: verify real CMake /preview/ bundle and transport as…
masarray Nov 4, 2026
6118310
M2: encode WIRE intents to real ENGINE C2 op/from/to/EdgeId ABI and v…
masarray Nov 4, 2026
896aa6f
M2 CI: fix JS test syntax for native wire payload ABI assertions
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
9 changes: 8 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-contract.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-contract.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,12 +95,13 @@ 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-contract.js', 'web/approved-native-bridge.js')) {
node --check $file
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
$contracts = @(
'tests/gui_workflow_contract_test.mjs'
'tests/approved_native_m2_contract.test.cjs'
'tests/native_ui_contract_test.mjs'
'tests/native_preset_contract_test.mjs'
'tests/fx_add_contract_test.mjs'
Expand Down Expand Up @@ -127,6 +132,8 @@ jobs:
-DJUCE_ROOT="${{ github.workspace }}/third_party/JUCE"
-DBUILD_TESTING=ON
-DJUCE_WEBVIEW2_PACKAGE_LOCATION="${{ github.workspace }}/.deps"
- name: Verify exact ONE approved /preview/ GUI CMake bundle
run: node scripts/check_approved_native_gui_release.mjs --source-only --bundle build/approved_gui
- name: Build executable and native RT tests
run: cmake --build build --config Release --target ARMixConsole ARMixFactoryFxRegistryTests ARMixFxOrderTests ARMixFxStructuralHandoffTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixJucePortMaskTests ARMixNativeMixerSessionTests ARMixNativeDrySendTests ARMixLiveChannelFxTests ARMixDedicatedAuxBusTests ARMixTenChannelLiveControlTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixShowSchemaTests ARMixShowStoreTests ARMixLiveShowCaptureTests ARMixNativeMasterLoudnessTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCaptureBoundaryTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
- name: Test realtime control primitives
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
- 'tests/wire_graph_canonical_model.test.cjs'
- 'tests/wire_main_native_handoff_contract.test.cjs'
- 'tests/ci_workflow_efficiency_test.mjs'
- 'tests/approved_native_m2_contract.test.cjs'
- 'scripts/build_ui_css.py'
- '.github/workflows/ui-smoke.yml'
- '.github/workflows/pages-publish.yml'
Expand All @@ -36,6 +37,7 @@ on:
- 'tests/native_ui_contract_test.mjs'
- 'tests/native_orbit_ui_smoke.py'
- 'tests/ci_workflow_efficiency_test.mjs'
- 'tests/approved_native_m2_contract.test.cjs'
- 'tests/wire_graph_canonical_model.test.cjs'
- 'tests/wire_main_native_handoff_contract.test.cjs'
- '.github/workflows/ui-smoke.yml'
Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:
node --check web/plugin-ui.js
node --check web/mixer-io.js
node --check web/mixer-layout.js
node --test tests/gui_workflow_contract_test.mjs tests/plugin_ui_contract_test.mjs tests/ci_workflow_efficiency_test.mjs tests/fx_drag_reorder_contract_test.mjs tests/mixer_io_operator_contract_test.mjs tests/mixer_shell_contract_test.mjs
node --test tests/gui_workflow_contract_test.mjs tests/plugin_ui_contract_test.mjs tests/ci_workflow_efficiency_test.mjs tests/fx_drag_reorder_contract_test.mjs tests/mixer_io_operator_contract_test.mjs tests/mixer_shell_contract_test.mjs tests/approved_native_m2_contract.test.cjs
- name: Validate approved GUI checkpoint and single publisher
run: python tests/gui_baseline_lock_test.py
- name: CSS V28 zero-regression source-order recovery (every GUI CI run)
Expand Down
55 changes: 52 additions & 3 deletions scripts/build_approved_native_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
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>'
ADAPTER_MARKER = ('<script defer src="assets/approved-native-contract.js"></script>\n'
'<script defer src="assets/approved-native-bridge.js"></script>')
SCHEMA = "arsonmix.approved-native-pages-bundle.v2"


Expand Down Expand Up @@ -51,11 +52,57 @@ def accepted_pages_html() -> str:
return (build_public_pages(Path(tmp) / "public") / "index.html").read_text("utf-8")


# Native-only event seam: the original PUBLIC Pages HTML is byte-for-byte
# unchanged. Insert five small control hooks ONLY into the generated WebView2
# HTML at native build time. Every anchor must occur exactly once: no silent
# breakage if Pages GUI source evolves. No extra layout or simulated PCM.
NATIVE_EVENT_HOOKS = (
("function wireGraphCommit(ops,{record=true}={}){\n",
"function wireGraphCommit(ops,{record=true}={}){\n"
" if(window.__ARMIX_NATIVE_M2__?.consumeWire?.(ops))return false;\n"),
("function wireWsUndo(){\n",
"function wireWsUndo(){\n"
" if(window.__ARMIX_NATIVE_M2__?.consumeUndo?.())return false;\n"),
("function handleField(event){\n",
"function handleField(event){\n"
" if(window.__ARMIX_NATIVE_M2__?.consumeField?.(event))return;\n"),
(" if(a==='wireExpand'){document.querySelector('.section-rail",
" if(window.__ARMIX_NATIVE_M2__?.consumeAction?.(t,a,btn))return;\n"
" if(a==='wireExpand'){document.querySelector('.section-rail"),
("document.querySelector('.console-body').addEventListener('dblclick',e=>{\n"
" const t=findTrack(e.target);if(!t)return;\n",
"document.querySelector('.console-body').addEventListener('dblclick',e=>{\n"
" const t=findTrack(e.target);if(!t)return;\n"
" if(window.__ARMIX_NATIVE_M2__?.consumeDoubleClick?.(e,t))return;\n"),
)


def native_html(approved: str | None = None) -> str:
html = accepted_pages_html() if approved is None else approved
original = accepted_pages_html() if approved is None else approved
newline = "\r\n" if "\r\n" in original else "\n"
html = original.replace("\r\n", "\n")
if html.count("</body>") != 1 or ADAPTER_MARKER in html:
raise ValueError("Approved Pages must have exactly one body and no prior native injection")
return html.replace("</body>", ADAPTER_MARKER + "\n</body>")
for before, after in NATIVE_EVENT_HOOKS:
if html.count(before) != 1 or after in html:
raise ValueError("Native-only M2 control hook anchor drift: " + before[:55])
html = html.replace(before, after, 1)
html = html.replace("</body>", ADAPTER_MARKER + "\n</body>")
return html.replace("\n", newline)


def public_from_native(native: str) -> str:
"""Reconstruct original public Pages HTML byte-for-byte from the native source."""
newline = "\r\n" if "\r\n" in native else "\n"
html = native.replace("\r\n", "\n")
if html.count(ADAPTER_MARKER + "\n") != 1:
raise ValueError("Native adapter marker missing or duplicated")
html = html.replace(ADAPTER_MARKER + "\n", "", 1)
for before, after in reversed(NATIVE_EVENT_HOOKS):
if html.count(after) != 1:
raise ValueError("Native-only M2 control hook missing or duplicated")
html = html.replace(after, before, 1)
return html.replace("\n", newline)


def safe_symbol(filename: str) -> str:
Expand Down Expand Up @@ -111,6 +158,8 @@ def stage(out: Path) -> dict:
out.mkdir(parents=True)
shutil.copytree(pages / "assets", out / "assets")
shutil.copy2(NATIVE_ADAPTER, out / "assets" / "approved-native-bridge.js")
shutil.copy2(ROOT / "web" / "approved-native-contract.js",
out / "assets" / "approved-native-contract.js")
native = native_html(approved.decode("utf-8")).encode("utf-8")
(out / "index.html").write_bytes(native)
files = [out / "index.html", *sorted(p for p in (out / "assets").rglob("*") if p.is_file())]
Expand Down
127 changes: 79 additions & 48 deletions scripts/check_approved_native_gui_release.mjs
Original file line number Diff line number Diff line change
@@ -1,53 +1,84 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Native RELEASE gate: user-approved /preview/ is the ONLY allowable Windows GUI.
// Necessary static provenance, NOT proof of rendered EXE screenshots or PCM FAT.
// ONE approved /preview/ Windows WebView2 resource bundle, not an old
// web/approved-preview staging fiction. Source proof != product PCM/hardware FAT.
import {readFileSync, existsSync} from 'node:fs';
import {resolve} from 'node:path';
import {resolve, join, sep} from 'node:path';
import {createHash} from 'node:crypto';
import {spawnSync} from 'node:child_process';

const root=resolve('.');
const abs=p=>resolve(root,p);
const exists=p=>existsSync(abs(p));
const read=p=>readFileSync(abs(p));
const digest=b=>createHash('sha256').update(b).digest('hex');
const fail=s=>{console.error('RELEASE BLOCKED — approved /preview/ GUI: '+s);process.exitCode=1;};
const entry='web/approved-preview/index.html';
const manifest='web/approved-preview/native-manifest.json';
const source='site/preview-v2/index.html'; // INTERNAL HTML seed, NOT /preview-v2/ product
const buttons='site/preview-buttons/assets/';
if(!exists(entry)||!exists(manifest)){
fail('Windows approved GUI bundle missing. Generate the exact /preview/ assembled HTML, CSS/JS/PNG, then embed it into JUCE.');
process.exit(1);
const argv=process.argv.slice(2);
const value=flag=>{
const at=argv.indexOf(flag);
return at<0?null:argv[at+1] || null;
};
const sourceOnly=argv.includes('--source-only');
const release=argv.includes('--release');
const bundle=resolve(value('--bundle') || process.env.ARMIX_NATIVE_GUI_BUNDLE || 'build/approved_gui');
const read=path=>readFileSync(path);
const sha=bytes=>createHash('sha256').update(bytes).digest('hex');
const block=reason=>{throw Error('APPROVED /preview/ native bundle BLOCKED: '+reason);};
const requireFile=(path,why)=>{
if(!existsSync(path))block(why+': '+path);
return read(path);
};
try {
if(!sourceOnly&&!release)block('Pass --source-only or --release explicitly');
const manifestPath=join(bundle,'approved-gui-manifest.json');
const manifest=JSON.parse(requireFile(manifestPath,'Missing actual CMake-generated manifest').toString('utf8'));
if(manifest.schema!=='arsonmix.approved-native-pages-bundle.v2' ||
manifest.authoritativePagesRoute!=='/preview/' ||
manifest.authoritativePagesOutput!=='preview/index.html')
block('Wrong public GUI identity/manifest schema');
const html=requireFile(join(bundle,'index.html'),'Missing native Pages entry');
if(sha(html)!==manifest.nativeHtmlSha256)block('Approved native HTML hash mismatch');
if(!Array.isArray(manifest.files)||manifest.files.length<4)
block('Native BinaryData resource inventory incomplete');
const paths=new Set();
for(const item of manifest.files) {
if(typeof item.path!=='string' || !/^[a-zA-Z0-9_./-]+$/.test(item.path) ||
item.path.startsWith('/') || item.path.split('/').includes('..') ||
paths.has(item.path))
block('Unexpected, repeated, or unsafe resource path');
paths.add(item.path);
const resolved=resolve(bundle,item.path);
if(!resolved.startsWith(bundle+sep))block('Resource escapes approved bundle');
if(sha(requireFile(resolved,'Missing approved native resource'))!==item.sha256)
block('Native resource hash mismatch: '+item.path);
}
for(const name of ['index.html','assets/approved-native-contract.js',
'assets/approved-native-bridge.js',
'assets/mixer-control-keys.css',
'assets/mixer-control-keys.js',
'assets/mute-solo-pfl-56x37.png','assets/mixer-wire-dots.css'])
if(!paths.has(name))block('Mandatory approved GUI/V8 transport resource missing: '+name);
const cmake=requireFile(join(root,'CMakeLists.txt'),'Missing native CMake').toString('utf8');
const host=requireFile(join(root,'src/Main.cpp'),'Missing JUCE host').toString('utf8');
if(!cmake.includes('scripts/build_approved_native_gui.py') ||
!cmake.includes('ARMIX_APPROVED_GUI_DIR') ||
!cmake.includes('juce_add_binary_data(ARMixAssets SOURCES'))
block('JUCE BinaryData does not use approved Pages source generator');
if(!host.includes('resolveApprovedGuiResource') ||
!host.includes('withResourceProvider (assetFor)'))
block('JUCE WebView ResourceProvider does not serve approved Pages assets');
if(/juce_add_binary_data\(ARMixAssets SOURCES\s*web\//.test(cmake) ||
host.includes('BinaryData::consolenative_html'))
block('Forbidden alternative GUI compiled in Windows executable');
const py=process.env.PYTHON || 'python';
const result=spawnSync(py,['scripts/build_approved_native_gui.py',
'--out',bundle,'--verify'],{cwd:root,encoding:'utf8',timeout:60000});
if(result.error || result.status!==0)
block('Pages→native byte-for-byte regeneration failed: '+
String(result.error?.message||result.stderr||result.stdout).slice(0,700));
if(release &&
host.includes('native_console_m2::reject (args, accepted)') &&
!host.includes('consoleBridge_.processNativeBusIntent'))
block('G0 rejects all PCM/WIRE operations; ENGINE #266 + native FAT not yet installed');
// This gate proves the CMake bundle; it cannot replace the separate exact
// Windows executable screenshot, PCM/VST3, or ASIO/WASAPI hardware FAT gate.
console.log('PASS: exact /preview/ GUI CMake resources, native v8 bridge and SHA256 manifest');
console.log('NOT hardware/PCM FAT — product promotion still requires #270 and #15 evidence');
} catch(error) {
console.error(error.message);
process.exitCode=1;
}
let m;try{m=JSON.parse(read(manifest).toString('utf8'));}catch(e){fail('Invalid manifest: '+e.message);process.exit(1);}
if(m.canonicalUrl!=='https://masarray.github.io/arsonmix/preview/'||m.nativeEntrypoint!==entry)fail('Canonical GUI identity is NOT /preview/');
if(m.entrySha256!==digest(read(entry)))fail('Native approved HTML digest mismatch');
const sourceHtml=read(source).toString('utf8');
let expected=sourceHtml;
for(const name of ['mixer-control-keys.css','mixer-control-keys.js']){
const key=buttons+name;
if(!exists(key)){fail('Missing approved PNG button asset '+key);continue;}
const rev=digest(read(key)).slice(0,16);
const token='assets/'+name;
const pattern=name.endsWith('.css') ? /assets\/mixer-control-keys\.css(?:\?[^"'\s>]*)?/g : /assets\/mixer-control-keys\.js(?:\?[^"'\s>]*)?/g;
const matches=[...expected.matchAll(pattern)];
if(matches.length!==1)fail('Expected exactly one PNG-button source reference '+name);
expected=expected.replace(pattern,token+'?rev='+rev);
}
if(read(entry).toString('utf8')!==expected)fail('Native HTML does not match EXACT approved /preview/ assembly');
const linked=[...new Set([...sourceHtml.matchAll(/(?:src|href)=["'](assets\/[^"'?]+)(?:\?[^"']*)?["']/g)].map(v=>v[1]))];
for(const rel of linked){
const name=rel.slice('assets/'.length);
const sourceAsset=['mixer-control-keys.css','mixer-control-keys.js','mute-solo-pfl-56x37.png'].includes(name)?buttons+name:'site/preview-v2/'+rel;
const nativeAsset='web/approved-preview/'+rel;
if(!exists(sourceAsset)||!exists(nativeAsset)||digest(read(sourceAsset))!==digest(read(nativeAsset)))fail('Native CSS/JS/art missing/changed: '+rel);
}
for(const name of ['mute-solo-pfl-56x37.png','mixer-wire-dots.css','knob-ICON.svg']){
const ref=name==='mute-solo-pfl-56x37.png'?buttons+name:'site/preview-v2/assets/'+name;
const native='web/approved-preview/assets/'+name;
if(!exists(native)||!exists(ref)||digest(read(native))!==digest(read(ref)))fail('Mandatory GUI art mismatch: '+name);
}
const cmake=read('CMakeLists.txt').toString('utf8'),host=read('src/Main.cpp').toString('utf8');
if(!cmake.includes(entry)||!cmake.includes('web/approved-preview/assets/'))fail('CMake BinaryData not built from approved /preview/ GUI and assets');
if(!/approved-preview|approvedPreview/i.test(host))fail('JUCE ResourceProvider not serving approved /preview/ GUI');
if(cmake.includes('web/console-native.html')||cmake.includes('web/index.html'))fail('Compiled alternate native/legacy HTML renderer');
if(!process.exitCode)console.log('APPROVED /preview/ static source/asset+JUCE contract PASS (actual Windows GUI/PCM FAT still required)');
Loading
Loading