Skip to content

M2 — authoritative native v6 snapshot/intent/ACK seam for the single approved /preview/ mixer - #394

Merged
masarray merged 29 commits into
mainfrom
integration/m2-approved-pages-native-state-20261104
Nov 4, 2026
Merged

masarray merged 29 commits into
mainfrom
integration/m2-approved-pages-native-state-20261104

Conversation

@masarray

@masarray masarray commented Nov 4, 2026

Copy link
Copy Markdown
Owner

M2: actual code, not another GUI or a second DSP

Continuation of merged M1 #392 and P0 #389. Existing approved Pages /preview/ DOM/CSS/buttons retained, only five nonvisual physical-operation hooks added to site/preview-v2/index.html for native mode.

Native producer (installed M4, no fabricated ChannelId)

src/ApprovedConsoleNativeTransportV6.h reads actual current JUCE device, active input/output masks and callback pin ordinals on message thread, serializes v6 device.epoch as canonical decimal string; advertises productionCallbackLive:false, callbackOwnsChannelIds:false, zero supported universal graph ops until ENGINE #266 real callback graph is installed. src/Main.cpp now handles arMixConsoleSubscribe / arMixConsoleIntent, sends real arMixConsoleSnapshot, and explicit REJECTED arMixConsoleAck for every unsupported/stale operation. No ordinal-only PCM alias, no additional callback.

Native JS consumer and UI binding

web/approved-native-contract.js: strict canonical uint64 IDs via BigInt, G0/accepted snapshot schema validation, epoch/revision freshness, unique request/session ID, supportedOp gating, PENDING → matching ACK → later same graph+roster revision snapshot before projection; rejects stale/unsupported, bounds timeout, never optimistic audio claims. web/approved-native-bridge.js wires the four real event names into the existing approved GUI, prepares stable view-local IDs (never downcasts native ID), projects only authentic accepted channels/edges and sends mapped SET_FADER/SET_PAN/SET_MUTE/SET_SOLO/APPLY_WIRE_TRANSACTION intents when advertised. Native mode blocks demo meter and unadmitted local mutation; public Pages demo unchanged.

Test coverage and optimization

New pure replay suite tests/approved_native_m2_contract.test.cjs covers >2^53 IDs, accepted readback, stale/rejected ACK, timeouts, invalid pins and no extra GUI. It runs in existing Windows + Chromium workflows; no extra workflow.

Explicit stop-ship

Current main engine does not yet admit production ChannelId callback (ENGINE #266 still draft): G0 truth only. Do not mark native PCM, VST3, routing or hardware qualified from M2 transport tests. M3 engine producer must take over accepted graph.channels/edges/supportedOps; avoid copying its parallel GUI. M4 FAT #270 / #15 remains required. Keep draft until native build/CTest and no demo regression PASS.
Commit: f82b556399a800b0923c6e22dfba3fae60d0afb7

…itted ChannelId graph; reject unsupported intents
…hot projection and truthful G0 device status
@masarray
masarray marked this pull request as ready for review November 4, 2026 19:42
@masarray
masarray merged commit c1a11af into main Nov 4, 2026
2 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T19:44:26.852840Z 896aa6f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 896aa6f1a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +49 to +51
if (!native?.admitted || !Array.isArray(native.graph.edges) ||
typeof make !== "function" || typeof render !== "function" ||
typeof ArSonWireGraph === "undefined") return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Expose the approved GUI state through an explicit adapter API

When an admitted native snapshot arrives, projection always fails because make and render are private to the IIFE in site/preview-v2/index.html; the separately loaded bridge cannot access them. The generated HTML only inserts event hooks and script tags, without exposing that closure. Consequently, valid snapshots produce NATIVE READBACK INVALID and acceptedGraphConnected never becomes true. The same scope problem makes findTrack, faderGesture, and displayMeterDbfs unavailable to the bridge. Expose a narrow API from inside the GUI closure, or initialize the adapter there, and test the assembled HTML with a valid native snapshot. This prevents the native-state stitching required by AGENTS.md.

AGENTS.md reference: AGENTS.md:L18-L18

Useful? React with 👍 / 👎.

Comment on lines +307 to +311
document.addEventListener("click",event=>{
const target=event.target.closest?.(
"#preview,#addTrack,#addBus,#addFx,#reset,#saveScene,#recallScene,#sceneSafe,#group,#ungroup,#copy,#paste,#clearCue,#pluginsButton,#pluginScan,#pluginImport,#pluginAddPath");
if(!target)return;
event.preventDefault();event.stopImmediatePropagation();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply native mutation guards to keyboard shortcuts too

In the native application, the click-only guard leaves the existing keyboard mutation paths active. The window keydown handler in site/preview-v2/index.html calls copyChannels(), pasteChannels(), and groupSelected() directly for Ctrl/Cmd+C, V, and G. Copying one strip and pasting onto another therefore changes displayed FX, gain, pan, mute, and solo without any native intent, ACK, or snapshot, even while G0 reports that edits are blocked. Guard these underlying operations or intercept their keyboard paths as well; otherwise the interface can display settings that the engine never accepted, contrary to AGENTS.md's native-state requirement.

AGENTS.md reference: AGENTS.md:L18-L18

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant