Skip to content

fix(cli): squad init --global creates files in personal-squad/ directory#641

Closed
diberry wants to merge 6 commits intobradygaster:devfrom
diberry:squad/53-fix-global-init
Closed

fix(cli): squad init --global creates files in personal-squad/ directory#641
diberry wants to merge 6 commits intobradygaster:devfrom
diberry:squad/53-fix-global-init

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Mar 26, 2026

Global init was creating the full squad structure at ~/.config/squad/.squad/ instead of ~/.config/squad/personal-squad/. This broke personal agent discovery because resolvePersonalSquadDir() looks in personal-squad/.

  • Fix init.ts to early-return for global init, targeting personal-squad/
  • Simplify dest in cli-entry.ts (no dead code)
  • Sandbox all tests (env override to temp dir)
  • 7 new tests, 52 total pass

Team review: Flight ✅, FIDO ✅ (was ❌, fixed by CONTROL), Procedures ✅

Closes diberry#53

@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 26, 2026

@bradygaster Ready for your review — team-approved with 3-reviewer gate (Flight, FIDO, Procedures).

larsontim12 pushed a commit to larsontim12/squad that referenced this pull request Mar 27, 2026
* test(shell): add auto-cast trigger and /init command coverage

35 new tests in test/init-autocast.test.ts covering the P0/P1 init
reliability fixes from PR bradygaster#640:

- hasRosterEntries predicate: 7 tests (populated/empty/missing Members)
- Auto-cast trigger conditions: 6 tests (fire/no-fire matrix)
- Orphan .init-prompt cleanup: 3 tests (delete/preserve logic)
- /init command triggerInitCast signal: 7 tests (with args/no args/edge)
- triggerInitCast App.tsx dispatch contract: 3 tests (shape/exclusion)
- activeInitSession Ctrl+C abort lifecycle: 5 tests (abort/clear/error)
- handleInitCast .init-prompt consumption: 4 tests (override/cleanup)

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

* docs(hockney): log auto-cast test coverage learnings

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

* feat(shell): P2 cast confirmation before team creation

After the coordinator proposes a team via handleInitCast, the REPL now
shows the formatted proposal and waits for the user to confirm (y/yes)
or reject (n/no) before calling createTeam.

Confirmation is skipped when:
- Auto-cast fires from .init-prompt (user ran squad init "prompt")
- /init "prompt" command (explicit user action)

Freeform REPL messages hitting an empty roster now pause for approval,
preventing garbage casts from vague or accidental prompts.

Implementation:
- pendingCastConfirmation state holds proposal + original parsed input
- handleDispatch intercepts y/n before normal routing
- finalizeCast() extracted as shared helper for both paths
- handleCancel clears pending state on Ctrl+C
- skipCastConfirmation flag on ParsedInput for /init trigger

Closes bradygaster#641

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

* docs: update Fenster history and decision for cast confirmation

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot bot added 6 commits March 27, 2026 13:40
Fork-specific workflow skills for PR hygiene:
- fork-first-pipeline: review on fork before opening upstream PRs
- bleed-check: twice-daily cross-branch audit for stowaway files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds Step 5.5 REBASE with guidance on rebasing feature branches against origin/dev to avoid full-file rewrites on shared files. Includes Shared File Strategy for surgical additions and When Rebase Fails recovery steps. Updates anti-patterns table to flag 'Skip rebase before upstream'.

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

- Fork-first-pipeline: Added serial branch operations warning, force-add note for gitignored skills, stale comments check
- Bleed-check: Added high-risk shared files callout, convention gate checks, CI path debugging pattern

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Dual Reviewer Gate: both Flight and FIDO must approve
- Convention Issues Are Blockers: /docs/ prefix, double blanks, table order, whitespace
- Review→Fix→Re-review Loop: both reviewers must re-review after fixes
- Reviewer Lockout: locked authors cannot self-fix after rejection
- Known PAO Quirks: watch for .squad/ files, /docs/ prefix, verification before push
- Review Comments: formal PR comment format and verdict options
- Tamir Reviewer Rule: only on upstream PRs with source material
- Commit Hygiene: one commit, amend fixups, force-push safely, verify before push

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When a PR completes the full fork pipeline (Flight+FIDO approved, bleed check passed, squashed, rebased, moved to upstream targeting Brady's dev), the upstream PR should be undrafted immediately.

The upstream PR is the final presentation — draft PRs signal incomplete work, but at this stage all iteration is finished on the fork.

Add gh pr ready command to Step 7 (UPSTREAM) as the final action after opening the upstream PR.

Add anti-pattern entry for leaving upstream PRs in draft.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Global init was creating the full squad scaffold at ~/.config/squad/.squad/
instead of ~/.config/squad/personal-squad/. This broke personal agent
discovery because resolvePersonalSquadDir() looks in personal-squad/.

- Add early return in runInit() for isGlobal that bootstraps personal-squad/
  with agents/, casting/, skills/, and config.json via ensurePersonalSquadDir()
- Update dest in cli-entry.ts to target personal-squad/ for global init
- Skip full sdkInitSquad scaffold for global init (no .squad/ at global root)
- Add 7 tests verifying correct file placement and no .squad/ pollution
- Update cli-global.test.ts to match new routing logic

Closes #53

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/53-fix-global-init branch from 8f86f41 to 20f9f2e Compare March 27, 2026 21:12
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 27, 2026

Closing as duplicate — Brady merged the same fix in #620 (getPersonalSquadRoot).

@diberry diberry closed this Mar 27, 2026
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.

squad init --global creates files in wrong location (.squad/ instead of personal-squad/)

1 participant