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
51 changes: 24 additions & 27 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,13 @@ on:
- 'tests/wire_graph_canonical_model.test.cjs'
- 'tests/wire_main_native_handoff_contract.test.cjs'
- 'tests/ci_workflow_efficiency_test.mjs'
- 'scripts/check_workstream_coordination.mjs'
- 'tests/workstream_coordination_contract.test.mjs'
- 'tests/approved_native_m2_contract.test.cjs'
- 'scripts/build_ui_css.py'
- '.github/workflows/ui-smoke.yml'
- '.github/workflows/pages-publish.yml'
# All PRs receive fast admission; Chromium is conditional on checked files.
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- 'web/**'
- 'integration/console-v6/**'
- 'site/**'
- 'AR-MIX-Live-FX-Host-Standalone-v0.3.html'
- 'scripts/build_pages.py'
- 'scripts/build_ui_css.py'
- 'tests/*.py'
- 'tests/gui_workflow_contract_test.mjs'
- 'tests/*gui*contract*.mjs'
- 'tests/native_ui_contract_test.mjs'
- 'tests/native_orbit_ui_smoke.py'
- 'tests/ci_workflow_efficiency_test.mjs'
- 'scripts/check_workstream_coordination.mjs'
- 'tests/workstream_coordination_contract.test.mjs'
- 'tests/approved_native_m2_contract.test.cjs'
- 'tests/wire_graph_canonical_model.test.cjs'
- 'tests/wire_main_native_handoff_contract.test.cjs'
- '.github/workflows/ui-smoke.yml'
- '.github/workflows/pages-publish.yml'
types: [opened, reopened, synchronize, edited, ready_for_review]
# Manual full suite (including immutable CSS migration tests) or release-integration PR.
workflow_dispatch:

Expand All @@ -61,17 +40,35 @@ permissions:
pull-requests: read

jobs:
frontend:
name: Standalone UI and geometry
coordination:
name: PR coordination admission
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 5
outputs:
run_ui: ${{ steps.pr_scope.outputs.run_ui || steps.push_scope.outputs.run_ui }}
steps:
- uses: actions/checkout@v4
- name: Cheap one-owner / overlapping-PR preflight (read-only)
- name: Audit PR metadata, file ownership and runtime collisions
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 }}
- name: Main push retains Chromium verification
id: push_scope
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: echo "run_ui=true" >> "$GITHUB_OUTPUT"
- name: Fast offline coordination contract regression
run: node --test tests/workstream_coordination_contract.test.mjs
frontend:
needs: coordination
if: ${{ github.event_name != 'pull_request' || needs.coordination.outputs.run_ui == 'true' }}
name: Standalone UI and geometry
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down
8 changes: 8 additions & 0 deletions docs/workstreams/MULTI_AGENT_COORDINATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ NEXT SINGLE MEANINGFUL MILESTONE:

Do not create 10 micro-PRs or issue-only progress in place of code. The owning lane implements substantive code and targeted tests; one integrator joins exact checked SHA. GUI remains Pages-only visual authority; only ENGINE provides real PCM; FAT is the independent final judge. If the device is unavailable, mark physical FAT pending. Keep #15 crackling stop-ship.

## M2.6: always-on lightweight PR coordination

The existing `.github/workflows/ui-smoke.yml` now checks **every pull request**, including docs-only, ENGINE-only and metadata-edited PRs. Its named `PR coordination admission` job checks owner markers, active PR overlaps and runtime domains and runs offline unit regressions. It sets `run_ui=true` only for UI/browser/approved-native changes; docs-only and ENGINE-only PRs do **not** start the heavyweight Chromium job. Windows native CI keeps its existing path filters. No fifth workflow or audio engine is added.

For merge safety, require the exact GitHub Actions job check **PR coordination admission** in `main` branch protection or rulesets, require PR review, and require up-to-date head (or merge queue). Verify a real check run exists before selecting the status name. Do not universally require Windows/Chromium checks when their path-based jobs are intentionally skipped. Configure this in repository Settings → Branches or Settings → Rules → Rulesets using administrator access. Confirm the GitHub branch API reports `protected: true` afterward.

**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.

## 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.
33 changes: 31 additions & 2 deletions scripts/check_workstream_coordination.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env node
// SPDX-License-Identifier: AGPL-3.0-only
// One-owner PR preflight. Runs in EXISTING GUI/Windows workflows only.
// Cheap GitHub REST reads; NEVER changes a repo, builds audio or blocks push/main.
// Cheap GitHub REST reads; NEVER changes a repo or builds audio.
// New PRs fail closed on unowned production paths or active same-owner collisions.
import { pathToFileURL } from 'node:url';
import { appendFileSync } from 'node:fs';

export const POLICY_EPOCH_PR = 399; // Existing #396/#398 are legacy; new #400+ are strict.
export const WORKSTREAMS = Object.freeze(['GUI', 'ENGINE', 'INTEGRATOR', 'FAT']);
Expand Down Expand Up @@ -175,6 +176,30 @@ async function allPages(base, token, limit = 10) {
}
throw Error('GitHub API pagination exceeded bounded limit: '+base);
}
// Scope expensive Chromium to the prior UI PR path policy, while every
// PR (docs-only / ENGINE-only included) receives fast ownership admission.
export function requiresUiSmoke(paths) {
return paths.some(path =>
path.startsWith('site/') ||
path.startsWith('web/') ||
path.startsWith('integration/console-v6/') ||
path === 'AR-MIX-Live-FX-Host-Standalone-v0.3.html' ||
path === 'scripts/build_pages.py' ||
path === 'scripts/build_ui_css.py' ||
/^tests\/[^/]+\.py$/.test(path) ||
/^tests\/[^/]*gui[^/]*contract[^/]*\.mjs$/.test(path) ||
[
'tests/gui_workflow_contract_test.mjs',
'tests/native_ui_contract_test.mjs',
'tests/ci_workflow_efficiency_test.mjs',
'tests/approved_native_m2_contract.test.cjs',
'tests/wire_graph_canonical_model.test.cjs',
'tests/wire_main_native_handoff_contract.test.cjs',
'.github/workflows/ui-smoke.yml',
'.github/workflows/pages-publish.yml'
].includes(path));
}

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 @@ -196,8 +221,9 @@ export async function auditGitHub({repo,number,token}) {
.map(f=>f.filename);
}));
}
return audit({pr,files:files.map(f=>f.filename),others,filesByPR,
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))};
}
async function main() {
const args=process.argv.slice(2);
Expand All @@ -211,6 +237,9 @@ async function main() {
repo:process.env.GITHUB_REPOSITORY || '',
number,token:process.env.GH_TOKEN || ''
});
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, 'run_ui='+(result.runUi?'true':'false')+'\n');
}
console.log('ArSonMix coordination: lane='+(result.lane||'UNDECLARED')+
' files='+result.changedFiles+' legacy='+result.legacy+
' authorized='+result.ok+' collision(s)='+result.activeCollisions);
Expand Down
30 changes: 23 additions & 7 deletions tests/ci_workflow_efficiency_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import {requiresUiSmoke} from '../scripts/check_workstream_coordination.mjs';

const read = path => readFileSync(path, 'utf8');
const native = read('.github/workflows/p1-windows.yml');
Expand Down Expand Up @@ -38,7 +39,8 @@ function globMatches(pattern, filename) {
const windowsPush = pathsFor(native, 'push', 'pull_request');
const windowsPR = pathsFor(native, 'pull_request', 'workflow_dispatch');
const uiPush = pathsFor(ui, 'push', 'pull_request');
const uiPR = pathsFor(ui, 'pull_request', 'workflow_dispatch');
// Unfiltered PR entry runs cheap admission; only UI-relevant paths run browser.
const uiPRSelected = filename => requiresUiSmoke([filename]);
const selected = (paths, file) => paths.some(p => globMatches(p, file));

test('visual GUI changes never consume Windows native runner on a PR or on main', () => {
Expand All @@ -47,7 +49,7 @@ test('visual GUI changes never consume Windows native runner on a PR or on main'
'web/mixer-layout.js', 'web/mixer-io.js',
'AR-MIX-Live-FX-Host-Standalone-v0.3.html'
]) {
assert.ok(selected(uiPR, filename), filename + ' must run frontend PR checks');
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(selected(windowsPush, filename), false, filename + ' wrongly triggers native main');
Expand All @@ -61,7 +63,7 @@ test('native PCM and device changes always use Windows/CTest, never Chromium by
]) {
assert.ok(selected(windowsPR, filename), filename + ' must qualify native PR');
assert.ok(selected(windowsPush, filename), filename + ' must qualify native main');
assert.equal(selected(uiPR, filename), false, filename + ' wrongly triggers browser PR');
assert.equal(uiPRSelected(filename), false, filename + ' wrongly triggers browser PR');
assert.equal(selected(uiPush, filename), false, filename + ' wrongly triggers browser main');
}
assert.match(native, /ctest --test-dir build -C Release --output-on-failure/);
Expand Down Expand Up @@ -89,17 +91,21 @@ 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, uiPR]) {
for (const paths of [windowsPush, windowsPR, uiPush]) {
assert.ok(selected(paths, filename), filename + ' needs native+GUI checks');
}
assert.ok(uiPRSelected(filename),filename+' needs PR Chromium tests');
}
});

test('docs and isolated CI tests do not fan out into unrelated builds', () => {
const paths = [windowsPR, windowsPush, uiPR, uiPush];
const paths = [windowsPR, 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.ok(paths.every(p => !selected(p, filename)), 'Doc triggered CI: ' + filename);
assert.equal(uiPRSelected(filename),false,'Doc only needs lightweight PR admission: '+filename);
}
for (const filename of [
'tests/pages_wire_first_canonical_main_smoke.py',
'tests/wire_graph_canonical_model.test.cjs',
Expand All @@ -108,7 +114,7 @@ test('docs and isolated CI tests do not fan out into unrelated builds', () => {
]) {
assert.equal(selected(windowsPR, filename), false);
assert.equal(selected(windowsPush, filename), false);
assert.equal(selected(uiPR, filename), true);
assert.equal(uiPRSelected(filename), true);
assert.equal(selected(uiPush, filename), true);
}
});
Expand Down Expand Up @@ -154,3 +160,13 @@ test('Pages is single guarded downstream publisher, never triggered by PR comple
assert.match(factory, /schedule:/);
assert.doesNotMatch(factory, /^\s{2}push:/m);
});

test('M2.6 always-on coordination job has a stable name and skips unrelated Chromium', () => {
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,/needs: coordination/);
assert.match(ui,/needs\.coordination\.outputs\.run_ui == 'true'/);
assert.match(ui,/node --test tests\/workstream_coordination_contract\.test\.mjs/);
});
24 changes: 23 additions & 1 deletion tests/workstream_coordination_contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import {POLICY_EPOCH_PR, ownerOf, metadata, audit} from '../scripts/check_workstream_coordination.mjs';
import {POLICY_EPOCH_PR, ownerOf, metadata, audit, requiresUiSmoke} from '../scripts/check_workstream_coordination.mjs';

const body=(lane,issue=397,parked=false)=>
'<!-- arsonmix-workstream: '+lane+' -->\n'+
Expand Down Expand Up @@ -207,3 +207,25 @@ test('coordinator uses existing native + Chromium CI, not a fifth workflow',()=>
assert.match(guide,/MULTI_AGENT_COORDINATION\.md/);
assert.match(guide,/#397/);
});

test('M2.6 always-on PR admission scopes Chromium to UI changes',()=>{
for(const path of [
'docs/RELEASE_NOTES.md','README.md','src/LiveAudioEngine.h',
'engine/core/PreparedMixerBlock.h',
'scripts/check_workstream_coordination.mjs',
'tests/workstream_coordination_contract.test.mjs'
]) assert.equal(requiresUiSmoke([path]),false,path);
for(const path of [
'site/preview/index.html','web/approved-native-bridge.js',
'integration/console-v6/contract.json','tests/pages_wire_first_canonical_main_smoke.py',
'.github/workflows/ui-smoke.yml'
]) assert.equal(requiresUiSmoke([path]),true,path);
assert.equal(requiresUiSmoke(['README.md','src/Main.cpp','site/preview/index.html']),true);
const workflow=readFileSync('.github/workflows/ui-smoke.yml','utf8');
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,/needs: coordination/);
assert.match(workflow,/needs\.coordination\.outputs\.run_ui/);
});
Loading