Summary
Implement the full OneDrive sync pipeline as described in .claude/rules/onedrive-sync.md. This covers the six ordered pipeline steps, parallel job execution, conflict detection/resolution, and the background scheduler.
Depends on
Scope
Pipeline steps (in order)
RemoteFolderEnumerator — fetch DeltaItem list from selected remote folders
RemoteDeletionDetector — delete local files whose remote counterpart is gone
LocalDeletionDetector — delete remote files the user deleted locally
DownloadJobBuilder — build download jobs (eTag-then-timestamp decision logic)
LocalChangeDetector — build upload jobs for new/changed local files
JobExecutor → ISyncPipeline → parallel workers via bounded Channel<SyncJob>
Key services
| Interface |
Notes |
ISyncService |
SyncAccountAsync, ResolveConflictAsync, events |
ISyncScheduler |
System.Threading.Timer, 60 min default, re-entrancy guard |
ISyncPipeline |
Bounded channel, workerCount from account.SyncConfig.WorkerCount |
ISyncWorker / ISyncWorkerFactory |
Per-worker execution |
IHttpDownloader |
Pre-signed URL download with retry/backoff |
IUploadService |
Resumable upload sessions, 10 MB chunks, retry/backoff |
ISyncedItemRegistrar |
Folder registration during enumeration |
SyncRuleEvaluator |
Most-specific-wins, default-deny |
FileClassifier |
Keyword tokenisation against FileClassificationRule |
ConflictResolver / ConflictApplier |
ConflictPolicy enum: KeepLocal / KeepRemote / Skip |
Events
ISyncService.SyncProgressChanged (SyncProgressEventArgs)
ISyncService.JobCompleted (JobCompletedEventArgs)
ISyncService.ConflictDetected (SyncConflict)
ISyncScheduler.SyncStarted / SyncCompleted
ViewModels subscribe to these events and marshal to UI thread via RxApp.MainThreadScheduler.
Error types
SyncError discriminated union: SyncAuthError, SyncGraphError, SyncStorageError, NoFoldersConfiguredError, SyncCancelledError
File system
All file I/O via IFileSystem (Testably abstraction). System.IO.* banned.
Acceptance criteria
Summary
Implement the full OneDrive sync pipeline as described in
.claude/rules/onedrive-sync.md. This covers the six ordered pipeline steps, parallel job execution, conflict detection/resolution, and the background scheduler.Depends on
OneDriveAccount,IAuthService,IGraphService)IAccountRepository,ISyncedItemRepository,ISyncRuleRepository,IDriveStateRepository,ISyncRepositoryScope
Pipeline steps (in order)
RemoteFolderEnumerator— fetchDeltaItemlist from selected remote foldersRemoteDeletionDetector— delete local files whose remote counterpart is goneLocalDeletionDetector— delete remote files the user deleted locallyDownloadJobBuilder— build download jobs (eTag-then-timestamp decision logic)LocalChangeDetector— build upload jobs for new/changed local filesJobExecutor→ISyncPipeline→ parallel workers via boundedChannel<SyncJob>Key services
ISyncServiceSyncAccountAsync,ResolveConflictAsync, eventsISyncSchedulerSystem.Threading.Timer, 60 min default, re-entrancy guardISyncPipelineworkerCountfromaccount.SyncConfig.WorkerCountISyncWorker/ISyncWorkerFactoryIHttpDownloaderIUploadServiceISyncedItemRegistrarSyncRuleEvaluatorFileClassifierFileClassificationRuleConflictResolver/ConflictApplierConflictPolicyenum: KeepLocal / KeepRemote / SkipEvents
ISyncService.SyncProgressChanged(SyncProgressEventArgs)ISyncService.JobCompleted(JobCompletedEventArgs)ISyncService.ConflictDetected(SyncConflict)ISyncScheduler.SyncStarted/SyncCompletedViewModels subscribe to these events and marshal to UI thread via
RxApp.MainThreadScheduler.Error types
SyncErrordiscriminated union:SyncAuthError,SyncGraphError,SyncStorageError,NoFoldersConfiguredError,SyncCancelledErrorFile system
All file I/O via
IFileSystem(Testably abstraction).System.IO.*banned.Acceptance criteria
ConflictDetectedevent.dotnet buildzero warnings;dotnet testall pass (unit + integration).