Skip to content

M3 FIRST REAL SOUND — wire approved GUI closed state into native bridge; fix fader commit and FX safety - #396

Merged
masarray merged 9 commits into
mainfrom
integration/m3-first-real-sound-native-gestures-20261105
Nov 4, 2026
Merged

masarray merged 9 commits into
mainfrom
integration/m3-first-real-sound-native-gestures-20261105

Conversation

@masarray

@masarray masarray commented Nov 4, 2026

Copy link
Copy Markdown
Owner

M3-A: actual approved GUI -> native ACK integration reliability (NOT full PCM yet)

Source branch from main@c1a11afd145380a944c9844937ccb6a97b5e0557. This preserves the sole public /preview/ HTML exactly, its approved hardware PNG assets, and one JUCE callback.

Root cause / code changes

  • Prior M2 external bridge could not access tracks, make, render, findTrack, wireEdges or displayMeterDbfs because original Pages code executes within an IIFE. It could never project a genuine accepted native snapshot even if ENGINE [ENGINE SOLE OWNER] One native callback → full-fidelity ChannelId cutover (draft) #266 admitted one.
  • Add a small, native-generated-only, reversible __ARMIX_NATIVE_SCOPE__ adapter inside the SAME approved GUI's existing IIFE. External bridge now maps real decimal-string ChannelId/EdgeId to this original state, with no second renderer/reducer and without JS PCM.
  • Native pointer fader commit happens exactly once inside original finishFaderPointer, before original code clears faderGesture. Former external window.pointerup listener ran too late and silently dropped the intent.
  • Gated native FX keyboard/drag reorder cannot mutate demo inserts; native unsupported operations stay blocked.
  • Gesture visual preview changes only CSS fader cap, not accepted audio state; REJECTED/STALE/timeout rerenders accepted state. Source-only Pages appearance/behaviour remains unchanged.
  • Add Node mocked-JUCE event integration test for real snapshot projection, SET_FADER intent, matching ACK, later same-revision accepted readback, rollback on native rejection, and native hook-owner locks.

Verification gates / release truth

This code does NOT promote productionCallbackLive, create a ChannelId engine, fake meter audio, or claim physical hardware FAT. ENGINE #266 + WIRE #387 must still be reconciled into the existing main JUCE callback for M3-B real PCM, followed by Windows exact-SHA and physical #15 FAT. Keep DRAFT until Windows CTest, Chromium and bundle parity PASS.

Related: #389, #266, #387, #270, #15.

masarray commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Milestone A integrator coordination: thank you for addressing native-only Pages IIFE scope and pointer fader ordering; these are genuine M3-A blockers and must be tested against the exact approved /preview/, not another renderer. Independent source/release-gate PR #398 touches only scripts/check_console_puzzle.mjs and tests/milestone_a_native_contract_test.mjs, so there is NO direct file overlap with #396. #398's cheap source suite now passes; Windows build/CTest in progress. After both PRs qualify, merge/reconcile each against current main, then ENGINE #266 supplies real accepted ChannelId PCM (one callback) while M3-A scope exports just project native snapshots. Keep productionCallbackLive=false until real audio authority is present. Physical #15 still pending.

masarray commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

M2.5 handoff: #395 closed as redundant native controller/producer; please port only missing safety regressions from exact #395 head 28862dd4: pending intent invalidated by device epoch change, source outside actual enabled pins, and foreign/out-of-order ACK. Do not add web/approved-native-m2-state.js as a second controller. Existing #396 IIFE/pointer event fix remains sole GUI-native consumer; require exact-head CI. Coordination #397, owner guard #400.

@masarray
masarray marked this pull request as ready for review November 4, 2026 20:11
@masarray
masarray merged commit 126ab2e 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-04T20:13:32.312329Z d13e0b9 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: d13e0b978a

ℹ️ 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".

" g.box.releasePointerCapture?.(ev.pointerId);\n",
" const g=faderGesture;faderGesture=null;\n"
" g.box.releasePointerCapture?.(ev.pointerId);\n"
" if(window.__ARMIX_NATIVE_M2__?.consumeField?.({target:g.input,type:'change'}))return;\n"),

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 Preserve Sends on Faders semantics when committing native gestures

With an admitted native graph containing a GROUP or FX_RETURN, #sofToggle still enables Sends on Faders through the original GUI handler. This new pointer-release hook nevertheless calls consumeField, which unconditionally translates level into SET_FADER; it never checks sofEnabled or the selected send destination. Consequently, moving a fader labeled SEND changes the channel's main gain instead of its send, despite toggleSof() explicitly promising that main faders are protected. Expose the active fader mode and dispatch the appropriate native send operation, or block Sends on Faders until that operation is supported.

AGENTS.md reference: AGENTS.md:L16-L16

Useful? React with 👍 / 👎.

Comment on lines +221 to +224
box?.style?.setProperty("--fader-fill",p+"%");
box?.style?.setProperty("--fader-lit",String(p/100));
box?.style?.setProperty("--fader-y",(100-p)+"%");
box?.style?.setProperty("--fader-frac",String(p/100));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore the accepted fader position when a pointer drag is canceled

If a native fader drag ends with pointercancel rather than pointerup, these new CSS updates leave the cap at the uncommitted position. The original cancellation handler in site/preview-v2/index.html only clears faderGesture, so no intent is submitted and no ACK rejection or timeout triggers the new rollback path. Subsequent unchanged native snapshots also skip projection through lastPaintedSignature, leaving the displayed gain inconsistent with accepted audio state indefinitely. Add a native cancellation hook that restores the input and cap from the accepted track state.

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