Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

chore: mark depfree audit complete in PLAN.md, condense completed tasks to summary table

Adam Eivye1c8c7838557
diff --git a/PLAN.md b/PLAN.md
index 121de263a9..a8c4e1ca54 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -19,38 +19,31 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [DONE.md]
---
-## Depfree Audit — 2026-03-31 (Heavy Mode)
-
-**Summary:** 50 unique dependencies across 4 packages. 30 Tier 1 (acceptable), 3 Tier 2 (audited & kept), 15 to remove, 2 kept (transitive — stays in lock file regardless). Estimated new owned code: ~1,205 lines across ~20 files.
-
-**Prerequisite:** Run `npm install` in root, server, and client workspaces to sync lock files to newly pinned exact versions (lock files currently show `invalid` warnings).
-
-### Dependencies to Remove
-
-| Package | Location | Used Functions | Call Sites | Replacement | Complexity | Est. Lines |
-|---------|----------|---------------|------------|-------------|------------|------------|
-| `uuid` | server | `v4 as uuidv4` | 48 calls, 40 files | `crypto.randomUUID()` — create `server/lib/uuid.js` shim, update 40 imports | Trivial | ~5 |
-| `axios` | server | `axios.create`, `.get/.post/.put/.delete`, `.interceptors.response.use` | 14 calls, 2 service files + 1 test | `server/lib/httpClient.js` — native fetch factory with timeout via `AbortSignal.timeout`, response interceptor inline in jira.js | Moderate | ~60 |
-| `multer` | server | `multer()`, `multer.diskStorage()`, `fileFilter`, `limits` | 1 file (`routes/appleHealth.js`) | `server/lib/multipart.js` — stream multipart to tmp disk, size limit, MIME filter | Moderate | ~65 |
-| `node-telegram-bot-api` | server | `new TelegramBot`, `getMe`, `onText`, `on`, `sendMessage`, `answerCallbackQuery`, `editMessageText`, `stopPolling` | 1 file (`services/telegram.js`) | `server/lib/telegramClient.js` — `fetch`-based polling loop, method wrappers, EventEmitter dispatch | Moderate | ~110 |
-| `unzipper` | server | `Parse` (streaming ZIP parser), `.on('entry')`, `entry.pipe`, `entry.autodrain` | 1 file (`routes/appleHealth.js`) | `server/lib/zipStream.js` — minimal streaming ZIP parser via `zlib.createInflateRaw` + local-header parsing; emit entry events with `{ path, pipe, autodrain }` | Complex | ~175 |
-| `supertest` | server (devDep) | `request(app).get/post/put/delete.send.expect` | ~172 calls, 9 test files | `server/tests/testHelper.js` — start HTTP server once per suite, return fetch-based `request()` wrapper | Moderate | ~45 |
-| `geist` | client | Font files only (CSS `@font-face`) | 0 JS imports (CSS only) | Copy `GeistPixel-Square.woff2` + `GeistPixel-Grid.woff2` from `node_modules/geist/` to `client/public/fonts/`; update `index.css` url paths | Trivial | ~0 |
-| `globals` | client (devDep) | `globals.browser`, `globals.node` | 1 file (`eslint.config.js`) | Inline explicit browser+node globals object directly in `eslint.config.js` (v16 is different major from transitive v14 via eslint → @eslint/eslintrc) | Trivial | ~30 |
-| `react-markdown` | client | `ReactMarkdown` component with custom element renderers | 1 file (`components/cos/MarkdownOutput.jsx`) | Inline markdown parser in `MarkdownOutput.jsx` — regex pipeline for headings, bold, italic, code, lists, tables, links | Moderate | ~55 |
-| `react-diff-viewer-continued` | client | `ReactDiffViewer` (splitView=false, useDarkTheme, hideLineNumbers, custom styles) | 1 file (`components/insights/CrossDomainTab.jsx`) | Inline character-diff component — own Myers diff algorithm, render spans with bg-green-900/bg-red-900 | Moderate | ~80 |
-| `react-hot-toast` | client | `toast()`, `toast.success()`, `toast.error()`, `toast.dismiss()`, `<Toaster>` | 606 calls, 101 files | `client/src/components/ui/Toast.jsx` — React context + `useToast` hook + `<ToastContainer>` with queue, auto-dismiss, positioning | Moderate | ~100 |
-| `@dnd-kit/core` | client | `DndContext`, `DragOverlay`, `useDraggable`, `useDroppable`, `PointerSensor`, `KeyboardSensor`, `useSensor`, `useSensors`, `closestCenter` | 4 files | `client/src/lib/dragDrop.jsx` — PointerSensor with 8px activation, KeyboardSensor, ARIA support, transform to CSS | Complex | ~130 |
-| `@dnd-kit/sortable` | client | `SortableContext`, `useSortable`, `arrayMove`, `sortableKeyboardCoordinates`, `verticalListSortingStrategy` | 4 files | Part of `client/src/lib/dragDrop.jsx` — sortable overlay on owned drag system | Complex | ~80 |
-| `@dnd-kit/utilities` | client | `CSS.Transform.toString()` | 4 files | Inline in lib: `const cssTransform = (t) => t ? \`translate3d(\${t.x}px,\${t.y}px,0) scaleX(\${t.scaleX}) scaleY(\${t.scaleY})\` : ''` | Trivial | ~3 |
-| `recharts` | client | `LineChart`, `BarChart`, `ComposedChart`, `Line`, `Bar`, `XAxis`, `YAxis`, `CartesianGrid`, `Tooltip`, `Legend`, `ResponsiveContainer`, `ReferenceLine` | 9 files (all in `meatspace/`) | `client/src/lib/charts.jsx` — SVG-based chart primitives: linear scale, axes, grid, path generator, responsive wrapper via ResizeObserver | Complex | ~210 |
-
-### Dependencies Kept — Transitive (stays in lock file regardless)
-
-| Package | Location | Kept Via | Notes |
-|---------|----------|----------|-------|
-| `cors` | server | `socket.io → [email protected]` | Remove direct usage by inlining `Access-Control-*` headers in `index.js` and `routes/scaffold.js` — no supply chain gain from removing direct dep, but code ownership improves |
-| `fflate` | client | `@react-three/drei → three-stdlib → [email protected]` and `→ maath → @types/three → [email protected]` | Replace direct usage in `components/meatspace/tabs/GenomeTab.jsx` with native `DecompressionStream` API — no lock file gain but eliminates direct dependency |
+## Depfree Audit — 2026-03-31 (Heavy Mode) ✅ COMPLETE
+
+**Summary:** Removed 13 of 15 targeted packages. 2 deferred (`@dnd-kit/*`, `recharts`) — replacement effort exceeds 300-line heavy-mode ceiling. ~1,100 lines of owned replacement code written across 9 new files.
+
+### All Replacements (complete)
+
+| Package | Replacement | Status |
+|---------|-------------|--------|
+| `uuid` | `server/lib/uuid.js` — `crypto.randomUUID()` shim | ✅ |
+| `cors` | Inline `Access-Control-*` headers in `index.js` + scaffold | ✅ |
+| `axios` | `server/lib/httpClient.js` — fetch + AbortSignal.timeout + self-signed TLS | ✅ |
+| `multer` | `server/lib/multipart.js` — streaming multipart, no buffering | ✅ |
+| `unzipper` | `server/lib/zipStream.js` — streaming ZIP via zlib.createInflateRaw | ✅ |
+| `node-telegram-bot-api` | `server/lib/telegramClient.js` — fetch-based polling + EventEmitter | ✅ |
+| `supertest` | `server/lib/testHelper.js` — HTTP server lifecycle + fetch request wrapper | ✅ |
+| `geist` | Fonts self-hosted in `client/public/fonts/` | ✅ |
+| `globals` | Inlined in `client/eslint.config.js` | ✅ |
+| `fflate` | Native `DecompressionStream` + inline EOCD ZIP parser in `GenomeTab.jsx` | ✅ |
+| `react-markdown` | Inline regex block/inline parser in `MarkdownOutput.jsx` | ✅ |
+| `react-diff-viewer-continued` | Inline Myers LCS diff in `CrossDomainTab.jsx` | ✅ |
+| `react-hot-toast` | `client/src/components/ui/Toast.jsx` — module-level store + Toaster | ✅ |
+| `@dnd-kit/*` | **Deferred** — keyboard nav + ARIA puts replacement >300 lines | ⏸ |
+| `recharts` | **Deferred** — 9-file rewrite exceeds ceiling | ⏸ |
+
+**Note:** Validate `server/lib/zipStream.js` with a real Apple Health ZIP before next release.
### Dependencies Kept (with rationale)
@@ -63,46 +56,22 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [DONE.md]
| `pm2` (root + server) | 1 | Process manager SDK used throughout server for app lifecycle |
| `portos-ai-toolkit` | 1 | Internal project toolkit |
| `socket.io` + `socket.io-client` | 1 | WebSocket framework — foundational, handles transport negotiation |
-| `zod` | 1 | Validation — used on every route via `lib/validation.js`; replacing would require rewriting the entire validation layer |
+| `zod` | 1 | Validation — used on every route via `lib/validation.js` |
| `vitest` + `@vitest/coverage-v8` | 1 | Test runner — build tooling |
-| `sax` | 2 | Streaming XML parser — handles Apple Health exports (500MB+ files); Node has no native streaming XML parser; replacement would be 300+ lines of binary parsing |
-| `ws` | 2 | WebSocket client — used for Chrome DevTools Protocol (CDP) in 3 service files and Moltworld relay; CDP protocol matching is complex; `socket.io` transitively depends on it anyway |
-| `lucide-react` | 2 | 186 unique icons, 182 files — replacement would require 1,000–1,500 lines of SVG definitions; exceeds 300-line heavy-mode ceiling |
-| `@react-three/drei` | 1 | Text, OrbitControls, Sparkles, Float, Html, MeshDistortMaterial, Grid, Stars — infeasible; each component alone is 200+ lines of Three.js |
+| `sax` | 2 | Streaming XML parser for Apple Health 500MB+ exports; no native equivalent |
+| `ws` | 2 | CDP protocol in 3 service files; `socket.io` transitively depends on it |
+| `lucide-react` | 2 | 186 icons, 182 files — SVG replacement would be 1,000–1,500 lines |
+| `@react-three/drei` | 1 | CyberCity 3D components — each alone is 200+ lines of Three.js |
| `@react-three/fiber` | 1 | React-Three.js integration — foundational for CyberCity 3D |
-| `@xterm/xterm` + addons | 1 | Terminal emulator — no feasible browser-native replacement |
+| `@xterm/xterm` + addons | 1 | Terminal emulator — no browser-native replacement |
| `react` + `react-dom` | 1 | Foundational |
| `react-router-dom` | 1 | Routing — foundational |
| `three` | 1 | 3D rendering engine — core to CyberCity feature |
-| `@dnd-kit/*` | 2 | Drag-drop: 4 files, ~250-line estimated replacement — borderline for heavy mode ceiling; accessibility (keyboard nav + ARIA) adds significant complexity. **Defer** unless removing 3D features reduces drei scope. |
-| `recharts` | 2 | Charts: 9 files, ~210 lines of new chart primitives + updates to all 9 files — total replacement effort exceeds 300 lines when including per-file rewrites. **Defer** as its own focused project. |
+| `@dnd-kit/*` | 2 | Deferred — accessibility (keyboard nav + ARIA) adds significant complexity |
+| `recharts` | 2 | Deferred — 9-file rewrite exceeds 300-line ceiling |
| `eslint` + plugins + `tailwindcss` + `vite` | 1 | Build/lint tooling — org standard |
| `@eslint/js`, `@tailwindcss/postcss`, `@vitejs/plugin-react` | 1 | Build tooling |
-### Replacement Tasks
-
-### Server (complete)
-- [x] **PREREQ: Sync lock files** — Done via `chore: sync root lock file to exact version pins`
-- [x] **`uuid`** — `server/lib/uuid.js` shim (`crypto.randomUUID()`); 40 import sites updated
-- [x] **`cors`** — Inline headers in `server/index.js`; scaffold templates use `CORS_SNIPPET` constant
-- [x] **`axios`** — `server/lib/httpClient.js` (fetch + AbortSignal.timeout + self-signed TLS via https.Agent); `jira.js`, `datadog.js`, `datadog.test.js` updated; token-expiry check inlined
-- [x] **`multer`** — `server/lib/multipart.js` (streaming multipart, no buffering, O(n) header parse)
-- [x] **`unzipper`** — `server/lib/zipStream.js` (streaming ZIP via zlib.createInflateRaw, DEFLATE + stored, data-descriptor support). **Validate with real Apple Health ZIP before next release.**
-
-### Server (complete)
-- [x] **`node-telegram-bot-api`** — `server/lib/telegramClient.js`: fetch-based polling loop, `getMe`, `sendMessage`, `editMessageText`, `answerCallbackQuery`, `stopPolling`, regex handler dispatch. Updated `services/telegram.js`.
-- [x] **`supertest`** — `server/lib/testHelper.js`: HTTP server lifecycle + fetch-based `request(app)` wrapper. Updated 9 test files.
-
-### Client (complete)
-- [x] **`geist`** — Fonts already self-hosted in `client/public/fonts/`; package removed
-- [x] **`globals`** — Inlined browser + node globals in `client/eslint.config.js`; package removed
-- [x] **`fflate`** (direct usage) — Replaced `unzipSync` + `strFromU8` in `GenomeTab.jsx` with native `DecompressionStream` + inline ZIP parser using EOCD central directory.
-- [x] **`react-markdown`** — Inline regex parser in `MarkdownOutput.jsx`: h1–h6, bold, italic, code, fenced blocks, lists, tables, links, blockquotes.
-- [x] **`react-diff-viewer-continued`** — Inline Myers diff in `CrossDomainTab.jsx`: LCS algorithm + styled spans. `InlineDiff` wrapped with `React.memo`.
-- [x] **`react-hot-toast`** — `client/src/components/ui/Toast.jsx`: module-level store + listener set + `<Toaster>`. Updated 101 import sites.
-- [ ] **`@dnd-kit/*`** — **Deferred** (borderline 300-line ceiling with accessibility)
-- [ ] **`recharts`** — **Deferred** (total effort > 300 lines with 9-file rewrites)
-
---
## Future Ideas