fix(gh-aw): preserve Squad CLI install contract - #1887
Conversation
Closes #1884 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 220886ad-9f6f-4397-82da-1b5a56822601
🟡 Impact Analysis — PR #1887Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affecteddocs (1 file)
root (1 file)
tests (2 files)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 2 commits — consider squashing before review |
| ✅ | 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 (4 files, +89 −24)
| File | +/− |
|---|---|
docs/src/content/docs/guide/gh-aw.md |
+1 −1 |
test/gh-aw-quality.test.ts |
+35 −5 |
test/squad-cli-pin.test.ts |
+24 −6 |
workflows/shared/squad.md |
+29 −12 |
Total: +89 −24
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
🟡 Changes recommended
The current health gating check can silently treat “squad not found / help failed” as “health unsupported” and proceed, which can mask real bootstrap failures in CI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the gh-aw shared Squad bootstrap to preserve the selected Squad CLI version through compilation by installing the CLI once via npm install --global --prefix $RUNNER_TEMP/..., binding SQUAD_CLI_VERSION at the step level, and gating squad health until a published release containing that command is available. It also adds regression tests covering both the source shared component and the compiled lock output, plus updates docs for the new default pin.
Changes:
- Install Squad CLI once in activation pre-steps via
npm install --global --prefix "$RUNNER_TEMP/..."and add its bin dir toGITHUB_PATH. - Bind
SQUAD_CLI_VERSIONon the install step (instead of job-level env) so gh-aw compilation preserves it; switch init/health to use the installedsquadbinary. - Add regression tests verifying the compiled workflow retains the version binding and install contract; update docs default pin to
0.12.0.
File summaries
| File | Description |
|---|---|
| workflows/shared/squad.md | Moves CLI version binding to step env, installs the CLI globally under $RUNNER_TEMP, and gates squad health until supported. |
| test/squad-cli-pin.test.ts | Adds assertions ensuring the install step binds SQUAD_CLI_VERSION and the source no longer uses npx-based invocation. |
| test/gh-aw-quality.test.ts | Adds compiled-output regression coverage for preserved version binding and install contract; updates health/init expectations for global install. |
| docs/src/content/docs/guide/gh-aw.md | Updates documented default SQUAD_CLI_VERSION to 0.12.0. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| set -euo pipefail | ||
| if squad help | grep -Fq 'Validate team state for CI'; then | ||
| squad health --json | ||
| else | ||
| echo "::warning::Squad CLI ${SQUAD_CLI_VERSION} predates the health command; the readiness gate will activate after the next published CLI pin." |
…all fixes Complete the 0.13.0 release notes to cover: - The gh-aw install contract fix (bradygaster#1887) and full hardening wave - squad-deps-worker new dependency manifest worker - Activation pin drift guard and auto-update on release - All workflow router, dispatch, and planning lifecycle fixes - CLI: squad health, watch stop signals, externalized state, archival, CRLF - SDK: scheduler Windows paths, FSStorageProvider rootDir, ADO URL decode Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Summary
npm install --globalin a runner-temporary prefix so package postinstall patches always executeSQUAD_CLI_VERSIONon the install step so gh-aw compilation preserves the selected version0.12.0) and capability-gatesquad healthuntil the release containing it is published32900470947Closes #1884
Validation
node node_modules\vitest\vitest.mjs run test/squad-cli-pin.test.ts test/gh-aw-quality.test.ts -t '#1884'— 3 passednode node_modules\vitest\vitest.mjs run test/squad-cli-pin.test.ts— 11 passedgh aw compile squad squad-implement-worker squad-deps-worker --strict --approve --no-check-updatein the downstream.github/workflowslayout — 3 compiled successfully; compiled lock inspection confirmed the version binding and global install commandSKIP_BUILD_BUMP=1 npm run build— passed for SDK and CLInpm install --global --prefix <temp> @bradygaster/squad-cli@0.12.0— installed0.12.0and confirmed the compatibility path is required because that published release does not exposehealthRelease dependency
The full readiness gate activates automatically once a stable CLI containing
squad healthis published and the existing release automation advances the activation pin. Until then, activation uses the published0.12.0global install, emits an explicit warning, and continues instead of failing on an unavailable command.No changeset is required because this PR does not modify
packages/squad-cli/src/orpackages/squad-sdk/src/.Security review
No secrets, actions, permissions, or redirect targets were added or removed. The existing GitHub token expressions are unchanged. The repository-controlled version value is passed through a quoted environment expansion into a fixed npm package name, and the global installation is scoped to
$RUNNER_TEMPrather than a system-wide prefix.