fix: CLI-only skills remain discoverable when project path casing differs

Merged
HA
3mo ago
+79-7

Summary

  • CLI-only skills remain discoverable when the current project path uses different letter casing on Windows or macOS.
  • Linux keeps case-sensitive path identity.

User Impact

  • Previously, the CLI-only source gate compared normalized project paths with an ordinal string comparison. Equivalent project paths with different casing could therefore be rejected on the default case-insensitive Windows and macOS filesystems.
  • Discovery now follows the editor platform's path identity policy: case-insensitive on Windows/macOS and ordinal on Linux.

Changes

  • Extracted both CLI-only path comparisons into one helper that receives the runtime platform explicitly.
  • Kept the extraction behavior-preserving in its own commit, then applied the platform policy in a second commit.
  • Added a deterministic Windows/macOS/Linux contract test.
  • Normalize optional trailing directory separators while preserving filesystem roots.
  • Kept Go unchanged because its CLI-only source path has no current-project identity gate.
  • Avoided per-volume filesystem probing because it would add I/O and complexity to a narrow source-discovery gate.

Test Scope Note

  • A final skill-set integration test cannot observe this gate failure in the repository checkout: when the dedicated CLI-only root is rejected, Packages/src is still enumerated later as a direct package root and rediscovers the same Editor/CliOnlyTools~ files. The attempted integration test passed before the fix and was removed because it did not constrain the faulty comparison.
  • The contract test targets the actual path identity seam used by both GetCliOnlySkillSourceRoot and IsCliOnlySkillSourceRoot.

Verification

  • TDD Red: with the extracted ordinal-only helper, the Windows and macOS cases failed while Linux passed (2 failed, 1 passed).
  • TDD Green: all three platform cases passed after applying the policy.
  • Review TDD Red/Green: trailing-separator equivalence failed on all three platform cases before normalization and passed afterward.
  • Repo-local Unity compile: 0 errors, 0 warnings.
  • SkillInstallLayoutTests: 19 passed.
  • ToolSkillSynchronizerTests: 52 passed.
  • git diff --check.

Review Response

  • Accepted cubic's trailing-separator finding after confirming in the active Unity runtime that Path.GetFullPath preserves the separator. The fix uses root-safe normalization rather than a plain TrimEnd that could collapse / or a drive root.

Compatibility

  • Source discovery ordering and wire formats are unchanged, so no protocol version bump is required.