Skip to content

refactor(native N-MOD-19): isolate DIRECT recovery coordinator and fault evidence - #813

Open
masarray wants to merge 3 commits into
mainfrom
refactor/nmod19-direct-device-recovery-coordinator-20261119
Open

masarray wants to merge 3 commits into
mainfrom
refactor/nmod19-direct-device-recovery-coordinator-20261119

Conversation

@masarray

Copy link
Copy Markdown
Owner

N-MOD-19 — Native DIRECT device recovery coordinator (second major domain)

Independent dedicated Device-side integration PR, branched from main@b30a59303ad3aed486a141c96acc42dec00d2caa. This Native device refactor is intentionally separate from N-MOD-14–18 Player #799, whose exact Windows qualification is running. Do not merge/cherry-pick across active GUI/Native branches without checking latest main and both PR HEADs.

Actual extraction

  • Move the whole CONTROL-thread DIRECT failback transaction, bounded retry and diagnostic evidence formatting from ConsoleWindow::serviceDirectRestore to src/NativeDirectRestoreCoordinator.h, with one borrowed LiveAudioEngine and one DirectRestoreBackoff. ConsoleWindow simply wires diagnostics/notification sinks, retains explicit cancel operations and accepted device/readback.
  • Move directRestoreState / attempts / generation / remaining time / error / pending snapshot projection into the same coordinator; preserve original JSON field names and exact operator messaging.
  • No new AudioDeviceManager, driver reopen worker, callback, PCM/VST3 render loop, UI, or second device owner. The existing engine alone executes setIndependentClockEnabled(false), only on JUCE CONTROL.
  • Existing DirectRestoreBackoff remains the bounded and generation-safe retry source of truth; leave independent-clock watchdog / direct ASIO fastpath unchanged.

Tests and measurable coupling

  • New JUCE core standalone NativeDirectRestoreBoundedRetryAndFaultEvidence CTest with fake device: idle, fault and immediate attempt, deferred 250ms retry, recovered DIRECT/retained mute, no repeat, pending direct restoration, 5-attempt exhaustion, no further reopen and snapshot compatibility; verify watchdog evidence precedes truncated full JSON.
  • CMake registers real standalone JUCE console test and binds it as dependency of the existing ARMixMixerRoutingTests Windows target.
  • Main.cpp reduces 70 real lines in this extraction; no pass-through adapter duplication. Four source/test files changed.
  • Source HEAD 9ae228b84c91b530a1c157c7ba39e93f88b1e0c9. Source code committed, Fast Native / MSVC / CTest not yet verified; hardware ASIO FAT and installer NOT RUN. Separate from Player branch; require fast native + one exact-SHA Windows CTest + protected gate at latest reconciled main before merge.

Owner handoff: HASIL = Device recovery now a testable single-authority control service; STATUS KODE DIBUAT (not compiled/merged). AMAN DIPAKAI? Current main unaffected, new source BELUM. TINDAKAN USER = TIDAK PERLU. NEXT: fast checks+Codex review, then reconcile and qualify once with appropriate Native merge.

Copy link
Copy Markdown
Owner Author

@codex review

Review exact HEAD 9ae228b84c91b530a1c157c7ba39e93f88b1e0c9 of Native N-MOD-19; this extracts ~70 lines of JUCE CONTROL-thread DIRECT recovery from ConsoleWindow into NativeDirectRestoreCoordinator plus a new JUCE CTest. Compare original serviceDirectRestore / annotateRecovery against new coordinator for 250/1000/3000/8000ms bounded backoff, generation-safe cancellation, diagnostics truncation order, stop-and-restore DIRECT only, never re-enable faulty independent bridge, preserved operator messages, dirty marker and accepted JSON projection; no duplicate engine/device manager or callback. Examine CMake JUCE test dependency, fake Engine contract, code compile, and native UI source guards. Source code is committed but Windows MSVC/CTest and physical ASIO FAT have not run for this SHA. Report functional defects only.

@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-19T04:33:16.028628Z 535d3f4 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.

@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: 535d3f4
Status: ✅  Deploy successful!
Preview URL: https://d517fb4b.arsonmix.pages.dev
Branch Preview URL: https://refactor-nmod19-direct-devic.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: 9ae228b84c

ℹ️ 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 src/Main.cpp Resolved

Copy link
Copy Markdown
Owner Author

@codex review

Review revised EXACT head 535d3f490dc4ae4af897b22fe85a1d08c2e92bb3 of N-MOD-19. Previous P1 source-contract finding was addressed: BOTH tests/direct_restore_recovery_contract_test.mjs and tests/independent_clock_adapter_contract_test.mjs now assert actual recovery paths, watchdog evidence, bounded backoff and state projection in the newly extracted src/NativeDirectRestoreCoordinator.h; they still verify that ConsoleWindow invokes it from JUCE control timer. Inspect C++ compilation risks in new coordinator + fake JUCE standalone regression, including record and notify injected callbacks, audio-thread exclusion, exact retry semantics, diagnostic field order and nonreopening on exhaustion. Fast Linux source check pending; actual Windows/MSVC CTest NOT YET RUN for this SHA. Report bugs, not style-only.

Copy link
Copy Markdown
Owner Author

/arsonmix-ci native 535d3f4

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 535d3f490d

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

This branch has not been deployed

No deployments
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