mirror of
https://github.com/panatgithub/AnkiHeadingSync.git
synced 2026-07-22 06:51:43 +00:00
删除已失效的 legacy sync use case、syncRegistry 持久化与旧 card pipeline,运行入口保持 ManualSyncService 主链。 Remove the obsolete legacy sync use cases, syncRegistry persistence, and old card pipeline while keeping the runtime on ManualSyncService.
2.3 KiB
2.3 KiB
Legacy Sync Cleanup Decisions
Runtime truth
- The only supported sync runtime after this cleanup is the
ManualSyncServicepath. - No legacy fallback will be preserved.
- Old
syncRegistrydata in data.json will be ignored and no migration will be implemented.
Files safe to delete directly once imports are removed
src/application/use-cases/ScanAndPlanSyncUseCase.tssrc/application/use-cases/ExecuteSyncPlanUseCase.tssrc/application/use-cases/SyncCurrentFileUseCase.tssrc/application/use-cases/SyncVaultUseCase.tssrc/application/use-cases/types.tssrc/application/services/HeadingSyncMarkerService.tssrc/application/ports/SyncRegistryRepository.tssrc/infrastructure/persistence/DataJsonSyncRegistryRepository.tssrc/domain/sync/**src/domain/card/services/CardExtractionService.ts- legacy-only tests for the modules above
Shared types to preserve
- Preserve these modules or exported types because current manual-sync still uses them:
RenderedFieldsMediaAssetSourceFileSourceLocationCardTypeRenderResourceResolverCardKeyContentHash
Mixed modules requiring partial extraction or reduction
src/infrastructure/persistence/DataJsonPluginConfigRepository.ts- Remove
PluginDataSnapshot.syncRegistryentirely. - Keep
settingsandpluginStatesupport intact.
- Remove
src/application/services/NoteFieldMappingService.ts- Stop importing
Cardfromdomain/card/entities/Card. - Use the existing local render-shape input plus
CardTypedirectly.
- Stop importing
src/domain/card/entities/Card.ts- Delete only if a post-decoupling search shows no remaining production usage.
Symbols that must disappear from production code
ScanAndPlanSyncUseCaseExecuteSyncPlanUseCaseSyncCurrentFileUseCaseSyncVaultUseCaseSyncRegistrySyncRegistryRepositoryDataJsonSyncRegistryRepositoryHeadingSyncMarkerServicelegacy-card-keypending-note-id-write
Test and doc policy
- Delete tests that only validate the removed legacy chain.
- Keep and repair tests covering the current manual-sync runtime.
- Update or remove docs that still present the legacy chain as active implementation.
- Historical docs may remain only if they clearly read as archival context and no longer imply active runtime ownership.