fix(test): correct gh-aw compile test workspace layout for dispatch-workflow validation - #1697
Merged
Merged
Conversation
test/gh-aw-quality.test.ts's compiled-workflow-contract test copied workflows/ into a bare workflows/ dir inside the ephemeral test git repo, then ran gh aw compile workflows/squad.md --strict. Since #1682 added safe-outputs.dispatch-workflow (workflows: [squad-implement-worker]) to workflows/squad.md, gh aw v0.85.4's dispatch-workflow validation now resolves its expected .github/workflows/ location relative to the compiled file, assuming the standard <root>/.github/workflows/<file>.md depth. Because this repo's source lives one level shallower, at <root>/workflows/<file>.md, gh aw's resolution lands one directory too high (confirmed empirically against both the test workspace and the real repo root), so it can never find squad-implement-worker and fails --strict compilation. This is the sole cause of dev's vitest red status since 2026-08-12T23:39. Fix: mirror the real downstream deployment layout inside the test workspace instead - copy workflows/ into <workspace>/.github/workflows/ and compile .github/workflows/squad.md, matching exactly how docs/src/content/docs/guide/gh-aw.md documents real installs via gh aw add owner/squad/workflows/squad-implement-worker.md@dev owner/squad/workflows/squad.md@dev (both files land side-by-side in the consumer's .github/workflows/). Verified this placement in an isolated compile outside any repo/worktree - dispatch-workflow resolves and compile succeeds with exit 0. This also changes the compiled runtime-import placeholder paths from bare shared/planning-ontology.md to .github/workflows/shared/planning-ontology.md, which is gh-aw's genuine, repo-root-relative behavior for that layout (reproduced in the same isolated compile) - updated the two literal assertions to match. Added a 20s test timeout since gh aw compile can exceed vitest's 5s default under full-suite parallel load. workflows/squad.md, workflows/squad-implement-worker.md, and #1682's dispatch-workflow feature are completely untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🟢 Impact Analysis — PR #1697Risk tier: 🟢 LOW 📊 Summary
🎯 Risk Factors
📦 Modules Affectedtests (1 file)
This report is generated automatically for every PR. See #733 for details. |
Contributor
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ✅ | Single commit | 1 commit — clean history |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ❌ | Copilot threads resolved | 1 unresolved Copilot thread(s) — fix and resolve before merging |
| ✅ | CI passing | All checks passing |
Files Changed (1 file, +26 −6)
| File | +/− |
|---|---|
test/gh-aw-quality.test.ts |
+26 −6 |
Total: +26 −6
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the gh aw compile --strict contract test workspace layout to mirror real downstream installs (.github/workflows/), so dispatch-workflow validation can resolve squad-implement-worker correctly and the test stops failing on CI.
Changes:
- Copy
workflows/into<workspace>/.github/workflows/and compile.github/workflows/squad.mdin the ephemeral test repo. - Update runtime-import literal expectations to match paths recorded relative to the repo root under the new layout.
- Add an explicit 20s timeout to reduce flakiness from
gh aw compilesubprocess duration under contention.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Mirror that real deployment layout in the ephemeral test workspace (instead | ||
| // of a bare `workflows/` copy) so the dispatch target `squad-implement-worker` | ||
| // resolves the same way it will for every real downstream install. | ||
| cpSync(WORKFLOWS_DIR, join(workspace, '.github', 'workflows'), { recursive: true }); |
This was referenced Aug 13, 2026
shantanusharma
pushed a commit
to shantanusharma/squad
that referenced
this pull request
Aug 15, 2026
dev's git history was orphaned on 2026-07-13 (root commit 4c5772c, 196 commits) and no longer shares a common ancestor with main (root commit f4830e4, 1722 commits). This silently blocked promotion: `git merge-base dev main` fails outright and PR bradygaster#1698 (dev -> main) is unmergeable as a result. The v0.11.0 promotion (2026-06-29) predates the reset, which is why it succeeded and this one cannot. This merges upstream/main into dev with --allow-unrelated-histories to give the two branches a real common ancestor again, so future dev -> main promotions work through normal fast-forward/merge mechanics instead of hitting this dead end. Conflict resolution policy (277 add/add conflicts, all resolved in dev's favor): - dev is the live 0.12.0 release line; main is 44 days stale. - Verified the one main-only code fix, bradygaster#1415 (`tools: ['*']` in .github/agents/squad.agent.md), is already present on dev, so taking dev's side loses no code. - All conflicts resolved via `git checkout --ours` (dev) + `git add`. - Verified afterward: package.json / packages/squad-cli/package.json / packages/squad-sdk/package.json still read 0.12.0; CHANGELOG.md still holds the `## [0.12.0] - 2026-08-12` entry; test/gh-aw-quality .test.ts still holds the bradygaster#1697 `.github/workflows` layout fix; workflows/squad.md and workflows/squad-implement-worker.md still hold the bradygaster#1682 feature. Non-conflicting content that arrived from main (~60 files): - Restored (content lost in the July reset): 7 docs pages under docs/src/content/{blog,docs}/ and 5 .squad/decisions/inbox/*.md decision records. The 5 decision files matched a gitignore pattern for new `git add` but were mechanically staged fine via the merge itself (already-tracked-on-main content merges at the object level and isn't filtered by .gitignore), so all 12 were kept. - 6 agent history.md / decisions.md files auto-merged cleanly (three-way, non-conflicting) and are kept as-is: they interleave older content from main with dev's newer entries, recovering more history lost in the reset. - Dropped: 48 .changeset/*.md files that arrived from main. They are already consumed into CHANGELOG.md's 0.12.0 entry; re-adding them risks tripping the Changeset Drift check for content that's already released. .changeset/ after this merge contains exactly what dev had (README.md, config.json, max-reasoning-effort.md). Net effect verified via `git diff --cached --stat`: only 18 files show a real diff versus dev's tip (the 12 restored files + 6 auto-merged history files); all 275 conflict resolutions and all 48 changeset removals are no-ops against dev's existing tree. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
test/gh-aw-quality.test.ts->gh-aw: compiled workflow contract->strict-compiles and preserves prompt/config behaviorhas keptdevred on vitest since 2026-08-12T23:39 (PR CI, not thenode --testrelease gate, which does not run this file - see note below).The test builds an ephemeral git workspace, copies this repo's
workflows/into<workspace>/workflows/, then runsgh aw compile workflows/squad.md --strict.#1682 added
safe-outputs.dispatch-workflow: { workflows: [squad-implement-worker] }toworkflows/squad.md.gh aw compile --strict(local version v0.85.4) validates that dispatch target against a.github/workflows/directory it computes relative to the compiled file, assuming the standard depth<root>/.github/workflows/<file>.md. This repo's real gh-aw source lives one level shallower, at<root>/workflows/<file>.md, so gh aw's computed root lands one directory too high - the parent of the actual workspace/repo root. It can never findsquad-implement-worker, and--strictcompilation fails:I reproduced this locally in a clean temp git repo containing only
workflows/, and independently confirmed the off-by-one behavior against the real repo root as well.squad-implement-worker.mdis present and committed ondev- this was never a missing-source problem, only a test-workspace-layout problem.What I changed (and why)
Only
test/gh-aw-quality.test.ts.workflows/squad.md,workflows/squad-implement-worker.md, and #1682'sdispatch-workflowfeature surface are completely untouched - I did not revert, weaken, or touch the feature in any way.In the compile test:
workflows/into<workspace>/.github/workflows/instead of<workspace>/workflows/..github/workflows/squad.md(wasworkflows/squad.md), and read the resulting lock file from the matching path.docs/src/content/docs/guide/gh-aw.md:gh aw add owner/squad/workflows/squad-implement-worker.md@dev owner/squad/workflows/squad.md@devlands both.mdfiles together in the consumer's own.github/workflows/, alongsideshared/*.md, which is the layoutgh aw compile --strict's dispatch-workflow validation actually expects..github/workflows/layout,gh aw compile .github/workflows/squad.md --strictsucceeds (exit 0, 1 succeeded, 2 warnings, dispatch-workflow resolves).{{#runtime-import ...}}placeholder paths relative to the repo root, not relative to the compiled file's directory. With this real layout the compiled output legitimately contains{{#runtime-import .github/workflows/shared/planning-ontology.md}}and{{#runtime-import .github/workflows/squad.md}}(previously asserted as the bareshared/planning-ontology.md/squad.md, which only held for the old, incorrect bare-workflows/test layout). Updated both literal assertions to match gh aw's genuine, verified behavior.gh aw compilesubprocess reliably takes ~2-3s, but can exceed vitest's 5s default under full-suite parallel resource contention on some machines - observed this directly while re-running the full suite for verification; this is a low-risk hardening of the exact test being touched, not scope creep).Local verification
npx vitest run test/gh-aw-quality.test.ts -t "strict-compiles": 1 passed, 78 skipped.gh-aw-quality.test.tsfile: the only remaining failures (12) are pre-existing, unrelated, Windows-onlyexecSync(..., { shell: '/bin/sh' })calls (Team Guard roster-row detection, Cast PR dedup jq filter) that ENOENT because/bin/shdoesn't exist on Windows. These are not caused by this change and were already confirmed (via the real failing CI run's logs) not to occur on Linux CI, where only this one dispatch-workflow test failed.npx vitest run(all ~272 test files, ~7500 tests) on this Windows dev machine: pre-existing, unrelated flakiness exists independent of this change (roughly 60-65 of 272 files fail even on a cleandevcheckout, mostly Windows//bin/shand environment-specific issues) - I confirmed this is not a regression by diffing my change against a stashed/reverted state and re-running. My diff is a single, 26-line change to one test's workspace setup and two literal assertions; nothing else was touched..github/agents/squad.agent.md. This is unrelated repo behavior (not part of my diff) - I reverted it every time it appeared and confirmed viagit diff --stat -wthat it is pure line-ending churn plus one unrelated version-stamp side effect, before committing.Note on why
devlooked green on the release gate despite thissquad-release.ymlrunsnode --test test/*.test.cjs, while PR CI runs vitest.test/gh-aw-quality.test.tsis a.tsfile the release gate's glob never sees, so this red vitest test did not blockdev -> mainpromotion (e.g. the v0.12.0 release-prep PR #1691 merged despite it). Worth knowing ifdevlooks green from the release workflow's perspective while PR CI disagrees.Confirming #1682 is untouched
git difffor this PR touches onlytest/gh-aw-quality.test.ts.workflows/squad.md'sdispatch-workflow,issue_number/aw_contextinputs, andbots:trigger are all present, unmodified, on this branch.workflows/squad-implement-worker.mdis unmodified.@bradygaster - flagging directly since you own #1682 and the dispatch-workflow feature; this PR only adjusts how the test verifies it compiles, it does not change the feature's behavior or configuration.