Skip to content

Implement manifest watcher #74

@2witstudios

Description

@2witstudios

Epic 4: WebSocket & Real-Time Push — Issue 2/3

Source: 2-agent watcher pattern

Description

Dual-source manifest change detection that broadcasts updates to connected WebSocket clients.

Acceptance Criteria

  • fs.watch on manifest.json with 300ms debounce
  • Status polling at 3s interval (calls checkAgentStatus() for live status)
  • Tracks previous agent statuses — sends individual agent:status events on change
  • Broadcasts full manifest:updated event on manifest file change
  • Graceful error handling for in-flight writes (manifest may be partially written)
  • Cleanup on server shutdown
  • Tests: debounce, status change detection, broadcast

Dependencies

Files to Create/Modify

  • src/server/ws/watcher.ts (new)
  • src/server/ws/watcher.test.ts (new)

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:websocketEpic 4: WebSocket & Real-Time PushmobilePPG Mobile project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions