Skip to content

fix(cli): squad doctor — add casting dir to upgrade, improve global install warnings - #823

Merged
diberry merged 2 commits into
devfrom
fix/squad-doctor-issues
Apr 4, 2026
Merged

diberry merged 2 commits into
devfrom
fix/squad-doctor-issues

Conversation

@diberry

@diberry diberry commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes 3 issues found during v0.9.1 insiders testing:

  1. Bug: \squad upgrade\ doesn't create .squad/casting/\ directory — added to ENSURE_DIRECTORIES and scaffold defaults
  2. UX: Doctor warns about missing vscode-jsonrpc and copilot-sdk in global installs — clarified messaging
  3. Investigated: \squad version\ command routing — confirmed correct, may be shell-specific

Related Issues

Related PRDs

Root Cause

\squad init\ and \squad upgrade\ are two code paths that should produce the same scaffolding but are maintained independently with no shared contract. When casting was added to init (Mar 23), the upgrade path was never updated. See retro analysis in #817.

Found by Brady during insiders install.

Copilot AI review requested due to automatic review settings April 4, 2026 18:16
@github-actions

github-actions Bot commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit b71e8a3

⚠️ 3 item(s) to address before review

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 Changeset file found
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved 6 active Copilot thread(s) resolved (4 outdated skipped)
❌ CI passing 15 check(s) still running

This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

github-actions Bot commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

⚠️ Architectural review: 1 warning(s).

Severity Category Finding Files
🟡 warning bootstrap-area 1 file(s) in the bootstrap area (packages/squad-cli/src/cli/core/) were modified. These files must maintain zero external dependencies. Review carefully. packages/squad-cli/src/cli/core/upgrade.ts

Automated architectural review — informational only.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses insiders-testing issues around upgrade scaffolding and doctor output, ensuring older repos get the newer casting directory/files and making global-install diagnostics less noisy.

Changes:

  • Add .squad/casting/ to the upgrade directory ensure list and scaffold default casting state files during squad upgrade.
  • Downgrade certain “missing node_modules dependency” doctor results from warn to info with updated messaging and reporting.
  • Add inline documentation in the CLI entrypoint about version routing investigation results.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/squad-cli/src/cli/core/upgrade.ts Ensures .squad/casting/ exists and scaffolds default casting JSON files during upgrade.
test/cli/upgrade.test.ts Adds coverage for casting directory creation, default scaffolding, non-overwrite behavior, and upgrade behavior for older repos.
packages/squad-cli/src/cli/commands/doctor.ts Adds info status to doctor checks and updates output summary/icon mapping and messaging.
test/cli/doctor.test.ts Updates expectations to match info severity and revised messaging for global installs.
packages/squad-cli/src/cli-entry.ts Adds comments clarifying the investigation into version command routing reports.

@github-actions

github-actions Bot commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #823

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 6
Files added 1
Files modified 5
Files deleted 0
Modules touched 3

🎯 Risk Factors

  • 6 files changed (6-20 → MEDIUM)
  • 3 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • .changeset/fix-doctor-casting-upgrade.md
squad-cli (3 files)
  • packages/squad-cli/src/cli-entry.ts
  • packages/squad-cli/src/cli/commands/doctor.ts
  • packages/squad-cli/src/cli/core/upgrade.ts
tests (2 files)
  • test/cli/doctor.test.ts
  • test/cli/upgrade.test.ts

This report is generated automatically for every PR. See #733 for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

…stalls

- ensureCastingDefaults() accepts optional templatesDir param to avoid
  redundant getTemplatesDir() call when invoked from runEnsureChecks()
- checkVscodeJsonrpcExports() distinguishes local dev (node_modules
  present → warn with remediation) from global install (→ info)
- checkCopilotSdkSessionPatch() applies the same global vs local logic

Resolves 3 unresolved Copilot review comments on PR #823.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

@bradygaster bradygaster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than addressing Copilot's reviews, LGTM

@bradygaster

Copy link
Copy Markdown
Collaborator

thank you @diberry!

@diberry
diberry merged commit 2f807d6 into dev Apr 4, 2026
17 checks passed
@diberry
diberry deleted the fix/squad-doctor-issues branch April 4, 2026 21:04
diberry added a commit that referenced this pull request Apr 4, 2026
Verifies init and upgrade produce equivalent scaffolding.
Tests ENSURE_DIRECTORIES coverage, casting defaults, and .gitattributes.

Closes #822
Related: #817, #823

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 4, 2026
Verifies init and upgrade produce equivalent scaffolding.
Tests ENSURE_DIRECTORIES coverage, casting defaults, and .gitattributes.

Closes #822
Related: #817, #823

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher added a commit that referenced this pull request Apr 5, 2026
Verifies init and upgrade produce equivalent scaffolding.
Tests ENSURE_DIRECTORIES coverage, casting defaults, and .gitattributes.

Closes #822
Related: #817, #823

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tamir Dresher <tamir.dresher@gmail.com>
diberry added a commit that referenced this pull request Apr 8, 2026
FR-2: Extended parity test suite with parametric ENSURE_DIRECTORIES tests,
casting/sessions recreation, pre-casting repo simulation, and doctor validation.
FR-3: Added upgrade-doctor-check CI job triggered on init/upgrade/doctor changes.
FR-7: Centralized global install detection in doctor, improved ESM check messaging.

FR-1 (casting fix) already merged via PR #823.
FR-4/5/6 (SDK compat) handled in #818.

Closes #817

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): doctor ESM checks should clarify global install context fix(cli): add .squad/casting to ENSURE_DIRECTORIES in upgrade.ts

3 participants