Skip to content

refactor(mv7): settle native SOURCE only after ACKed exact PCM readback - #783

Merged
masarray merged 5 commits into
mainfrom
refactor/mv7-native-source-readback-settlement-20261118
Nov 18, 2026
Merged

masarray merged 5 commits into
mainfrom
refactor/mv7-native-source-readback-settlement-20261118

Conversation

@masarray

Copy link
Copy Markdown
Owner

MV-7 — Channel Strip SOURCE pending/ACK/readback correctness

Base: main@1e5df9a3cc91c31b4fd457fb9ce360725afcf2d6 (MV-6 #782 merged). No overlapping active approved GUI PR.

Actual reliability problem

The ChannelId SOURCE bridge cleared activeNativeSource immediately on a positive arMixNativeSourceAck. A second queued channel could therefore dispatch against a pending/old installed PCM graph, and the first input could appear settled before its exact physical pins had been proven by native readback. A successful command response does not prove callback-applied source.

Real code change (three existing files)

  • web/approved-channel-strip-view-model.js: new pure sourceReadbackSettlement(pending,next) checks admitted ChannelId PCM, matching full string uint64 device epoch/ChannelId, reported ACK graph revision (never Number rounding), and exact native source.portId, portIdRight, sourceFormat or actual absent SOURCE NONE; returns NONE/PENDING_ACK/PENDING/CONFIRMED/STALE. The existing sourceAckResult now verifies ACK ChannelId and strictly later decimal-string graphRevision instead of accepting any matching requestId ok:true.
  • web/approved-native-bridge.js: single existing activeNativeSource remains busy after an accepted ACK, recording publisher revision. One native callback readback settlement releases it only on independently verified native SOURCE pins, or after epoch/roster loss. Pending same-epoch queue drains only after that release. Both a cached readback arriving before ACK and an unchanged snapshot are handled; existing 8-second timeout and no-fake readback discipline are retained.
  • tests/approved_native_m2_contract.test.cjs: positive/negative exact ChannelId/64-bit/epoch/revision, mono/stereo/right physical pin, SOURCE NONE, stale graph, output absence, and end-to-end staged ACK+unchanged PCM+later published readback+next queued channel; prior fail-ACK drain test stays enabled.

Boundaries

No new ViewModel/controller/store; no C++/JUCE/ASIO/DSP/plugin/.smix/HTML/CSS/PNG changes; one actual native SOURCE dispatcher/queue, one accepted ChannelId/EdgeId PCM graph and one approved /preview/ GUI. Native ACK is never treated as physical readback or hardware FAT.

Status: KODE DIBUAT; exact-head Fast UI + Fast Native + full Chromium pending; hardware FAT and installer NOT RUN. Owner action: TIDAK PERLU MELAKUKAN APA-APA.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 774c9a8
Status: ✅  Deploy successful!
Preview URL: https://1ed2e232.arsonmix.pages.dev
Branch Preview URL: https://refactor-mv7-native-source-r.arsonmix.pages.dev

View logs

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui f1da56e

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 774c9a8

@masarray
masarray marked this pull request as ready for review November 18, 2026 06:48
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T06:52:03.981851Z 774c9a8 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.

@masarray
masarray merged commit af21ba4 into main Nov 18, 2026
42 checks passed

Copy link
Copy Markdown
Owner Author

OWNER DELIVERY — MV-7 SOURCE readback correctness (2026-11-18)

Hasil terlihat oleh pengguna: SOURCE selection stays at its verified installed input while a native ChannelId physical patch is pending; an ACK alone no longer releases the channel queue. The next channel's SOURCE edit waits for accepted native PCM proof (exact pin pair, input MONO/STEREO and graph revision) or a truly rejected/stale/timed-out request. Device reconnect and incompatible session authority are fail-closed. No visible design changes and no audio rerenderers added.

STATUS: MERGED MAIN — PR #783, squash commit af21ba4963a26e5af65c851bcfda4c87b74e46d6, reviewed/qualified exact PR HEAD 774c9a867909f7075029469833983bb056888791. Three existing files changed: web/approved-channel-strip-view-model.js contains pure sourceReadbackSettlement and strict correlated ACK revision/ChannelId; web/approved-native-bridge.js retains single original pending native source, 8s timeout, command transport, and the authoritative controller's readback; tests/approved_native_m2_contract.test.cjs validates real M4/ChannelId behavior, huge uint64 epochs/revisions, source NONE, exact MONO/STEREO physical ports, invalid session authority, ACK/revision mismatch, and a two-channel queue held until later installed readback. No new controller, audio engine, shared session or store.

Tests/proof: Fast UI PASS, Fast Native PASS; exact-head Full Chromium workflow #44252952668 PASS 109/109 steps, including Stage C original/compiled CSS screenshot parity; Ready-state Fast UI PASS, Fast Native PASS, Required Merge Gate SUCCESS "All scoped checks passed" on 774c9a867909f7075029469833983bb056888791. Main-push UI run 44254307747 and native run 44254307663 were still in progress at this report; no claim of postmerge PASS yet.

AMAN DIPAKAI? YA for merged source-GUI correctness qualified by CI. BELUM for freshly built installer, actual vendor ASIO/dual-device hardware FAT, or an audio live release (all NOT RUN/NOT SHIPPED). Single approved /preview/, native ChannelId/EdgeId PCM/VST3 callback, .smix authority and existing operator workflow unchanged. Tindakan Anda: TIDAK PERLU MELAKUKAN APA-APA.

Next: evaluate postmerge main jobs; next MVVM milestone reduce pending/readback duplication in channel scalar or device lifecycle, only where true domain policy is removed from the 4k-line bridge. Do not duplicate graph/state/transport or redesign approved GUI.

@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: 774c9a8679

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

!decimalId(pending.ackRevision)||
!decimalId(next.graph.revision)||
BigInt(pending.ackRevision)<=BigInt(pending.beforeRevision)||
BigInt(next.graph.revision)<BigInt(pending.ackRevision))

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 Require the ACK's exact graph revision before confirming SOURCE

If another native edit advances the graph before the ACKed revision is observed, this comparison accepts the later snapshot as proof of the SOURCE request. For example, an ACK for revision 6 followed only by revision 7 with matching pins returns CONFIRMED, causing settleNativeSourceReadback to report verified PCM and release the next queued edit without observing revision 6. The existing controller in web/approved-native-contract.js instead treats readback beyond the ACK revision as conflicting. Require exact revision equality and handle a superseding revision as a conflict/refresh rather than successful settlement; AGENTS.md explicitly requires a matching ACK and same-revision native snapshot.

AGENTS.md reference: AGENTS.md:L178-L178

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