Skip to content

fix(doctor): compare real paths in the bridge check; macOS-stable tests - #2494

Merged
bradygaster merged 1 commit into
devfrom
squad/macos-path-spellings
Nov 13, 2026
Merged

bradygaster merged 1 commit into
devfrom
squad/macos-path-spellings

Conversation

@bradygaster

Copy link
Copy Markdown
Collaborator

Follow-up to #2492. Six tests still failed on macOS after #2492. One was a real squad doctor bug; the rest were test assumptions.

squad doctor (product fix)

The bridge check compares the team folder that squad_state_health reports with the one doctor expects. The bridge reports it resolved (/private/var/...) and doctor expected the original spelling (/var/...), so the check failed with "bridge resolved X, expected Y" whenever the folder had two spellings. On macOS that includes anything under the temp folder. It now compares real paths. This caused the upgrade-profile-teamroot failure.

Tests

  • upstream-source-hardening: the CLI clones into the resolved path, so the test now resolves its temp folder too.
  • profile-fs-guard: the guard creates its root under the resolved temp folder, and the check now compares against that.
  • export-import: on macOS it redirected HOME, but XDG_CONFIG_HOME (which the test harness always sets) takes precedence. It now redirects XDG_CONFIG_HOME on every POSIX platform.

Result

Local full suite on macOS: 26 failures before #2492, now 3. All 3 are known timing flakes that pass when re-run alone (e2e-integration and two gh-aw-install-staging tests).

🤖 Generated with Claude Code

- squad doctor: the bridge reports its team dir resolved (/private/var/...)
  while doctor expected the unresolved spelling (/var/...), so the check
  failed on macOS temp and symlinked folders. Compare real paths.
- Tests that assumed os.tmpdir() is already resolved, or that macOS ignores
  XDG_CONFIG_HOME, now hold on macOS: upstream-source-hardening,
  profile-fs-guard, export-import.

Local full suite on macOS: 26 failures before #2492, now 0 besides timing
flakes that pass when re-run alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bradygaster
bradygaster enabled auto-merge (squash) November 13, 2026 09:54
Copilot AI dynamic review requested due to automatic review settings November 13, 2026 09:54
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2494

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 (2 files)
  • .changeset/doctor-real-paths.md
  • CHANGELOG.md
squad-cli (1 file)
  • packages/squad-cli/src/cli/commands/doctor.ts
tests (3 files)
  • test/cli/export-import.test.ts
  • test/cli/upstream-source-hardening.test.ts
  • test/profile-fs-guard.test.ts

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

@github-actions

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

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

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 2 item(s) to address before review

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

Files Changed (6 files, +20 −11)

File +/−
.changeset/doctor-real-paths.md +5 −0
CHANGELOG.md +1 −0
packages/squad-cli/src/cli/commands/doctor.ts +7 −4
test/cli/export-import.test.ts +3 −5
test/cli/upstream-source-hardening.test.ts +2 −1
test/profile-fs-guard.test.ts +2 −1

Total: +20 −11


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements 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.

🟢 Approval recommended

No active review issues were identified for the bridge path-resolution fix and related test adjustments.

No open issues 🎉

What changed in this PR

Follow-up to #2492 that fixes false squad doctor bridge failures when symlinked paths identify the same team folder, and adjusts tests for macOS path and configuration behavior.

Changes:

  • Compare resolved team-directory paths in the bridge check.
  • Align test setup and assertions with resolved temporary paths and XDG_CONFIG_HOME precedence.
  • Document the fix and add a CLI patch changeset.
File Description
test/​profile-fs-guard.test.ts Resolve the temporary directory used in the guard assertion.
test/​cli/​upstream-source-hardening.test.ts Resolve the test directory to match CLI clone paths.
test/​cli/​export-import.test.ts Redirect XDG_CONFIG_HOME on all POSIX platforms.
packages/​squad-cli/​src/​cli/​commands/​doctor.ts Compare real paths when validating the bridge’s team directory.
CHANGELOG.md Document the bridge-check fix.
.changeset/​doctor-real-paths.md Add a patch release entry for the CLI.

Review effort: Balanced (dynamic)

@bradygaster
bradygaster merged commit d8f4187 into dev Nov 13, 2026
32 checks passed
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.

2 participants