feat(drive): add --debug NDJSON sync log to drive watch#77
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--debugflag (andWSPC_DRIVE_DEBUG=1) towspc drive watch: appends NDJSON debug events to<folder>/.wspc-drive/debug.logwith 10MB rotation todebug.log.old; write failures never break sync.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.x-wspc-client: drive-syncso the server can attributedrive_file_operationevents to the sync loop vs generic API traffic.Spec:
docs/superpowers/specs/2026-07-13-sync-debug-log-design.mdin wspc-drive. Companion PRs in wspc-drive (dashboard toggle) and wspc (PostHog events).Test plan
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.x-wspc-clientheader on upload/delete.🤖 Generated with Claude Code