Skip to content

feat(drive): emit drive_sync_progress events during watch sync#76

Merged
yurenju merged 1 commit into
mainfrom
claude/drive-sync-progress
Jul 8, 2026
Merged

feat(drive): emit drive_sync_progress events during watch sync#76
yurenju merged 1 commit into
mainfrom
claude/drive-sync-progress

Conversation

@yurenju

@yurenju yurenju commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What

wspc drive watch --json now emits incremental drive_sync_progress events during a sync round, so consumers (wspc-drive dashboard) can show live per-file progress instead of a static Syncing… badge.

How

  • runDriveSyncOnce takes an optional onProgress?: (processed, total) => void.
  • A lightweight pre-pass runs the pure decideDriveAction over every path to compute total = number of actionable paths (transfers, deletes, conflicts), excluding unchanged / state_only / remove_state. This keeps incremental syncs from jumping straight to ~100% and stalling.
  • The execute loop is otherwise unchanged; it bumps processed and fires onProgress after each actionable path.
  • drive watch forwards the callback as { "kind": "drive_sync_progress", "processed": N, "total": M } NDJSON events (one per actionable file — rate is bounded by network I/O, so no timer throttle).

Compatibility

Purely additive. Old consumers ignore the new event kind.

Tests

  • runDriveSyncOnce reports total = actionable count (unchanged excluded) and processed increments 0 → total.
  • drive watch emits drive_sync_progress events from the progress callback.
  • Full suite: 482 passed, typecheck clean.

Design: docs/superpowers/specs/2026-07-08-library-sync-progress-design.md in wspc-drive.

runDriveSyncOnce accepts an onProgress callback and reports
processed/total over actionable paths only (transfers, deletes,
conflicts), excluding unchanged and state-only paths so incremental
syncs show meaningful progress. drive watch forwards the callback as
drive_sync_progress NDJSON events.
@yurenju yurenju merged commit 24b4e21 into main Jul 8, 2026
2 checks passed
@yurenju yurenju deleted the claude/drive-sync-progress branch July 8, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant