Skip to content

Implement cora watch — background file watcher (Phase 2) #436

Description

@ajianaz

Goal

Standalone cora watch command using notify crate for real-time file system watching.

Spec

cora watch                      # Watch current project, auto-reindex on change
cora watch --debounce 500ms     # Custom debounce window
cora watch --git-only           # Only trigger on git-tracked files
cora watch --verbose            # Log every event + reindex

Implementation

  1. Add notify crate dependency (cross-platform: inotify/FSEvents/kqueue)
  2. Watch project root recursively
  3. Debounce: collect events in 500ms window, then batch reindex
  4. Git-aware: ignore untracked files (.gitignore)
  5. Reindex: use existing incremental pipeline
  6. Signal handling: SIGTERM/SIGINT → clean shutdown

Dependencies

  • notify crate (~50KB compiled)
  • No new heavy deps

Acceptance

  • cora watch starts and detects file changes
  • Modifying a .rs file triggers reindex within 1s
  • .gitignore-ed files are ignored
  • Clean shutdown on Ctrl+C

Estimated Effort

3-5 days

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions