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

fix: address Codex 5.5 review (round 1) — nav drift, lint, bundle weight

Adam Eivy000368249df1
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index a4ea06da2e..c4443f8a74 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -1,5 +1,17 @@
# Next Release
+## Fixed
+
+- **Codex 5.5 review round 1: navigation + lint + bundle** — addressed the four "Next 1-2 Days" items from `CODEX5.5_REVIEW.md`.
+ - **Client lint runs again.** `npm run lint --prefix client` was crashing with `TypeError: expand is not a function` because the top-level `brace-expansion: ^5.0.5` security override was being inherited by ESLint's `minimatch@3` chain, which still consumes the v1 CommonJS API. Added a nested override (`"minimatch@3": { "brace-expansion": "^1.1.12" }`) so minimatch gets a patched-but-API-compatible version while everything else still gets v5. Fixing lint exposed real issues that pre-commit was silently skipping: `CharacterSheet.jsx:218` referenced an undefined `put` (should be `charPut`); `domIndex.js`/`voiceClient.js` used browser globals (`CSS`, `OfflineAudioContext`, `MediaRecorder`, `AudioWorkletNode`) that weren't declared in `eslint.config.js`. All errors fixed; lint is now 0 errors.
+ - **Removed `/cos/scripts` dead route.** Sidebar + nav manifest pointed to a `scripts` tab that was merged into `Jobs` back in v1.34.0. Selecting Scripts from `⌘K`/voice/sidebar silently fell through to Tasks. Cleared the entry from both `Layout.jsx` and `navManifest.js`.
+ - **Surfaced hidden-but-shipped tabs.** `Brain → Feeds` and `Digital Twin → Time Capsule` were rendered by their pages (`brain/constants.js`, `digital-twin/constants.js`) but absent from the sidebar and nav manifest, so users could only reach them by typing the URL. Added `nav.brain.feeds` and `nav.twin.time-capsule` entries (with aliases + keywords) and matching sidebar links.
+ - **Fixed `/ask` height/layout brittleness.** The Ask page wraps a full-height chat shell, but `Layout.jsx`'s full-width route list omitted `/ask`, so it rendered inside the padded `max-w-7xl` wrapper and compensated with `h-[calc(100vh-4rem)] -m-4`. Classified `/ask` (and `/ask/:conversationId`) as full-width and switched the shell to `h-full` to inherit the layout's flex height.
+ - **Nav contract test.** Added `lib/navManifest.test.js` cross-checks: for each tabbed page (`/brain`, `/cos`, `/digital-twin`, `/meatspace`), every nav manifest path must resolve to a real `TAB` id from the page's `constants.js`, and every `TAB` id must be reachable from the manifest. This is what would have caught all three nav drift bugs above. Constants files are read as text and TAB ids extracted with regex so the test runs in the server-only Node environment without pulling in client `lucide-react` imports.
+ - **Bundle weight cut.** `App.jsx` was statically importing 24 page modules (Brain, DigitalTwin, MeatSpace, Wiki, Post, Settings, Insights, Loops, CharacterSheet, etc.) that the user never sees on first load. Switched all non-home pages to `lazyWithReload(...)`. Result: main `index-*.js` chunk dropped from **~2.95 MB / 736 KB gzip** to **295 KB / 76 KB gzip** (~4× reduction in initial download). Each lazy page now ships in its own chunk loaded on navigation.
+
+ Files: `client/package.json` (nested minimatch override), `client/eslint.config.js` (browser globals), `client/src/pages/CharacterSheet.jsx` (charPut fix), `client/src/components/Layout.jsx` (sidebar entries + full-width route), `client/src/pages/Ask.jsx` (height fix), `client/src/App.jsx` (lazy imports), `server/lib/navManifest.js` (entries), `server/lib/navManifest.test.js` (contract tests).
+
## Added
- **Image Gen page + custom-prompt test render in Settings** — the Image Gen settings tab no longer caps out at "test the connection". A new **Test Render** card lets you write a real prompt (and optional negative prompt) and watch a live diffusion preview, so saving the SD API URL is verified end-to-end without leaving the settings screen. A dedicated **Image Gen** page (`/image-gen`) is now reachable from the sidebar (alphabetized between Goals and Insights) and from `⌘K` (aliases `image-gen`, `imagegen`, `generate-image`, `sd`, `stable-diffusion`). The page exposes positive/negative prompts, six preset resolutions (square / landscape / portrait + Flux 832×1216 / 1216×832 + 1024² HD), Steps and CFG Scale sliders, a seed input with a randomize-die button, a live preview (base64 progressive frames piped through Socket.IO `image-gen:*` events), step/ETA readout, and a session history grid (last 24 renders, persisted to `localStorage`) with one-click "Reuse settings" and Download. UI guidance was lifted from the sibling `pixie-forge` project. The settings tab's previously bare `image-gen` alias was renamed to `image-gen-settings` so the bare alias now lands on the new page. The duplicated diffusion-progress socket subscription pattern (also present in `CharacterSheet.jsx`) was extracted into a shared `useImageGenProgress()` hook so the new ImageGenTab + ImageGen page consume one source of truth via `begin()` / `end()` lifecycle calls.
diff --git a/client/eslint.config.js b/client/eslint.config.js
index 58eebc33cf..22eb779637 100644
--- a/client/eslint.config.js
+++ b/client/eslint.config.js
@@ -34,6 +34,14 @@ const browserGlobals = {
Image: 'readonly', Audio: 'readonly', SVGElement: 'readonly',
getComputedStyle: 'readonly', matchMedia: 'readonly',
self: 'readonly', globalThis: 'readonly',
+ CSS: 'readonly',
+ AudioContext: 'readonly', OfflineAudioContext: 'readonly',
+ AudioWorkletNode: 'readonly', MediaRecorder: 'readonly',
+ MediaStream: 'readonly', MediaStreamTrack: 'readonly',
+ RTCPeerConnection: 'readonly', RTCSessionDescription: 'readonly',
+ WebSocket: 'readonly', SpeechRecognition: 'readonly',
+ webkitSpeechRecognition: 'readonly', SpeechSynthesisUtterance: 'readonly',
+ speechSynthesis: 'readonly',
};
const nodeGlobals = {
diff --git a/client/package.json b/client/package.json
index 298c84326a..953f093062 100644
--- a/client/package.json
+++ b/client/package.json
@@ -38,6 +38,9 @@
},
"overrides": {
"brace-expansion": "^5.0.5",
- "socket.io-parser": "^4.2.6"
+ "socket.io-parser": "^4.2.6",
+ "minimatch@3": {
+ "brace-expansion": "^1.1.12"
+ }
}
}
diff --git a/client/src/App.jsx b/client/src/App.jsx
index 3b9b3b82b7..a2f752bd71 100644
--- a/client/src/App.jsx
+++ b/client/src/App.jsx
@@ -4,30 +4,8 @@ import Layout from './components/Layout';
import { getSettings, updateSettings } from './services/api';
import BrailleSpinner from './components/BrailleSpinner';
import Dashboard from './pages/Dashboard';
-import Ambient from './pages/Ambient';
import Apps from './pages/Apps';
-import CreateApp from './pages/CreateApp';
-import Templates from './pages/Templates';
-import PromptManager from './pages/PromptManager';
-import Brain from './pages/Brain';
-import Security from './pages/Security';
-import DigitalTwin from './pages/DigitalTwin';
-import Agents from './pages/Agents';
-import Uploads from './pages/Uploads';
-import Settings from './pages/Settings';
-import Shell from './pages/Shell';
-import BrowserPage from './pages/Browser';
-import Jira from './pages/Jira';
-import JiraReports from './pages/JiraReports';
-import DataManager from './pages/DataManager';
-import Insights from './pages/Insights';
-import Instances from './pages/Instances';
-import MeatSpace from './pages/MeatSpace';
-import Post from './pages/Post';
-import Review from './pages/Review';
-import Loops from './pages/Loops';
-import CharacterSheet from './pages/CharacterSheet';
-import Wiki from './pages/Wiki';
+import Ambient from './pages/Ambient';
// Auto-reload on stale chunk errors (e.g., after a rebuild changes chunk hashes)
// Uses sessionStorage to prevent infinite reload loops (max 1 reload per session)
@@ -68,6 +46,28 @@ const Submodules = lazyWithReload(() => import('./pages/Submodules'));
const ChiefOfStaff = lazyWithReload(() => import('./pages/ChiefOfStaff'));
const Ask = lazyWithReload(() => import('./pages/Ask'));
const ImageGen = lazyWithReload(() => import('./pages/ImageGen'));
+const CreateApp = lazyWithReload(() => import('./pages/CreateApp'));
+const Templates = lazyWithReload(() => import('./pages/Templates'));
+const PromptManager = lazyWithReload(() => import('./pages/PromptManager'));
+const Brain = lazyWithReload(() => import('./pages/Brain'));
+const Security = lazyWithReload(() => import('./pages/Security'));
+const DigitalTwin = lazyWithReload(() => import('./pages/DigitalTwin'));
+const Agents = lazyWithReload(() => import('./pages/Agents'));
+const Uploads = lazyWithReload(() => import('./pages/Uploads'));
+const Settings = lazyWithReload(() => import('./pages/Settings'));
+const Shell = lazyWithReload(() => import('./pages/Shell'));
+const BrowserPage = lazyWithReload(() => import('./pages/Browser'));
+const Jira = lazyWithReload(() => import('./pages/Jira'));
+const JiraReports = lazyWithReload(() => import('./pages/JiraReports'));
+const DataManager = lazyWithReload(() => import('./pages/DataManager'));
+const Insights = lazyWithReload(() => import('./pages/Insights'));
+const Instances = lazyWithReload(() => import('./pages/Instances'));
+const MeatSpace = lazyWithReload(() => import('./pages/MeatSpace'));
+const Post = lazyWithReload(() => import('./pages/Post'));
+const Review = lazyWithReload(() => import('./pages/Review'));
+const Loops = lazyWithReload(() => import('./pages/Loops'));
+const CharacterSheet = lazyWithReload(() => import('./pages/CharacterSheet'));
+const Wiki = lazyWithReload(() => import('./pages/Wiki'));
// Loading fallback for lazy-loaded pages
const PageLoader = () => (
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index ef1e79f261..e83fc5f3c7 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -74,7 +74,9 @@ import {
BookOpen,
NotebookPen,
Search,
- Mic
+ Mic,
+ Rss,
+ Archive
} from 'lucide-react';
/* global __APP_VERSION__ */
import Logo from './Logo';
@@ -104,6 +106,7 @@ const navItems = [
{ to: '/brain/config', label: 'Config', icon: Settings },
{ to: '/brain/daily-log', label: 'Daily Log', icon: NotebookPen },
{ to: '/brain/digest', label: 'Digest', icon: Calendar },
+ { to: '/brain/feeds', label: 'Feeds', icon: Rss },
{ to: '/brain/graph', label: 'Graph', icon: Network },
{ to: '/brain/inbox', label: 'Inbox', icon: MessageSquare },
{ to: '/brain/links', label: 'Links', icon: Link2 },
@@ -142,7 +145,6 @@ const navItems = [
{ to: '/loops', label: 'Loops', icon: RefreshCw },
{ to: '/cos/memory', label: 'Memory', icon: Brain },
{ to: '/cos/schedule', label: 'Schedule', icon: Clock },
- { to: '/cos/scripts', label: 'Scripts', icon: Terminal },
{ to: '/cos/productivity', label: 'Streaks', icon: Flame },
{ to: '/cos/jobs', label: 'System Tasks', icon: Bot },
{ to: '/cos/tasks', label: 'Tasks', icon: FileText }
@@ -186,7 +188,8 @@ const navItems = [
{ to: '/digital-twin/interview', label: 'Interview', icon: MessageSquare },
{ to: '/digital-twin/overview', label: 'Overview', icon: Heart },
{ to: '/digital-twin/taste', label: 'Taste', icon: Palette },
- { to: '/digital-twin/test', label: 'Test', icon: CheckCircle }
+ { to: '/digital-twin/test', label: 'Test', icon: CheckCircle },
+ { to: '/digital-twin/time-capsule', label: 'Time Capsule', icon: Archive }
]
},
{ to: '/goals/list', label: 'Goals', icon: Target, single: true },
@@ -704,6 +707,8 @@ export default function Layout() {
{/* Main content */}
{(() => {
const isFullWidth = location.pathname === '/character' ||
+ location.pathname === '/ask' ||
+ location.pathname.startsWith('/ask/') ||
location.pathname.startsWith('/calendar') ||
location.pathname.startsWith('/cos') ||
location.pathname.startsWith('/brain') ||
diff --git a/client/src/pages/Ask.jsx b/client/src/pages/Ask.jsx
index d535a2ba41..8cb8e1b320 100644
--- a/client/src/pages/Ask.jsx
+++ b/client/src/pages/Ask.jsx
@@ -436,7 +436,7 @@ export default function Ask() {
const showEmptyState = !conversationId && !streaming;
return (
- <div className="flex flex-col md:flex-row h-[calc(100vh-4rem)] -m-4">
+ <div className="flex flex-col md:flex-row h-full">
<Sidebar
conversations={conversations}
activeId={conversationId}
diff --git a/client/src/pages/CharacterSheet.jsx b/client/src/pages/CharacterSheet.jsx
index c292e52138..af5c8df670 100644
--- a/client/src/pages/CharacterSheet.jsx
+++ b/client/src/pages/CharacterSheet.jsx
@@ -215,7 +215,7 @@ export default function CharacterSheet() {
generateAvatar({ name: char.name, characterClass: char.class })
.then(result => {
setChar(prev => ({ ...prev, avatarPath: result.path }));
- return put({ avatarPath: result.path });
+ return charPut({ avatarPath: result.path });
})
.catch(err => toast.error(err.message || 'Failed to generate avatar'))
.finally(() => {
diff --git a/server/lib/navManifest.js b/server/lib/navManifest.js
index 04f0b1a2f1..54f77462df 100644
--- a/server/lib/navManifest.js
+++ b/server/lib/navManifest.js
@@ -25,6 +25,7 @@ export const NAV_COMMANDS = [
{ id: 'nav.brain.config', path: '/brain/config', label: 'Config', section: 'Brain', aliases: ['brain-config'] },
{ id: 'nav.brain.daily-log', path: '/brain/daily-log', label: 'Daily Log', section: 'Brain', aliases: ['daily-log', 'journal'] },
{ id: 'nav.brain.digest', path: '/brain/digest', label: 'Digest', section: 'Brain', aliases: ['brain-digest'] },
+ { id: 'nav.brain.feeds', path: '/brain/feeds', label: 'Feeds', section: 'Brain', aliases: ['brain-feeds', 'feeds', 'rss'], keywords: ['rss', 'subscriptions'] },
{ id: 'nav.brain.graph', path: '/brain/graph', label: 'Graph', section: 'Brain', aliases: ['brain-graph'] },
{ id: 'nav.brain.links', path: '/brain/links', label: 'Links', section: 'Brain', aliases: ['brain-links'] },
{ id: 'nav.brain.memory', path: '/brain/memory', label: 'Memory', section: 'Brain', aliases: ['brain-memory', 'memory'] },
@@ -50,7 +51,6 @@ export const NAV_COMMANDS = [
{ id: 'nav.cos.learning', path: '/cos/learning', label: 'Learning', section: 'Chief of Staff', aliases: ['cos-learning'] },
{ id: 'nav.cos.memory', path: '/cos/memory', label: 'Memory', section: 'Chief of Staff', aliases: ['cos-memory'] },
{ id: 'nav.cos.schedule', path: '/cos/schedule', label: 'Schedule', section: 'Chief of Staff', aliases: ['schedule', 'cos-schedule'] },
- { id: 'nav.cos.scripts', path: '/cos/scripts', label: 'Scripts', section: 'Chief of Staff', aliases: ['cos-scripts'] },
{ id: 'nav.cos.productivity', path: '/cos/productivity', label: 'Streaks', section: 'Chief of Staff', aliases: ['streaks', 'cos-productivity'] },
{ id: 'nav.cos.jobs', path: '/cos/jobs', label: 'System Tasks', section: 'Chief of Staff', aliases: ['cos-jobs', 'system-tasks'] },
@@ -79,6 +79,7 @@ export const NAV_COMMANDS = [
{ id: 'nav.twin.interview', path: '/digital-twin/interview', label: 'Interview', section: 'Digital Twin', aliases: ['twin-interview'] },
{ id: 'nav.twin.taste', path: '/digital-twin/taste', label: 'Taste', section: 'Digital Twin', aliases: ['twin-taste'] },
{ id: 'nav.twin.test', path: '/digital-twin/test', label: 'Test', section: 'Digital Twin', aliases: ['twin-test'] },
+ { id: 'nav.twin.time-capsule', path: '/digital-twin/time-capsule', label: 'Time Capsule', section: 'Digital Twin', aliases: ['time-capsule', 'twin-time-capsule', 'capsule'], keywords: ['legacy', 'archive', 'snapshot'] },
{ id: 'nav.meatspace.overview', path: '/meatspace/overview', label: 'Overview', section: 'MeatSpace', aliases: ['meatspace'] },
{ id: 'nav.meatspace.health', path: '/meatspace/health', label: 'Health', section: 'MeatSpace', aliases: ['meatspace-health', 'health'] },
diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.js
index 245814581b..a6466daf09 100644
--- a/server/lib/navManifest.test.js
+++ b/server/lib/navManifest.test.js
@@ -1,6 +1,29 @@
import { describe, it, expect } from 'vitest';
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
import { NAV_COMMANDS, getNavAliasMap, resolveNavCommand } from './navManifest.js';
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const REPO_ROOT = path.resolve(__dirname, '..', '..');
+
+// Maps URL prefix → file holding the page's TABS constant. Each page validates
+// the :tab param against its own TABS list, so the nav manifest must agree.
+const TABBED_PAGES = [
+ { prefix: '/brain', constantsFile: 'client/src/components/brain/constants.js' },
+ { prefix: '/cos', constantsFile: 'client/src/components/cos/constants.js' },
+ { prefix: '/digital-twin', constantsFile: 'client/src/components/digital-twin/constants.js' },
+ { prefix: '/meatspace', constantsFile: 'client/src/components/meatspace/constants.js' },
+];
+
+// Extract `id: '<value>'` from the first `export const TABS = [ ... ];` block.
+function extractTabIds(constantsPath) {
+ const src = fs.readFileSync(constantsPath, 'utf8');
+ const block = src.match(/export const TABS\s*=\s*\[([\s\S]*?)\];/);
+ if (!block) throw new Error(`No TABS array found in ${constantsPath}`);
+ return [...block[1].matchAll(/id:\s*['"]([^'"]+)['"]/g)].map((m) => m[1]);
+}
+
describe('navManifest — shape invariants', () => {
it('every command has id, path, label, section', () => {
for (const cmd of NAV_COMMANDS) {
@@ -51,6 +74,30 @@ describe('resolveNavCommand — fuzzy matching', () => {
});
});
+describe('nav contract — tabbed pages match their TABS constants', () => {
+ for (const { prefix, constantsFile } of TABBED_PAGES) {
+ describe(prefix, () => {
+ const tabIds = extractTabIds(path.join(REPO_ROOT, constantsFile));
+ const tabIdSet = new Set(tabIds);
+ const navEntries = NAV_COMMANDS.filter((c) => c.path.startsWith(`${prefix}/`));
+ const navTabs = navEntries.map((c) => ({ tab: c.path.slice(prefix.length + 1), command: c }));
+
+ it('every nav manifest tab resolves to a real TAB id', () => {
+ const orphans = navTabs
+ .filter(({ tab }) => !tabIdSet.has(tab))
+ .map(({ command, tab }) => `${command.id} (${command.path}) → unknown tab "${tab}"`);
+ expect(orphans).toEqual([]);
+ });
+
+ it('every TAB id is reachable via the nav manifest', () => {
+ const navTabSet = new Set(navTabs.map((t) => t.tab));
+ const missing = tabIds.filter((id) => !navTabSet.has(id));
+ expect(missing).toEqual([]);
+ });
+ });
+ }
+});
+
describe('getNavAliasMap — voice-agent compatibility', () => {
it('exposes every alias as a flat path map', () => {
const map = getNavAliasMap();