diff --git a/docs/AGENT_TASK_ROADMAP.md b/docs/AGENT_TASK_ROADMAP.md index c938d59..1cb134f 100644 --- a/docs/AGENT_TASK_ROADMAP.md +++ b/docs/AGENT_TASK_ROADMAP.md @@ -1,6 +1,6 @@ # NoteLett — Agent Task Roadmap -**Date:** March 30, 2026 +**Date:** March 31, 2026 **Product:** NoteLett (`notelett`) — Structured notes for humans + AI agents **Repo:** `learning_ai_notes` **Stack:** Fastify 5 backend (port 4016) · Next.js 16 web (port 3000) · Expo mobile @@ -14,7 +14,7 @@ |---------|-----------------|-------|-------|---------------| | **Backend** | 7 modules, ~32 endpoints, 8 MCP tools | 20 files (unit + integration) | ✅ tsc | 13 (5 missing source in common_plat) | | **Web** | 6 pages, 13 components, 15 lib files | 7 unit + 7 E2E | ✅ next build | 10 (all used) | -| **Mobile** | 5 tabs incl. settings, note detail, auth (+ register + session-aware index), kill-switch gate, broadcast + survey in root layout, feedback on settings, offline queue flush (boot + foreground), `app-metadata` for telemetry versions, Vitest RN mocks + component smoke tests, 5 stores | 32 tests (6 files) | ✅ typecheck | Direct `@bytelyst/*` clients (+ optional future RN platform SDK) | +| **Mobile** | 5 tabs incl. settings, note detail, auth (+ register + session-aware index), kill-switch gate, broadcast + survey in root layout, feedback on settings, **auth-gated** store hydrates + broadcast/survey polling, offline queue flush (after auth, boot + foreground), **`flushTelemetry` on background**, `app-metadata` for telemetry versions, Vitest RN mocks + component smokes (auth, home, settings), 5 stores | 33 tests (7 files) | ✅ typecheck | Direct `@bytelyst/*` clients (+ optional future RN platform SDK) | **Package resolution note:** 5 backend `@bytelyst/*` packages (`backend-config`, `backend-flags`, `backend-telemetry`, `fastify-auth`, `field-encrypt`) do not have source directories in `learning_ai_common_plat/packages/`. They resolve via `^0.1.0` from the private Gitea npm registry but their source must be created in common_plat. This is a shared blocker with NomGap — see Phase 0 below. @@ -24,14 +24,13 @@ For **ordered mobile implementation** (Expo app under `mobile/`), use **[`MOBILE ### Mobile — remaining gaps (March 2026 review) -Shipped since earlier audit: **session-aware `index`** (`hasBootstrapped` → tabs vs auth), **register** on auth store, **kill-switch blocking UI**, **broadcast + survey** in `_layout.tsx`, **feedback** on settings, **offline queue flush** on boot and `AppState` active, **telemetry app/build** via `mobile/src/lib/app-metadata.ts` (Expo Constants). +**Shipped:** Session-aware `index`, register, kill-switch UI, broadcast/survey, feedback, offline queue, `app-metadata`, **auth-gated hydrates** (notes/workspaces/inbox + polling only when `isAuthenticated`), **`flushTelemetry()` on background**, settings smoke test, capture → `blob-upload` comment. -Still open or follow-up (see [`MOBILE_DELEGATION_ROADMAP.md`](./MOBILE_DELEGATION_ROADMAP.md) **§ Remaining checklist**): +**Still open** (see [`MOBILE_DELEGATION_ROADMAP.md`](./MOBILE_DELEGATION_ROADMAP.md) **§ Remaining / deferred**): -1. **Hydrate vs auth** — `_layout` still kicks off `hydrateNotes` / `hydrateWorkspaces` / `hydrateInbox` in the same effect as `bootstrapAuth()` without awaiting auth; unauthenticated cold starts may still hit 401s or empty error handling (**Block A** refinement). -2. **Telemetry flush** — No `AppState` → `telemetryClient.flush()` (or equivalent) on background; offline **note** queue flushes on foreground (**Block G**). -3. **Optional convergence** — Adopt `@bytelyst/react-native-platform-sdk` for flags/kill/broadcast/survey to match NomGap, or keep discrete clients and document (**Block A §A.3**). -4. **Deeper tests / sync** — Expand RNTL coverage; optional `@bytelyst/sync` remains **Block I**. +1. **Deeper RNTL** — fireEvent / richer assertions (Block H TODO in delegation doc). +2. **Optional** — `@bytelyst/react-native-platform-sdk` alignment with NomGap (**A §A.3**). +3. **Optional** — `@bytelyst/sync` (**Block I**). --- diff --git a/docs/MOBILE_DELEGATION_ROADMAP.md b/docs/MOBILE_DELEGATION_ROADMAP.md index f842234..8df3600 100644 --- a/docs/MOBILE_DELEGATION_ROADMAP.md +++ b/docs/MOBILE_DELEGATION_ROADMAP.md @@ -40,20 +40,19 @@ --- -## Remaining checklist (March 2026 review) +## Remaining / deferred (March 2026) -Earlier “post-review” items **1–7** (session index, kill UI, broadcast/survey, feedback, queue flush, telemetry versions) are **addressed in code**. Focus next: +| # | Item | Status | +|---|------|--------| +| 1 | Hydrates only after `hasBootstrapped` + `isAuthenticated` | ✅ `_layout.tsx` | +| 2 | Telemetry **`flushTelemetry()`** on `AppState` background/inactive | ✅ `platform.ts` + `_layout.tsx` | +| 3 | Blob uploads single path | ✅ `api/blob-upload.ts` + capture screen comment | +| 4 | Extra RNTL smoke (`SettingsScreen`) | ✅ `settings.test.tsx` | +| 5 | Deeper RNTL (fireEvent / full render tree) | 🟨 Deferred — see Block H TODO | +| 6 | `@bytelyst/react-native-platform-sdk` vs discrete clients | ⏸ Optional (**A §A.3**) | +| 7 | `@bytelyst/sync` | ⏸ Block **I** | -| # | Issue | Primary files | Block | -|---|--------|----------------|--------| -| 1 | Hydrates still run in parallel with `bootstrapAuth` — may 401 before token | `_layout.tsx`, stores | **A** (refine) | -| 2 | No telemetry **buffer flush** on background (offline note queue flushes on foreground) | `platform.ts` / `_layout.tsx` | **G** | -| 3 | Blob uploads for attachments — ensure single path via `blobClient` when file capture ships | capture / note detail | **F** | -| 4 | Deeper RNTL coverage beyond smoke tests | `mobile/` tests | **H** | -| 5 | Optional `@bytelyst/react-native-platform-sdk` vs discrete clients (NomGap alignment) | providers | **A §A.3** | -| 6 | Optional `@bytelyst/sync` | stores + API | **I** | - -**Architecture note:** NomGap uses **`@bytelyst/react-native-platform-sdk`** for flags, kill switch, broadcast, survey. NoteLett uses **direct** `broadcast-client`, `survey-client`, etc. — both valid; converge only if you want one pattern across products. +**Architecture note:** NomGap uses **`react-native-platform-sdk`** providers; NoteLett uses **direct** platform HTTP clients — both valid until you standardize. --- @@ -94,6 +93,7 @@ If the team standardizes on **`@bytelyst/react-native-platform-sdk`**: either in ### A.4 Done criteria - [x] Cold start: authed → tabs; unauthed → auth +- [x] **Refine:** Data hydrates (notes/workspaces/inbox), broadcast/survey polling, and queue flush timers run **only when** `hasBootstrapped && isAuthenticated` — avoids pre-auth 401s - [x] `cd mobile && pnpm run typecheck && pnpm test` - [x] Update **Current State** / any new checklist rows in [`AGENT_TASK_ROADMAP.md`](./AGENT_TASK_ROADMAP.md) - [x] Commit: [`ae0a481`](https://github.com/saravanakumardb1/learning_ai_notes/commit/ae0a481) — `feat(mobile): complete block A auth session flow` @@ -207,6 +207,7 @@ Execute in **flexible order**; prefer **small commits**. | Task | Hints | |------|--------| | **Telemetry metadata** | Use `expo-constants` for `appVersion` / `buildNumber` instead of hardcoded strings in `platform.ts` | +| **Telemetry flush** | `flushTelemetry()` on `AppState` `background` / `inactive` (matches NomGap pattern) | | **Feature flags in UI** | Gate experimental mobile surfaces with `isFeatureEnabled` where web uses flags | | **Accessibility** | `accessibilityLabel` on tab icons and primary actions | | **Theme** | Prefer shared tokens from `@bytelyst/design-tokens` / `theme/` consistently | @@ -214,6 +215,7 @@ Execute in **flexible order**; prefer **small commits**. **Done criteria** - [x] Runtime telemetry/client metadata uses `expo-constants` + platform metadata helpers +- [x] **`flushTelemetry`** exported from `platform.ts`; root layout flushes on background - [x] Accessibility labels added on tabs and primary action buttons - [x] Typecheck/tests pass and changes reflected in [`AGENT_TASK_ROADMAP.md`](./AGENT_TASK_ROADMAP.md) - [x] Commit: [`e4683ad`](https://github.com/saravanakumardb1/learning_ai_notes/commit/e4683ad) — `fix(mobile): complete block G metadata and accessibility` @@ -232,10 +234,11 @@ Execute in **flexible order**; prefer **small commits**. - [x] **Auth screen** — import smoke test (valid component, named export, no redirect when unauthenticated) - [x] **Home tab screen** — import smoke test (valid component, named export) +- [x] **Settings screen** — import smoke test (`settings.test.tsx`) ### H.3 Done criteria -- [x] `cd mobile && pnpm run typecheck && pnpm test` — 32 tests pass (27 store + 5 component) +- [x] `cd mobile && pnpm run typecheck && pnpm test` — component smokes include auth, home, settings - [x] Update [`AGENT_TASK_ROADMAP.md`](./AGENT_TASK_ROADMAP.md) - [x] Commit: [`5a0175f`](https://github.com/saravanakumardb1/learning_ai_notes/commit/5a0175f) — `feat(mobile): add Block H — Vitest RN mock aliases + component smoke tests` @@ -289,7 +292,13 @@ Systematic review of all completed blocks (A–H) identified and fixed: - **All screens** — missing `accessibilityLabel` on interactive elements (commit `83f4953`) - **Backend** — `trackEvent` call signature mismatch + route test `delete` mock (commit `6acd1a7`) -**Remaining:** Block F (blob uploads) and Block I (sync engine) are deferred/optional. +**Follow-up (March 31, 2026):** + +- [x] **Auth-gated hydrates** — notes/workspaces/inbox + broadcast/survey polling + offline flush timers only after `isAuthenticated` +- [x] **`flushTelemetry()`** on app background/inactive +- [x] **Settings** RNTL smoke test; **capture** documents `blob-upload` for future file picker + +**Still deferred:** Block **I** (`@bytelyst/sync`); optional RN **platform SDK** alignment; deeper RNTL assertions (Block H TODO). ---