feat: use FSEvents for the UI live publisher on macOS
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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/
- Lenguaje dominante
- Go
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 7 h 42 min
- PR fusionados (30 d)
- 111
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de seanb4t/codegraph-go
-
chore needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
seanb4t/codegraph-go#380 ·
Los mantenedores suelen responder en 1 día
-
chore needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
seanb4t/codegraph-go#379 ·
Los mantenedores suelen responder en 1 día
-
area:query chore needs-triage spec-needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
seanb4t/codegraph-go#377 ·
Los mantenedores suelen responder en 1 día
-
chore needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
seanb4t/codegraph-go#362 ·
Los mantenedores suelen responder en 1 día
-
area:query bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
seanb4t/codegraph-go#355 ·
Los mantenedores suelen responder en 1 día
Todos los issues de seanb4t/codegraph-go
Issues similares
-
Add iterate GmbH domains to a dedicated list and include it in company and developer categoriesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
v2fly/domain-list-community#4307 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without boundAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mattabate/life-distributable#232 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día