From 53d138b06c0112776592b5ab6cb42c4f54f2bc4d Mon Sep 17 00:00:00 2001 From: brady gaster Date: Tue, 25 Aug 2026 08:18:18 -0700 Subject: [PATCH 1/2] test(gh-aw): enforce dispatcher-first install order Closes #1878 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- test/gh-aw-implement-workflow.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/gh-aw-implement-workflow.test.ts b/test/gh-aw-implement-workflow.test.ts index a28fe26a7..b8ec959c8 100644 --- a/test/gh-aw-implement-workflow.test.ts +++ b/test/gh-aw-implement-workflow.test.ts @@ -237,12 +237,18 @@ describe('gh-aw implement workflows', () => { }); it('documents one-command installation in dependency order', () => { - const workerIndex = guide.indexOf('bradygaster/squad/workflows/squad-implement-worker.md@dev'); const dispatcherIndex = guide.indexOf('bradygaster/squad/workflows/squad.md@dev'); + const workerIndex = guide.indexOf('bradygaster/squad/workflows/squad-implement-worker.md@dev'); + const reviewerIndex = guide.indexOf('bradygaster/squad/workflows/squad-review.md@dev'); + expect(dispatcherIndex).toBeGreaterThan(-1); expect(workerIndex).toBeGreaterThan(-1); - expect(dispatcherIndex).toBeGreaterThan(workerIndex); - expect(guide).toContain('The single command installs the dedicated worker first'); + expect(reviewerIndex).toBeGreaterThan(-1); + expect(workerIndex).toBeGreaterThan(dispatcherIndex); + expect(reviewerIndex).toBeGreaterThan(workerIndex); + expect(guide).toMatch( + /Keep the dispatcher first\. `gh aw add` discovers its implementation-worker and\s+reviewer dependencies while compiling it; the explicit worker and reviewer\s+entries then confirm the complete install surface without creating duplicates\./, + ); }); }); From ade7250acf206db4f8074b764ed7d6a1a76b67ca Mon Sep 17 00:00:00 2001 From: brady gaster Date: Tue, 25 Aug 2026 08:43:25 -0700 Subject: [PATCH 2/2] test(gh-aw): scope install order to one command Closes #1878 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2eefae63-8d83-42fe-8eea-dff205151afb --- test/gh-aw-implement-workflow.test.ts | 32 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/test/gh-aw-implement-workflow.test.ts b/test/gh-aw-implement-workflow.test.ts index b8ec959c8..beda23c35 100644 --- a/test/gh-aw-implement-workflow.test.ts +++ b/test/gh-aw-implement-workflow.test.ts @@ -237,15 +237,29 @@ describe('gh-aw implement workflows', () => { }); it('documents one-command installation in dependency order', () => { - const dispatcherIndex = guide.indexOf('bradygaster/squad/workflows/squad.md@dev'); - const workerIndex = guide.indexOf('bradygaster/squad/workflows/squad-implement-worker.md@dev'); - const reviewerIndex = guide.indexOf('bradygaster/squad/workflows/squad-review.md@dev'); - - expect(dispatcherIndex).toBeGreaterThan(-1); - expect(workerIndex).toBeGreaterThan(-1); - expect(reviewerIndex).toBeGreaterThan(-1); - expect(workerIndex).toBeGreaterThan(dispatcherIndex); - expect(reviewerIndex).toBeGreaterThan(workerIndex); + const paths = [ + 'bradygaster/squad/workflows/squad.md@dev', + 'bradygaster/squad/workflows/squad-implement-worker.md@dev', + 'bradygaster/squad/workflows/squad-review.md@dev', + ]; + const orderedInstallCommand = [ + 'gh aw add \\', + ` ${paths[0]} \\`, + ` ${paths[1]} \\`, + ` ${paths[2]}`, + ].join('\n'); + const normalizedGuide = guide.replace(/\r\n/g, '\n'); + const hasOrderedInstallCommand = (markdown: string): boolean => + [...markdown.matchAll(/```bash\n([\s\S]*?)\n```/g)] + .some(match => match[1].includes(orderedInstallCommand)); + + expect(hasOrderedInstallCommand(normalizedGuide)).toBe(true); + + const reorderedGuide = normalizedGuide.replaceAll( + `${paths[0]} \\\n ${paths[1]}`, + `${paths[1]} \\\n ${paths[0]}`, + ); + expect(hasOrderedInstallCommand(reorderedGuide)).toBe(false); expect(guide).toMatch( /Keep the dispatcher first\. `gh aw add` discovers its implementation-worker and\s+reviewer dependencies while compiling it; the explicit worker and reviewer\s+entries then confirm the complete install surface without creating duplicates\./, );