Skip to content

fix(ignore): prevent case-insensitive ignore rule bypass - #5

Merged
mevarx merged 1 commit into
mevarx:mainfrom
SultanGun:fix/case-insensitive-ignore-rules
Oct 28, 2026
Merged

mevarx merged 1 commit into
mevarx:mainfrom
SultanGun:fix/case-insensitive-ignore-rules

Conversation

@SultanGun

Copy link
Copy Markdown
Contributor

Summary

Prevent ignored files from being accessed through alternate casing on case-insensitive filesystems.

Problem

Ignore rules could be bypassed by changing the capitalization of a file or directory path on Windows and macOS. This could allow file tools to access files that should remain ignored.

Changes

  • Add a shared platform policy for case-insensitive filesystem handling.
  • Normalize ignore patterns and candidate paths consistently on Windows and macOS.
  • Add matcher tests for filenames, directories, globs, negation, and Linux case-sensitive behavior.
  • Add integration tests for FileReadTool, FileWriteTool, and FilePatchTool to prevent alternate-case bypasses.

Verification

  • go test ./internal/ignore -v -count=1
  • go test ./internal/tools -run "^TestTools_IgnoreRules" -v -count=1
  • go vet ./...
  • gofmt -l .
  • Linux and macOS cross-compilation checks passed.

The full Windows tools test suite has known file-sharing violation failures in tests involving file writes. The affected write implementation is unchanged by this PR; the issue is being addressed separately.

Scope

This PR addresses ignore-rule enforcement only. It does not include the separate Windows file-sharing retry fix.

@mevarx
mevarx merged commit 15c3133 into mevarx:main Oct 28, 2026
5 checks passed
Repository owner locked and limited conversation to collaborators Oct 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants