Skip to content

bug: upgrade --migrate-directory exits early, skips the actual upgrade #125

Closed

Description

@bradygaster

Problem

When a user runs npx github:bradygaster/squad upgrade --migrate-directory, the command:

  1. Renames .ai-team/ → .squad/
  2. Updates .gitattributes and .gitignore
  3. Scrubs email addresses
  4. Calls process.exit(0) and stops

The normal upgrade flow (copying squad.agent.md, updating workflows, writing .ai-team-templates/, running version-specific migrations) never runs.

Reproduction

Reproduced against bradygaster/SqncR (squad v0.3.0):

node squad-v050-index.js upgrade --migrate-directory
# Result: .ai-team/ renamed to .squad/, squad.agent.md still at v0.3.0

Expected vs Actual

Expected Actual
.ai-team/ → .squad/ ✅ ✅
squad.agent.md updated to v0.5.0 ✅ ❌ Still v0.3.0
Workflows updated ✅ ❌ Not updated
.ai-team-templates/ created ✅ ❌ Not created
Version-specific migrations run ✅ ❌ Not run

Root Cause

index.js line 1181: process.exit(0) terminates the process after directory migration, before the upgrade logic executes.

Fix

After the migration block completes successfully, fall through to the normal upgrade flow instead of exiting. The isMigrateDirectory flag should trigger the rename as a pre-step, not as an exclusive path.

Impact

Any user upgrading from .ai-team/-based installs (pre-0.5.0) to 0.5.0+ using the documented --migrate-directory flag ends up with a migrated directory structure but stale Squad files. The help text implies the flag works alongside upgrade, not instead of it.

Found by: Diagnostic run on SqncR — investigation triggered by reported 0.5.0 issues.

Activity

  1. bradygaster commented on Feb 20, 2026

    @bradygaster
    CollaboratorAuthor

    Fixed in v0.5.2. Removed \process.exit(0)\ from the \isMigrateDirectory\ block so that --migrate-directory\ now renames the directory as a pre-step and then falls through to the full upgrade flow (squad.agent.md, workflows, .ai-team-templates, migrations). Validated against bradygaster/SqncR.

  2. diberry commented on Mar 31, 2026

    @diberry
    Contributor

    🔄 Ralph status update: PR #725 has team review, CI green except changelog-gate. Labeled \squad:pr-reviewed. Awaiting Dina review.

  3. added 3 commits that reference this issue on Apr 2, 2026
    4386470
    925aafd
    2fef196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions