Skip to content

fix: freeze boundary check silently blocks edits through symlinks#781

Open
km-git007 wants to merge 2 commits intogarrytan:mainfrom
km-git007:fix/freeze-silently-blocks-symlinks
Open

fix: freeze boundary check silently blocks edits through symlinks#781
km-git007 wants to merge 2 commits intogarrytan:mainfrom
km-git007:fix/freeze-silently-blocks-symlinks

Conversation

@km-git007
Copy link
Copy Markdown

What

The /freeze skill's boundary check silently blocks legitimate edits when symlinks are involved. When a user sets the freeze boundary to a symlinked directory (e.g., /home/user/project_link/home/user/real_project), attempting to edit a file accessed via the real path gets blocked with no warning.

Why

Two root causes:

  1. Skill saves symlink paths unresolved: Used pwd instead of pwd -P
  2. Hook doesn't fully resolve symlinks: _resolve_path() left symlinks in final path component unresolved

How

  • Commit 1: Improved _resolve_path() in freeze/bin/check-freeze.sh to resolve symlinks by cd'ing into directories
  • Commit 2: Changed pwd to pwd -P in skill, updated docs

Testing

Verified: symlinked freeze boundaries now allow edits via the real path

Notes

  • Two-commit approach for clarity
  • Backwards compatible; no breaking changes
  • Defensive fix works with both old and new configs

Kaustav Mishra added 2 commits April 3, 2026 18:57
The _resolve_path() function now properly handles symlinks by cd'ing into
directories and using pwd -P to resolve them canonically. Previously, it
would resolve parent directories but leave symlinks in the final component
unresolved, causing the boundary check to silently block legitimate edits
when symlinks were involved.

The fix detects if the input is a directory and resolves it in one go,
rather than splitting into dirname/basename which loses symlink information
in the final component.

This prevents silent failures where editing a file accessed via a symlink
(e.g., /home/user/project_link/file.txt) would be blocked even though
/home/user/project_link was set as the freeze boundary.
Change pwd to pwd -P when saving the freeze directory, ensuring that if
a user provides a symlink path (e.g., /home/user/project_link), it gets
stored as the canonical real path. This prevents the hook from silently
blocking edits when the file is accessed via the symlink.

Aligns the skill's path resolution with the improved hook behavior.
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