diff --git a/docs/IMPLEMENTATION_TRACKER.md b/docs/IMPLEMENTATION_TRACKER.md index fe91818..7b7053e 100644 --- a/docs/IMPLEMENTATION_TRACKER.md +++ b/docs/IMPLEMENTATION_TRACKER.md @@ -8,12 +8,12 @@ ## How to Use This Document -- Each phase has a top-level checkbox that tracks overall phase completion. -- Each task within a phase has its own checkbox. -- When a task is completed, check it off and add the commit SHA in parentheses. +- Each task has its own checkbox. Check it off and add the commit SHA in parentheses when done. - Run the verification commands listed in each phase before marking it done. -- Phases are sequenced by dependency — complete Phase 1 before Phase 2, etc. -- Phases 1–3 are the critical path. Phases 4–7 can be parallelized after Phase 3. +- **Dependency chain:** Phase 1 → Phase 2 → Phase 3 (critical path). +- **After Phase 1:** Phase 5 (DevOps) can start in parallel. +- **After Phase 3:** Phases 4, 6, 7 can be parallelized. +- **Phase 8** (docs) runs last, after all other phases. --- @@ -27,7 +27,7 @@ --- -## Phase 1 — Bug Fixes (Gaps A1–A6, D3–D4) +## Phase 1 — Bug Fixes (Gaps A1–A6, D3–D4) [ ] **Goal:** Eliminate all runtime bugs and latent crash risks. Clean dead code. **Estimated effort:** 2–3 hours @@ -42,7 +42,8 @@ - [ ] **1.2** Lazy-init `blobClient` in `web/src/lib/blob-client.ts` (Gap A1) - Replace `const blobClient = createBlobClient(...)` with lazy singleton `function getBlobClient()` - - Update all call sites within the file (`blobClient.getSasUrl(...)` → `getBlobClient().getSasUrl(...)`) + - Update all 4 call sites within the file (`blobClient.getSasUrl(...)` → `getBlobClient().getSasUrl(...)`) + - Remove dead re-export `export { blobClient }` on line 48 (zero external imports) - File: `web/src/lib/blob-client.ts` - [ ] **1.3** Add `"use client"` directive to `web/src/lib/notes-client.ts` (Gap A6) @@ -82,7 +83,7 @@ fix(web): lazy-init extraction + blob clients, add use-client to notes-client --- -## Phase 2 — Code Quality (Gaps D1–D2, A3–A4) +## Phase 2 — Code Quality (Gaps D1–D2, A3–A4) [ ] **Goal:** Consolidate duplicate types, optimize N+1 queries. **Estimated effort:** 2–3 hours @@ -128,7 +129,7 @@ refactor(web): consolidate types, optimize N+1 queries [D1, A3, A4, D2] --- -## Phase 3 — Backend Test Depth (Gap A5) +## Phase 3 — Backend Test Depth (Gap A5) [ ] **Goal:** Replace registration-only route tests with real API behavior tests. **Estimated effort:** 3–4 hours @@ -159,8 +160,9 @@ refactor(web): consolidate types, optimize N+1 queries [D1, A3, A4, D2] - File: `backend/src/modules/note-artifacts/routes.test.ts` - [ ] **3.5** Add integration tests for `note-relationships` routes - - Test: POST create → GET list → DELETE - - Target: 3–5 tests + - Test: POST create → GET list (by workspaceId + noteId) + - Note: no DELETE route exists — only GET and POST are implemented + - Target: 3–4 tests - File: `backend/src/modules/note-relationships/routes.test.ts` - [ ] **3.6** Add integration tests for `note-agent-actions` routes @@ -178,7 +180,7 @@ refactor(web): consolidate types, optimize N+1 queries [D1, A3, A4, D2] ```bash cd backend && npm run typecheck && npm test -# Target: 60+ tests (up from 24) +# Target: ~60–75 tests (up from 24) ``` ### Commit convention @@ -189,7 +191,7 @@ test(backend): add integration tests for all 7 route modules [A5] --- -## Phase 4 — Web Feature Gaps (Gaps B1, B2, B8) +## Phase 4 — Web Feature Gaps (Gaps B1, B2, B8) [ ] **Goal:** Add missing web CRUD flows that the PRD requires. **Estimated effort:** 3–4 hours @@ -240,11 +242,11 @@ feat(web): add create note, archive/restore, link note flows [B1, B2, B8] --- -## Phase 5 — DevOps (Gaps C1–C5) +## Phase 5 — DevOps (Gaps C1–C5) [ ] **Goal:** Docker builds, CI, and deployment readiness. **Estimated effort:** 2–3 hours -**Dependencies:** Phase 1 (`output: "standalone"` must be set first). +**Dependencies:** Phase 1 only (`output: "standalone"` must be set first). Can run in parallel with Phases 2–3. ### Tasks @@ -294,7 +296,7 @@ feat(devops): Dockerfiles, docker-compose, CI, docker-prep [C1–C5] --- -## Phase 6 — E2E & Mobile Tests (Gaps B7, C4) +## Phase 6 — E2E & Mobile Tests (Gaps B7, C4) [ ] **Goal:** Playwright E2E for web, Vitest for mobile. **Estimated effort:** 3–4 hours @@ -357,11 +359,12 @@ test(mobile): add store and API client unit tests [B7] --- -## Phase 7 — AI Enrichment & Advanced Features (Gaps B3, B6) +## Phase 7 — AI Enrichment & Advanced Features (Gaps B3, B6) [ ] **Goal:** Add extraction-backed enrichment and import/export. -**Estimated effort:** 4–5 hours +**Estimated effort:** 3–4 hours **Dependencies:** Phase 3 (backend test patterns), Phase 4 (web CRUD flows). +**Note:** Gap A4 (workspace note count optimization) is fully addressed in Phase 2 task 2.3 — not duplicated here. ### Tasks @@ -378,18 +381,11 @@ test(mobile): add store and API client unit tests [B7] - Add "Export" button on web workspace page - Files: `backend/src/modules/notes/routes.ts`, `web/src/app/(app)/workspaces/page.tsx` -- [ ] **7.3** Add workspace-level note count to backend (Gap A4) - - Add `noteCount` field to workspace list response - - Use Cosmos cross-query or batch aggregate - - Remove the client-side all-notes fetch from `listWorkspaceSummaries()` - - Files: `backend/src/modules/workspaces/repository.ts`, `web/src/lib/notes-client.ts` - -- [ ] **7.4** Add tests for new endpoints +- [ ] **7.3** Add tests for new endpoints - Test: summarize route (mock extraction-service) - Test: export route (JSON + Markdown formats) - - Test: workspace list with note counts - - Target: 6–10 tests - - Files: `backend/src/modules/notes/routes.test.ts`, `backend/src/modules/workspaces/routes.test.ts` + - Target: 4–8 tests + - Files: `backend/src/modules/notes/routes.test.ts` ### Verification @@ -401,13 +397,13 @@ cd web && npm run typecheck && npm test && npm run build ### Commit convention ``` -feat(backend): note summarization, export, workspace note counts [B3, B6, A4] +feat(backend): note summarization + export endpoints [B3, B6] feat(web): summarize + export UI triggers [B3, B6] ``` --- -## Phase 8 — Documentation Alignment (Gaps E1–E2) +## Phase 8 — Documentation Alignment (Gaps E1–E2) [ ] **Goal:** Update all docs to reflect the final implementation state. **Estimated effort:** 1 hour @@ -472,11 +468,11 @@ Track completed phases and commits here as work progresses. | Surface | Before | After Phase 3 | After Phase 6 | After Phase 7 | |---------|--------|---------------|---------------|---------------| -| Backend | 24 tests (12 files) | ~75 tests | ~75 tests | ~85 tests | +| Backend | 24 tests (12 files) | ~60–75 tests | ~60–75 tests | ~70–85 tests | | Web unit | 6 tests (5 files) | 6 tests | ~12 tests | ~12 tests | | Web E2E | 0 | 0 | ~20 tests | ~20 tests | | Mobile | 0 | 0 | ~15 tests | ~15 tests | -| **Total** | **30** | **~81** | **~122** | **~132** | +| **Total** | **30** | **~66–81** | **~107–122** | **~117–132** | ---