Skip to content

docs: add case-insensitive path comparison to windows-compatibility skill#574

Merged
bradygaster merged 1 commit intobradygaster:devfrom
diberry:squad/update-windows-compat-skill
Mar 23, 2026
Merged

docs: add case-insensitive path comparison to windows-compatibility skill#574
bradygaster merged 1 commit intobradygaster:devfrom
diberry:squad/update-windows-compat-skill

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Mar 23, 2026

Why

During StorageProvider Phase 1, we built a path confinement system (rootDir and assertSafePath) that used \String.startsWith()\ to verify paths stay within bounds. This passed 4 rounds of security review by RETRO, architectural review by Flight, and test review by FIDO.

None of them caught that \startsWith()\ is case-sensitive, but Windows and macOS (HFS+) are case-insensitive. A path like \c:\Users\temp\file.txt\ would be incorrectly blocked when rootDir was \C:\Users\temp.

The existing \windows-compatibility\ skill — which has high confidence and was earned from multiple prior bugs — covered timestamps (colons in filenames), git commands (\git -C\ failures), commit messages (PowerShell newlines), and path construction (\path.join\ vs manual concatenation). But it said nothing about path comparison semantics.

What

Adds a new \Path Comparison (Case Sensitivity)\ section with:

  • Platform detection pattern (\process.platform === 'win32' || process.platform === 'darwin')
  • \pathStartsWith()\ helper that lowercases on case-insensitive platforms
  • Anti-pattern example showing the exact bug we hit
  • Note that Linux is case-sensitive and must NOT be lowercased

Updated in both template locations (squad-sdk and squad-cli) for template sync.

Impact

Future agents working on any path comparison code will see this pattern via skill-aware routing, preventing the same class of bug from recurring.

squad obo dina

…kill

During StorageProvider Phase 1, a cross-platform audit found that
startsWith() is case-sensitive but Windows and macOS filesystems
are case-insensitive. This gap was missed by 4 rounds of security
review because the existing skill covered timestamps, git commands,
and path separators — but not path comparison semantics.

Adding platform-aware comparison pattern and anti-pattern example
so future agents catch this automatically via skill-aware routing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 23, 2026

Team-reviewed and approved by Flight and FIDO. Ready for your eyes @bradygaster. squad obo dina

@bradygaster bradygaster merged commit 5754367 into bradygaster:dev Mar 23, 2026
2 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.

3 participants