Skip to content

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

Merged
hatayama merged 3 commits into
v3-betafrom
fix/hatayama/normalize-cli-only-root-casing
Jul 8, 2026
Merged

hatayama merged 3 commits into
v3-betafrom
fix/hatayama/normalize-cli-only-root-casing

Conversation

@hatayama

@hatayama hatayama commented Jul 8, 2026 •

Copy link
Copy Markdown
Owner

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.

hatayama added 2 commits July 8, 2026 21:36
Route both current-project and CLI-only source-root comparisons through one platform-aware seam while preserving the existing ordinal comparison. Passing the runtime platform explicitly keeps the upcoming path identity policy free of hidden environment dependencies.
Treat differently cased paths as identical for Windows and macOS editor sessions while retaining ordinal identity on Linux. This prevents the CLI-only source gate from dropping equivalent current-project paths on the default case-insensitive filesystems.

Add a deterministic three-platform contract test. Per-volume filesystem probing is intentionally avoided because it would add I/O and complexity to a narrow source-discovery gate.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

SkillSourceRootEnumerator's path comparison logic is refactored to use a new platform-aware HaveSamePathIdentityAtPlatform helper, applying case-insensitive comparison on Windows/macOS editors and case-sensitive comparison elsewhere. A new parameterized test validates this behavior across platforms.

Changes

Platform-aware path identity

Layer / File(s) Summary
Path identity helper and call sites
Packages/src/Editor/Infrastructure/SkillSetup/SkillSourceRootEnumerator.cs
Adds internal HaveSamePathIdentityAtPlatform method that compares full paths using OrdinalIgnoreCase for WindowsEditor/OSXEditor and Ordinal otherwise; GetCliOnlySkillSourceRoot and IsCliOnlySkillSourceRoot now use this helper instead of a fixed ordinal comparison.
Cross-platform casing test
Assets/Tests/Editor/SkillInstallLayoutTests.cs
Adds a parameterized NUnit test verifying that casing-differing paths are treated as identical on WindowsEditor/OSXEditor but distinct on LinuxEditor.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main fix: preserving CLI-only skill discovery when project path casing differs.
Description check ✅ Passed The description is detailed and directly related to the path-casing discovery fix and its tests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hatayama/normalize-cli-only-root-casing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Path.GetFullPath preserves trailing directory separators, so equivalent project roots could still fail the centralized identity check. Normalize optional trailing separators while retaining filesystem roots such as slash and drive roots.

Add three-platform regression coverage for trailing-separator equivalence.
@hatayama
hatayama merged commit fcd6a20 into v3-beta Jul 8, 2026
10 checks passed
@hatayama
hatayama deleted the fix/hatayama/normalize-cli-only-root-casing branch July 8, 2026 12:54
@github-actions github-actions Bot mentioned this pull request Jul 11, 2026
RyanXie123 pushed a commit to RyanXie123/unity-cli-loop that referenced this pull request Sep 22, 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.

1 participant