Commit Graph

131 Commits

Author SHA1 Message Date
saravanakumardb1
ee586065dd refactor(web+backend): consolidate types, optimize N+1 queries [D1, A3, A4, D2]
- types.ts: consolidate NoteDoc, WorkspaceDoc, NoteAgentActionDoc etc. from client files
- notes-client.ts: import from types.ts, optimize getNoteDetail with direct GET /notes/:id
- review-client.ts: import from types.ts, use /note-agent-actions/pending (eliminates N+1)
- notes-client.ts: use /workspaces/summaries (eliminates fetch-all-notes for counts)
- backend: add GET /workspaces/summaries with noteCount per workspace
- backend: add GET /note-agent-actions/pending (cross-workspace)
- backend: add countNotesByWorkspaces + listPendingActions repository functions
- Add createNote, archiveNote, restoreNote, createNoteRelationship client functions
- Fix existing tests for new route counts and mock order
2026-03-19 07:32:54 -07:00
saravanakumardb1
dbb1a84dba fix(web): lazy-init extraction + blob clients, add use-client to notes-client
- extraction-client.ts: lazy singleton (SSR crash fix) [A1]
- blob-client.ts: lazy singleton + remove dead re-export [A1]
- notes-client.ts: add "use client" directive [A6]
- next.config.ts: add output: "standalone" [A2]
- Delete mock-data.ts and review-data.ts (dead code) [D3, D4]
2026-03-19 07:20:28 -07:00
saravanakumardb1
e50df779da docs: fix 7 inaccuracies in implementation tracker after systematic review
Corrections:
- Remove duplicate task 7.3 (Gap A4 already in Phase 2 task 2.3), renumber
- Fix task 3.5: remove false DELETE claim (note-relationships has GET+POST only)
- Fix task 1.2: add note about removing dead 'export { blobClient }' re-export
- Fix 'How to Use' parallelization: Phase 5 needs Phase 1 only, not Phase 3
- Add phase-level [ ] checkboxes to all 8 phase headers
- Align Phase 3 test target: '60+' → '~60-75' (matches summary table)
- Fix Phase 7 effort estimate (4-5h → 3-4h after removing duplicate task)
- Fix test target summary to use ranges instead of single estimates
2026-03-19 07:15:26 -07:00
saravanakumardb1
1d068e748c docs: add detailed implementation tracker with 8 phases and 35 checkbox tasks
Derived from GAP_ANALYSIS.md (25 gaps across 5 categories).
Structured as 8 sequential phases with:
- Per-task checkboxes with gap IDs for traceability
- Specific file paths and code patterns for each fix
- Verification commands per phase
- Commit message conventions
- Test target summary (30→132 tests across all surfaces)
- Progress log table for tracking commits
- Deferred items (B4 webhooks, B5 sharing, E2 WINDSURF_CONTEXT)

Phases: 1-Bug Fixes, 2-Code Quality, 3-Backend Tests,
4-Web Features, 5-DevOps, 6-E2E+Mobile Tests,
7-AI Enrichment, 8-Docs Alignment
2026-03-19 07:09:47 -07:00
saravanakumardb1
ee033f4eab docs: fix 8 inaccuracies in gap analysis after systematic self-review
Corrections:
- Remove D5 (factually wrong — backend tsconfig already excludes test files)
- Fix web component count 12→10, lib file count 11→18
- Fix B1 title: 'No note delete' → 'No note restore' (PRD says archive/restore)
- Add A6: notes-client.ts missing 'use client' (fragile SSR import chain)
- Expand A1 to include blob-client.ts module-scope instantiation
- Note telemetry/flags/kill-switch are lower risk (client-only imports)
- Strengthen D3/D4: confirmed zero-import dead code, not just 'unclear'
- A5: note that auth.test.ts and MCP tests do have real behavior tests
- Update bug count 5→6, total gaps 29→25
2026-03-19 07:06:05 -07:00
saravanakumardb1
513ee5a6a5 docs: comprehensive gap analysis — 29 numbered gaps across 5 categories
Systematic audit of backend (7 modules, 24 tests), web (6 pages, 12
components, 6 tests), and mobile (4 tabs, 0 tests) against PRD.

Key findings:
- 5 bugs (extraction-client SSR crash, missing standalone output,
  N+1 queries, registration-only backend tests, tsconfig exclude)
- 8 missing features (no web note create, no import/export, no
  sharing, no summarization, no relationship UI, zero mobile tests)
- 5 DevOps gaps (no Dockerfiles, no docker-compose, no CI, no E2E)
- 5 code quality issues (duplicate types, mock-data leftovers, N+1)
- 2 documentation gaps (roadmap checklists not updated)

Includes 7-sprint prioritized implementation plan with estimates.
2026-03-19 06:56:24 -07:00
saravanakumardb1
4da42b2d27 fix(web): wrap search + workspaces pages in Suspense for useSearchParams prerendering 2026-03-12 17:18:12 -07:00
saravanakumardb1
4ffe7569b0 fix(auth): JWKS URL-tracking singleton + expanded test coverage 2026-03-12 11:22:04 -07:00
saravanakumardb1
8e2a1b37c3 feat(auth): RS256 JWKS verification — NoteLett backend 2026-03-12 11:15:06 -07:00
saravanakumardb1
14aeeafe83 chore(docs): regenerate AI agent config files 2026-03-10 22:56:39 -07:00
saravanakumardb1
724a6659df docs: update AGENTS.md with api-helpers.ts and corrected test counts
- Added api-helpers.ts to web lib repo layout
- Backend tests: 18 → 19 (11 files) after saved-views route test
2026-03-10 19:57:40 -07:00
saravanakumardb1
b651210edc chore(web): remove unused PRODUCT_ID import from notes-client
Stale import left behind after extracting API client factory to api-helpers.ts.
2026-03-10 19:56:27 -07:00
saravanakumardb1
420945e081 fix(web): stabilize useKeyboardShortcuts with ref-based callback
- Use useRef to hold shortcuts array, read from ref inside event handler
- Event listener registered once on mount (empty deps), avoids re-subscription
  when callers forget to memoize the shortcuts array
- Prevents subtle memory leak from rapid add/remove of keydown listeners
2026-03-10 19:54:50 -07:00
saravanakumardb1
c2202e9e52 refactor(web): extract shared API client factory, fix types, use crypto.randomUUID
- Created api-helpers.ts with shared getAccessToken() + createNotesApiClient()
- Removed duplicate API client factory from notes-client.ts, review-client.ts,
  saved-views-client.ts (3 copies → 1 shared module)
- Added reviewedBy/reviewedAt/reviewNote fields to review-client NoteAgentActionDoc
  type to match backend response shape
- Search page: use crypto.randomUUID() for saved view IDs instead of Date.now()
  to prevent collisions on rapid saves

Verification: web typecheck + 6/6 tests pass.
2026-03-10 19:53:45 -07:00
saravanakumardb1
c6aa775cd3 fix(backend): saved-views DELETE 204 response + add route test
- DELETE /saved-views/:id now uses reply.code(204).send() for explicit
  empty response (Fastify 5 best practice)
- Added routes.test.ts for saved-views module (verifies 2 GET, 1 POST,
  1 PATCH, 1 DELETE handler registration)
- Backend now at 19 tests across 11 files
2026-03-10 19:50:52 -07:00
saravanakumardb1
d09259c42e docs: update AGENTS.md + ROADMAP.md with all completed features, register saved_views container
- AGENTS.md: added saved-views module, lib/platform.ts, batch-review endpoint, saved-views endpoints, blob-client to shared packages, 7 Cosmos containers, keyboard shortcuts + debounce hooks
- ROADMAP.md: 6 new commit entries, all blockers/deferrals marked resolved
- cosmos-init.ts: registered saved_views container with /userId partition

All 3 surfaces verified: backend 18/18, web 6/6, mobile typecheck pass.
2026-03-10 19:45:13 -07:00
saravanakumardb1
f8a4c18f27 feat(mobile): wire review note input to inbox approve/reject
- note-agent-actions API: updateApprovalState now accepts optional reviewNote
- inbox-store: approve/reject actions pass reviewNote through to backend
- Inbox screen: TextInput for review note above approval cards
- Review note cleared after successful approve/reject

Verification: mobile typecheck passes.
2026-03-10 19:41:39 -07:00
saravanakumardb1
12d90098eb feat(web): saved views CRUD, keyboard shortcuts, debounced search
- saved-views-client.ts: full CRUD client for backend saved-views module
- use-keyboard-shortcuts.ts: reusable hook for global keyboard shortcuts
- KeyboardShortcuts.tsx: wired into (app) layout — Cmd+K search, Cmd+N workspaces, Cmd+Shift+D dashboard, Cmd+Shift+R reviews, Esc blur
- use-debounce.ts: shared debounce hook (replaces inline setTimeout in search)
- Search page: saved views loaded from backend with save/delete UI
- Search page: search debounced at 250ms via useDebounce hook
- Updated search page test to mock saved-views-client and useDebounce

Verification: web typecheck + 6/6 tests pass.
2026-03-10 19:39:28 -07:00
saravanakumardb1
ca3cdbad4e feat(web): wire full review UX — batch select, review notes, batch approve/reject
- Reviews page: batch selection mode with Select All / Clear
- Reviews page: batch Approve N / Reject N buttons
- Reviews page: review note textarea shared by single + batch flows
- review-client.ts: added batchReviewItems() calling POST /batch-review
- review-client.ts: approve/reject now pass reviewNote to backend
- Clears review note + batch selection after successful action

Verification: web typecheck passes.
2026-03-10 19:35:40 -07:00
saravanakumardb1
bdbf387f88 feat(backend): add batch review endpoint + saved-views module
- note-agent-actions: added POST /batch-review for bulk approve/reject (up to 50 items)
- note-agent-actions: PATCH now auto-sets reviewedBy/reviewedAt on approve/reject
- saved-views: new module with full CRUD (types, repository, routes)
  - Cosmos container: saved_views, partition: /userId
  - Supports scope filtering (workspace, search, review)
- Registered saved-views routes in server.ts (7 modules total)
- Updated route count tests

Verification: backend typecheck + 18/18 tests pass.
2026-03-10 19:33:33 -07:00
saravanakumardb1
878c644dd8 feat(platform): wire shared platform packages into mobile + refactor web blob-client (DRY)
Phase 1 — Platform SDK integration:
- Mobile: added @bytelyst/telemetry-client, feature-flag-client, kill-switch-client, blob-client deps
- Mobile: created src/lib/platform.ts — centralized platform init (telemetry, flags, kill-switch, blob)
- Mobile: wired initPlatform() into root layout startup
- Web: refactored blob-client.ts to use shared @bytelyst/blob-client (eliminates hand-rolled SAS fetch code)
- Web: added @bytelyst/blob-client dep

DRY: Both web and mobile now use the same @bytelyst/blob-client package for blob operations.

Verification: web typecheck + mobile typecheck pass.
2026-03-10 19:29:00 -07:00
saravanakumardb1
9d392eab39 docs: add AGENTS.md, README.md, and update roadmap with session commit refs
- AGENTS.md: full AI agent onboarding guide following ecosystem conventions
- README.md: quick start, architecture overview, env setup, test commands
- ROADMAP.md: added commit references for identity lock, MCP tools, platform integrations, blob client
- Marked resolved blockers (product identity, blob artifacts)
2026-03-10 19:01:48 -07:00
saravanakumardb1
196b2106d8 feat(web): add blob upload/download client for artifact management
- getArtifactUploadUrl() — SAS URL with write permissions
- uploadArtifact() — direct browser-to-blob upload via SAS
- downloadArtifact() — fetch blob content via SAS read URL
- Uses platform-service /blob/sas endpoint for SAS token generation

Verification: web typecheck passes.
2026-03-10 18:58:25 -07:00
saravanakumardb1
8755661049 feat(web): wire feature-flag and kill-switch platform clients
- Added @bytelyst/feature-flag-client and @bytelyst/kill-switch-client deps
- Created web/src/lib/feature-flags.ts — poll-based flag client (fail-open)
- Created web/src/lib/kill-switch.ts — kill-switch check client (fail-open)
- Telemetry, diagnostics, extraction were already wired

Verification: web typecheck + 6 tests pass.
2026-03-10 18:56:14 -07:00
saravanakumardb1
12058ed745 feat(mcp): add update-note, link-notes, extract-tasks, attach-artifact MCP tools
4 new executable MCP tools with full audit trail:
- notes.notes.update — update title/body/status/tags with dry-run support
- notes.relationships.link — create typed relationships between notes
- notes.tasks.extract — extract actionable tasks from note body (checkbox + TODO patterns)
- notes.artifacts.attach — attach file/summary/extraction/citation/export artifacts

All tools follow the existing pattern:
- Product scope enforcement
- Agent action audit recording
- Idempotency key + correlation ID propagation
- Dry-run preview support

Also updated .env.example with notelett identity.

Verification: backend typecheck + 18 tests pass.
2026-03-10 18:53:28 -07:00
saravanakumardb1
e1fde25afd feat(identity): lock NoteLett product identity across all surfaces
- productId: notelett
- displayName: NoteLett
- domain: notelett.app
- iOS bundle: com.bytelyst.notelett
- Android bundle: com.notelett.app
- backend port: 4016
- token namespace: --nl-* (CSS), NoteLettTheme (native)

Rippled through:
- shared/product.json (canonical source)
- backend package.json, config, cosmos-init, all 10 test files
- web package.json, landing page, notes-client test
- mobile app.json, package.json, auth screen
- docs: PRD, ROADMAP, architecture review, foundations, web/mobile roadmaps
- registered in learning_ai_common_plat/products/notelett/

Verification: backend typecheck + 18 tests, web typecheck + 6 tests, mobile typecheck — all pass.
2026-03-10 18:47:01 -07:00
saravanakumardb1
e6beef83eb docs(notes): record dashboard note progress 2026-03-10 18:23:21 -07:00
saravanakumardb1
8a1b79c4e4 fix(notes): link recent note tags 2026-03-10 18:21:32 -07:00
saravanakumardb1
b147f14b1c docs(notes): record search filter progress 2026-03-10 18:19:40 -07:00
saravanakumardb1
fa87efd13b fix(notes): link search result filters 2026-03-10 18:17:13 -07:00
saravanakumardb1
dc917df240 docs(notes): record review state progress 2026-03-10 18:14:20 -07:00
saravanakumardb1
758d5d42a4 fix(notes): link note review state 2026-03-10 18:12:23 -07:00
saravanakumardb1
66d4cd4c6e docs(notes): record workspace filter progress 2026-03-10 18:10:21 -07:00
saravanakumardb1
260428d6f3 fix(notes): link workspace filters 2026-03-10 18:08:16 -07:00
saravanakumardb1
dbf0fa84ab docs(notes): record metadata progress 2026-03-10 18:05:49 -07:00
saravanakumardb1
6d72561b30 fix(notes): link note metadata 2026-03-10 18:04:15 -07:00
saravanakumardb1
c3e738cff3 docs(notes): finish dashboard metric progress 2026-03-10 18:01:25 -07:00
saravanakumardb1
3e88ed6a12 docs(notes): record dashboard metric progress 2026-03-10 18:00:02 -07:00
saravanakumardb1
2a9f49048d fix(notes): link dashboard metrics 2026-03-10 17:58:51 -07:00
saravanakumardb1
042cace2f3 docs(notes): record workspace progress 2026-03-10 17:55:14 -07:00
saravanakumardb1
22df6d956f fix(notes): activate workspace saved views 2026-03-10 17:53:32 -07:00
saravanakumardb1
bd7fc9d7a7 docs(notes): record search entrypoint progress 2026-03-10 17:51:07 -07:00
saravanakumardb1
88c11c25f2 fix(notes): activate saved searches 2026-03-10 17:49:02 -07:00
saravanakumardb1
ea7f1c15f8 docs(notes): record review workflow progress 2026-03-10 17:46:02 -07:00
saravanakumardb1
99bc7a93ba fix(notes): link review workflows 2026-03-10 17:43:57 -07:00
saravanakumardb1
49d4790344 docs(notes): record workflow progress 2026-03-10 17:40:38 -07:00
saravanakumardb1
6222fdaaa0 fix(notes): link dashboard workflows 2026-03-10 17:38:49 -07:00
saravanakumardb1
e0ad97023a docs(notes): record review progress 2026-03-10 17:36:27 -07:00
saravanakumardb1
5ce940110f fix(notes): select review queue items 2026-03-10 17:34:47 -07:00
saravanakumardb1
504b339203 docs(notes): record sidebar progress 2026-03-10 17:32:15 -07:00