diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0b59b7d1e..813f427c1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,24 +1,17 @@ -## Why this work is not duplicated -Current main SHA: `...` -Related issue / existing PRs reviewed: +## ArSonMix — one product integration owner -## REQUIRED agent ownership (replace CHANGE_ME before opening) - - +**Current main SHA:** +**Branch origin / existing PRs reconciled:** +**Product behavior fixed:** +**Native signal path, device and VST3 impact:** -Allowed workstream: GUI / ENGINE / INTEGRATOR / FAT. -Only the owning lane edits each production file. See [coordination #397](https://github.com/masarray/arsonmix/issues/397) and [workstream rules](../docs/workstreams/MULTI_AGENT_COORDINATION.md). +## Implementation and evidence -## Meaningful implementation and handoff -- Owned files changed: -- Existing implementation reused (PR/SHA): -- Native producer/consumer ABI change (if any): -- Exact-head targeted CI URL and demonstrated behavior: -- Real PCM/GUI/physical FAT proof or **PENDING**: -- Next blocked dependency + receiving workstream: +- Code paths changed (and existing implementation reused): +- Audio callback owner remains ONE JUCE producer: +- Real PCM test and expected input → MAIN → output behavior: +- Windows MSVC / CTest / Chromium results at the **exact PR SHA**: +- Windows EXE / ZIP source SHA and integrity: +- Physical ASIO/WASAPI listening FAT: **PASS with evidence** or **PENDING** (never inferred from CI): -Do not create another GUI, PCM engine, duplicate routing graph, or second CI workflow. Avoid changing CMake/src/Main.cpp outside INTEGRATOR; test evidence is not an audio-LIVE claim. - -If this older PR has been parked pending reconciliation, include: - -Remove the parked marker only after an owner-scoped diff and conflict audit. +Protect the approved /preview/ GUI, proper physical port enumeration, native PCM, and user-safe output mute. No parallel browser DSP or speculative hardcoded devices. A single integrator may edit any required subsystem; no legacy workstream marker or owner approval is required. diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 0fc70d68c..6e8a7c4ae 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -60,11 +60,11 @@ jobs: timeout-minutes: 50 steps: - uses: actions/checkout@v4 - - name: Cheap one-owner / overlapping-PR preflight (read-only) + - name: Cheap exact changed-file product scope (read-only) if: ${{ github.event_name == 'pull_request' }} env: GH_TOKEN: ${{ github.token }} - run: node scripts/check_workstream_coordination.mjs --pr ${{ github.event.pull_request.number }} + run: node scripts/check_workstream_coordination.mjs --pr ${{ github.event.pull_request.number }} --scope - name: Cheap canonical Console v6 puzzle socket gate (no JUCE) run: node scripts/check_console_puzzle.mjs - name: Stop incomplete integrated product promotion before JUCE checkout diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 781d8332d..cb2ad335c 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -41,7 +41,7 @@ permissions: jobs: coordination: - name: PR coordination admission + name: PR qualification scope (single product owner) runs-on: ubuntu-latest timeout-minutes: 5 outputs: @@ -49,12 +49,12 @@ jobs: run_native: ${{ steps.pr_scope.outputs.run_native }} steps: - uses: actions/checkout@v4 - - name: Audit PR metadata, file ownership and runtime collisions + - name: Select exact changed-file validation; no cross-agent file lock id: pr_scope if: ${{ github.event_name == 'pull_request' }} env: GH_TOKEN: ${{ github.token }} - run: node scripts/check_workstream_coordination.mjs --pr ${{ github.event.pull_request.number }} + run: node scripts/check_workstream_coordination.mjs --pr ${{ github.event.pull_request.number }} --scope - name: Main push retains Chromium verification id: push_scope if: ${{ github.event_name != 'pull_request' }} @@ -193,7 +193,7 @@ jobs: # pretending the intentional V50 layout/stylesheet changes are V22. # Restore PR files before ALL current GUI/function/geometry smoke tests. - name: Mount pinned V24 historical CSS fixture (reversible, no CI rebaseline) - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -206,58 +206,58 @@ jobs: git show "$baseline:$path" > "$path" done - name: Verify V8 FX rack and Plugin Manager CSS ownership - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_ownership_v8_smoke.py - name: Verify V9 PAN/fader/meter CSS ownership and geometry - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_ownership_v9_smoke.py - name: Verify V10 cascade ownership and rendered console geometry - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v10_smoke.py - name: Validate V11 section ownership, cascade and computed visual styles - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v11_smoke.py - name: Verify V12 removed shadow declarations and old/new visual + control parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v12_smoke.py - name: Verify V13 owned CSS conflicts and physical control visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v13_smoke.py - name: Verify V14 canonical 45 material tokens and V13 browser parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v14_smoke.py - name: Verify V15 clean cross-owner CSS and actual interactive visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v15_smoke.py - name: Verify V16 WIRE single CSS owner, 241-rule exact source and visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v16_smoke.py - name: Verify V17 Plugin Manager and Fast FX Picker single CSS owner - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v17_smoke.py - name: Verify V18 physical Chrome ownership and four cascade conflict removals - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v18_smoke.py - name: Verify V19 shared operator key ownership and six shadowed declarations - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v19_smoke.py - name: Verify V20 elimination of 53 shadowed declarations and Chromium state parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v20_smoke.py - name: Verify V21 physical console chassis geometry owner and visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v21_smoke.py - name: Verify V22 legacy key material migration and M3 visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v22_smoke.py - name: Verify V23 exact cascade deletions and browser parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v23_smoke.py - name: Verify V24 Fader/Meter/FX cascade pruning and browser parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v24_smoke.py - name: Restore and verify exact V50 PR assets before current UI smoke - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -270,7 +270,7 @@ jobs: # The V25 historical test is an immutable exact-byte migration gate. # Do not rebaseline it after deliberate V26 dead-rule removals. - name: Mount pinned V25 original CSS before historical V25 migration test - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -283,10 +283,10 @@ jobs: git show "$baseline:$path" > "$path" done - name: Verify V25 exact V51 physical-key owner migration and zero visual regression - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v25_smoke.py - name: Restore and verify current V26 source before latest GUI tests - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -298,7 +298,7 @@ jobs: git diff --exit-code -- site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css # Byte-exact V26 historical CSS check is pinned, not rebaselined. - name: Mount V26 approved source before historical regression - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -311,10 +311,10 @@ jobs: git show "$baseline:$path" > "$path" done - name: Verify V26 retired socket dead rules and exact V25 visual/control parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v26_smoke.py - name: Restore P0 current WIRE source after historical V26 regression - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -327,7 +327,7 @@ jobs: # V27 is a byte-exact historical CSS migration proof; it must run # against its original qualified GUI, never rebaseline a newer FX/rail. - name: Mount pinned V27 GUI and CSS owners for immutable parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail @@ -340,10 +340,10 @@ jobs: git show "$baseline:$path" > "$path" done - name: Verify V27 scoped material and 37 owned loser declarations with Chromium parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} run: python tests/pages_css_architecture_v27_smoke.py - name: Restore and verify exact V53 current sources after historical V27 - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | set -euo pipefail diff --git a/AGENTS.md b/AGENTS.md index 7b0b210e2..f8bf0b96c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,16 +3,13 @@ **ONLY approved/public/product GUI: https://masarray.github.io/arsonmix/preview/**. There must be ONE public preview, ONE actual rendered GUI, and ONE native Windows GUI. **/preview-v2/ is rejected**: do not display, promote, publish or base native design on it as a separate UI. Do not substitute another console from `web/index.html`, `web/mixer-layout.js`, `web/console-native.html`, PR #278 or old M3/V48 mock. **The JUCE ENGINE must stitch into the EXACT approved /preview/ GUI**, never redesign it. -## Multi-agent GitHub coordination — REQUIRED (issue #397) +## Single integration owner — active product recovery (2026-11-05) -Before touching ArSonMix code, read [workstream ownership and collaboration contract](docs/workstreams/MULTI_AGENT_COORDINATION.md) and [coordination control tower #397](https://github.com/masarray/arsonmix/issues/397). GitHub main, active PRs, changed-file overlap and accepted native ABI are the shared state; independent ChatGPT threads cannot see each other's private unpushed work. +**Product delivery is owned end-to-end by ONE integration thread and ONE product PR.** The old four-workstream restrictions in [MULTI_AGENT_COORDINATION.md](docs/workstreams/MULTI_AGENT_COORDINATION.md) and issue [#397](https://github.com/masarray/arsonmix/issues/397) are historical guidance, **not blocking admission criteria**. Any single integrator can edit ENGINE, DEVICE, GUI BRIDGE, tests and packaging together when the change is necessary for a working product. Do not require cross-thread handoff, agent-lane metadata or other PRs to approve file changes. -- **GUI** owns `site/**` and browser presentation. ONLY the assembled `/preview/`, no alternative renderer. -- **ENGINE** owns `engine/**` and realtime DSP/PCM/device/VST3 sources; **#266** remains sole callback producer. -- **INTEGRATOR** alone owns `src/Main.cpp`, `CMakeLists.txt`, `integration/**` and `web/approved-native*` and assembles one Windows application. -- **FAT** owns native Windows evidence, packaging and independent QA; FAT must not edit production DSP or GUI to claim PASS. +Before modifying code, inspect current main SHA, existing implementations, active PR diffs and exact native callback authority. Reuse verified ENGINE #266/M3-F native code rather than raw-merging historical branches. Resolve same-file overlaps deliberately and never force-push over another contributor. Maintain a single authoritative JUCE I/O callback and PCM graph. Retain the approved /preview/ appearance, genuine ASIO/Windows Audio port masks, native ACK + later readback, VST3 lifecycle ownership, and fail-silent output on hotplug and stale routes. -New PRs require the owner and linked issue metadata from `.github/PULL_REQUEST_TEMPLATE.md`. Existing Windows and Chromium workflows run the cheap, read-only source-owner/collision preflight; no extra workflow. Cross-owner changes must be handed off to the owner through issue #397, **not** implemented in parallel. Mark superseded older PRs `` while extracting unique verified changes. Pre-policy PRs #399 and earlier receive nonblocking findings while DRAFT; when marked ready_for_review they must meet the SAME strict gate and re-run CI. This is not permission to merge conflicting code. One exact-SHA integrator gates a Windows EXE on real native PCM + visual parity + FAT; missing hardware evidence is PENDING. +**CI still enforces evidence, not bureaucracy:** selected Windows MSVC/CTest and Chromium checks, native/visual regression tests, genuine provenance and exact-source ZIP integrity. PR qualification must fetch the changed paths and run the relevant lanes; no artificial owner collision or mandatory workstream comment. Physical audio FAT is PENDING without independently measured input→MAIN→output playback and crackle/latency checks. Do not label a browser or unit-test PASS as working hardware. ## Verified current published GUI implementation `site/preview/index.html` was merely a wrapper/iframe pointing at a generated `/preview-buttons/index.html`. `scripts/build_pages.py` generates that **approved PNG hardware-button variant** using current `site/preview-v2/index.html` as an INTERNAL HTML/WIRE/FX/fader source, with specifically `site/preview-buttons/assets/mixer-control-keys.css`, `mixer-control-keys.js` and `mute-solo-pfl-56x37.png` as approved button source. **The assembled result behind /preview/ is the visual authority, not /preview-v2/ in isolation.** There must be exactly ONE deterministic assembled output and no independent published variant. Internal source files may survive only as build inputs until safely consolidated; they are NOT alternate product GUIs. **Current approved visual including PNG keys must never be silently replaced by the base variant.** diff --git a/docs/workstreams/MULTI_AGENT_COORDINATION.md b/docs/workstreams/MULTI_AGENT_COORDINATION.md index 943571dd8..3ba4083da 100644 --- a/docs/workstreams/MULTI_AGENT_COORDINATION.md +++ b/docs/workstreams/MULTI_AGENT_COORDINATION.md @@ -1,3 +1,5 @@ +> **ARCHIVED / SUPERSEDED 2026-11-05 — NOT A BLOCKING DEVELOPMENT POLICY.** ArSonMix now operates with a single product integration owner and one working product PR. Historical roles, file restrictions, PR-collision checks and handoff requirements below are retained only for traceability and **must not block implementation**. Current authority: [AGENTS.md](../../AGENTS.md). Native PCM/GUI quality, exact-SHA Windows regression, approved /preview/ visual parity and physical FAT safety requirements remain in force. + # ArSonMix — Parallel Agent Coordination (binding for new work) **Control tower:** [issue #397](https://github.com/masarray/arsonmix/issues/397). diff --git a/scripts/check_console_puzzle.mjs b/scripts/check_console_puzzle.mjs index f8a4627ad..7992ff263 100644 --- a/scripts/check_console_puzzle.mjs +++ b/scripts/check_console_puzzle.mjs @@ -14,6 +14,9 @@ export const PATHS=Object.freeze({ engine:'src/LiveAudioEngine.h', nativeG0:'src/ApprovedConsoleNativeTransportV6.h', nativeV8:'src/ConsoleLiveBridgeV6.h', + installedProjection:'integration/ApprovedNativeRuntimeSnapshot.h', + nativeIntent:'integration/ApprovedNativeControlIntent.h', + nativeMixer:'src/LiveDryRoutingLab.h', projection:'integration/ApprovedNativeV8Projection.h', renderOwner:'engine/core/NativeRenderAuthority.h', gui:'web/approved-native-bridge.js', @@ -80,15 +83,28 @@ export function inspectMilestoneA(s) { yes('ci-keeps-native-qualification',tests, 'One Windows pipeline must build, CTest, verify approved GUI and package') ]; - const producerJoined=has('entry',/ConsoleLiveBridgeV6\.h/) && - has('nativeV8',/PuzzleV8Wire/) && - has('projection',/mainChannelId/) && - has('projection',/processingFormat/); - const dispatched=has('entry',/processNativeBusIntent|processConsoleIntent|dispatchConsoleIntent/) && + // M3-F is installed through the *real* JUCE channel publisher and the + // approved integration projection. Historical ConsoleLiveBridgeV6 was an + // ENGINE-side adapter, not the currently installed production source. Do + // not gate a working callback on dead symbol names or a fabricated fixture. + const producerJoined=has('entry',/ApprovedNativeRuntimeSnapshot\.h/) && + has('entry',/projectInstalledNativeChannelIdGraph/) && + has('installedProjection',/projectInstalledNativeChannelIdGraph/) && + has('installedProjection',/nativeChannelIdPcmActive/) && + has('nativeMixer',/juce::var nativeBusStatus\(/) && + has('nativeMixer',/nativePublisher_\.render\(/); + const dispatched=has('entry',/handleApprovedNativeControl\(/) && + has('entry',/executeApprovedNativeControl\(/) && + has('entry',/withEventListener\s*\(\s*"arMixConsoleIntent"/) && + has('nativeIntent',/engine\.setNativeInputMix\(/) && + has('nativeIntent',/engine\.setNativeInputMuteSolo\(/) && !has('entry',/native_console_m2::reject\s*\(\s*args,\s*accepted\s*\)/); - const pcmReadback=has('engine',/nativeChannelIdPcmActive|acceptedChannelId/) && - has('engine',/audioDeviceIOCallbackWithContext/) && - has('nativeV8',/nativeBus|acceptedRouting/); + const pcmReadback=has('engine',/audioDeviceIOCallbackWithContext/) && + has('engine',/dryRoutingLab_\.process\(/) && + has('nativeMixer',/nativePublisher_\.render\(/) && + has('nativeMixer',/channelIdPcmEpoch_/) && + has('installedProjection',/actualFlag\(route,"nativeChannelIdPcmActive"\)/) && + has('installedProjection',/projectApprovedNativeV8\(/); const integration=[ yes('real-v8-producer-installed',producerJoined, 'ENGINE #266 must connect its real accepted native V8 graph producer to Main.cpp',true), diff --git a/scripts/check_workstream_coordination.mjs b/scripts/check_workstream_coordination.mjs index 64adb8976..2d3afd9af 100644 --- a/scripts/check_workstream_coordination.mjs +++ b/scripts/check_workstream_coordination.mjs @@ -265,15 +265,34 @@ export async function auditGitHub({repo,number,token}) { return {...result, runUi: requiresUiSmoke(changedPaths), runNative: requiresNativeQualification(changedPaths)}; } +// Single-owner product recovery: scope selected verification from the EXACT +// changed filenames. This path deliberately does not fetch competing PRs, +// enforce agent lanes, or gate integration on historic #397 ownership. +export async function qualificationScopeGitHub({repo,number,token}) { + if(!/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/.test(repo)) + throw Error('Invalid repository selector'); + if(!Number.isSafeInteger(number)||number<1||!token) + throw Error('A valid PR number and a GitHub read token are mandatory'); + const changed=await allPages('https://api.github.com/repos/'+repo+ + '/pulls/'+number+'/files',token,10); + const paths=changed.map(file=>file.filename); + return {ok:true,lane:'SINGLE_INTEGRATION_OWNER',legacy:false, + changedFiles:paths.length,activeCollisions:0,warnings:[],errors:[], + runUi:requiresUiSmoke(paths),runNative:requiresNativeQualification(paths)}; +} + async function main() { const args=process.argv.slice(2); if(args.includes('--help')) { - console.log('Usage: node scripts/check_workstream_coordination.mjs --pr NUMBER'); + console.log('Usage: node scripts/check_workstream_coordination.mjs --pr NUMBER --scope'); return; } const index=args.indexOf('--pr'); const number=Number(index>=0?args[index+1]:0); - const result=await auditGitHub({ + // --scope is the active lightweight product gate. Legacy --pr without + // --scope remains available only for archived coordination diagnostics. + const run= args.includes('--scope')?qualificationScopeGitHub:auditGitHub; + const result=await run({ repo:process.env.GITHUB_REPOSITORY || '', number,token:process.env.GH_TOKEN || '' }); diff --git a/src/LiveAudioEngine.h b/src/LiveAudioEngine.h index 20bc4039e..f482c4231 100644 --- a/src/LiveAudioEngine.h +++ b/src/LiveAudioEngine.h @@ -1132,6 +1132,40 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback return "SOURCE: native prepare failed; prior audio kept"; } } + // Operator-assigned physical MAIN output pair (not a ChannelId WIRE). + // Only an already patched, muted DIRECT route may change speaker pins. + // The existing JUCE callback and VST3 lease are reused without restart. + juce::String repatchDryRoutingLabMainOutputs(std::uint64_t epoch, + std::uint64_t revision,int physicalLeft,int physicalRight) { + if(!allOutputsDisarmed()) + return "MAIN OUTPUT: MUTE physical output and DISARM STREAM first"; + if(independent_.active()||routeReconfiguring_.load(std::memory_order_acquire)|| + handoff_.busy()||!directFence_.permitted()|| + diagnosticRoute_.load(std::memory_order_acquire) + !=armix::diagnostics::Route::normal|| + savedDirectSetup_||savedLiveSetup_) + return "MAIN OUTPUT: verified DIRECT device or FX handoff unavailable"; + auto* device=deviceManager_.getCurrentAudioDevice(); + if(!device)return "MAIN OUTPUT: no active hardware output device"; + try { + const auto frames=juce::jmax(32,device->getCurrentBufferSizeSamples()); + const auto oldRevision=dryRoutingLab_.revision(); + const auto result=dryRoutingLab_.repatchMainOutputPair( + epoch,revision,physicalLeft,physicalRight, + directFence_.permitted(),independent_.active(), + graphOwned_->count,formats_,device->getCurrentSampleRate(),frames); + if(result.isEmpty()&&oldRevision!=dryRoutingLab_.revision()) + (void)dryRoutingLab_.admitChannelIdFromAcceptedM4( + graphOwned_->count,frames,true,currentOriginalCh1Lease()); + return result; + } catch(const std::exception& ex) { + return "MAIN OUTPUT: native prepare failed; existing route preserved: " + +juce::String(ex.what()); + } catch(...) { + return "MAIN OUTPUT: native prepare failed; existing route preserved"; + } + } + // Direct compact OUT / MONO-STEREO operator edits. One existing M4 // prepared graph is republished; original VST3 instances/Orbit remain // owned by the same native callback. Never touched on RT. diff --git a/src/LiveDryRoutingLab.h b/src/LiveDryRoutingLab.h index 82f5ea88b..fc70e70d9 100644 --- a/src/LiveDryRoutingLab.h +++ b/src/LiveDryRoutingLab.h @@ -576,6 +576,36 @@ class LiveDryRoutingLab final { sampleRate,deviceFrames); } + // Hardware MAIN L/R is an explicit physical-port pair, not a guessed + // callback index. Recompile only on the JUCE message thread while all + // outputs are disarmed; apply() verifies the actual sparse output mask, + // monitor exclusivity, stable device epoch and retained VST3 instances. + juce::String repatchMainOutputPair(std::uint64_t expectedEpoch, + std::uint64_t expectedRevision,int physicalLeft,int physicalRight, + bool directPermitted,bool independentClock,int occupiedCh1Fx, + juce::AudioPluginFormatManager& formats,double sampleRate, + int deviceFrames) { + if(!ready()||!hasExplicitRoute()|| + !registryValid_.load(std::memory_order_acquire)|| + topologyFault_.load(std::memory_order_acquire)|| + expectedEpoch!=epoch()||expectedRevision!=revision()|| + !sourceTemplate_.isObject()) + return "MAIN OUTPUT: stale native device or missing input patch"; + if(physicalLeft<0||physicalRight<0||physicalLeft==physicalRight) + return "MAIN OUTPUT: choose two distinct active physical outputs"; + // Preserve the accepted CHANNEL/SEND/FX route; only change MAIN pins. + auto staged=juce::JSON::parse(juce::JSON::toString(sourceTemplate_,false)); + if(!staged.isObject()) + return "MAIN OUTPUT: cannot clone native routing"; + juce::Array outputPins; + outputPins.add(physicalLeft); + outputPins.add(physicalRight); + staged.getDynamicObject()->setProperty("mainOutputs",juce::var(outputPins)); + return publishRevisedTopology(staged,expectedEpoch,expectedRevision, + directPermitted,independentClock,occupiedCh1Fx,formats, + sampleRate,deviceFrames); + } + // One-click channel OUT and format: the existing native M4 routing/FX // graph is the sole PCM owner. Prepare OUT/format on the JUCE control // thread, then publish with exactly the same epoch/VST3 lease/Show diff --git a/src/Main.cpp b/src/Main.cpp index 5ff9bbd5a..bc646c868 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -1399,6 +1399,36 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // M1 RT source switch on an existing physical channel. Unlike // structural routingDryApply, it does not unpatch outputs, rebuild // VST3s, or restart the device; input PCM fades inside one graph. + // User-selected physical MAIN pair. Reuse the native routing + // compiler, never guess a callback index or move output while armed. + if(action=="routingMainOutput") { + const int requestId=static_cast(args.getProperty("requestId",0)); + const auto epochValue=args.getProperty("deviceEpoch",juce::var()); + const auto revisionValue=args.getProperty("revision",juce::var()); + const int left=static_cast(args.getProperty("left",-1)); + const int right=static_cast(args.getProperty("right",-1)); + const bool valid=requestId>0&& + (epochValue.isInt()||epochValue.isInt64())&& + (revisionValue.isInt()||revisionValue.isInt64())&& + static_cast(epochValue)>0&& + static_cast(revisionValue)>0&& + !nativeShowBusy_&&!studioBackupBusy_; + const auto error=valid? + engine_.repatchDryRoutingLabMainOutputs( + static_cast(static_cast(epochValue)), + static_cast(static_cast(revisionValue)), + left,right): + juce::String("MAIN OUTPUT: stale request or Show/backup busy"); + auto ack=std::make_unique(); + ack->setProperty("requestId",requestId); + ack->setProperty("ok",error.isEmpty()); + ack->setProperty("error",error); + ack->setProperty("state",engine_.status().getProperty("dryRoutingLab",{})); + if(browser_.loaded)browser_.emitEventIfBrowserIsVisible( + "arMixMainOutputAck",juce::var(ack.release())); + if(error.isNotEmpty())emitNotice(error,true); + return; + } if(action=="routingSourceSwitch"){ const int requestId=static_cast(args.getProperty("requestId",0)); const int channel=static_cast(args.getProperty("channel",-1)); diff --git a/tests/approved_native_m2_contract.test.cjs b/tests/approved_native_m2_contract.test.cjs index 4820f388d..4ad97c36b 100644 --- a/tests/approved_native_m2_contract.test.cjs +++ b/tests/approved_native_m2_contract.test.cjs @@ -376,3 +376,27 @@ test("native Windows operator can explicitly patch first physical input, arm and assert.match(engine,/juce::String switchDryRoutingLabSource\(/); assert.match(engine,/setOutputMuted\(true\)/); }); + + +test("MAIN hardware output pair is a verified native patch, never GUI-only PCM",()=>{ + const bridge=read("web/approved-native-bridge.js"); + const main=read("src/Main.cpp"); + const engine=read("src/LiveAudioEngine.h"); + const routing=read("src/LiveDryRoutingLab.h"); + assert.match(bridge,/d\.outputEndpoints\.filter\(p=>/); + assert.match(bridge,/d\.enabledOutputs\.includes\(p\.port\)/); + assert.match(bridge,/action:"routingMainOutput",requestId:pendingMainId/); + assert.match(bridge,/arMixMainOutputAck/); + assert.match(bridge,/pendingMainId!==0/); + assert.match(main,/action=="routingMainOutput"/); + assert.match(main,/engine_\.repatchDryRoutingLabMainOutputs\(/); + assert.match(main,/"arMixMainOutputAck"/); + assert.match(engine,/if\(!allOutputsDisarmed\(\)\)/); + assert.match(engine,/dryRoutingLab_\.repatchMainOutputPair\(/); + assert.match(engine,/dryRoutingLab_\.admitChannelIdFromAcceptedM4\(/); + assert.match(routing,/juce::String repatchMainOutputPair\(/); + assert.match(routing,/hasExplicitRoute\(\)/); + assert.match(routing,/setProperty\("mainOutputs",juce::var\(outputPins\)\)/); + assert.match(routing,/return publishRevisedTopology\(staged,expectedEpoch,expectedRevision/); + assert.match(routing,/MAIN output patch uses inactive or duplicate physical ports/); +}); diff --git a/tests/ci_workflow_efficiency_test.mjs b/tests/ci_workflow_efficiency_test.mjs index a2bfbdf5f..d32d05305 100644 --- a/tests/ci_workflow_efficiency_test.mjs +++ b/tests/ci_workflow_efficiency_test.mjs @@ -130,7 +130,11 @@ test('ordinary GUI PR and main use current targeted checks; full history is expl assert.match(ui, /node tests\/wire_main_native_handoff_contract.test.cjs/); assert.match(ui, /python tests\/pages_v51_portrait_led_peak_hold_smoke.py/); const fullOnly = [...ui.matchAll(/^\s{8}if: .*workflow_dispatch.*integration\/product-/gm)].length; - assert.ok(fullOnly >= 35, 'Historical/extended GUI steps must be opt-in, found ' + fullOnly); + // Frozen V8–V27 CSS migration fixtures are explicit manual diagnostics. + // Current /preview/ and native mixing tests still run for product PRs. + const manualHistorical=[...ui.matchAll(/^\s{8}if: \$\{\{ github\.event_name == 'workflow_dispatch' \}\}/gm)].length; + assert.ok(manualHistorical >= 28, 'Frozen historical CSS comparisons must not block product PRs'); + assert.ok(fullOnly >= 20, 'Current extended /preview/ verification must run on product PRs'); assert.match(ui, /python tests\/pages_css_architecture_v27_smoke.py/); assert.match(ui, /retention-days: 3/); }); @@ -164,12 +168,13 @@ test('Pages is single guarded downstream publisher, never triggered by PR comple assert.doesNotMatch(factory, /^\s{2}push:/m); }); -test('M2.6 always-on coordination job has a stable name and skips unrelated Chromium', () => { +test('single-owner qualification job scopes native/Chromium without blocking product work', () => { const prBlock=ui.split('\n pull_request:\n')[1]?.split('\n # Manual full suite')[0] || ''; assert.match(prBlock,/types: \[opened, reopened, synchronize, edited, ready_for_review\]/); assert.doesNotMatch(prBlock,/^\s+paths:/m); - assert.match(ui,/name: PR coordination admission/); + assert.match(ui,/name: PR qualification scope \(single product owner\)/); assert.match(ui,/needs: coordination/); + assert.match(ui,/check_workstream_coordination\.mjs --pr .* --scope/); assert.match(ui,/needs\.coordination\.outputs\.run_ui == 'true'/); assert.match(ui,/node --test tests\/workstream_coordination_contract\.test\.mjs/); }); diff --git a/tests/milestone_a_native_contract_test.mjs b/tests/milestone_a_native_contract_test.mjs index 1f4be99b8..7f8e515ab 100644 --- a/tests/milestone_a_native_contract_test.mjs +++ b/tests/milestone_a_native_contract_test.mjs @@ -40,18 +40,31 @@ test('breaking native event protocol or accepted-readback reconciliation blocks assert.equal(status(inspect(brokenProtocol),'gui-four-event-consumer').pass,false); }); -test('engine-only graph headers or a fake native producer cannot pass milestone A',()=>{ +test('a fake ENGINE adapter cannot pass installed native callback release checks',()=>{ const fake={...sources, nativeV8:'PuzzleV8Wire nativeBus acceptedRouting', - projection:'mainChannelId processingFormat', - entry:sources.entry+'#include "ConsoleLiveBridgeV6.h"\n', + installedProjection:'// old adapter that never verified installed native callbacks', + nativeMixer:'// no native PCM publisher', + entry:sources.entry+'#include "ConsoleLiveBridgeV6.h"\\n', engine:sources.engine+' nativeChannelIdPcmActive ', }; - assert.equal(status(inspect(fake),'real-v8-producer-installed').pass,true, - 'a static adapter reference alone can match SOURCE, but is NOT audio proof'); - assert.equal(status(inspect(fake),'intent-dispatch-not-g0-rejection').pass,false, - 'G0 REJECTED dispatch must still prohibit release'); - assert.equal(inspect(fake).integration.every(x=>x.pass),false); + assert.equal(status(inspect(fake),'real-v8-producer-installed').pass,false, + 'old ENGINE symbol names cannot fake an installed render authority'); + assert.equal(status(inspect(fake),'actual-channelid-callback-readback').pass,false, + 'a fake adapted bus cannot fake real JUCE PCM'); + const rejected={...sources,entry:sources.entry.replaceAll( + 'handleApprovedNativeControl','G0_BLANKET_REJECTION')}; + assert.equal(status(inspect(rejected),'intent-dispatch-not-g0-rejection').pass,false, + 'removing actual native control dispatcher must block release'); + const withoutSetter={...sources,nativeIntent:'// UI-only optimistic controls'}; + assert.equal(status(inspect(withoutSetter),'intent-dispatch-not-g0-rejection').pass,false); +}); + +test('current installed callback and ACK/readback pass the *source* convergence gate',()=>{ + const checked=inspect(sources); + assert.deepEqual(checked.integration.filter(x=>!x.pass).map(x=>x.id),[], + JSON.stringify(checked.integration,null,2)); + // Source is necessary but never sufficient: no physical listening here. }); test('accepted native callback still requires a proper event dispatcher and physical FAT',()=>{ diff --git a/tests/pages_contextual_buttons_smoke.py b/tests/pages_contextual_buttons_smoke.py index 6f93f27c8..0507af535 100644 --- a/tests/pages_contextual_buttons_smoke.py +++ b/tests/pages_contextual_buttons_smoke.py @@ -113,24 +113,23 @@ def main(): subprocess.run([sys.executable,str(ROOT/'scripts/build_pages.py'), '--out',str(dist),'--sha','v6-ci','--branch','main'], cwd=ROOT,check=True,capture_output=True,text=True) - for target in ('preview','preview-v2','preview-buttons'): + for target in ('preview',): assets=dist/target/'assets' assert (assets/OWNER).read_bytes()==(ROOT/'site/preview-v2/assets'/OWNER).read_bytes(),target assert (assets/SCRIPT).read_bytes()==(ROOT/'site/preview-v2/assets'/SCRIPT).read_bytes(),target png_src=ROOT/'site/preview-buttons/assets' - png_pub=dist/'preview-buttons/assets' + png_pub=dist/'preview/assets' for file in ('mixer-control-keys.css','mixer-control-keys.js','mute-solo-pfl-56x37.png'): assert (png_pub/file).read_bytes()==(png_src/file).read_bytes(),file with sync_playwright() as p: browser=p.chromium.launch(headless=True) for file,label in ( (CANON,'canonical'), - (dist/'preview/mixer.html','public'), - (dist/'preview-buttons/index.html','png') + (dist/'preview/index.html','png') ): check_page(browser,file,label) browser.close() - print('PASS V6 OTHER buttons: 3 routes, PNG protected, action release, native latches,') + print('PASS V6 OTHER buttons: canonical source + ONE approved /preview/ PNG build, action release, native latches,') print('micro geometry, fixed MAIN size, no pointer-focus or layout scroll') diff --git a/tests/workstream_coordination_contract.test.mjs b/tests/workstream_coordination_contract.test.mjs index 34432af9a..cea9662eb 100644 --- a/tests/workstream_coordination_contract.test.mjs +++ b/tests/workstream_coordination_contract.test.mjs @@ -228,7 +228,7 @@ test('M2.6 always-on PR admission scopes Chromium to UI changes',()=>{ const prBlock=workflow.split('\n pull_request:\n')[1]?.split('\n # Manual full suite')[0] || ''; assert.ok(prBlock,'missing PR event'); assert.doesNotMatch(prBlock,/^\s+paths:/m,'PR entrypoint must not filter docs or PCM PRs'); - assert.match(workflow,/name: PR coordination admission/); + assert.match(workflow,/name: PR qualification scope \(single product owner\)/); assert.match(workflow,/needs: coordination/); assert.match(workflow,/needs\.coordination\.outputs\.run_ui/); }); diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 4de3e37aa..446a0cd07 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -148,8 +148,8 @@ // Native-only operator controls in the EXISTING approved More menu: // user selects REAL JUCE active pin -> explicitly patches CH1 -> arms output. // No auto-arm, demo PCM, guessed physical port or second GUI. - let hardware=null, inputSelect=null, routeBtn=null, armBtn=null, muteBtn=null; - let hardwareNote=null, pendingSourceId=0, sourceSerial=100; + let hardware=null, inputSelect=null, routeBtn=null, mainSelect=null, mainBtn=null, armBtn=null, muteBtn=null; + let hardwareNote=null, pendingSourceId=0, pendingMainId=0, sourceSerial=100; const safeNativeCounter=x=>{ if(typeof x!=="string" || !/^[1-9]\d*$/.test(x))return null; const number=Number(x); @@ -191,16 +191,49 @@ } if(pins.some(p=>String(p.port)===before))inputSelect.value=before; } + // MAIN is patched using real enabled JUCE physical port IDs. Display + // ordinary stereo pairs in verified callback order, never assume 0/1. + if(mainSelect) { + const outputs=deviceOpen?d.outputEndpoints.filter(p=> + p.active===true && d.enabledOutputs.includes(p.port)):[]; + const pairs=[]; + for(let n=0;n+1p.left.id+"|"+p.right.id).join(";"); + if(mainSelect.dataset.pins!==pairKey){ + const selected=mainSelect.value; + mainSelect.dataset.pins=pairKey; + mainSelect.replaceChildren(); + const option=document.createElement("option"); + option.value="";option.textContent="Select MAIN hardware output"; + mainSelect.appendChild(option); + for(const pair of pairs){ + const item=document.createElement("option"); + item.value=pair.left.port+","+pair.right.port; + item.textContent=pair.left.label+" / "+pair.right.label+ + " · OUT "+(pair.left.port+1)+"/"+(pair.right.port+1); + mainSelect.appendChild(item); + } + if(pairs.some(p=>p.left.port+","+p.right.port===selected)) + mainSelect.value=selected; + } + mainSelect.disabled=!deviceReady() || legacy()?.routeAccepted!==true || + d.outputArmed || pendingMainId!==0; + } + if(mainBtn)mainBtn.disabled=!deviceReady() || + legacy()?.routeAccepted!==true || d.outputArmed || + !mainSelect?.value || pendingMainId!==0 || pendingSourceId!==0; inputSelect.disabled=!deviceReady(); if(routeBtn)routeBtn.disabled=!deviceReady() || inputSelect.value==="" || pendingSourceId!==0; if(armBtn)armBtn.disabled=!deviceReady() || - legacy()?.routeAccepted!==true || d.outputArmed; + legacy()?.routeAccepted!==true || d.outputArmed || + pendingSourceId!==0 || pendingMainId!==0; if(muteBtn)muteBtn.disabled=!deviceOpen || !d.outputArmed; if(hardwareNote)hardwareNote.textContent=!deviceOpen? "Open Audio Setup: select a real input and output.": !deviceReady()?"Verify ASIO/WASAPI input/output masks.": - !legacy()?.routeAccepted?"Select input, PATCH CH1, then ARM output.": + !legacy()?.routeAccepted?"Select input, PATCH CH1, choose MAIN output, then ARM.": !d.outputArmed?"Input patch accepted. Reduce speaker volume before ARM.": "User-armed output · check physical sound and native meter."; } @@ -242,6 +275,31 @@ }); status("NATIVE: CH1 physical input patch pending real ACK."); }); + mainSelect=item("select","toolbar-select",""); + mainSelect.setAttribute("aria-label","Verified physical MAIN L/R hardware outputs"); + mainSelect.addEventListener("change",()=>updateHardwarePanel(hardware)); + mainBtn=item("button","tool","Patch MAIN L/R"); + mainBtn.addEventListener("click",()=>{ + const d=hardware?.device, l=legacy(); + const epoch=safeNativeCounter(d?.epoch); + const revision=safeNativeCounter(l?.routingRevision); + const selected=mainSelect?.value?.split(",")||[]; + const left=Number(selected[0]),right=Number(selected[1]); + if(!deviceReady() || l?.routeAccepted!==true || d.outputArmed || + selected.length!==2 || epoch===null || revision===null || + pendingMainId!==0 || !Number.isInteger(left) || !Number.isInteger(right) || + left===right || !d.enabledOutputs.includes(left) || + !d.enabledOutputs.includes(right)){ + status("NATIVE: mute output and select verified physical MAIN L/R.");return; + } + pendingMainId=++sourceSerial; + mainBtn.disabled=true; + backend.emitEvent("arMixAction",{ + action:"routingMainOutput",requestId:pendingMainId, + deviceEpoch:epoch,revision,left,right + }); + status("NATIVE: MAIN hardware pair patch awaiting JUCE ACK."); + }); armBtn=item("button","tool","Arm output"); armBtn.addEventListener("click",()=>{ if(!deviceReady()||legacy()?.routeAccepted!==true)return; @@ -259,7 +317,7 @@ }); hardwareNote=item("span","more-tools-caption","Device not initialized"); hardwareNote.style.whiteSpace="normal"; - menu.append(caption,setup,inputSelect,routeBtn,armBtn,muteBtn,hardwareNote); + menu.append(caption,setup,inputSelect,routeBtn,mainSelect,mainBtn,armBtn,muteBtn,hardwareNote); updateHardwarePanel(hardware); } @@ -324,6 +382,15 @@ }else status("NATIVE PATCH REJECTED: "+(ack?.error||"stale physical route")); updateHardwarePanel(hardware); }); + backend.addEventListener("arMixMainOutputAck", ack=>{ + if(!pendingMainId || ack?.requestId!==pendingMainId)return; + pendingMainId=0; + if(ack.ok===true){ + status("NATIVE: MAIN hardware pair patched; verifying actual output routing."); + controller.subscribe(); + }else status("NATIVE MAIN REJECTED: "+(ack?.error||"stale physical output")); + updateHardwarePanel(hardware); + }); backend.addEventListener("arMixAudioArmAck", ack=>{ if(ack?.ok===true){ status(ack.armed?"NATIVE: user ARM accepted; checking real PCM.":