diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 7fff53b..e9ad30a 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -85,5 +85,5 @@ Plans: | 3. Wizard UI | v1.0 | 5/5 | Complete | 2026-03-27 | | 4. Review, Download & Security | v1.0 | 5/5 | Complete | 2026-03-27 | | 5. Tech Debt | 4/4 | Complete | 2026-03-30 | - | -| 6. New Backends | 1/4 | In Progress| | - | +| 6. New Backends | 3/4 | In Progress| | - | | 7. Validation & UX Polish | v1.1 | 0/TBD | Not started | - | diff --git a/.planning/STATE.md b/.planning/STATE.md index 584944a..920b40a 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -3,14 +3,14 @@ gsd_state_version: 1.0 milestone: v1.1 milestone_name: Backlog & Tech Debt status: planning -stopped_at: Completed 06-new-backends 06-00-PLAN.md -last_updated: "2026-03-30T16:10:26.805Z" +stopped_at: Completed 06-new-backends 06-01-PLAN.md +last_updated: "2026-03-30T16:14:54.046Z" last_activity: 2026-03-27 — v1.1 roadmap created, 11 requirements mapped across 3 phases progress: total_phases: 3 completed_phases: 1 total_plans: 8 - completed_plans: 5 + completed_plans: 6 percent: 88 --- @@ -69,6 +69,7 @@ Progress: [░░░░░░░░░░] 0% (v1.1) | Phase 05-tech-debt P01 | 5 | 2 tasks | 4 files | | Phase 05-tech-debt P03 | 3 | 2 tasks | 2 files | | Phase 06-new-backends P00 | 5min | 3 tasks | 3 files | +| Phase 06-new-backends P01 | 5min | 2 tasks | 3 files | ## Accumulated Context @@ -91,6 +92,8 @@ Recent decisions affecting v1.1 work: - [Phase 06-new-backends]: Wave 0 RED stubs: as BackendType cast allows test files to parse before BackendType union is extended - [Phase 06-new-backends]: GCS rclone type = 'google cloud storage' (with spaces) not 'gcs' — verified against rclone docs, test asserts not.toContain('type = gcs') - [Phase 06-new-backends]: SFTP CSS-hide tab toggle pattern follows AzureAuthToggle convention (div.hidden/div.block) +- [Phase 06-new-backends]: GCS rclone type = 'google cloud storage' (with spaces) not 'gcs' — critical for correct rclone.conf output, test asserts not.toContain('type = gcs') +- [Phase 06-new-backends]: OneDrive uses paste-based OAuth token (JSON token field), GCS uses service_account_credentials (paste JSON), B2 uses account + key — all follow stateless browser-paste pattern ### Pending Todos @@ -105,6 +108,6 @@ None yet. ## Session Continuity -Last session: 2026-03-30T16:10:26.803Z -Stopped at: Completed 06-new-backends 06-00-PLAN.md +Last session: 2026-03-30T16:14:54.042Z +Stopped at: Completed 06-new-backends 06-01-PLAN.md Resume file: None diff --git a/.planning/phases/06-new-backends/06-01-SUMMARY.md b/.planning/phases/06-new-backends/06-01-SUMMARY.md new file mode 100644 index 0000000..8fb6f08 --- /dev/null +++ b/.planning/phases/06-new-backends/06-01-SUMMARY.md @@ -0,0 +1,122 @@ +--- +phase: 06-new-backends +plan: "01" +subsystem: api +tags: [rclone, onedrive, gcs, b2, registry, zod, typescript] + +# Dependency graph +requires: + - phase: 06-00 + provides: "Wave 0 RED test stubs for registry, rclone-conf, and RemoteConfigStep — test infrastructure established" +provides: + - "BackendType union extended to 7 types: azureblob, s3, s3-compatible, onedrive, sftp, gcs, b2" + - "BACKEND_REGISTRY entries for onedrive, gcs, b2 with rclone-accurate field keys" + - "BACKEND_SCHEMAS covers onedrive, gcs, b2 via buildZodSchema" + - "RCLONE_TYPE_MAP with gcs mapped to 'google cloud storage' (with spaces)" +affects: + - 06-02 + - 06-03 + +# Tech tracking +tech-stack: + added: [] + patterns: + - "registry-driven schema generation: buildZodSchema(BackendType) derives Zod shapes from BACKEND_REGISTRY automatically" + - "RCLONE_TYPE_MAP: BackendType key -> rclone internal type string, with space-containing values for gcs" + +key-files: + created: [] + modified: + - src/schemas/registry.ts + - src/schemas/index.ts + - src/generators/rclone-conf.ts + +key-decisions: + - "GCS rclone type = 'google cloud storage' (with spaces) not 'gcs' — verified against rclone docs, test asserts not.toContain('type = gcs')" + - "OneDrive uses token (OAuth JSON), drive_id, drive_type fields — paste-based token flow (no live OAuth in app)" + - "B2 uses account (applicationKeyId) and key (application key secret) — matches rclone b2 docs field names exactly" + - "GCS uses project_number + service_account_credentials (not service_account_file) — paste-based credentials flow" + +patterns-established: + - "All new backends follow pure registry + FieldRenderer pattern: add fields to BACKEND_REGISTRY, BACKEND_SCHEMAS and RCLONE_TYPE_MAP update automatically" + +requirements-completed: + - BACK-01 + - BACK-03 + - BACK-04 + +# Metrics +duration: 5min +completed: 2026-03-30 +--- + +# Phase 6 Plan 01: OneDrive, GCS, B2 Data Layer Summary + +**OneDrive, GCS, and B2 added to BackendType union, BACKEND_REGISTRY, BACKEND_SCHEMAS, and RCLONE_TYPE_MAP — all 55 registry and rclone-conf tests pass with gcs correctly mapped to 'google cloud storage'** + +## Performance + +- **Duration:** ~5 min +- **Started:** 2026-03-30T16:13:36Z +- **Completed:** 2026-03-30T16:13:36Z +- **Tasks:** 2 +- **Files modified:** 3 + +## Accomplishments +- BackendType union extended from 3 to 7 values (onedrive, sftp, gcs, b2 added) +- BACKEND_REGISTRY populated with onedrive (token/drive_id/drive_type), gcs (project_number/service_account_credentials), b2 (account/key) entries +- BACKEND_SCHEMAS and RCLONE_TYPE_MAP extended — gcs maps to 'google cloud storage' (with spaces per rclone docs) +- All 55 registry and rclone-conf tests GREEN; zero TypeScript errors + +## Task Commits + +Both plan tasks were implemented together in a single atomic commit: + +1. **Task 1: Extend registry.ts — BackendType union + onedrive/gcs/b2 entries** - `c1d61d3` (feat) +2. **Task 2: Extend index.ts and rclone-conf.ts — schemas + type map for onedrive/gcs/b2** - `c1d61d3` (feat) + +Note: Tasks 1 and 2 were committed together in commit `c1d61d3 feat(06-02)` which was executed before this plan's formal execution run. The commit message references 06-02 because the agent session that created it ran Plan 02's implementation and included Plan 01's changes in the same commit. + +## Files Created/Modified +- `src/schemas/registry.ts` - BackendType union extended to 7 types; onedrive/gcs/b2/sftp BACKEND_REGISTRY entries added +- `src/schemas/index.ts` - BACKEND_SCHEMAS extended with onedrive, sftp, gcs, b2 via buildZodSchema +- `src/generators/rclone-conf.ts` - RCLONE_TYPE_MAP extended with onedrive, sftp, gcs ('google cloud storage'), b2 + +## Decisions Made +- GCS rclone type string is 'google cloud storage' (with spaces) not 'gcs' — critical: test explicitly asserts not.toContain('type = gcs') +- OneDrive uses paste-based OAuth token (JSON) rather than live OAuth flow — keeps app stateless +- B2 field names 'account' and 'key' match rclone b2 config key names exactly +- GCS field 'service_account_credentials' uses paste-based JSON approach (not file path) for browser environment + +## Deviations from Plan + +### Implementation Pre-committed by Adjacent Plan Execution + +All three files (registry.ts, index.ts, rclone-conf.ts) were already fully implemented when this plan executed. Commit `c1d61d3` (labeled feat(06-02)) included all Plan 01 changes alongside Plan 02's sftp entry because the previous agent session ran Plan 02 implementation first. + +The plan's verification criteria are fully met: +- BackendType union has all 7 types: confirmed +- onedrive/gcs/b2 registry entries with correct rclone keys: confirmed +- BACKEND_SCHEMAS covers onedrive/gcs/b2: confirmed +- gcs maps to 'google cloud storage' in RCLONE_TYPE_MAP: confirmed +- rclone-conf tests pass for onedrive/gcs/b2: 55/55 tests GREEN +- Zero TypeScript errors outside sftp-missing-key: confirmed (no TypeScript errors at all — sftp entry is present) + +--- + +**Total deviations:** 0 functional deviations — plan executed correctly. Implementation ordering deviation noted (Plan 02 agent pre-implemented Plan 01 changes). + +## Issues Encountered +None — all files were already correctly implemented. + +## User Setup Required +None - no external service configuration required. + +## Next Phase Readiness +- Data layer complete for onedrive/gcs/b2 — Plan 02 (SFTP) data layer also complete in same commit +- Plan 03 can wire RemoteConfigStep to use BACKEND_REGISTRY for dynamic backend selection +- No blockers + +--- +*Phase: 06-new-backends* +*Completed: 2026-03-30*