Skip to content

feat(drive): add --debug NDJSON sync log to drive watch#77

Merged
yurenju merged 2 commits into
mainfrom
claude/sync-debug-log
Jul 13, 2026
Merged

feat(drive): add --debug NDJSON sync log to drive watch#77
yurenju merged 2 commits into
mainfrom
claude/sync-debug-log

Conversation

@yurenju

@yurenju yurenju commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add --debug flag (and WSPC_DRIVE_DEBUG=1) to wspc drive watch: appends NDJSON debug events to <folder>/.wspc-drive/debug.log with 10MB rotation to debug.log.old; write failures never break sync.
  • Events: fs_event (raw pre-debounce), realtime_event, sync_start (trigger: local/remote/initial/retry), sync_end (duration + summary), sync_phases (scan/manifest/process ms), decision (per actionable path with base/local/remote comparison fields; unchanged paths skipped), conflict (type/strategy), retry.
  • Sync upload/delete requests now send x-wspc-client: drive-sync so the server can attribute drive_file_operation events to the sync loop vs generic API traffic.

Spec: docs/superpowers/specs/2026-07-13-sync-debug-log-design.md in wspc-drive. Companion PRs in wspc-drive (dashboard toggle) and wspc (PostHog events).

Test plan

  • New test/handwritten/drive/debug-log.test.ts: writer NDJSON schema, rotation, error swallowing, watch wiring (fs_event/sync_start/sync_end/retry), sync decision/conflict/phases events, no file when debug off.
  • New api test: x-wspc-client header on upload/delete.
  • Full suite green (config-lock concurrent-writer test is a known Windows flake, passes standalone).

🤖 Generated with Claude Code

@yurenju yurenju merged commit 5845e41 into main Jul 13, 2026
2 checks passed
@yurenju yurenju deleted the claude/sync-debug-log branch July 13, 2026 04:20
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