# Track A — LLM Lab Workspace Removal

> **Repo:** `learning_ai_local_llms`
> **Can start:** Immediately (no dependencies)
> **Estimated time:** ~2.5 hours
> **Roadmap:** `../LOCAL_AI_CONSOLIDATION_ROADMAP.md` — read the Execution Checklist and Safety Matrix sections first.

---

## Goal

Remove the chat workspace from Local LLM Lab, making Local Memory GPT the single chat surface. Then add a cross-link from Mission Control to LocalMemGPT.

---

## Steps (4 commits)

### COMMIT 1 — `refactor(dashboard): remove chat workspace — LocalMemGPT is the chat surface`

1. Run `cd dashboard && pnpm test && pnpm run build` to establish green baseline
2. Delete the entire `dashboard/src/app/(workspace)/` directory (22 files: 6 routes + 16 components)
3. Delete `dashboard/src/app/api/ollama/title/` directory (1 workspace-only route)
4. Delete workspace lib files:
   - `dashboard/src/app/lib/db.ts`
   - `dashboard/src/app/lib/agents.ts`
   - `dashboard/src/app/lib/quick-actions.ts`
   - `dashboard/src/app/lib/scheduled-tasks.ts`
   - `dashboard/src/app/lib/cron.ts`
   - `dashboard/src/app/lib/migrate.ts`
5. Trim `types.ts`:
   - Copy `Attachment` (lines 119–126) and `ModelDefaults` (lines 163–169) into the shared section (after line 77)
   - Delete everything from line 78 onward (the `// --- v4 Workspace Types ---` comment and below)
   - **Why:** `router.ts` line 1 does `import type { Attachment, ModelDefaults } from './types'` → used by `api/ollama/chat/route.ts` (Mission Control)
6. Delete workspace tests:
   - `dashboard/src/app/lib/__tests__/agents.test.ts`
   - `dashboard/src/app/lib/__tests__/cron.test.ts`
7. Create `dashboard/src/app/page.tsx` that redirects to `/mission-control`:
   ```tsx
   import { redirect } from 'next/navigation';
   export default function Home() {
     redirect('/mission-control');
   }
   ```
8. Remove npm deps from `dashboard/package.json`: `idb`, `cron-parser`, `fuse.js`
9. Run `pnpm install` to update lockfile
10. Verify: `pnpm run typecheck && pnpm test && pnpm run build`
11. Grep for any remaining imports of deleted files:
    ```bash
    grep -r 'from.*\(workspace\)\|from.*db\|from.*agents\|from.*quick-actions\|from.*scheduled-tasks\|from.*cron\|from.*migrate' dashboard/src/
    ```

### COMMIT 2 — `test(e2e): update specs after workspace removal`

1. Delete `e2e/chat.spec.ts` — tests workspace chat flow
2. Update `e2e/health.spec.ts` — remove `Conversation Routes` test that navigates to `/c/test-id`
3. Update `e2e/accessibility.spec.ts` — remove `/compare`, `/tts`, `/whisper` from routes array (keep `/`, `/mission-control`)
4. Update `e2e/visual-regression.spec.ts` — remove `workspace` and `compare` from ROUTES array (keep `mission-control`)
5. Update `e2e/navigation.spec.ts` — `/` now redirects to `/mission-control`
6. Update `e2e/models.spec.ts` — `/` now redirects

### COMMIT 3 — `docs: update agent docs after workspace removal`

1. Update `AGENTS.md` — remove workspace references, update repo layout, adjust test count
2. Update `README.md` — remove chat workspace description, add note pointing to Local Memory GPT for chat
3. Update `CLAUDE.md`, `.windsurfrules`, `.cursorrules` — align with new scope

### COMMIT 4 — `feat(dashboard): add LocalMemGPT cross-link in Mission Control`

1. Add a "Chat with your models →" card/banner in Mission Control dashboard
2. Link to `http://localhost:3070` (LocalMemGPT web default port)
3. Make URL configurable via `LOCALMEMGPT_URL` env var (default: `http://localhost:3070`)
4. Add `LOCALMEMGPT_URL` to `.env.example`

---

## CRITICAL SAFETY RULES

**DO NOT delete these API routes** — Mission Control uses all of them:

- `api/ollama/chat/` — model testing prompt (page.tsx line 719)
- `api/ollama/stream/` — model comparison + benchmarks (lines 331, 538)
- `api/ollama/logs/` — Ollama log viewer (line 297)
- `api/tts/` — TTS engine status panel (line 179)
- `api/whisper/` — Whisper status card (line 165)
- `api/whisper/transcribe/` — transcription test button (line 313)

**DO NOT delete these lib files** — all shared:

- `lib/router.ts`, `lib/format.ts`, `lib/ollama-config.ts`, `lib/llm-router.ts`
- `lib/product-config.ts`, `lib/use-theme.ts`, `lib/use-keyboard-shortcuts.ts`

**DO NOT delete** `src/components/` — all 6 components are shared by Mission Control.

**DO NOT delete** `globals.css` — all 319 lines are shared (no workspace-specific tokens).
