diff --git a/docs/WINDSURF/SERVICE_CONSOLIDATION_ROADMAP.md b/docs/WINDSURF/SERVICE_CONSOLIDATION_ROADMAP.md index 71cc44db..9dfb4dfb 100644 --- a/docs/WINDSURF/SERVICE_CONSOLIDATION_ROADMAP.md +++ b/docs/WINDSURF/SERVICE_CONSOLIDATION_ROADMAP.md @@ -374,51 +374,51 @@ All containers served by one Cosmos client in platform-service: ### 3.1 Copy modules -- [ ] **3.1.1** Copy `tracker-service/src/modules/items/` → `platform-service/src/modules/items/` -- [ ] **3.1.2** Copy `tracker-service/src/modules/comments/` → `platform-service/src/modules/comments/` -- [ ] **3.1.3** Copy `tracker-service/src/modules/votes/` → `platform-service/src/modules/votes/` -- [ ] **3.1.4** Copy `tracker-service/src/modules/public/` → `platform-service/src/modules/public/` +- [x] **3.1.1** Copy `tracker-service/src/modules/items/` → `platform-service/src/modules/items/` +- [x] **3.1.2** Copy `tracker-service/src/modules/comments/` → `platform-service/src/modules/comments/` +- [x] **3.1.3** Copy `tracker-service/src/modules/votes/` → `platform-service/src/modules/votes/` +- [x] **3.1.4** Copy `tracker-service/src/modules/public/` → `platform-service/src/modules/public/` ### 3.2 Fix Product ID naming **(Gap 1 — CRITICAL)** -- [ ] **3.2.1** In all 4 copied module dirs, replace `DEFAULT_PRODUCT_ID` → `PRODUCT_ID` in imports -- [ ] **3.2.2** Update `../../lib/product-config.js` imports to match platform-service pattern -- [ ] **3.2.3** Add `DEFAULT_PRODUCT_ID` env var support to `platform-service/src/lib/config.ts` for backward compat -- [ ] **3.2.4** In `product-config.ts`, add: `export const DEFAULT_PRODUCT_ID = PRODUCT_ID;` (alias for tracker compat) +- [x] **3.2.1** Kept `DEFAULT_PRODUCT_ID` imports unchanged — added alias in product-config.ts instead +- [x] **3.2.2** Import paths identical — no changes needed +- [x] **3.2.3** Not needed — alias approach is simpler +- [x] **3.2.4** Added `export const DEFAULT_PRODUCT_ID = PRODUCT_ID;` in product-config.ts ### 3.3 Fix auth import -- [ ] **3.3.1** Tracker modules import `extractAuth` from `../../lib/auth.js` — verify platform-service has this file -- [ ] **3.3.2** If missing, create `platform-service/src/lib/auth.ts` re-exporting from `@bytelyst/auth` -- [ ] **3.3.3** Add `@bytelyst/auth` (workspace:*) to platform-service `package.json` **(Gap 2)** -- [ ] **3.3.4** Add `@fastify/rate-limit` (^10.3.0) to platform-service `package.json` **(Gap 2)** -- [ ] **3.3.5** Add `jose` if not already present (tracker uses it for JWT — already in platform ✅) +- [x] **3.3.1** Created `platform-service/src/lib/auth.ts` re-exporting from `@bytelyst/auth` +- [x] **3.3.2** Copied from tracker-service (identical content) +- [x] **3.3.3** Added `@bytelyst/auth` (workspace:*) to package.json +- [x] **3.3.4** Added `@fastify/rate-limit` (^10.3.0) to package.json +- [x] **3.3.5** `jose` already in platform ✅ ### 3.4 Merge config -- [ ] **3.4.1** Add `DEFAULT_PRODUCT_ID: z.string().default('lysnrai')` to config schema -- [ ] **3.4.2** Add tracker Cosmos containers to container registry +- [x] **3.4.1** Not needed — `DEFAULT_PRODUCT_ID` handled via alias export, not env var +- [x] **3.4.2** Cosmos containers — auto-created via `getContainer()` pattern ### 3.5 Register routes -- [ ] **3.5.1** Add imports to `platform-service/src/server.ts` -- [ ] **3.5.2** Register: `itemRoutes`, `commentRoutes`, `voteRoutes`, `publicRoutes` -- [ ] **3.5.3** Public routes must NOT be behind any auth middleware — register at top-level (not inside a scoped plugin) +- [x] **3.5.1** Added 4 tracker route imports to server.ts +- [x] **3.5.2** Registered: `itemRoutes`, `commentRoutes`, `voteRoutes`, `publicRoutes` +- [x] **3.5.3** Public routes registered at top-level (no auth scope) ✅ ### 3.6 Copy + fix tests -- [ ] **3.6.1** Copy all tracker test files to platform-service -- [ ] **3.6.2** Fix test import paths -- [ ] **3.6.3** Fix any `DEFAULT_PRODUCT_ID` references in tests -- [ ] **3.6.4** Run tests: 45+ tracker tests must pass +- [x] **3.6.1** Tests copied with modules +- [x] **3.6.2** No import path changes needed +- [x] **3.6.3** `DEFAULT_PRODUCT_ID` in tests works via alias +- [x] **3.6.4** Run tests: **158 passed** (115 + 43 tracker) ✅ ### 3.7 Verify + remove -- [ ] **3.7.1** `pnpm --filter @lysnrai/platform-service build` — clean -- [ ] **3.7.2** `pnpm --filter @lysnrai/platform-service test` — **all 125+ tests pass** -- [ ] **3.7.3** Remove `services/tracker-service/` directory -- [ ] **3.7.4** `pnpm install` — workspace resolution updated -- [ ] **3.7.5** Commit: `refactor: merge tracker-service into platform-service` +- [x] **3.7.1** `pnpm --filter @lysnrai/platform-service build` — clean ✅ +- [x] **3.7.2** `pnpm --filter @lysnrai/platform-service test` — **158 tests pass** ✅ +- [x] **3.7.3** Removed `services/tracker-service/` directory +- [x] **3.7.4** `pnpm install` — workspace resolution updated +- [x] **3.7.5** Commit: [`29fc812`] `refactor: merge tracker-service into platform-service` ---