Repository navigation
M2.5 P0 — reconcile active PR owners and enforce no duplicate GUI/bridge/PCM in existing CI #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # M2.5 — REPOSITORY / ARCHITECTURE RECONCILIATION | ||
|
|
||
| **Authoritative progress ledger:** https://github.com/masarray/arsonmix/issues/399 | ||
| **Baseline:** `main@c1a11afd145380a944c9844937ccb6a97b5e0557` (M2 #394 merged, one approved /preview/). | ||
| **Purpose:** prevent concurrent ChatGPT threads from creating competing GUI, bridge, native PCM, or FAT implementations. | ||
|
|
||
| ## Ownership (one authoring branch per runtime subsystem) | ||
|
|
||
| | Runtime scope | Sole active owner | Work retained | Conflict disposition | | ||
| |---|---|---|---| | ||
| | GUI visible DOM/CSS/PNG | Approved /preview/ source, GUI #393 | only existing visual, no redesign | #393 consolidation deferred until joined native stable; port without overwriting current bridge | | ||
| | GUI↔native accepted state | M2 #394 merged; #396 repairs original IIFE/gesture | one `approved-native-contract.js`, one `approved-native-bridge.js` | #395 alternate M2 controller redundant; preserve unique validations, retire duplicate producer | | ||
| | JUCE callback, PCM graph, VST3 lease | #266 only (WIRE #387 absorbed) | dynamic ChannelId/EdgeId PCM; CH1 10CH+4AUX compatibility | FAT #270 and WASAPI #251 must not bulk overwrite engine | | ||
| | Pre-release admission | #398 | canonical /preview/ & callback gates | no competing puzzle/release check | | ||
| | Windows UAT/FAT | #270 testing only + #15 physical rig | exact joined SHA Windows bundle/PCM/VST3/device measurements | no engine or GUI implementation owned by FAT | | ||
| | WASAPI reliability | #251 after #266 cutover | 0 FX dry path crackle evidence | do not parallel-edit `LiveAudioEngine.h` | | ||
| | FactoryFX sibling plugin packaging | #225 | signed/manifests/release watch | no engine callback or GUI replacement | | ||
|
|
||
| ## How threads coordinate | ||
|
|
||
| 1. **Before editing:** read `main`, `AGENTS.md`, issue #399, open PRs, and exact current HEAD. If a PR owns your files/domain, contribute there or add a handoff; **do not create another production path**. | ||
| 2. **Every PR:** identify one owner, base SHA, changed production domains, native GUI parity, current CI, and the PR it supersedes. | ||
| 3. **Merge order:** unique GUI scope correction #396 → integrate #266 on CURRENT main (with Main.cpp event handlers and M2 native asset producer retained) → #398 source/release gate → #270 FAT-only evidence. #393 byte-identical source cleanup can follow sound cutover. Order may change based on tests, never by bulk merge. | ||
| 4. **At merge:** verify exact-head Windows + Chromium, graph/ACK/snapshot test, rejected/stale PCM behavior, no second callback/renderer. Hardware certification is independent. Close or explicitly mark superseded work after its unique tests are ported. | ||
| 5. **CI efficiency:** `scripts/check_workstream_ownership.mjs` is a cheap step in existing workflows (no new runners). PR ≤ #399 gets actionable warnings; new PR ≥ #400 fails if it overlaps an OPEN owner's production domain. Workflow/CMake shared junctions are warnings requiring manual review, not an artificial blocker. | ||
|
|
||
| For live auditing on a PR checkout: | ||
| ```sh | ||
| node scripts/check_workstream_ownership.mjs | ||
| node --test tests/workstream_ownership_guard.test.mjs | ||
| ``` | ||
|
|
||
| **Limits:** CI detects cross-PR workstream overlap, not actual concurrent unsaved edits in another ChatGPT session. Branch protection/rulesets require GitHub repository admin access; passing CI alone cannot enforce merging on an unprotected `main`. | ||
|
|
||
| **Definition of done:** current baseline, unambiguous active owners, no duplicate bridge owner, exact-head qualified joined engine+GUI, FAT still PENDING until hardware evidence. No GUI changes for M2.5. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| // M2.5: fail *new* PRs that duplicate the LIVE implementation owner. | ||
| // This is a cheap control-plane check, never a DSP implementation. | ||
| // Existing PRs <= #399 are advisory until their unique work is absorbed. | ||
| import {readFileSync} from 'node:fs'; | ||
| import {fileURLToPath} from 'node:url'; | ||
|
|
||
| export const POLICY_ISSUE=399; | ||
| export const STRICT_FROM_PR=400; | ||
|
|
||
| // Shared junction files (CMake/workflows) require review, but are not an | ||
| // automatic rejection: GUI, engine and FAT genuinely have to meet here. | ||
| const SHARED=/^(?:\.github\/workflows\/|CMakeLists\.txt$|scripts\/(?:package_native_windows|verify_native_windows_artifact)\.ps1$)/; | ||
| const REGIONS=[ | ||
| ['engine', /^(?:engine\/|src\/(?:LiveAudioEngine|LiveDryRoutingLab|ConsoleLiveBridgeV6|ApprovedNativeV8Projection|NativeVerifiedSourcePatch|NativeDryShowRecall|NativeLiveShowCapture|NativeShowSaveWorker)\.(?:h|cpp)$)/], | ||
| ['host', /^src\/(?:Main|ApprovedConsoleNativeTransportV6|ApprovedConsoleM2Snapshot)\.(?:h|cpp)$/], | ||
| ['native-gui-bridge', /^(?:web\/approved-native-(?:bridge|contract|m2-state)\.js|scripts\/build_approved_native_gui\.py)$/], | ||
| ['approved-gui', /^(?:site\/preview(?:\/|-v2\/|-buttons\/)|scripts\/build_pages\.py$)/], | ||
| ['release-admission', /^scripts\/(?:check_console_puzzle|check_approved_native_gui_release)\.mjs$/], | ||
| ['hardware-fat', /^scripts\/(?:collect_hardware_fat_windows\.ps1|console_v6_fat_gate\.mjs)$/], | ||
| ]; | ||
| const FORBIDDEN_NEW=/^web\/(?:console-native\.(?:html|css|js)|index\.html)$/; | ||
|
|
||
| export function region(path) { | ||
| for(const [label,re] of REGIONS)if(re.test(path))return label; | ||
| return null; | ||
| } | ||
| function filesOf(pr) { | ||
| return (pr.files||[]).map(v=>typeof v==='string'?{filename:v,status:'modified'}:v) | ||
| .filter(v=>typeof v?.filename==='string'); | ||
| } | ||
| export function auditWorkstreams(current, openPrs) { | ||
| const files=filesOf(current), ours=new Set(files.map(f=>f.filename)); | ||
| const mine=new Map(); | ||
| for(const f of files) { | ||
| const label=region(f.filename); | ||
| if(label) { | ||
| if(!mine.has(label))mine.set(label,[]); | ||
| mine.get(label).push(f.filename); | ||
|
Comment on lines
+35
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the current PR renames a protected file outside its recognized region, AGENTS.md reference: AGENTS.md:L36-L36 Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
| const hard=[], advisory=[]; | ||
| for(const f of files) { | ||
| if(FORBIDDEN_NEW.test(f.filename) && f.status!=='removed') | ||
| hard.push({reason:'rejected-alternative-GUI',file:f.filename,other:null}); | ||
| } | ||
| for(const other of openPrs) { | ||
| if(other.number===current.number || other.state==='closed')continue; | ||
| const theirs=filesOf(other),otherRegions=new Map(); | ||
| for(const f of theirs) { | ||
| const label=region(f.filename); | ||
| if(label) { | ||
| if(!otherRegions.has(label))otherRegions.set(label,[]); | ||
| otherRegions.get(label).push(f.filename); | ||
| } | ||
| // Renames can be a hidden transfer of a protected path. | ||
| if(typeof f.previous_filename==='string') { | ||
| const previous=region(f.previous_filename); | ||
| if(previous) { | ||
| if(!otherRegions.has(previous))otherRegions.set(previous,[]); | ||
| otherRegions.get(previous).push(f.previous_filename); | ||
| } | ||
| } | ||
| } | ||
| for(const [label,paths] of mine) { | ||
| if(otherRegions.has(label))hard.push({ | ||
| reason:'duplicate-'+label,file:paths[0],other:other.number, | ||
| overlapping:otherRegions.get(label)[0], | ||
| }); | ||
| } | ||
| const otherFiles=new Set(theirs.flatMap(f=>[f.filename,f.previous_filename].filter(Boolean))); | ||
| for(const path of ours) { | ||
| if(SHARED.test(path)&&otherFiles.has(path)) | ||
| advisory.push({reason:'shared-merge-junction',file:path,other:other.number}); | ||
| } | ||
| } | ||
| return {hard,advisory,enforced:Number(current.number)>=STRICT_FROM_PR}; | ||
| } | ||
| async function json(url,token) { | ||
| const response=await fetch(url,{headers:{ | ||
| 'Accept':'application/vnd.github+json', | ||
| 'User-Agent':'ArSonMix-M2.5-ownership-check', | ||
| ...(token?{'Authorization':'Bearer '+token}:{}) | ||
| },signal:AbortSignal.timeout(18000)}); | ||
| if(!response.ok)throw Error('GitHub PR metadata unavailable: HTTP '+response.status+ | ||
| ' / '+url.split('?')[0]); | ||
| return response.json(); | ||
| } | ||
| async function remotePRs(repo,token) { | ||
| const root='https://api.github.com/repos/'+repo; | ||
| const prs=await json(root+'/pulls?state=open&per_page=100',token); | ||
| if(prs.length===100)throw Error('Cannot certify overlap: >99 open PRs (pagination required)'); | ||
| return Promise.all(prs.map(async pr=>{ | ||
| const files=[]; | ||
| for(let page=1;page<=5;page++) { | ||
| const a=await json(root+'/pulls/'+pr.number+'/files?per_page=100&page='+page,token); | ||
| files.push(...a.map(f=>({filename:f.filename,status:f.status, | ||
| previous_filename:f.previous_filename}))); | ||
| if(a.length<100)break; | ||
| if(page===5)throw Error('PR #'+pr.number+' exceeds 500 changed files'); | ||
| } | ||
| return {number:pr.number,title:pr.title,state:pr.state,files}; | ||
| })); | ||
| } | ||
| export async function main() { | ||
| if(process.argv.includes('--test-fixture')) { | ||
| const at=process.argv.indexOf('--test-fixture'); | ||
| const bundle=JSON.parse(readFileSync(process.argv[at+1],'utf8')); | ||
| const out=auditWorkstreams(bundle.current,bundle.open); | ||
| console.log(JSON.stringify(out,null,2)); | ||
| if(out.enforced&&out.hard.length)process.exitCode=1; | ||
| return; | ||
| } | ||
| const eventPath=process.env.GITHUB_EVENT_PATH; | ||
| if(!eventPath){console.log('M2.5 ownership check: no PR event, skipping.');return;} | ||
| const event=JSON.parse(readFileSync(eventPath,'utf8')); | ||
| const number=event.pull_request?.number; | ||
| if(!Number.isInteger(number)){console.log('M2.5: non-PR event; skip.');return;} | ||
| const repo=process.env.GITHUB_REPOSITORY; | ||
| if(!/^[\w.-]+\/[\w.-]+$/.test(repo||''))throw Error('Invalid GITHUB_REPOSITORY'); | ||
| const prs=await remotePRs(repo,process.env.GH_TOKEN||process.env.GITHUB_TOKEN); | ||
| const current=prs.find(x=>x.number===number); | ||
| if(!current)throw Error('Cannot certify overlap: current PR #'+number+' not in open PRs'); | ||
| const report=auditWorkstreams(current,prs); | ||
| const notify=(severity,entry)=>{ | ||
| const text='M2.5 '+entry.reason+' '+entry.file+ | ||
| (entry.other?' vs PR #'+entry.other+' ('+entry.overlapping+')':'')+ | ||
| ' · see #'+POLICY_ISSUE; | ||
| console.log('::'+severity+'::'+text); | ||
| }; | ||
| for(const item of report.advisory)notify('warning',item); | ||
| for(const item of report.hard)notify(report.enforced?'error':'warning',item); | ||
| console.log('M2.5 #'+number+': '+report.hard.length+' production ownership conflicts, '+ | ||
| report.advisory.length+' shared junctions; '+ | ||
| (report.enforced?'STRICT':'ADVISORY (legacy PR)')+ | ||
| '; no new workflow, no extra runner.'); | ||
| if(report.enforced&&report.hard.length)process.exitCode=1; | ||
| } | ||
| if(process.argv[1]&&fileURLToPath(import.meta.url)===process.argv[1]) { | ||
| main().catch(err=>{console.error('::error::M2.5 ownership check: '+err.message);process.exitCode=1;}); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| import test from 'node:test'; | ||
| import assert from 'node:assert/strict'; | ||
| import {auditWorkstreams,region,STRICT_FROM_PR,POLICY_ISSUE} | ||
| from '../scripts/check_workstream_ownership.mjs'; | ||
| const pr=(number,files,state='open')=>({number,files,state}); | ||
| test('M2.5 recognizes ALL existing runtime owner boundaries',()=>{ | ||
| assert.equal(POLICY_ISSUE,399);assert.equal(STRICT_FROM_PR,400); | ||
| for(const [file,owner] of [ | ||
| ['engine/core/DynamicAcceptedSession.h','engine'], | ||
| ['src/LiveAudioEngine.h','engine'], | ||
| ['src/ConsoleLiveBridgeV6.h','engine'], | ||
| ['src/Main.cpp','host'], | ||
| ['web/approved-native-contract.js','native-gui-bridge'], | ||
| ['web/approved-native-bridge.js','native-gui-bridge'], | ||
| ['scripts/build_approved_native_gui.py','native-gui-bridge'], | ||
| ['site/preview-v2/index.html','approved-gui'], | ||
| ['site/preview/index.html','approved-gui'], | ||
| ['scripts/build_pages.py','approved-gui'], | ||
| ['scripts/check_console_puzzle.mjs','release-admission'], | ||
| ['scripts/collect_hardware_fat_windows.ps1','hardware-fat'], | ||
| ['tests/new_file_test.cpp',null], | ||
| ['docs/workstreams/M2_5_RECONCILIATION.md',null] | ||
| ])assert.equal(region(file),owner,file); | ||
| }); | ||
| test('new PR cannot create second native bridge while #396/#395 still own it',()=>{ | ||
| const now=pr(400,['web/approved-native-bridge.js']); | ||
| const open=[pr(396,['web/approved-native-bridge.js']), | ||
| pr(395,['web/approved-native-m2-state.js'])]; | ||
| const result=auditWorkstreams(now,open); | ||
| assert.equal(result.enforced,true); | ||
| assert.equal(result.hard.length,2); | ||
| assert.ok(result.hard.every(x=>x.reason==='duplicate-native-gui-bridge')); | ||
| }); | ||
| test('same engine DOMAIN, even distinct files, collides with #266',()=>{ | ||
| const out=auditWorkstreams(pr(401,['engine/core/NewAudioCallback.h']),[ | ||
| pr(266,['src/LiveAudioEngine.h','engine/core/DynamicAcceptedSession.h']), | ||
| pr(270,['engine/core/PreparedMixerBlock.h']) | ||
| ]); | ||
| assert.deepEqual(out.hard.map(x=>x.other),[266,270]); | ||
| }); | ||
| test('legacy PRs get actionable warnings, not endless CI cancellations',()=>{ | ||
| const out=auditWorkstreams(pr(396,['web/approved-native-bridge.js']),[ | ||
| pr(395,['web/approved-native-bridge.js']) | ||
| ]); | ||
| assert.equal(out.enforced,false);assert.equal(out.hard.length,1); | ||
| }); | ||
| test('coordinating docs/workflow overlap is review-only, not another engine owner',()=>{ | ||
| const out=auditWorkstreams(pr(400,[ | ||
| '.github/workflows/p1-windows.yml','AGENTS.md', | ||
| 'docs/workstreams/M2_5_RECONCILIATION.md' | ||
| ]),[ | ||
| pr(266,['.github/workflows/p1-windows.yml','src/LiveAudioEngine.h']), | ||
| pr(393,['.github/workflows/ui-smoke.yml']) | ||
| ]); | ||
| assert.equal(out.enforced,true); | ||
| assert.equal(out.hard.length,0); | ||
| assert.equal(out.advisory.length,1); | ||
| }); | ||
| test('retired closed PR no longer blocks real native work',()=>{ | ||
| const out=auditWorkstreams(pr(401,['web/approved-native-bridge.js']),[ | ||
| pr(395,['web/approved-native-bridge.js'],'closed') | ||
| ]); | ||
| assert.equal(out.hard.length,0); | ||
| }); | ||
| test('new alternate console renderer is rejected; deletion is allowed',()=>{ | ||
| const alt='web/console-native.html'; | ||
| assert.equal(auditWorkstreams(pr(401,[{filename:alt,status:'added'}]),[]).hard.length,1); | ||
| assert.equal(auditWorkstreams(pr(401,[{filename:alt,status:'removed'}]),[]).hard.length,0); | ||
| }); | ||
| test('renamed protected path cannot bypass domain collision',()=>{ | ||
| const out=auditWorkstreams(pr(401,['site/preview/index.html']),[ | ||
| pr(393,[{filename:'archive/preview-old.html',previous_filename:'site/preview-v2/index.html', | ||
| status:'renamed'}]) | ||
| ]); | ||
| assert.equal(out.hard.length,1); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new PR that changes only
scripts/check_console_puzzle.mjs,scripts/check_approved_native_gui_release.mjs,scripts/collect_hardware_fat_windows.ps1, orscripts/console_v6_fat_gate.mjsnever reaches this guard: none matches thepull_request.pathsfilters in eitherui-smoke.ymlorp1-windows.yml, the only workflows invoking it. Consequently, these declared protected domains can overlap an open owner without any ownership check running, contrary to the enforcement required byAGENTS.md. Add the protected script paths to an existing workflow's PR filters.AGENTS.md reference: AGENTS.md:L36-L36
Useful? React with 👍 / 👎.