Skip to content

M4 operator routing safety: native Route Only / Send, anti-double-dry and fail-closed sidechain/PDC - #404

Merged
masarray merged 6 commits into
mainfrom
integration/m4-operator-routing-admission-20261105
Nov 4, 2026
Merged

masarray merged 6 commits into
mainfrom
integration/m4-operator-routing-admission-20261105

Conversation

@masarray

@masarray masarray commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

M4 — meaningful independent integration slice (NOT a second audio engine)

Base: main@3c7ea623960067c0a3daac2f81bfc579ac59b81a. Workstream coordination handoff posted to #397.

Implemented

  • integration/console-v6/m4-operator-routing.mjs: pure accepted native v8 graph → APPLY_WIRE_TRANSACTION intent planner for ROUTE_ONLY and POST send. Canonical uint64 decimal-string identities, exact epoch/graph/roster revision fence, native capability admission, native-edge provenance, directed-cycle rejection, duplicate sends, anti-double-dry, wet-only FX return verification, exclusive-primary preservation.
  • assessM4Pdc + sidechain admission: unverified VST3 detector input, unknown plugin latency, unsupported PRE taps, send-gain readback, bus creation and unsupported compressor sidechain FAIL CLOSED. No audible pseudo-sidechain, no optimistic graph/ACK/PCM.
  • tests/m4_operator_routing.test.mjs: positive route-only/send operator actions and negative G0, fake graph, >2^53 64-bit IDs, duplicate/feedback, parallel dry, unverified FX wetness, sidechain lease/PDC, and graph state non-mutation.
  • Registers tests in the existing cheap scripts/check_console_puzzle.mjs invoked by existing Windows and Chromium workflows. NO new workflow, CMake, native callback, render, or GUI source.
  • integration/M4_OPERATOR_ROUTING_HANDOFF.md documents exact ENGINE [ENGINE SOLE OWNER] One native callback → full-fidelity ChannelId cutover (draft) #266 requirements and UI owner one-/two-click gestures using the approved /preview/.

Ownership boundaries / not claimed

CI/merge gate

Require exact-head fast contract tests and existing Windows gate PASS before review/merge; no false audio claims. Shared control tower #397.

M4 native ACK safety added on HEAD 9c13f59a7f69ce60a2d9fc43c8624bdad456e1f8

  • Tightened the ONE existing web/approved-native-contract.js::readbackProvesIntent: native Route Only ACK now proves the actual new primary OUT, absence of old dry-to-MAIN cable, and exact requested tap/gain; CONNECT verifies requested tap/gain when supplied. Backward-compatible with legacy v6 request fields omitted.
  • Extended the same cheap M4 test suite with actual M2 controller → ACK → accepted snapshot positive and negative tests. This is a genuine regression for silently doubled dry audio and wrong send tap/level; no new renderer/audio authority.
  • Exact-head Chromium #41913598998 and Windows #41913599141 are running; no PASS claim until complete.

@masarray
masarray marked this pull request as ready for review November 4, 2026 21:42
@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-04T21:44:04.035125Z 7796943 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: 7796943ef9

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

!Number.isFinite(e.gainLinear) ||
Math.abs(edit.gainLinear-e.gainLinear)>0.0001))
return false;
return edit.op!=="ROUTE_ONLY" || e.primaryOutput===true;

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 Use the accepted v8 primary-output representation

For an admitted v8 snapshot whose edges omit primaryOutput, a correctly applied Route Only now fails with ACK_READBACK_EFFECT_MISMATCH, even when ch.primaryOutId matches the destination and the old MAIN edge is absent. contracts/console-puzzle-v8.json does not require this edge flag, normalizeSnapshot() accepts its absence, and web/approved-native-bridge.js derives primary status from source.primaryOutId. The new planner also rejects these valid snapshots because it requires the same flag on every edge. Use the existing channel-level primary-output identity consistently, or update and reconcile the public ABI before requiring an additional field.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment on lines +118 to +120
if(sendsToMain(view,sourceId,simulated)>1)
return fail('EXCLUSIVE_ROUTE_RETAINS_PARALLEL_DRY_PATH',
'Native Route Only changes the primary OUT; existing parallel sends remain.');

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 Check upstream channels when admitting a new dry path

When an input already routes directly to MAIN and also sends to a Group with no output, Route Only from that Group to MAIN returns ok:true: this check counts only the Group's single path, but the input now reaches MAIN twice, directly and through the Group. This is a valid acyclic accepted graph, and the resulting readback passes the new Route Only proof, so the advertised anti-double-dry protection does not prevent the duplicated audio. Check the simulated dry-path counts for affected upstream channels as well as sourceId; the SEND_POST admission check needs the same treatment.

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