Skip to content

refactor(g-mv22): hardware-scoped SOURCE queue leases for ChannelId and M4 - #804

Merged
masarray merged 2 commits into
mainfrom
refactor/g-mv22-physical-source-queue-lease-20261119
Nov 19, 2026
Merged

masarray merged 2 commits into
mainfrom
refactor/g-mv22-physical-source-queue-lease-20261119

Conversation

@masarray

Copy link
Copy Markdown
Owner

G-MV22 — Same-epoch SOURCE physical-device safety + modular state ownership

Problem audited on merged G-MV21 main: SOURCE queues were scoped only by deviceEpoch. A changed physical input/output mask, sample rate, or buffer size may retain the same epoch, permitting an old queued GUI source intent (or ACKed source readback settlement) to outlive its physical hardware mapping. ChannelId/M4 native source request lease construction was duplicated in the bridge, which made it easy to omit physical identity from one path.

Implementation

  • Reuse G-MV20's single canonical snapshot.hardwareConfiguration token. Never recalculate hardware/pins in Channel Strip VM.
  • Queue selections made by the operator carry a copied immutable physical identity token. If the current normalized hardware or v6 controller identity differs, sourceDispatchPlan() drops the old queued source (including on unchanged epochs).
  • Move per-authority pending SOURCE request lease construction from the WebView bridge to one pure sourceQueueRequestLease() in the existing Channel Strip ViewModel. It validates actual ChannelId/revision/roster or M4 lane/revision before a single bridge transport emits, and freezes per-request identity/choice.
  • Both ChannelId and M4 sourceQueueReadback() now refuse to confirm an old ACKed source against the wrong canonical hardware token even if epoch, source channel, and pin numbers happen to match.
  • Preserve current first-sound UNADMITTED → M4 promotion when the hardware is unchanged, FIFO latest-choice-wins, unrelated channel progress, strict ACK+independent readback, physical output authorization, one native DSP/PCM renderer and ONE approved /preview/.
  • Test same-epoch input/output mask, rate/buffer changes, harmless pin reorder, ChannelId and M4 ACK/readback, queue entry missing token, stale plan after hardware changes, immutability, no duplicate lease in bridge.

Compat: Existing pure test fixture callers that omit a physical token remain usable for isolated historical helpers; the actual GUI always supplies hardware.hardwareConfiguration and refuses to emit if missing. No driver, DSP, .smix, CSS or layout changes. CI fast UI/native then one exact-SHA Full Chromium and Required Merge Gate; only merge if clean. Windows installer and physical multi-ASIO FAT not claimed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 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-19T00:14:16.183124Z 20be733 PR opened
ℹ️ 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.

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 20be733
Status: ✅  Deploy successful!
Preview URL: https://97f9890e.arsonmix.pages.dev
Branch Preview URL: https://refactor-g-mv22-physical-sou.arsonmix.pages.dev

View logs

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 20be733

@masarray
masarray merged commit 4f720c7 into main Nov 19, 2026
29 checks passed

Copy link
Copy Markdown
Owner Author

G-MV22 — Indonesian owner completion / continuity (19 Nov 2026 WIB)

(1) Hasil untuk pengguna: Pilihan SOURCE/INPUT lama sekarang tidak akan diteruskan ke native ketika mask input/output, sample rate, atau buffer hardware berubah pada epoch yang sama. Native ChannelId maupun M4 harus memegang fingerprint fisik yang sama dari saat pilihan diantrekan, dikirim, hingga ACK + independent PCM readback. Urutan enumerasi pin/monitor tetap tidak menyebabkan false remap. Pemilihan source tetap latest-choice-wins dan antrean channel lain tidak tertahan oleh entri kedaluwarsa.

(2) Status sebenarnya: MERGED MAIN melalui PR #804, squash SHA 4f720c719d64d50d55bd1e4b243b7cdf87c008a2. Verified source HEAD 20be733a1e30d14f0ee834522f15a3d059f1326e. Hanya tiga file: web/approved-channel-strip-view-model.js, web/approved-native-bridge.js dan tests/approved_native_m2_contract.test.cjs. sourceQueueRequestLease() sekarang satu factory pure untuk ChannelId/M4; WebView bridge tetap satu dispatcher/ACK/readback/timer/queue owner, tidak membuat session atau DSP owner baru.

(3) Aman dipakai? YA untuk source code hasil merge dan perilaku GUI yang diverifikasi oleh CI. BELUM berarti installer Windows baru tersedia, hardware ASIO fisik telah diuji, atau multi-vendor capture telah dikualifikasi. Tidak ada perubahan DSP, VST3, driver, .smix, CSS/layout atau speaker auto-ARM.

(4) Tindakan Anda: TIDAK PERLU MELAKUKAN APA-APA.

(5) Bukti exact SHA:

(6) Langkah berikutnya: G-MV23 should audit lifecycle of SOURCE timeout/reconnect and queued-gesture cancel/retry without introducing any second state owner; prefer further pure ViewModel policy and remove redundant bridge responsibility proven by tests. Preserve the one approved /preview/, installed ChannelId/EdgeId PCM graph, valid M4 first-sound promotion, independent native ACK/readback and physical speaker authorization.

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