Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
paths:
- 'CMakeLists.txt'
- 'integration/console-v6/**'
# Native headers may live outside console-v6 (M3 readback/ABI).
- 'integration/*.h'
- 'integration/*.hpp'
- 'integration/*.cpp'
- 'integration/**/*.h'
- 'integration/**/*.hpp'
- 'integration/**/*.cpp'
- 'src/**'
- 'web/approved-native-bridge.js'
- 'web/approved-native-contract.js'
Expand All @@ -20,38 +27,23 @@ on:
- 'tests/*.cpp'
- 'scripts/package_native_windows.ps1'
- 'scripts/verify_native_windows_artifact.ps1'
- 'scripts/collect_hardware_fat_windows.ps1'
- 'scripts/console_v6_fat_gate.mjs'
- 'scripts/verify_console_s0_native_fixture.mjs'
- 'scripts/run_console_native_s0.mjs'
- 'scripts/check_console_puzzle.mjs'
- 'scripts/check_approved_native_gui_release.mjs'
- 'scripts/check_pr278_console_authority.mjs'
- 'scripts/m3e_fat_evidence_gate.mjs'
- 'scripts/factoryfx_release_bundle.py'
- 'config/factoryfx-approved-releases.json'
- 'config/factoryfx-notices/**'
- 'scripts/tests/test_factoryfx_release_bundle.py'
- '.github/workflows/p1-windows.yml'
# GUI-only PRs receive browser checks; they need not compile JUCE on every edit.
# Native bridge changes still require Windows; pure visual GUI follows Pages only.
# A full executable/package is still produced on native main and explicit FAT.
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- 'CMakeLists.txt'
- 'integration/console-v6/**'
- 'src/**'
- 'web/approved-native-bridge.js'
- 'web/approved-native-contract.js'
- 'tests/approved_native_m2_contract.test.cjs'
- 'scripts/build_approved_native_gui.py'
- 'tests/approved_native_gui_bundle_test.py'
- 'web/bridge.js'
- 'web/monitor.js'
- 'engine/**'
- 'tests/*.cpp'
- 'tests/*native*contract*.mjs'
- 'tests/live_graph_contract_test.mjs'
- 'scripts/package_native_windows.ps1'
- 'scripts/verify_native_windows_artifact.ps1'
- 'scripts/factoryfx_release_bundle.py'
- 'config/factoryfx-approved-releases.json'
- 'config/factoryfx-notices/**'
- 'scripts/tests/test_factoryfx_release_bundle.py'
- '.github/workflows/p1-windows.yml'
# PR native compile is called ONLY by UI smoke's Product Qualification fan-in.
# GUI/docs-only PRs skip Windows entirely; main and manual release stay here.
# Called by the all-PR quality workflow. No duplicate Windows PR run.
workflow_call:
workflow_dispatch:

concurrency:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
timeout-minutes: 5
outputs:
run_ui: ${{ steps.pr_scope.outputs.run_ui || steps.push_scope.outputs.run_ui }}
run_native: ${{ steps.pr_scope.outputs.run_native }}
steps:
- uses: actions/checkout@v4
- name: Audit PR metadata, file ownership and runtime collisions
Expand All @@ -61,6 +62,51 @@ jobs:
run: echo "run_ui=true" >> "$GITHUB_OUTPUT"
- name: Fast offline coordination contract regression
run: node --test tests/workstream_coordination_contract.test.mjs
native:
needs: coordination
if: ${{ github.event_name == 'pull_request' && needs.coordination.outputs.run_native == 'true' }}
uses: ./.github/workflows/p1-windows.yml
permissions:
contents: read
pull-requests: read

qualification:
name: Product Qualification
needs: [coordination, frontend, native]
if: ${{ always() && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Enforce actual outcomes for every selected test lane
shell: bash
env:
COORD_RESULT: ${{ needs.coordination.result }}
UI_RESULT: ${{ needs.frontend.result }}
NATIVE_RESULT: ${{ needs.native.result }}
RUN_UI: ${{ needs.coordination.outputs.run_ui }}
RUN_NATIVE: ${{ needs.coordination.outputs.run_native }}
run: |
set -euo pipefail
echo "Coordination: $COORD_RESULT, Chromium: $UI_RESULT ($RUN_UI), Windows: $NATIVE_RESULT ($RUN_NATIVE)"
if [[ "$COORD_RESULT" != "success" ]]; then
echo "::error::Coordination must PASS."
exit 1
fi
if [[ "$RUN_UI" != "true" && "$RUN_UI" != "false" ]] ||
[[ "$RUN_NATIVE" != "true" && "$RUN_NATIVE" != "false" ]]; then
echo "::error::Missing/malformed PR qualification scope."
exit 1
fi
if [[ "$RUN_UI" == "true" && "$UI_RESULT" != "success" ]]; then
echo "::error::Required Chromium UI smoke did not PASS."
exit 1
fi
if [[ "$RUN_NATIVE" == "true" && "$NATIVE_RESULT" != "success" ]]; then
echo "::error::Required Windows native CTest did not PASS."
exit 1
fi
echo "Product Qualification PASS for selected lanes at this PR revision."

frontend:
needs: coordination
if: ${{ github.event_name != 'pull_request' || needs.coordination.outputs.run_ui == 'true' }}
Expand Down
12 changes: 12 additions & 0 deletions docs/workstreams/MULTI_AGENT_COORDINATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ For merge safety, require the exact GitHub Actions job check **PR coordination a

**Admin limitation:** the connected GitHub app cannot write protection/rulesets. Until enabled, a successful CI job is a meaningful PR signal, but it cannot stop an authorized maintainer from bypassing review or pushing directly to `main`. Hardware FAT #15 and exact-sha production gates remain independent and mandatory.

## P0 product qualification — conditional native CI with one required verdict

**Owner:** INTEGRATOR, control tower #397. No second native producer, GUI renderer, DSP callback or workflow file.

The existing `.github/workflows/ui-smoke.yml` is the sole PR entry point. Its always-on `PR coordination admission` computes **`run_ui`** and **`run_native`** from the GitHub API's exact PR changed filenames. It invokes the existing `.github/workflows/p1-windows.yml` as a **reusable workflow** only when native source/ABI, Windows packaging, or release-admission files changed. The Windows workflow still independently builds and packages on `main` pushes/manual dispatch; it no longer starts a **duplicate** path-filtered PR Windows run.

A separate tiny **`Product Qualification`** fan-in runs for every PR, even when its dependencies fail or are skipped. It succeeds **only** if ownership admission passes and every selected lane completes successfully: required Chromium frontend for UI changes; required Windows JUCE/CTest for native changes; both for mixed bridge changes. Docs-only PRs require only admission. A cancelled/failing/skipped **required** lane is a failure, never a fake PASS. Exact-head checks are attached to the PR by the caller workflow; source checkout and ABI ownership are unchanged.

Native classification covers `integration/**/*.h/.hpp/.cpp` (including M3 `ApprovedNative*` headers) and release-admission scripts; isolated `integration/*.mjs` and documentation are **not** blanket triggers. The existing Windows `main` push path filters also include newly covered C++ headers and release gate scripts. The Windows CRLF/LF checkout discrepancy in M2.6 tests is normalized before parsing workflow triggers.

**Administrator action after a green PR:** add the exact GitHub Actions check **`Product Qualification`** to [Protected Main ruleset](https://github.com/masarray/arsonmix/rules/26568033) alongside the existing `PR coordination admission` check, keeping up-to-date branches enabled. The connector cannot alter repository rulesets. Until this is done, the new verdict is visible and functional but not formally a required merge check.

## Administrative limitation

GitHub may allow a maintainer to merge even with a failed check unless **required status checks** and appropriate branch protection/rulesets are configured. App connections cannot always administer these. Treat #397 as the human coordination gate, and enable branch protection for existing Windows/Chromium checks (or a dedicated required coordination check if introduced later) through repository Settings when available. This policy does not magically observe unpushed private ChatGPT threads.
47 changes: 45 additions & 2 deletions scripts/check_workstream_coordination.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,44 @@ export function requiresUiSmoke(paths) {
].includes(path));
}


// Native qualification is intentionally narrower than "integration/**":
// C++ headers/translation units require a real MSVC+JUCE build, whereas
// isolated policy/docs/JS can finish without a paid Windows runner.
// This is the single PR file-scope authority for the reusable native job.
export function requiresNativeQualification(paths) {
return paths.some(path =>
path === 'CMakeLists.txt' ||
path.startsWith('src/') ||
path.startsWith('engine/') ||
path.startsWith('integration/console-v6/') ||
/^integration\/.*\.(?:h|hpp|hh|hxx|c|cc|cpp|cxx)$/i.test(path) ||
path === '.github/workflows/p1-windows.yml' ||
['web/approved-native-bridge.js', 'web/approved-native-contract.js',
'web/bridge.js', 'web/monitor.js',
'tests/approved_native_m2_contract.test.cjs',
'tests/approved_native_gui_bundle_test.py',
'scripts/build_approved_native_gui.py',
'scripts/package_native_windows.ps1',
'scripts/verify_native_windows_artifact.ps1',
'scripts/collect_hardware_fat_windows.ps1',
'scripts/console_v6_fat_gate.mjs',
'scripts/verify_console_s0_native_fixture.mjs',
'scripts/run_console_native_s0.mjs',
'scripts/check_console_puzzle.mjs',
'scripts/check_approved_native_gui_release.mjs',
'scripts/check_pr278_console_authority.mjs',
'scripts/factoryfx_release_bundle.py',
'scripts/m3e_fat_evidence_gate.mjs',
'config/factoryfx-approved-releases.json',
'tests/live_graph_contract_test.mjs'].includes(path) ||
path.startsWith('config/factoryfx-notices/') ||
/^tests\/[^/]+\.cpp$/i.test(path) ||
/^tests\/[^/]*native[^/]*contract[^/]*\.mjs$/i.test(path) ||
/^tests\/(?:m3e_fat_evidence_gate|console_v6_fat_gate)\.test\.mjs$/.test(path) ||
path === 'scripts/tests/test_factoryfx_release_bundle.py');
}

export async function auditGitHub({repo,number,token}) {
if (!/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/.test(repo))
throw Error('Invalid repository selector');
Expand All @@ -223,7 +261,9 @@ export async function auditGitHub({repo,number,token}) {
}
const result = audit({pr,files:files.map(f=>f.filename),others,filesByPR,
fileStatuses:Object.fromEntries(files.map(f=>[f.filename,f.status]))});
return {...result, runUi: requiresUiSmoke(files.map(f=>f.filename))};
const changedPaths = files.map(f=>f.filename);
return {...result, runUi: requiresUiSmoke(changedPaths),
runNative: requiresNativeQualification(changedPaths)};
}
async function main() {
const args=process.argv.slice(2);
Expand All @@ -238,8 +278,11 @@ async function main() {
number,token:process.env.GH_TOKEN || ''
});
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, 'run_ui='+(result.runUi?'true':'false')+'\n');
appendFileSync(process.env.GITHUB_OUTPUT, 'run_ui='+(result.runUi?'true':'false')+'\n'+
'run_native='+(result.runNative?'true':'false')+'\n');
}
console.log('Qualification scope: ui='+(result.runUi?'yes':'no')+
' native='+(result.runNative?'yes':'no'));
console.log('ArSonMix coordination: lane='+(result.lane||'UNDECLARED')+
' files='+result.changedFiles+' legacy='+result.legacy+
' authorized='+result.ok+' collision(s)='+result.activeCollisions);
Expand Down
44 changes: 34 additions & 10 deletions tests/ci_workflow_efficiency_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import {requiresUiSmoke} from '../scripts/check_workstream_coordination.mjs';
import {requiresUiSmoke, requiresNativeQualification} from '../scripts/check_workstream_coordination.mjs';

const read = path => readFileSync(path, 'utf8');
const read = path => readFileSync(path, 'utf8').replace(/\r\n/g, '\n');
const native = read('.github/workflows/p1-windows.yml');
const ui = read('.github/workflows/ui-smoke.yml');
const pages = read('.github/workflows/pages-publish.yml');
Expand Down Expand Up @@ -36,8 +36,9 @@ function globMatches(pattern, filename) {
return new RegExp(regex + '$').test(filename);
}

const windowsPush = pathsFor(native, 'push', 'pull_request');
const windowsPR = pathsFor(native, 'pull_request', 'workflow_dispatch');
const windowsPush = pathsFor(native, 'push', 'workflow_call');
// Pull requests are always admitted; this exact classifier decides whether to call reusable MSVC.
const nativePrSelected = filename => requiresNativeQualification([filename]);
const uiPush = pathsFor(ui, 'push', 'pull_request');
// Unfiltered PR entry runs cheap admission; only UI-relevant paths run browser.
const uiPRSelected = filename => requiresUiSmoke([filename]);
Expand All @@ -51,7 +52,7 @@ test('visual GUI changes never consume Windows native runner on a PR or on main'
]) {
assert.ok(uiPRSelected(filename), filename + ' must run frontend PR checks');
assert.ok(selected(uiPush, filename), filename + ' must qualify Pages');
assert.equal(selected(windowsPR, filename), false, filename + ' wrongly triggers native PR');
assert.equal(nativePrSelected(filename), false, filename + ' wrongly triggers native PR');
assert.equal(selected(windowsPush, filename), false, filename + ' wrongly triggers native main');
}
});
Expand All @@ -61,7 +62,7 @@ test('native PCM and device changes always use Windows/CTest, never Chromium by
'src/LiveAudioEngine.h', 'engine/core/DynamicPreparedMixerBlock.h',
'tests/channel_routing_contract_test.cpp'
]) {
assert.ok(selected(windowsPR, filename), filename + ' must qualify native PR');
assert.ok(nativePrSelected(filename), filename + ' must qualify native PR');
assert.ok(selected(windowsPush, filename), filename + ' must qualify native main');
assert.equal(uiPRSelected(filename), false, filename + ' wrongly triggers browser PR');
assert.equal(selected(uiPush, filename), false, filename + ' wrongly triggers browser main');
Expand All @@ -81,7 +82,7 @@ test('approved Pages to JUCE build seam is a native gate, never an unrelated CSS
'scripts/build_approved_native_gui.py',
'tests/approved_native_gui_bundle_test.py'
]) {
assert.ok(selected(windowsPR,filename), filename+' must run native build on PR');
assert.ok(nativePrSelected(filename), filename+' must run native build on PR');
assert.ok(selected(windowsPush,filename), filename+' must rebuild native main bundle');
}
assert.match(native,/Check approved Pages GUI provenance before costly JUCE checkout/);
Expand All @@ -91,28 +92,30 @@ test('native WebView bridge and integration genuinely require both owners', () =
for (const filename of [
'web/bridge.js', 'web/monitor.js', 'integration/console-v6/contract.json'
]) {
for (const paths of [windowsPush, windowsPR, uiPush]) {
for (const paths of [windowsPush, uiPush]) {
assert.ok(selected(paths, filename), filename + ' needs native+GUI checks');
}
assert.ok(uiPRSelected(filename),filename+' needs PR Chromium tests');
assert.ok(nativePrSelected(filename),filename+' needs PR native tests');
}
});

test('docs and isolated CI tests do not fan out into unrelated builds', () => {
const paths = [windowsPR, windowsPush, uiPush];
const paths = [windowsPush, uiPush];
for (const filename of [
'README.md', 'docs/workstreams/START_HERE_WIRE_FIRST_20261104.md'
]) {
assert.ok(paths.every(p => !selected(p, filename)), 'Doc triggered CI: ' + filename);
assert.equal(uiPRSelected(filename),false,'Doc only needs lightweight PR admission: '+filename);
assert.equal(nativePrSelected(filename),false,'Doc must not compile native: '+filename);
}
for (const filename of [
'tests/pages_wire_first_canonical_main_smoke.py',
'tests/wire_graph_canonical_model.test.cjs',
'tests/wire_main_native_handoff_contract.test.cjs',
'tests/ci_workflow_efficiency_test.mjs'
]) {
assert.equal(selected(windowsPR, filename), false);
assert.equal(nativePrSelected(filename), false);
assert.equal(selected(windowsPush, filename), false);
assert.equal(uiPRSelected(filename), true);
assert.equal(selected(uiPush, filename), true);
Expand Down Expand Up @@ -170,3 +173,24 @@ test('M2.6 always-on coordination job has a stable name and skips unrelated Chro
assert.match(ui,/needs\.coordination\.outputs\.run_ui == 'true'/);
assert.match(ui,/node --test tests\/workstream_coordination_contract\.test\.mjs/);
});

test('P0 single product qualification fans in exact scoped native and UI jobs',()=>{
assert.match(native,/^ workflow_call:/m);
assert.doesNotMatch(native,/^ pull_request:/m);
assert.match(ui,/uses: \.\/\.github\/workflows\/p1-windows\.yml/);
assert.match(ui,/name: Product Qualification/);
assert.match(ui,/needs: \[coordination, frontend, native\]/);
assert.match(ui,/NATIVE_RESULT.*needs\.native\.result/);
assert.match(ui,/UI_RESULT.*needs\.frontend\.result/);
assert.match(ui,/if: \$\{\{ always\(\) && github\.event_name == 'pull_request' \}\}/);
for(const path of [
'integration/ApprovedNativeRuntimeSnapshot.h',
'integration/ApprovedNativeV8Projection.h',
'integration/ApprovedNativeControlIntent.h',
'scripts/check_console_puzzle.mjs',
'scripts/check_approved_native_gui_release.mjs'
]) assert.ok(nativePrSelected(path),path+' bypassed native build');
for(const path of ['docs/workstreams/MULTI_AGENT_COORDINATION.md',
'site/preview/assets/mixer-fader-assembly.css'])
assert.equal(nativePrSelected(path),false,path+' wrongly launches Windows');
});
Loading
Loading