Skip to content

refactor(g-mv24): unify retained/reconnect GUI transient cleanup - #806

Merged
masarray merged 4 commits into
mainfrom
refactor/g-mv24-retained-readback-single-ui-cleanup-20261119
Nov 19, 2026
Merged

masarray merged 4 commits into
mainfrom
refactor/g-mv24-retained-readback-single-ui-cleanup-20261119

Conversation

@masarray

@masarray masarray commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

G-MV24 — One retained/reconnect GUI lease cleanup, preserving legal metadata writes

Audited defect

On G-MV23 main, device/authority changes called a complete expireTransientNativeUi() cleanup while NEEDS_REMAP had a second, partial pending-transaction cleanup list. Repeated retained snapshots could leave M4, FX/global/slot bypass, external output, WIRE, and other physical UI leases in inconsistent states. Before checking the authority, the bridge could also schedule redundant M4 SOURCE queue microtasks from retained snapshots.

Final implementation

  • discardTransientNativeUi({preserveRetainedIdentity=false}) is the only complete cleanup owner for transient GUI SOURCE/M4/FX/WIRE/output/track actions. An actual physical device or authority change calls expireTransientNativeUi() and rejects previous pending ChannelId identity edits as well.
  • Repeated retained NEEDS_REMAP snapshots use the same complete audio-lease discard silently, preserving the retained-graph paint signature to avoid repeated DOM rebuilding.
  • Important exception from Codex review, fixed: NEEDS_REMAP still permits native cosmetic ChannelId name/color/icon writes and cache migration. The retained cleanup preserves same-lease pendingIdentity so its independent ACK + appearance readback can finish. On a real hardware/authority switch the default cleanup still invalidates old identity writes.
  • Pure deviceVM.nativeTransientReadbackPolicy(kind) permits SOURCE drain only for matching CHANNEL_ID, M4, or prepared UNADMITTED first-sound authority; not for NEEDS_REMAP, STALE, LOGICAL_ONLY, or INVALID.
  • Regression tests check all discarded GUI lease categories, one cleanup owner, lossless retained visual paint, both cosmetic-identity policies, and unchanged M4 first-source routing. Existing native identity ACK/readback regression supports retained native presentation.

Architecture / verification

ONE approved /preview/, ONE schema-v6 controller, ONE native PCM owner/transport, accepted ChannelId/EdgeId and M4 compatibility. Does not alter native DSP/VST3, hardware drivers, .smix, CSS/layout, or automatically arm speakers. Exact-head Fast UI/native, Full Chromium, Required Merge Gate and clean squash merge are mandatory. No physical ASIO FAT or new Windows installer claimed; parallel N-MOD untouched.

@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-19T02:15:41.242449Z 647de6a 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: 36929d5
Status: ✅  Deploy successful!
Preview URL: https://3ed7010c.arsonmix.pages.dev
Branch Preview URL: https://refactor-g-mv24-retained-rea.arsonmix.pages.dev

View logs

@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: 647de6a077

ℹ️ 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 thread web/approved-native-bridge.js Resolved

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 36929d5

@masarray
masarray merged commit 6187f5b into main Nov 19, 2026
29 checks passed

Copy link
Copy Markdown
Owner Author

G-MV24 — Owner completion / handoff (19 Nov 2026, WIB)

1. Outcome / operator: On reconnect, device swap or ChannelId authority change, SOURCE, FX, WIRE, EXTERNAL OUT, M4 controls, native slider gestures and other transient UI transactions all use one complete invalidation path. During repeated NEEDS_REMAP readbacks the same path drops unsafe audio/output leases without resetting retained-mixer paint signature on every callback. Native appearance changes (channel name/color/icon and legacy cache migration) remain legal while physical playback is retained: same-lease metadata ACK+readback can still complete, but actual endpoint/authority changes expire them.

2. Status: MERGED MAIN on protected PR #806, squash SHA 6187f5b835da6b692cc21ecf1d03c528ebe950b2 (verified main HEAD). Qualified exact source HEAD 36929d51f749e0661bc2a492091c25d63de7a353. Changed only 3 files: web/approved-native-bridge.js, web/approved-device-view-model.js, tests/approved_device_pin_identity_contract.test.cjs. No native files, graph, VST3, PCM, .smix, styling or layout changed.

3. Safety scope: Source/UI contract and approved /preview/ checks PASS, and one JUCE PCM renderer / one native v6 reconciler and ACK+independent readback remain protected. No new Windows installer, physical ASIO FAT, dual-device hardware admission or speaker-listening qualification was run/claimed.

4. Owner action: Nothing required for code milestone. New Windows installer/hardware field validation remains a separate user-test activity.

5. Exact-SHA evidence:

6. Next G-MV: Audit reconnect and retained AUTHORITY recovery from initial retained graph back into ChannelId/M4 for timing races, including ensuring only accepted readback releases deferred input edits and never restores old physical output arming. Prefer targeted ViewModel pure policy and tests rather than additional duplicated bridge state. Keep ONE /preview/, ONE native PCM engine, and unchanged .smix authoritative persistence.

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