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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat([nav-tabbed-page-coverage-guard]): assert every tabbed-page tab has a nav manifest entry
[._.]/ Adam Eivy6e1adff0ca9b
diff --git a/client/src/components/settings/SettingsTabsHeader.jsx b/client/src/components/settings/SettingsTabsHeader.jsxindex 50cbe1a58a..1fc53b4d4c 100644--- a/client/src/components/settings/SettingsTabsHeader.jsx+++ b/client/src/components/settings/SettingsTabsHeader.jsx@@ -9,7 +9,7 @@ import TabPills from '../ui/TabPills';//// Pass `activeTab` matching one of the TABS ids below. Internal Settings// pages use the `<tab>` slug; the standalone pages use `providers` / `prompts`.-const TABS = [+export const TABS = [{ id: 'ai-assignments', label: 'AI Assignments', to: '/settings/ai-assignments' },{ id: 'autofixer', label: 'Autofixer', to: '/settings/autofixer' },{ id: 'backup', label: 'Backup', to: '/settings/backup' },diff --git a/client/src/pages/Calendar.jsx b/client/src/pages/Calendar.jsxindex 6786fc1e33..b4d07852b0 100644--- a/client/src/pages/Calendar.jsx+++ b/client/src/pages/Calendar.jsx@@ -14,7 +14,9 @@ import ReviewTab from '../components/calendar/ReviewTab';import CalendarLifetimeTab from '../components/meatspace/tabs/CalendarTab';import SyncTab from '../components/calendar/SyncTab';-const TABS = [+// Exported so the nav-manifest tab-coverage guard (server/lib/navManifest.test.js)+// can assert each tab round-trips to a NAV_COMMANDS path.+export const TABS = [{ id: 'agenda', label: 'Agenda', icon: CalendarDays },{ id: 'day', label: 'Day', icon: CalendarIcon },{ id: 'week', label: 'Week', icon: Columns },diff --git a/client/src/pages/Goals.jsx b/client/src/pages/Goals.jsxindex 830f2ff1bf..12db779f57 100644--- a/client/src/pages/Goals.jsx+++ b/client/src/pages/Goals.jsx@@ -7,7 +7,8 @@ import GoalsListView from '../components/goals/GoalsListView';import MortalLoomBanner from '../components/MortalLoomBanner';import BrailleSpinner from '../components/BrailleSpinner';-const TABS = [+// Exported for the nav-manifest tab-coverage guard (server/lib/navManifest.test.js).+export const TABS = [{ id: 'list', label: 'List', icon: List },{ id: 'tree', label: 'Tree', icon: TreePine }];diff --git a/client/src/pages/Insights.jsx b/client/src/pages/Insights.jsxindex 88545feb37..4d20511660 100644--- a/client/src/pages/Insights.jsx+++ b/client/src/pages/Insights.jsx@@ -12,7 +12,8 @@ import CrossDomainTab from '../components/insights/CrossDomainTab';import ConfidenceBadge from '../components/insights/ConfidenceBadge';import { timeAgo } from '../utils/formatters';-const TABS = [+// Exported for the nav-manifest tab-coverage guard (server/lib/navManifest.test.js).+export const TABS = [{ id: 'overview', label: 'Overview', icon: Lightbulb },{ id: 'genome-health', label: 'Genome-Health', icon: Dna },{ id: 'taste-identity', label: 'Taste & Identity', icon: Palette },diff --git a/client/src/pages/Messages.jsx b/client/src/pages/Messages.jsxindex c312a6289d..76a715bf1b 100644--- a/client/src/pages/Messages.jsx+++ b/client/src/pages/Messages.jsx@@ -10,7 +10,8 @@ import ConfigTab from '../components/messages/ConfigTab';import DraftsTab from '../components/messages/DraftsTab';import SyncTab from '../components/messages/SyncTab';-const TABS = [+// Exported for the nav-manifest tab-coverage guard (server/lib/navManifest.test.js).+export const TABS = [{ id: 'inbox', label: 'Inbox', icon: Mail },{ id: 'drafts', label: 'Drafts', icon: Mail },{ id: 'sync', label: 'Sync', icon: RefreshCw },diff --git a/client/src/pages/Sharing.jsx b/client/src/pages/Sharing.jsxindex 41834d4f1d..40e9709166 100644--- a/client/src/pages/Sharing.jsx+++ b/client/src/pages/Sharing.jsx@@ -40,7 +40,8 @@ export function isLiveSubscription(item, now = Date.now()) {// Top-level deep-linkable sections. Buckets is the bucket-management view;// Duplicates + Conflicts are the sync-hygiene review surfaces.-const SECTIONS = [+// Exported for the nav-manifest tab-coverage guard (server/lib/navManifest.test.js).+export const SECTIONS = [{ id: 'buckets', label: 'Buckets', icon: Folder, path: '/sharing' },{ id: 'duplicates', label: 'Duplicates', icon: Copy, path: '/sharing/duplicates' },{ id: 'conflicts', label: 'Conflicts', icon: GitMerge, path: '/sharing/conflicts' },diff --git a/client/src/pages/Wiki.jsx b/client/src/pages/Wiki.jsxindex a62b543072..e7bf8bbf45 100644--- a/client/src/pages/Wiki.jsx+++ b/client/src/pages/Wiki.jsx@@ -11,7 +11,8 @@ import WikiSearchTab from '../components/wiki/tabs/SearchTab';import WikiGraphTab from '../components/wiki/tabs/GraphTab';import WikiLogTab from '../components/wiki/tabs/LogTab';-const TABS = [+// Exported for the nav-manifest tab-coverage guard (server/lib/navManifest.test.js).+export const TABS = [{ id: 'overview', label: 'Overview', icon: BarChart3 },{ id: 'browse', label: 'Browse', icon: FileText },{ id: 'search', label: 'Search', icon: Search },diff --git a/server/lib/navManifest.js b/server/lib/navManifest.jsindex 656080e3e2..829f25dabe 100644--- a/server/lib/navManifest.js+++ b/server/lib/navManifest.js@@ -42,6 +42,9 @@ export const NAV_COMMANDS = [{ id: 'nav.brain.graph', path: '/brain/graph', label: 'Graph', section: 'Brain', aliases: ['brain-graph'] },{ id: 'nav.brain.import', path: '/brain/import', label: 'Import', section: 'Brain', aliases: ['brain-import', 'import-chatgpt', 'chatgpt-import'], keywords: ['chatgpt', 'openai', 'export', 'third-party'] },{ id: 'nav.insights', path: '/insights/overview', label: 'Insights', section: 'Brain', aliases: ['insights'] },+ { id: 'nav.insights.genome-health', path: '/insights/genome-health', label: 'Genome-Health', section: 'Brain', aliases: ['genome-health', 'insights-genome-health'], keywords: ['genome', 'dna', 'health', 'longevity', 'genetic'] },+ { id: 'nav.insights.taste-identity', path: '/insights/taste-identity', label: 'Taste & Identity', section: 'Brain', aliases: ['taste-identity', 'insights-taste-identity'], keywords: ['taste', 'identity', 'preferences', 'aesthetic'] },+ { id: 'nav.insights.cross-domain', path: '/insights/cross-domain', label: 'Cross-Domain Patterns', section: 'Brain', aliases: ['cross-domain', 'insights-cross-domain', 'cross-domain-patterns'], keywords: ['cross domain', 'patterns', 'correlations', 'connections'] },{ 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'] },{ id: 'nav.brain.notes', path: '/brain/notes', label: 'Notes', section: 'Brain', aliases: ['brain-notes', 'notes'] },@@ -104,6 +107,7 @@ export const NAV_COMMANDS = [{ id: 'nav.twin.enrich', path: '/digital-twin/enrich', label: 'Enrich', section: 'Digital Twin', aliases: ['twin-enrich'] },{ id: 'nav.twin.export', path: '/digital-twin/export', label: 'Export', section: 'Digital Twin', aliases: ['twin-export'] },{ id: 'nav.goals', path: '/goals/list', label: 'Goals', section: 'Digital Twin', aliases: ['goals'] },+ { id: 'nav.goals.tree', path: '/goals/tree', label: 'Goals Tree', section: 'Digital Twin', aliases: ['goals-tree', 'goal-tree'], keywords: ['hierarchy', 'decomposition', 'subgoals', 'breakdown'] },{ id: 'nav.twin.goals', path: '/digital-twin/goals', label: 'Twin Goals', section: 'Digital Twin', aliases: ['twin-goals'] },{ id: 'nav.twin.identity', path: '/digital-twin/identity', label: 'Identity', section: 'Digital Twin', aliases: ['twin-identity', 'identity'] },{ id: 'nav.twin.import', path: '/digital-twin/import', label: 'Import', section: 'Digital Twin', aliases: ['twin-import'] },@@ -133,6 +137,7 @@ export const NAV_COMMANDS = [{ id: 'nav.settings.ai-assignments', path: '/settings/ai-assignments', label: 'AI Assignments', section: 'Settings', aliases: ['ai-assignments', 'assignments', 'settings-ai-assignments', 'ai-inventory'], keywords: ['provider', 'model', 'pin', 'inventory', 'migration', 'llm'] },{ id: 'nav.settings.autofixer', path: '/settings/autofixer', label: 'Autofixer', section: 'Settings', aliases: ['autofixer', 'settings-autofixer', 'auto-fixer'], keywords: ['crash', 'fix', 'pm2', 'repair', 'ai provider', 'restart'] },{ id: 'nav.settings.backup', path: '/settings/backup', label: 'Backup', section: 'Settings', aliases: ['backup', 'settings-backup'] },+ { id: 'nav.settings.catalog', path: '/settings/catalog', label: 'Catalog Types', section: 'Settings', aliases: ['settings-catalog', 'catalog-types'], keywords: ['catalog', 'types', 'character', 'place', 'object', 'taxonomy'] },{ id: 'nav.settings.database', path: '/settings/database', label: 'Database', section: 'Settings', aliases: ['settings-database', 'database'] },{ id: 'nav.settings.embeddings', path: '/settings/embeddings', label: 'Embeddings', section: 'Settings', aliases: ['settings-embeddings', 'embeddings', 'embedding'], keywords: ['vector', 'pgvector', 'semantic search', 'nomic', 'ollama', 'lm studio'] },{ id: 'nav.settings.general', path: '/settings/general', label: 'General', section: 'Settings', aliases: ['settings', 'settings-general', 'general'] },diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.jsindex ee612b928b..fc2361a153 100644--- a/server/lib/navManifest.test.js+++ b/server/lib/navManifest.test.js@@ -7,21 +7,47 @@ import { NAV_COMMANDS, getNavAliasMap, resolveNavCommand } from './navManifest.jconst __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.+// Maps URL prefix → how to extract the page's own tab set from its source. Each+// page validates the :tab/:section param against this list, so the nav manifest+// must agree. Two source shapes are supported:+// kind 'ids' — `export const <constName> = [{ id: '<slug>', … }]`, where each+// tab lives at `<prefix>/<slug>` (Brain/CoS/Calendar/Goals/…).+// kind 'links' — `export const <constName> = [{ to|path: '<abs path>', … }]`,+// where the page's own tabs are the entries whose path is exactly+// `<prefix>` or under `<prefix>/`; entries pointing elsewhere+// (e.g. Settings' "Prompts" → /prompts) are cross-links, not tabs.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' },+ { prefix: '/brain', file: 'client/src/components/brain/constants.js', kind: 'ids', constName: 'TABS' },+ { prefix: '/cos', file: 'client/src/components/cos/constants.js', kind: 'ids', constName: 'TABS' },+ { prefix: '/digital-twin', file: 'client/src/components/digital-twin/constants.js', kind: 'ids', constName: 'TABS' },+ { prefix: '/meatspace', file: 'client/src/components/meatspace/constants.js', kind: 'ids', constName: 'TABS' },+ { prefix: '/calendar', file: 'client/src/pages/Calendar.jsx', kind: 'ids', constName: 'TABS' },+ { prefix: '/goals', file: 'client/src/pages/Goals.jsx', kind: 'ids', constName: 'TABS' },+ { prefix: '/insights', file: 'client/src/pages/Insights.jsx', kind: 'ids', constName: 'TABS' },+ { prefix: '/messages', file: 'client/src/pages/Messages.jsx', kind: 'ids', constName: 'TABS' },+ { prefix: '/wiki', file: 'client/src/pages/Wiki.jsx', kind: 'ids', constName: 'TABS' },+ { prefix: '/settings', file: 'client/src/components/settings/SettingsTabsHeader.jsx', kind: 'links', constName: 'TABS' },+ { prefix: '/sharing', file: 'client/src/pages/Sharing.jsx', kind: 'links', constName: 'SECTIONS' },];-// 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]);+// Pull the inner text of `export const <constName> = [ … ];` (requiring `export`+// also asserts the constant stays importable — a forgotten `export` fails loudly).+function extractConstArrayBlock(src, constName) {+ const block = src.match(new RegExp(`export const ${constName}\\s*=\\s*\\[([\\s\\S]*?)\\];`));+ if (!block) throw new Error(`No exported ${constName} array found`);+ return block[1];+}++// The set of absolute tab paths a page serves under its own prefix.+function extractTabPaths(filePath, { kind, constName, prefix }) {+ const block = extractConstArrayBlock(fs.readFileSync(filePath, 'utf8'), constName);+ if (kind === 'ids') {+ return [...block.matchAll(/id:\s*['"]([^'"]+)['"]/g)].map((m) => `${prefix}/${m[1]}`);+ }+ // kind 'links': keep only entries that point at this page, dropping cross-links.+ return [...block.matchAll(/(?:to|path):\s*['"]([^'"]+)['"]/g)]+ .map((m) => m[1])+ .filter((p) => p === prefix || p.startsWith(`${prefix}/`));}describe('navManifest — shape invariants', () => {@@ -110,27 +136,31 @@ describe('resolveNavCommand — fuzzy matching', () => {});});-describe('nav contract — tabbed pages match their TABS constants', () => {- for (const { prefix, constantsFile } of TABBED_PAGES) {+describe('nav contract — tabbed pages match their tab constants', () => {+ for (const page of TABBED_PAGES) {+ const { prefix, file } = page;describe(prefix, () => {- // Read inside it() bodies (not at describe time) so a moved/renamed- // constants file surfaces as a focused test failure rather than- // aborting the entire suite during Vitest's collection phase.- 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 tabIdSet = new Set(extractTabIds(path.join(REPO_ROOT, constantsFile)));- const orphans = navTabs- .filter(({ tab }) => !tabIdSet.has(tab))- .map(({ command, tab }) => `${command.id} (${command.path}) → unknown tab "${tab}"`);+ // The nav manifest paths owned by this page: exactly `<prefix>` (a default+ // section served at the bare prefix, e.g. /sharing → buckets) or anything+ // under `<prefix>/`. Compare on the bare path so deep-link query/hash+ // variants (e.g. /media/image?settings=1) normalize first.+ const navPaths = NAV_COMMANDS+ .map((c) => c.path.split(/[?#]/)[0])+ .filter((p) => p === prefix || p.startsWith(`${prefix}/`));++ // Read inside it() bodies (not at describe time) so a moved/renamed source+ // file surfaces as a focused test failure rather than aborting the entire+ // suite during Vitest's collection phase.+ it('every nav manifest path resolves to a real page tab', () => {+ const tabPaths = new Set(extractTabPaths(path.join(REPO_ROOT, file), page));+ const orphans = navPaths.filter((p) => !tabPaths.has(p));expect(orphans).toEqual([]);});- it('every TAB id is reachable via the nav manifest', () => {- const tabIds = extractTabIds(path.join(REPO_ROOT, constantsFile));- const navTabSet = new Set(navTabs.map((t) => t.tab));- const missing = tabIds.filter((id) => !navTabSet.has(id));+ it('every page tab is reachable via the nav manifest', () => {+ const tabPaths = extractTabPaths(path.join(REPO_ROOT, file), page);+ const navSet = new Set(navPaths);+ const missing = tabPaths.filter((p) => !navSet.has(p));expect(missing).toEqual([]);});});