fix: a running watcher keeps writing through .codegraph after a pull turns it into a symlink
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by reading query.IndexDirs and trace how the watcher started by codegraph serve --mcp with auto-sync and codegraph daemon start flushes or swaps the store. Review #374 and #364 for the existing path checks and store swap behavior. Reproduce the checkout replacing .codegraph/store with an external symlink, then confirm the watcher refuses to write through it before each flush or swap.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
A running watcher keeps writing index data through .codegraph after a pull or checkout replaces that directory with a symlink.
When a command or daemon.New starts, the root .codegraph and .codegraph/store paths are checked once (#374). A long-running watcher never checks them again. This applies to codegraph serve --mcp with auto-sync and to codegraph daemon start.
.codegraph is ignored by .gitignore because of the * inside it. When a commit adds .codegraph or .codegraph/store as a symlink, Git replaces the real directory without a warning.
The next flush or store swap then follows the new link. Depending on the target, it can:
- rewrite the index of another project,
- replace or delete the contents of another store, or
- create a store at a dangling target outside the repository.
The Git half was observed. The codegraph half is not reproduced. It is a static trace from the security lane of the suite review of #374, rated medium.
Related: #372 (the start-up finding) and #364 (the store swap through a symlinked store directory).
What you expected instead
Before each flush or store swap, the watcher checks the index paths again with query.IndexDirs. If they now resolve outside the repository, the watcher stops with the same refusal error that a command gives.
Another option is to record the resolved paths at watcher start. Before each flush or swap, the watcher compares them with the current resolution and stops on any change.
Steps to reproduce
The Git half was observed with steps 1 to 4. Steps 5 and 6 cover the codegraph half, which is not yet reproduced.
cd <repo>, a repository with a built index in.codegraph.codegraph daemon start- Commit a symlink at
.codegraph/storethat points to a directory outside the repository. git checkout <commit that adds the symlink>- If the checkout replaces the real
.codegraph/storedirectory, edit a source file so the watcher flushes. - Check whether the watcher writes into the symlink target.
Version
Built from source at main (commit d8517c46).
Platform
macOS (Darwin 27.2.0).
How did you install it?
Built from source
Languages in the affected repository
Not applicable.
Before submitting
- I searched existing issues and this is not a duplicate
- I checked the capability matrix and this is not a documented limitation
- This is not a security vulnerability
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 0
- Merge trung bình
- 7 giờ 42 phút
- Pull request đã merge (30 ngày)
- 111
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của seanb4t/codegraph-go
-
chore needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
seanb4t/codegraph-go#380 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
seanb4t/codegraph-go#379 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query chore needs-triage spec-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
seanb4t/codegraph-go#377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
seanb4t/codegraph-go#362 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
seanb4t/codegraph-go#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của seanb4t/codegraph-go
Issue tương tự
-
Add iterate GmbH domains to a dedicated list and include it in company and developer categoriesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
v2fly/domain-list-community#4307 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without boundĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mattabate/life-distributable#232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày