Allow verified linked worktrees under ~/.config#1293
Open
WangErgouaaaa wants to merge 1 commit into
Open
Conversation
Agent harnesses place legitimate task worktrees below ~/.config, which the sensitive-path guard previously rejected wholesale. Permit only Git-linked worktrees whose standard main checkout is outside every protected home directory, while preserving the block for ordinary config paths and all other sensitive roots. Constraint: ~/.ssh, ~/.gnupg, and ~/.aws must remain unconditional denials Rejected: Allow every Git repository under ~/.config | ordinary repositories there are still configuration data and should remain protected Confidence: high Scope-risk: narrow Directive: Do not widen this exception beyond verified linked worktrees without equivalent boundary tests Tested: security and worktree suites; full build; full suite 2373 passed with 2 host EMFILE watcher failures unrelated to this change Not-tested: Windows linked-worktree layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CodeGraph currently rejects every project path below
~/.configas sensitive. Agent harnesses can legitimately place task-owned Git linked worktrees there, so those worktrees cannot be indexed even when their main checkout is outside every protected home directory.This change permits only that verified linked-worktree case while retaining the existing denial for ordinary config directories and for
.ssh,.gnupg, and.aws.Security boundary
The exception requires all of the following:
.gitfile.gitdirectoryAn ordinary directory or standalone repository below
~/.configremains blocked.Test plan
npm run buildnpx vitest run __tests__/security.test.ts __tests__/worktree-detection.test.ts— 63 passed, 2 skipped~/.configis accepted while an ordinary config directory is rejectedgit diff --checkFull-suite note
The local full suite reached 2373 passed and 4 skipped. Two filesystem-watcher tests timed out after the host reported
EMFILE: too many open files; rerunning those tests alone reproduced the same host-level watcher exhaustion.