feat: use FSEvents for the UI live publisher on macOS
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
- 30/100
Hướng nghiên cứu
Start with armWatches in internal/uiserver/livepublish.go (around line 495) and newLivePublisher (around line 562), where the fsnotify watcher is created, then compare with the FSEvents backend in internal/watch/watcher_darwin.go. The main open question is the mapping from FSEvents flags to re-arm decisions, which the issue leaves undefined, so settle the design before coding. Done means the macOS publisher holds a fixed descriptor count regardless of files in .codegraph/store, and re-arming on Create, Remove and Rename still works.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What exists today?
The UI live publisher in internal/uiserver/livepublish.go watches the store with fsnotify. newLivePublisher (line 562) creates the watcher at line 568. armWatches (line 495) adds the watches on the deepest existing path of the chain [repoRoot, .codegraph, .codegraph/store] and on its parent. In a normal index, those paths are .codegraph/store and .codegraph.
How does it behave now?
On macOS, fsnotify uses kqueue. kqueue holds one file descriptor for every file in each watched directory. Each codegraph ui process therefore holds one descriptor per file in .codegraph/store and one per file in .codegraph. On 2026-10-31, this repository's index had 10 store files, and a larger index had about 95 store files.
The publisher needs only the signal that the store changed. It re-runs its change detector on any event, so the per-file watches add cost without adding information.
PR #229 moved the indexing watcher in internal/watch to FSEvents on macOS. The live publisher does not use that backend. Related: #227 (closed, the FSEvents change for the indexing watcher).
How should it behave?
On macOS, the live publisher must hold a fixed number of descriptors, independent of the file count in .codegraph/store. One non-recursive FSEvents stream on .codegraph meets that requirement.
The arming state machine in armWatches must keep working. It re-arms on Create, Remove and Rename, so a store replaced by rename is still seen. FSEvents watches by path and survives a replaced directory, but the mapping from FSEvents flags to re-arm decisions is not defined yet.
Two options are open. The first option reuses the darwin backend in internal/watch/watcher_darwin.go. That backend runs one recursive stream over the repo root, so it needs a non-recursive or filtered variant for .codegraph. The second option adds a small FSEvents stream in internal/uiserver, behind the same build tag as the watch backend.
What kind of improvement?
Performance
Would this change existing behavior?
No. The UI output does not change. The publisher still reacts to store changes and runs the same change detector.
Before submitting
- I searched existing issues and this is not a duplicate
- I checked that the current behavior is not a deliberate decision in
openspec/specs/
- 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