Remove Convex Sync Infrastructure
Description¶
Convex cloud sync is being replaced by S3 + DVC for data storage and versioning (see QC-047 rewrite). Remove all Convex-specific infrastructure, schemas, and dependencies from the codebase. This is a prerequisite for the new storage context architecture.
QualCoder v2's sync story shifts from real-time cloud database sync (Convex) to explicit research-data-native storage (S3 + DVC) — better suited for large datasets (Firebase exports, transcripts, media) and reproducible research workflows.
Acceptance Criteria¶
- [x] #1 Remove
src/shared/infra/convex/(ConvexClient) - [x] #2 Remove
src/shared/infra/sync/(SyncEngine, outbox, id_map) - [x] #3 Remove
src/shared/core/sync/(sync entities, events, derivers, invariants, commands) - [x] #4 Remove
src/shared/infra/app_context/sync_context.py - [x] #5 Remove
src/shared/infra/signal_bridge/sync.py - [x] #6 Remove
src/shared/presentation/molecules/sync_status_button.py - [x] #7 Remove
src/contexts/cases/infra/convex_repository.py - [x] #8 Remove
src/contexts/settings/interface/cloud_sync_mcp_tools.py - [x] #9 Remove
convex/directory (schema.ts, all table files, tsconfig) - [x] #10 Remove
docker-compose.ymlConvex backend service (if only used for Convex) - [x] #11 Remove cloud sync UI from Settings dialog (checkbox, URL field)
- [x] #12 Remove
BackendConfig.cloud_sync_enabledandconvex_urlfrom settings entities - [x] #13 Remove
src/tests/e2e/test_cloud_sync_e2e.py - [x] #14 Remove Convex dependencies from
pyproject.toml/requirements.txt - [x] #15 No remaining references to "convex" or "cloud_sync" in codebase (grep clean)
- [x] #16 All existing tests pass after removal (
make test-all)
Implementation Notes¶
Files to Remove¶
# Convex client
src/shared/infra/convex/
# Sync engine & infrastructure
src/shared/infra/sync/
src/shared/infra/app_context/sync_context.py
src/shared/infra/signal_bridge/sync.py
# Sync domain
src/shared/core/sync/
# UI
src/shared/presentation/molecules/sync_status_button.py
# Context-specific Convex adapters
src/contexts/cases/infra/convex_repository.py
src/contexts/settings/interface/cloud_sync_mcp_tools.py
# Tests
src/tests/e2e/test_cloud_sync_e2e.py
# Convex backend
convex/
docker-compose.yml (review — may have other services)
Files to Edit¶
src/contexts/settings/core/entities.py— RemoveBackendConfig,cloud_sync_enabled,convex_url,uses_convexsrc/contexts/settings/presentation/dialogs/settings_dialog.py— Remove cloud sync UI sectionsrc/shared/infra/app_context/context.py— Remove SyncContext creation, Convex client wiring- Any
__init__.pyfiles that re-export sync/convex modules pyproject.toml/requirements.txt— Remove convex SDK dependencydocs/ARCHITECTURE.md— Remove Convex referencesdocs/decisions/ADR-002-sync-engine-pattern.md— Mark as superseded
Approach¶
- Remove files bottom-up (leaf dependencies first)
- Fix imports and references
- Run
make test-allto verify nothing breaks - Grep for any remaining "convex", "cloud_sync", "SyncEngine" references
Sub-tasks¶
- [x] QC-050.01 - Remove Convex backend (
convex/, docker-compose) - [x] QC-050.02 - Remove sync infrastructure (
src/shared/infra/sync/,src/shared/core/sync/) - [x] QC-050.03 - Remove Convex client and context-specific adapters
- [x] QC-050.04 - Remove cloud sync UI and settings
- [x] QC-050.05 - Clean up dependencies and documentation
- [x] QC-050.06 - Verify all tests pass