Trajectory Search — Decomposition Plan
**Date**: 2025-07-15 **Author**: Automated analysis (Claude) **Baseline**: DEP Audit V2 (5.2/10), EVO3 evolution plan **Codebase**: 88,382 LOC TypeScript frontend + 6,839 LOC Rust backend = **95,221 LOC total** **Goal**: Break the 82K-line monolith into focused, shippable standalone apps
Full Public Reader
Trajectory Search — Decomposition Plan
Date: 2025-07-15
Author: Automated analysis (Claude)
Baseline: DEP Audit V2 (5.2/10), EVO3 evolution plan
Codebase: 88,382 LOC TypeScript frontend + 6,839 LOC Rust backend = 95,221 LOC total
Goal: Break the 82K-line monolith into focused, shippable standalone apps
---
Executive Summary
Trajectory Search is 6 products wearing a trench coat pretending to be one app. The DEP audit proved it — 5.2/10, 156 TypeScript errors, no code splitting, 1.7
The right move: Decompose into 6 focused apps + 1 shared package. Each app ships independently, owns its quality bar, and can be developed by a single engineer without context-switching across 20+ views.
The 6 Products
| # | Product | LOC | Files | Extraction Difficulty | Ships To |
|---|---|---|---|---|---|
| 1 | Trajectory Search (Core) | 11,720 | 42 | — (stays) | Tauri desktop |
| 2 | Trajectory Calendar | 9,392 | 27 | Medium | Life OS / standalone |
| 3 | Kinetic Theater | 12,281 | 34 | Easy | CC-Dashboard / standalone |
| 4 | Dream Studio | 8,595 | 23 | Easy | Content Studio / standalone |
| 5 | Architecture Explorer | 11,208 | 28 | Hard | Compass / Orbit desktop |
| 6 | Research Browser | 3,519 | 15 | Easy | Standalone Tauri app |
Shared infrastructure: 26,572 LOC across utilities, types, agents, orchestrator, terminals, settings → extract to `@trajectory/shared`
---
App 1: Trajectory Search (Core)
> Identity: The semantic search engine for the knowledge graph. The original product. Everything else was a distraction.
What It Becomes
The lean, fast search experience. Semantic search across the knowledge graph with collections, comparison, synthesis, and idea management. No calendar. No motion visualization. No image generation. Just search.
Exact Files (5,025 LOC search + 6,695 LOC knowledge layer = ~11,720 LOC)
#### Search Components
| File | LOC | Purpose |
|------|-----|---------|
| `components/views/SearchView.tsx` | 554 | Main search interface |
| `components/QueryBar.tsx` | 288 | Global bottom query bar |
| `components/ResultList.tsx` | 146 | Search result list |
| `components/ResultCard.tsx` | 354 | Individual result card |
| `components/FiltersPanel.tsx` | 168 | Search filters (source, era, depth) |
| `components/CollectionModal.tsx` | 213 | Save results to collection |
| `components/CompareView.tsx` | 208 | Side-by-side comparison |
| `components/SynthesizeModal.tsx` | 403 | AI synthesis of selected results |
| `components/SelectionBar.tsx` | 128 | Selection action bar |
| `components/SelectedResultsPanel.tsx` | 215 | Selected results card panel |
| `components/SearchBar.tsx` | 116 | Search input component |
| `components/ResumeSearchBanner.tsx` | 67 | Resume previous search |
#### Knowledge Layer Components (Ideas, Chains, Claims, Artifacts)
| File | LOC | Purpose |
|------|-----|---------|
| `components/views/IdeasView.tsx` | 193 | Ideas list view |
| `components/views/ChainsView.tsx` | 117 | Knowledge chains view |
| `components/views/ClaimsView.tsx` | 101 | Claims verification view |
| `components/views/ArtifactsView.tsx` | 100 | Artifacts list view |
| `components/views/ActionsView.tsx` | 16 | Actions stub (to implement or remove) |
| `components/ideas/IdeaCard.tsx` | 96 | Idea card component |
| `components/ideas/IdeaDetailModal.tsx` | 223 | Idea detail modal |
| `components/ideas/IdeasToolbar.tsx` | 72 | Ideas toolbar |
| `components/ideas/NewIdeaModal.tsx` | 149 | New idea creation |
| `components/chains/ChainCard.tsx` | 154 | Chain card component |
| `components/chains/ChainDetailModal.tsx` | 254 | Chain detail modal |
| `components/chains/ChainsToolbar.tsx` | 61 | Chains toolbar |
| `components/claims/ClaimCard.tsx` | 147 | Claim card component |
| `components/claims/ClaimsToolbar.tsx` | 62 | Claims toolbar |
| `components/artifacts/ArtifactCard.tsx` | 83 | Artifact card component |
| `components/idea-scaffold/IdeaScaffoldLauncher.tsx` | 477 | Idea scaffolding launcher |
| `components/idea-scaffold/ProposalReviewModal.tsx` | 365 | Proposal review |
| `components/idea-scaffold/ExecutionProgress.tsx` | 246 | Execution progress tracking |
| `components/ChainMemoryView.tsx` | 832 | 3D chain memory visualization |
#### Hooks
| File | LOC | Purpose |
|------|-----|---------|
| `hooks/useSearch.ts` | 183 | Core search hook |
| `hooks/useSearchPersistence.ts` | 235 | Search history persistence |
| `hooks/useCollections.ts` | 174 | Collection management |
| `hooks/useResultFeedback.ts` | 219 | Result feedback/filtering |
| `hooks/useGraphKernel.ts` | 300 | Graph Kernel slice operations |
| `hooks/useIdeas.ts` | 265 | Idea CRUD operations |
| `hooks/useLocalIdeas.ts` | 187 | Local idea storage |
| `hooks/useKnowledgeChains.ts` | 365 | Knowledge chain management |
| `hooks/useClaims.ts` | 171 | Claims lifecycle |
| `hooks/useIdeaScaffold.ts` | 287 | Idea scaffolding |
| `hooks/useSynthesisAgent.ts` | 241 | Synthesis agent operations |
#### Libraries
| File | LOC | Purpose |
|------|-----|---------|
| `lib/search-engines.ts` | 91 | Search engine configuration |
| `lib/graph-kernel-api.ts` | 403 | Graph Kernel REST client |
| `contexts/SearchContext.tsx` | 26 | Search context provider |
| `lib/context/context-retriever.ts` | 515 | Context retrieval for search |
| `lib/context/index.ts` | 19 | Context module index |
| `lib/agents/synthesis.ts` | 297 | Synthesis agent |
| `lib/agents/idea-scaffold.ts` | 834 | Idea scaffolding agent |
| `lib/agents/scaffolding.ts` | 300 | Scaffolding utilities |
Dependencies
From `@trajectory/shared`:
- Supabase client (`lib/supabase.ts`)
- Tauri bindings (`lib/tauri.ts`)
- Types (`lib/types.ts`)
- Common components (ErrorBoundary, Skeleton, CommandPalette, SettingsModal)
- Agent SDK types (`lib/agents/types.ts`)
External packages:
- `react`, `react-dom` (core)
- `@tauri-apps/cli` (desktop shell)
- `@supabase/supabase-js` (cloud persistence)
- `@react-three/fiber`, `@react-three/drei`, `three` (ChainMemoryView 3D — could lazy load)
- `lucide-react` (icons)
- `framer-motion` (animations)
- `tailwind-merge` (CSS utilities)
- `use-debounce` (utility)
- `@comp-core/agent-sdk` (agent integration)
Standalone Viability: ✅ HIGH
This is the original product. It's the most complete domain. What's missing:
- Fix ~20 TS errors in search/ideas/chains area
- Implement `handleSaveCollection` (currently a TODO)
- Complete ActionsView (16-line stub) or remove it
- Wire Graph Kernel visualization (API exists, no visual graph)
Target Platform: Tauri Desktop (primary), Web (future)
The search experience is keyboard-heavy and benefits from desktop integration (global hotkey, system tray). Web version is viable for read-only search.
Where It Stays
This IS Trajectory Search. Everything else leaves. Post-decomposition, this becomes a focused ~12K LOC app (plus ~5K from shared package).
Extraction Difficulty: N/A
Core app stays in place. Other domains extract FROM it.
---
App 2: Trajectory Calendar
> Identity: AI-powered calendar with NLP event creation, templates, routines, and project scheduling.
What It Becomes
"Trajectory Calendar" — a standalone AI calendar app. Integrates with Orbit for project scheduling, uses NLP for natural language event creation, has a chat sidebar for AI-assisted planning, and includes template/routine builders.
Exact Files (9,392 LOC)
#### Components (3,089 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `components/calendar/Calendar.tsx` | 191 | Main calendar container |
| `components/calendar/CalendarChatSidebar.tsx` | 247 | AI chat sidebar |
| `components/calendar/CalendarHeader.tsx` | 197 | Calendar header with navigation |
| `components/calendar/CalendarSidebar.tsx` | 257 | Calendar sidebar with filters |
| `components/calendar/DayView.tsx` | 147 | Day view layout |
| `components/calendar/WeekView.tsx` | 181 | Week view layout |
| `components/calendar/MonthView.tsx` | 141 | Month view layout |
| `components/calendar/AgendaView.tsx` | 172 | Agenda list view |
| `components/calendar/EventModal.tsx` | 417 | Event create/edit modal |
| `components/calendar/EventCard.tsx` | 186 | Event card component |
| `components/calendar/NotificationToast.tsx` | 255 | Notification toast UI |
| `components/calendar/ReminderSettingsPanel.tsx` | 425 | Reminder settings panel |
| `components/calendar/TemplateBrowser.tsx` | 371 | Template browser/picker |
| `components/calendar/chat/ChatInput.tsx` | 143 | Chat input component |
| `components/calendar/chat/ChatMessage.tsx` | 104 | Chat message bubble |
| `components/calendar/chat/ChatMessageList.tsx` | 177 | Chat message list |
| `components/calendar/chat/SuggestionCard.tsx` | 179 | AI suggestion card |
#### Hooks (1,804 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `hooks/useCalendar.ts` | 616 | Calendar state management |
| `hooks/useCalendarChat.ts` | 471 | Calendar AI chat |
| `hooks/useTemplates.ts` | 717 | Template engine hook |
#### Libraries (3,798 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/calendar/conflict-detector.ts` | 643 | Event conflict detection |
| `lib/calendar/nlp-patterns.ts` | 651 | NLP event parsing |
| `lib/calendar/project-blueprint.ts` | 463 | Project schedule blueprint |
| `lib/calendar/routine-builder.ts` | 310 | Routine/habit builder |
| `lib/calendar/template-engine.ts` | 457 | Event template engine |
| `lib/calendar/workout-builder.ts` | 352 | Workout schedule builder |
| `lib/agents/calendar.ts` | 922 | Calendar AI agent |
#### Tests (352 LOC — broken)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/calendar/__tests__/template-engine.test.ts` | 352 | Template engine tests (34 TS errors) |
#### Rust Backend (relevant portions)
| File | LOC | Purpose |
|------|-----|---------|
| `src-tauri/src/reminders/` | 1,143 | Reminders module (types, service, scheduler, engine, store, commands) |
Dependencies
From `@trajectory/shared`:
- Supabase client (event persistence)
- Tauri bindings (reminders, notifications)
- Types (CalendarEvent, CalendarTemplate, etc.)
- Agent SDK types
External packages:
- `react`, `react-dom`
- `@tauri-apps/cli` (desktop — notifications, system tray)
- `@supabase/supabase-js` (cloud sync)
- `@anthropic-ai/sdk` or `openai` (for calendar AI chat)
- `lucide-react`, `framer-motion`, `tailwind-merge`
- `use-debounce`
Standalone Viability: ✅ MEDIUM-HIGH
Strong feature set. What's missing:
- Fix 34 TS errors in template-engine tests
- Fix 9 errors in conflict-detector
- Fix 5 errors in calendar agent
- Fix 4 errors in SuggestionCard
- Fix 1 error in ReminderSettingsPanel
- Wire Orbit project integration fully (project-blueprint.ts references Orbit)
- Add proper CalendarEvent types to shared package
- Reminders Rust module needs extraction too
Target Platform: Tauri Desktop + Web + Mobile
Calendar is a cross-platform essential. Desktop for full NLP chat experience, web for quick access, mobile for on-the-go viewing.
Where It Merges
→ Trajectory OS / Life OS: The calendar is a core Life OS feature. It could become the calendar module in `trajectory-os` or a standalone `trajectory-calendar` app that Life OS integrates.
Alternatively: standalone `apps/trajectory/trajectory-calendar/` in the monorepo.
Extraction Difficulty: Medium
The calendar has clean boundaries (own component directory, own lib directory, own hooks). The coupling points are:
1. `lib/agents/calendar.ts` depends on agent SDK types
2. `project-blueprint.ts` imports Orbit project types
3. Reminder Rust module needs to come along
4. CalendarEvent types are in shared `lib/types.ts`
---
App 3: Kinetic Theater
> Identity: Motion visualization engine with phrase intelligence, memory replay, anticipation, and device choreography.
What It Becomes
"Kinetic Theater" — a creative motion visualization and choreography tool. Visualizes motion data, phrase patterns, and memory sequences with audio synth bridges and anticipation engines.
Exact Files (12,281 LOC)
#### Components (4,023 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `components/kinetic-theater/KineticTheaterView.tsx` | 668 | Main theater view |
| `components/kinetic-theater/LatentVisualizer.tsx` | 622 | Latent space visualizer |
| `components/kinetic-theater/MatchedTurnsPanel.tsx` | 187 | Matched conversation turns |
| `components/kinetic-theater/PhrasePanel.tsx` | 442 | Phrase intelligence panel |
| `components/kinetic-theater/ConvergencePanel.tsx` | 240 | Convergence visualization |
| `components/kinetic-theater/MemoryGallery.tsx` | 409 | Memory gallery browser |
| `components/kinetic-theater/AnticipationPanel.tsx` | 265 | Motion anticipation |
| `components/kinetic-theater/MemoryReplayPanel.tsx` | 486 | Memory replay player |
| `components/views/DevicesView.tsx` | 334 | Motion device management |
| `components/views/PerspectivesView.tsx` | 193 | Motion perspectives |
| `components/perspectives/GlassBreakerPerspective.tsx` | 322 | Glass breaker effect |
| `components/perspectives/HandGuardPerspective.tsx` | 328 | Hand guard effect |
| `components/perspectives/PerspectiveCard.tsx` | 129 | Perspective card component |
| `components/motion/MotionMetricsPanel.tsx` | 198 | Motion metrics display |
#### Hooks (1,760 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `hooks/useKineticTheater.ts` | 523 | Theater state management |
| `hooks/useMotionAnticipation.ts` | 257 | Motion anticipation |
| `hooks/usePerspective.ts` | 264 | Perspective selection |
| `hooks/useDeviceConnection.ts` | 173 | Device connection management |
| `hooks/useConnectionDetection.ts` | 543 | Connection auto-detection |
#### Libraries (5,698 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/kinetic-theater/phrase-intelligence.ts` | 677 | Phrase analysis engine |
| `lib/kinetic-theater/kinetic-memory.ts` | 657 | Kinetic memory system |
| `lib/kinetic-theater/motion-anticipation.ts` | 545 | Motion prediction |
| `lib/kinetic-theater/audio-synth-bridge.ts` | 498 | Audio synthesis bridge |
| `lib/kinetic-theater/memory-player.ts` | 489 | Memory sequence playback |
| `lib/kinetic-theater/memory-persistence.ts` | 517 | Memory storage |
| `lib/kinetic-theater/motion-stream.ts` | 572 | Motion data streaming |
| `lib/kinetic-theater/motion-query-engine.ts` | 401 | Motion data queries |
| `lib/kinetic-theater/types.ts` | 366 | Kinetic Theater types |
| `lib/motion-api.ts` | 83 | Motion server API client |
| `lib/motion-perspectives/types.ts` | 205 | Perspective types |
| `lib/motion-perspectives/registry.ts` | 107 | Perspective registry |
| `lib/motion-perspectives/effects/haptic-feedback.ts` | 189 | Haptic feedback effect |
| `lib/motion-perspectives/effects/glass-shatter.ts` | 392 | Glass shatter effect |
Dependencies
From `@trajectory/shared`:
- Tauri bindings (device communication)
- Types (minimal — mostly self-contained types)
- Common components (ErrorBoundary, Skeleton)
External packages:
- `react`, `react-dom`
- `@tauri-apps/cli` (device access, system APIs)
- `framer-motion` (animations — heavy use)
- `lucide-react`, `tailwind-merge`
No Supabase dependency. Kinetic Theater is entirely local/device-oriented.
Standalone Viability: ✅ HIGH
The most self-contained domain. Clean boundaries:
- Own component directory
- Own lib directory with comprehensive type system
- Own hook set
- Minimal external dependencies
- No Supabase coupling
What's missing:
- Fix ~7 TS errors in perspectives (LatentState, MotionDescriptor missing exports)
- Fix readonly array assignment in haptic-feedback.ts
- Clean up unused variables in glass-shatter.ts
- Need a motion server endpoint (currently configured via env vars)
Target Platform: Tauri Desktop (primary)
Motion visualization requires low-latency device communication and GPU access. Desktop-first, potentially with a WebSocket-based web viewer later.
Where It Merges
→ CC-Dashboard / Echelon: The motion choreography fits naturally into the desktop dashboard at `apps/desktop/echelon/`. Kinetic Theater could become a module within the CC-Dashboard or remain standalone as `apps/trajectory/kinetic-theater/`.
Extraction Difficulty: Easy
Lowest coupling of any domain:
1. No Supabase dependency
2. No Graph Kernel dependency
3. Own type system (`lib/kinetic-theater/types.ts`)
4. Only shared dependency is Tauri bindings and common UI components
5. motion-api.ts is the only external service client (simple HTTP)
---
App 4: Dream Studio
> Identity: AI image/content generation studio with multiple providers, templates, and a generation pipeline.
What It Becomes
"Dream Studio" — an AI creative generation app. Multi-provider image generation (Anthropic, OpenAI, Groq, Gemini), template system (app, game, dashboard, story, canvas), full pipeline from task breakdown to rendering.
Exact Files (8,595 LOC)
#### Components (4,036 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `components/dream/DreamView.tsx` | 720 | Main dream interface |
| `components/dream/DreamHistory.tsx` | 273 | Generation history |
| `components/dream/DreamImageGallery.tsx` | 455 | Image gallery |
| `components/dream/DreamPreview.tsx` | 347 | Generation preview |
| `components/dream/DreamSettings.tsx` | 238 | Provider/model settings |
| `components/dream/DreamTabs.tsx` | 367 | Tab navigation |
| `components/dream/DreamTemplateSelector.tsx` | 372 | Template picker |
| `components/FullScreenGenerationView.tsx` | 634 | Fullscreen generation view |
| `components/CanvasView.tsx` | 630 | Canvas rendering view |
#### Hooks (723 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `hooks/useDream.ts` | 723 | Dream generation state management |
#### Libraries (3,836 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/dream/agent-client.ts` | 540 | Dream agent client |
| `lib/dream/image-providers.ts` | 361 | Image provider abstractions |
| `lib/dream/prompts.ts` | 354 | Prompt templates |
| `lib/dream/providers.ts` | 619 | Provider implementations |
| `lib/dream/service.ts` | 510 | Dream generation service |
| `lib/dream/templates/app-template.ts` | 66 | App template |
| `lib/dream/templates/canvas-template.ts` | 133 | Canvas template |
| `lib/dream/templates/dashboard-template.ts` | 113 | Dashboard template |
| `lib/dream/templates/game-template.ts` | 87 | Game template |
| `lib/dream/templates/story-template.ts` | 91 | Story template |
| `lib/dream/templates/index.ts` | 145 | Template registry |
| `lib/agents/dream.ts` | 350 | Dream agent implementation |
| `lib/hooks/dream-continue.ts` | 467 | Dream continuation logic |
#### Tests (783 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/dream/providers.test.ts` | 783 | Provider tests |
Dependencies
From `@trajectory/shared`:
- Tauri bindings (file save, clipboard)
- Types (DreamConfig, GenerationResult, etc.)
- Agent SDK types
External packages:
- `react`, `react-dom`
- `@anthropic-ai/sdk` (Anthropic provider)
- `openai` (OpenAI provider)
- `html2canvas` (screenshot/canvas capture)
- `framer-motion` (animations)
- `lucide-react`, `tailwind-merge`
Standalone Viability: ✅ HIGH
Very self-contained generation pipeline:
- Own component directory
- Own lib directory with complete provider abstraction
- Single hook manages all state
- Has its own test file (providers.test.ts — 783 LOC, works)
What's missing:
- Dream → Idea Vault flow (currently minimal)
- Content library for organizing generated assets
- Export pipeline (download, share, publish)
- Voice generation integration (ElevenLabs)
- Video generation (Veo 3.0 / Kling)
Target Platform: Web (primary), Tauri Desktop, Mobile
Image generation is a cloud-first feature. Web makes sense as primary platform, with Tauri for power users who want local generation.
Where It Merges
→ Content Studio: Dream Studio IS the content studio. It should become `apps/trajectory/content-studio/` or `apps/trajectory/dream-studio/` as a standalone creative tool.
Extraction Difficulty: Easy
Second-lowest coupling:
1. Provider system is fully self-contained
2. Template system is internal
3. Only shared dependency is Tauri bindings and types
4. html2canvas is the only unusual external dep
5. Agent SDK coupling is minimal (just for agent-client.ts)
---
App 5: Architecture Explorer
> Identity: Monorepo visualization, project organization, spine timeline, evolution tracking, and knowledge transfer.
What It Becomes
"Architecture Explorer" — a codebase and project intelligence tool. Visualizes monorepo structure, tracks project evolution over time, manages project connections/tags/collections, and enables knowledge transfer between projects.
Exact Files (11,208 LOC)
#### Components (5,577 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `components/views/ArchitectureView.tsx` | 782 | Main architecture view (Part 1) |
| `components/views/ArchitectureViewPart2.tsx` | 439 | Architecture view Part 2 |
| `components/views/ArchitectureViewPart3.tsx` | 474 | Architecture view Part 3 |
| `components/views/ArchitectureExplorer.tsx` | 465 | Architecture explorer panel |
| `components/views/SpineTimelineView.tsx` | 661 | Spine timeline view |
| `components/timeline/EvolutionTimeline.tsx` | 557 | Evolution timeline |
| `components/timeline/TimelineEvent.tsx` | 187 | Timeline event component |
| `components/timeline/TimelineFilters.tsx` | 133 | Timeline filter controls |
| `components/timeline/TimelineScrubber.tsx` | 125 | Timeline scrubber control |
| `components/projects/CollectionManager.tsx` | 383 | Project collection management |
| `components/projects/OrganizationPanel.tsx` | 396 | Project organization panel |
| `components/projects/ConnectionManager.tsx` | 294 | Project connection management |
| `components/projects/ConnectionSuggestionsPanel.tsx` | 323 | Connection suggestions |
| `components/projects/KnowledgeTransferDialog.tsx` | 344 | Knowledge transfer dialog |
| `components/projects/ProjectManagerModal.tsx` | 342 | Project manager modal |
| `components/projects/ProjectGraphView.tsx` | 431 | Project dependency graph |
| `components/projects/TagManager.tsx` | 255 | Project tag management |
#### Hooks (3,075 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `hooks/useSpineTimeline.ts` | 686 | Spine timeline state |
| `hooks/useEvolutionBridge.ts` | 303 | Evolution bridge |
| `hooks/useProjectOrganization.ts` | 547 | Project organization |
| `hooks/useProjectConnections.ts` | 344 | Project connections |
| `hooks/useProjectTags.ts` | 123 | Project tags |
| `hooks/useProjectActivity.ts` | 171 | Project activity feed |
| `hooks/useMonorepoScanner.ts` | 527 | Monorepo structure scanning |
| `hooks/useKnowledgeTransfer.ts` | 375 | Knowledge transfer operations |
#### Libraries (1,541 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/spine/parser.ts` | 655 | Spine format parser |
| `lib/spine/temporal-parser.ts` | 430 | Temporal data parser |
| `lib/spine/types.ts` | 456 | Spine type definitions |
Dependencies
From `@trajectory/shared`:
- Supabase client (project persistence)
- Tauri bindings (file system access, monorepo scanning)
- Types (OrbitProject, EvolutionEvent, SpineEntry, etc.)
- Graph Kernel API (for architecture graph rendering)
- Common components (ErrorBoundary, Skeleton)
External packages:
- `react`, `react-dom`
- `@tauri-apps/cli` (file system scanning)
- `@supabase/supabase-js` (cloud persistence)
- `recharts` (evolution timeline charts)
- `lucide-react`, `framer-motion`, `tailwind-merge`
Standalone Viability: ⚠️ MEDIUM
Most coupled domain. Issues:
- 34+ TS errors in ArchitectureExplorer.tsx and ArchitectureViewPart2.tsx — heaviest error concentration
- 3-part ArchitectureView is a code smell (should be consolidated)
- Heavy dependency on Orbit project types
- useEvolutionBridge has 11 TS errors (type drift)
- SpineTimelineView has 8 errors
- Spine parser has 4 errors
- Needs Orbit API integration for project data
- recharts dependency for timeline visualization
What's needed before extraction:
1. Fix all 34+ Architecture View TS errors
2. Fix 11 useEvolutionBridge errors
3. Consolidate 3-part architecture view
4. Ensure Orbit API client is properly abstracted
Target Platform: Tauri Desktop (primary)
Architecture exploration needs file system access for monorepo scanning. Desktop-native makes sense. Web version possible for read-only exploration.
Where It Merges
→ Compass / Orbit Desktop: This overlaps with `apps/trajectory/trajectory-orbit/orbit-desktop/`. The Architecture Explorer could become a module within Orbit Desktop, or replace Compass entirely as the project intelligence UI.
Strong candidate for merging into `trajectory-orbit/orbit-desktop/` as the visualization layer.
Extraction Difficulty: Hard
Highest coupling:
1. Deep Orbit project type dependency (OrbitProject, etc.)
2. Graph Kernel integration for architecture rendering
3. Supabase dependency for project persistence
4. 34+ TS errors need fixing first
5. 3-part view needs consolidation
6. useEvolutionBridge has drift issues
7. Spine parser references external types
---
App 6: Research Browser
> Identity: Embedded research browser with quick capture, omnibox, multi-tab browsing, and search engine selection.
What It Becomes
"Research Browser" — a focused research browsing tool. Multi-tab browsing with quick capture (highlight → save to knowledge graph), find-in-page, omnibox search, and search engine selection.
Exact Files (3,519 LOC)
#### Components (1,579 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `components/research-browser/ResearchBrowserView.tsx` | 403 | Main browser view |
| `components/research-browser/BrowserTab.tsx` | 88 | Browser tab component |
| `components/research-browser/BrowserTabBar.tsx` | 59 | Tab bar |
| `components/research-browser/BrowserToolbar.tsx` | 272 | Browser toolbar |
| `components/research-browser/FindInPage.tsx` | 255 | Find in page feature |
| `components/research-browser/Omnibox.tsx` | 123 | URL/search omnibox |
| `components/research-browser/QuickCapture.tsx` | 317 | Quick capture to knowledge graph |
| `components/research-browser/SearchEngineSelector.tsx` | 62 | Search engine picker |
#### Hooks (1,252 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `hooks/useResearchBrowser.ts` | 397 | Browser state management |
| `hooks/useBrowserEvents.ts` | 404 | Browser event handling |
| `hooks/useBrowserHistory.ts` | 276 | Browsing history |
| `hooks/useBrowserPersistence.ts` | 175 | Session persistence |
#### Libraries (688 LOC)
| File | LOC | Purpose |
|------|-----|---------|
| `lib/browser-types.ts` | 137 | Browser type definitions |
| `lib/webview.ts` | 194 | Webview management utilities |
| `lib/agents/research.ts` | 357 | Research agent |
#### Rust Backend (relevant portions)
| File | LOC | Purpose |
|------|-----|---------|
| `src-tauri/src/browser/commands.rs` | 413 | Browser webview commands |
| `src-tauri/src/browser/mod.rs` | 3 | Browser module |
Dependencies
From `@trajectory/shared`:
- Tauri bindings (webview management — critical)
- Types (BrowserTab, BrowserSession, etc.)
- Common components
External packages:
- `react`, `react-dom`
- `@tauri-apps/cli` (webview management — essential, cannot work without it)
- `lucide-react`, `tailwind-merge`
Notably NO: Supabase, AI SDKs, heavy visualization libs.
Standalone Viability: ⚠️ MEDIUM
The browser is inherently Tauri-dependent (needs webview commands). Issues:
- Tauri webview coupling is tight — browser/commands.rs needs to come along
- Quick Capture → knowledge graph flow needs API abstraction
- Research agent depends on agent SDK
- Without Tauri, this can't render web pages (no iframe equivalent)
What's needed:
1. Abstract Tauri webview commands into a provider interface
2. Define capture → search pipeline API
3. Browser Rust module needs extraction
Target Platform: Tauri Desktop only
Research browser REQUIRES Tauri's webview capabilities. No web or mobile version possible without a completely different architecture.
Where It Merges
→ Standalone `apps/trajectory/research-browser/` or absorbed into `apps/trajectory/latent-browser/` (which already exists in the monorepo). The latent-browser may be an earlier version or separate concept — check before extraction.
Extraction Difficulty: Easy (code), Medium (runtime)
Code coupling is low, but runtime coupling is medium:
1. Clean component directory
2. Clean hook set
3. Own type definitions
4. BUT: Tauri webview commands are the backbone
5. Rust browser module needs extraction
6. Quick Capture ties into search/knowledge pipeline
---
Shared Package: `@trajectory/shared`
> Everything that multiple apps need. Extract once, share everywhere.
Package Architecture
packages/trajectory-shared/
├── src/
│ ├── components/ # Common UI components
│ │ ├── ErrorBoundary.tsx (417 LOC)
│ │ ├── Skeleton.tsx (from common/)
│ │ ├── CommandPalette.tsx (240 LOC)
│ │ ├── SettingsModal.tsx (394 LOC)
│ │ ├── VoiceInputButton.tsx (242 LOC)
│ │ ├── StatusBar.tsx (124 LOC)
│ │ ├── ServiceStatusBar.tsx (344 LOC)
│ │ ├── CompactHeader.tsx (294 LOC) — make configurable per app
│ │ └── ExpandableCard.tsx (123 LOC)
│ │
│ ├── terminal/ # Terminal components
│ │ ├── EmbeddedTerminal.tsx (880 LOC)
│ │ ├── QuadTerminal.tsx (425 LOC)
│ │ └── ClaudeTerminalPanel/ (581 LOC total)
│ │
│ ├── agents/ # Agent infrastructure
│ │ ├── types.ts (260 LOC)
│ │ ├── code-reviewer.ts (313 LOC)
│ │ ├── agent-sdk.d.ts (103 LOC)
│ │ └── index.ts (98 LOC)
│ │
│ ├── skills/ # Skills store
│ │ ├── types.ts (255 LOC)
│ │ ├── validation.ts (633 LOC)
│ │ └── index.ts (7 LOC)
│ │
│ ├── orchestrator/ # Meta orchestrator
│ │ ├── meta-orchestrator.ts (779 LOC)
│ │ ├── autonomous-builder.ts (517 LOC)
│ │ └── index.ts (31 LOC)
│ │
│ ├── pulse/ # Pulse health metrics
│ │ ├── api-client.ts (250 LOC)
│ │ ├── types.ts (204 LOC)
│ │ └── index.ts (34 LOC)
│ │
│ ├── hooks/ # Shared hooks
│ │ ├── useKeyboardShortcuts.ts (199 LOC)
│ │ ├── useVoiceInput.ts (242 LOC — from hooks/)
│ │ ├── useCommandPalette.ts (154 LOC)
│ │ ├── useSkillsStore.ts (1,072 LOC)
│ │ ├── useAgentQueue.ts (554 LOC)
│ │ ├── usePulse.ts (367 LOC)
│ │ ├── useLedgerRealtime.ts (from hooks/)
│ │ ├── useTimeline.ts (250 LOC)
│ │ ├── useMetaOrchestrator.ts (214 LOC)
│ │ └── self-continue.ts (504 LOC — from lib/hooks/)
│ │
│ ├── lib/ # Core utilities
│ │ ├── tauri.ts (56 LOC)
│ │ ├── supabase.ts (47 LOC)
│ │ ├── types.ts (1,580 LOC)
│ │ ├── commands.ts (from lib/)
│ │ ├── screenshot.ts (82 LOC)
│ │ ├── crypto-shim.ts (26 LOC)
│ │ └── notes-service.ts (583 LOC)
│ │
│ ├── views/ # Shared view components (non-domain-specific)
│ │ ├── PromptsView.tsx (635 LOC)
│ │ ├── TimelineView.tsx (242 LOC)
│ │ ├── SkillsStoreView.tsx (540 LOC)
│ │ ├── AgentsView.tsx (611 LOC)
│ │ └── NotesView/ (856 LOC total)
│ │
│ └── sandbox/ # Sandbox utilities
│ ├── sandbox-manager.ts (513 LOC)
│ └── index.ts (18 LOC)
│
├── package.json
├── tsconfig.json
└── index.tsShared Package Size: ~14,500 LOC
This represents the truly shared infrastructure:
- Common UI: ErrorBoundary, Skeleton, CommandPalette, Settings, StatusBar, Header
- Terminal stack: EmbeddedTerminal, QuadTerminal, ClaudeTerminal
- Agent infrastructure: SDK types, queue, code reviewer, orchestrator
- Data services: Supabase, Tauri bindings, Pulse, Ledger
- Shared views: Notes, Prompts, Skills Store, Agents, Timeline
- Types: The massive `lib/types.ts` (1,580 LOC)
Remaining Components (stay with Search Core)
These components live in the root but belong to Search Core's UI:
| File | LOC | Purpose |
|------|-----|---------|
| `components/ProjectsCard.tsx` | 1,503 | Project card (needs refactoring — 1,503 LOC!) |
| `components/PlansCard.tsx` | 281 | Plans card |
| `components/PlanDetailModal.tsx` | 257 | Plan detail modal |
| `components/InboxCard.tsx` | 227 | Inbox card |
| `components/InboxIndicator.tsx` | 286 | Inbox indicator |
| `components/ActionsCard.tsx` | 410 | Actions card |
| `components/SaveAsIdeaModal.tsx` | 323 | Save as idea modal |
| `components/ProjectTree.tsx` | 238 | Project tree |
| `components/HierarchicalProjectTree.tsx` | 406 | Hierarchical project tree |
| `components/TrajectoryBadge.tsx` | 311 | Trajectory badge component |
| `components/realtime/LedgerFeed.tsx` | 568 | Ledger real-time feed |
| `components/queue/QueueSidebar.tsx` | 314 | Queue sidebar |
| `components/queue/QueueStatusBar.tsx` | 103 | Queue status bar |
| `components/settings/QueueSettingsPanel.tsx` | 261 | Queue settings |
| `components/tabs/TabNavigation.tsx` | 136 | Tab navigation |
| `components/tabs/TabButton.tsx` | 60 | Tab button |
---
Extraction Order
Principle: Least coupled → Most coupled. Extract the easy wins first to reduce the monolith incrementally.
Phase 1: Easy Extractions (Week 1-2)
#### Step 1: Kinetic Theater → standalone app
- Why first: Lowest coupling, no Supabase, no Graph Kernel, own type system
- Effort: 2-3 days
- Actions:
1. Create `apps/trajectory/kinetic-theater/` with Tauri scaffolding
2. Move all `components/kinetic-theater/`, `components/perspectives/`, `components/motion/`, `components/views/DevicesView.tsx`, `components/views/PerspectivesView.tsx`
3. Move `hooks/useKineticTheater.ts`, `useMotionAnticipation.ts`, `usePerspective.ts`, `useDeviceConnection.ts`, `useConnectionDetection.ts`
4. Move `lib/kinetic-theater/`, `lib/motion-api.ts`, `lib/motion-perspectives/`
5. Fix 7 TS errors in perspectives
6. Add shared package dependency for Tauri bindings + common UI
7. Remove from trajectory-search, update App.tsx
8. Verify build: `npm run build` passes in both projects
#### Step 2: Dream Studio → standalone app
- Why second: Self-contained provider system, own tests
- Effort: 2-3 days
- Actions:
1. Create `apps/trajectory/dream-studio/` with Vite scaffolding (web-first)
2. Move all `components/dream/`, `components/FullScreenGenerationView.tsx`, `components/CanvasView.tsx`
3. Move `hooks/useDream.ts`
4. Move `lib/dream/`, `lib/agents/dream.ts`, `lib/hooks/dream-continue.ts`
5. Move `lib/dream/providers.test.ts` (working test!)
6. Add shared package dependency
7. Remove from trajectory-search, update App.tsx
8. Verify both builds
#### Step 3: Research Browser → standalone Tauri app
- Why third: Small codebase, clean boundaries
- Effort: 2 days
- Actions:
1. Create `apps/trajectory/research-browser/` with Tauri scaffolding
2. Move all `components/research-browser/`
3. Move `hooks/useResearchBrowser.ts`, `useBrowserEvents.ts`, `useBrowserHistory.ts`, `useBrowserPersistence.ts`
4. Move `lib/browser-types.ts`, `lib/webview.ts`, `lib/agents/research.ts`
5. Extract `src-tauri/src/browser/` module
6. Check against `apps/trajectory/latent-browser/` for overlap
7. Add shared package dependency
8. Remove from trajectory-search, update App.tsx
Phase 2: Medium Extractions (Week 3-4)
#### Step 4: Trajectory Calendar → standalone app
- Why fourth: Clean directory boundaries but more TS errors to fix first
- Effort: 4-5 days
- Actions:
1. Fix 34 template-engine test errors
2. Fix 9 conflict-detector errors
3. Fix 5 calendar agent errors
4. Fix 4 SuggestionCard errors + 1 ReminderSettingsPanel error
5. Create `apps/trajectory/trajectory-calendar/` with Tauri scaffolding
6. Move all `components/calendar/`
7. Move `hooks/useCalendar.ts`, `useCalendarChat.ts`, `useTemplates.ts`
8. Move `lib/calendar/`, `lib/agents/calendar.ts`
9. Extract `src-tauri/src/reminders/` module
10. Abstract Orbit project types for project-blueprint.ts
11. Add shared package dependency
12. Remove from trajectory-search, update App.tsx
Phase 3: Hard Extractions (Week 5-6)
#### Step 5: Architecture Explorer → into Orbit Desktop or standalone
- Why last: Highest coupling, most TS errors, Orbit dependency
- Effort: 5-7 days
- Actions:
1. Fix 22 ArchitectureExplorer errors
2. Fix 12 ArchitectureViewPart2 errors
3. Fix 5+2 remaining Architecture View errors
4. Fix 11 useEvolutionBridge errors
5. Fix 8 SpineTimelineView errors + 6 useSpineTimeline errors
6. Fix 4 spine parser errors
7. Consolidate 3-part ArchitectureView into single component with sections
8. Evaluate: merge into `apps/trajectory/trajectory-orbit/orbit-desktop/` or create `apps/trajectory/architecture-explorer/`
9. Move all `components/views/Architecture*.tsx`, `components/views/SpineTimelineView.tsx`
10. Move `components/timeline/`, `components/projects/`
11. Move all project hooks (useSpineTimeline, useEvolutionBridge, useProject*, useMonorepoScanner, useKnowledgeTransfer)
12. Move `lib/spine/`
13. Abstract Orbit types and Graph Kernel dependency
14. Add shared package dependency
15. Remove from trajectory-search, update App.tsx
#### Step 6: Extract `@trajectory/shared` package
- When: In parallel with Phase 1, finalize during Phase 3
- Effort: 3-4 days (cumulative, done incrementally)
- Actions:
1. Create `packages/trajectory-shared/`
2. Extract `lib/types.ts`, `lib/tauri.ts`, `lib/supabase.ts`
3. Extract common components (ErrorBoundary, Skeleton, etc.)
4. Extract terminal components
5. Extract agent infrastructure
6. Extract shared hooks
7. Set up proper TypeScript project references
8. Publish as workspace package in monorepo
---
Post-Decomposition: Trajectory Search Core
After all extractions, the core app looks like:
### File Count: ~42 files (down from 271)
### LOC: ~12,000 frontend + ~4,300 Rust backend (commands.rs) ≈ 16,300 total
Structure
trajectory-search/
├── src/
│ ├── App.tsx (~200 LOC — dramatically simplified)
│ ├── main.tsx
│ ├── contexts/
│ │ └── SearchContext.tsx
│ ├── components/
│ │ ├── views/
│ │ │ ├── SearchView.tsx
│ │ │ ├── IdeasView.tsx
│ │ │ ├── ChainsView.tsx
│ │ │ ├── ClaimsView.tsx
│ │ │ └── ArtifactsView.tsx
│ │ ├── search/
│ │ │ ├── QueryBar.tsx
│ │ │ ├── ResultList.tsx
│ │ │ ├── ResultCard.tsx
│ │ │ ├── FiltersPanel.tsx
│ │ │ ├── SearchBar.tsx
│ │ │ ├── ResumeSearchBanner.tsx
│ │ │ ├── SelectionBar.tsx
│ │ │ └── SelectedResultsPanel.tsx
│ │ ├── ideas/
│ │ ├── chains/
│ │ ├── claims/
│ │ ├── artifacts/
│ │ ├── idea-scaffold/
│ │ ├── modals/
│ │ │ ├── CompareView.tsx
│ │ │ ├── SynthesizeModal.tsx
│ │ │ ├── CollectionModal.tsx
│ │ │ └── ChainMemoryView.tsx
│ │ └── (shared components via @trajectory/shared)
│ ├── hooks/
│ │ ├── useSearch.ts
│ │ ├── useSearchPersistence.ts
│ │ ├── useCollections.ts
│ │ ├── useResultFeedback.ts
│ │ ├── useGraphKernel.ts
│ │ ├── useIdeas.ts
│ │ ├── useLocalIdeas.ts
│ │ ├── useKnowledgeChains.ts
│ │ ├── useClaims.ts
│ │ ├── useIdeaScaffold.ts
│ │ └── useSynthesisAgent.ts
│ └── lib/
│ ├── search-engines.ts
│ ├── graph-kernel-api.ts
│ ├── context/
│ └── agents/
│ ├── synthesis.ts
│ ├── idea-scaffold.ts
│ └── scaffolding.ts
├── src-tauri/
│ └── src/
│ ├── main.rs
│ ├── commands.rs (slimmed — remove calendar/browser/motion commands)
│ └── agent_client.rs
└── package.json (dramatically slimmed dependencies)Slimmed Dependencies
Remove after decomposition:
- `@react-three/fiber`, `@react-three/drei`, `three`, `@types/three` → Kinetic Theater (unless ChainMemoryView stays)
- `@xterm/xterm`, `@xterm/addon-fit`, `@xterm/addon-web-links` → @trajectory/shared
- `@tiptap/*` (12 packages), `tiptap-markdown` → @trajectory/shared (Notes)
- `recharts` → Architecture Explorer
- `html2canvas` → Dream Studio
- `tippy.js` → Remove entirely (unused or replace with Radix)
- `@anthropic-ai/sdk`, `openai` → Dream Studio (unless synthesis uses them)
Keep:
- `react`, `react-dom`
- `@tauri-apps/cli`
- `@supabase/supabase-js`
- `framer-motion`
- `lucide-react`
- `tailwind-merge`
- `use-debounce`
- `@comp-core/agent-sdk`
- `@trajectory/shared` (new)
Tab Count: 5 (down from 19)
Search │ Ideas │ Chains │ Claims │ ArtifactsPlus shared views from @trajectory/shared accessible via Command Palette:
- Notes, Prompts, Skills, Agents, Timeline
---
Monorepo vs Separate Repos
Recommendation: Monorepo (stay in Comp-Core)
Reasoning:
1. Shared types evolve together — `lib/types.ts` (1,580 LOC) is referenced by 4+ apps. Type changes need atomic commits across consumers.
2. Shared package versioning — `@trajectory/shared` in a monorepo uses workspace protocol (`workspace:*`). Separate repos need a package registry and semver coordination.
3. Existing infrastructure — Comp-Core already has the monorepo structure (`apps/`, `core/`, `packages/`). Adding `packages/trajectory-shared/` is natural.
4. CI/CD simplification — One pipeline tests all affected apps on shared package changes. Separate repos need cross-repo CI triggers.
5. Orbit already lives here — `trajectory-orbit/` is in the monorepo. Architecture Explorer merging into Orbit Desktop is trivial in-monorepo, painful across repos.
6. Developer experience — `npm install` once, all apps available. No git submodules, no published packages to manage.
Proposed Monorepo Layout
Comp-Core/
├── apps/
│ └── trajectory/
│ ├── trajectory-search/ # Core search (slimmed to ~16K LOC)
│ ├── trajectory-calendar/ # NEW: Calendar standalone
│ ├── kinetic-theater/ # NEW: Motion visualization
│ ├── dream-studio/ # NEW: AI content generation
│ ├── research-browser/ # NEW: Research browsing (or merge into latent-browser)
│ ├── latent-browser/ # Existing — check overlap with research-browser
│ ├── trajectory-orbit/ # Existing — Architecture Explorer merges here
│ ├── trajectory-mobile/ # Existing
│ ├── trajectory-os/ # Existing
│ └── ...
├── packages/
│ └── trajectory-shared/ # NEW: Shared types, components, hooks
├── core/
│ └── cc-agent-sdk/ # Existing agent SDK
└── ...---
Timeline Estimate
| Phase | Task | Duration | Dependencies |
|---|---|---|---|
| 0 | Create `@trajectory/shared` scaffold | 1 day | — |
| 1a | Extract Kinetic Theater | 2-3 days | Phase 0 |
| 1b | Extract Dream Studio | 2-3 days | Phase 0 |
| 1c | Extract Research Browser | 2 days | Phase 0 |
| 2 | Extract Trajectory Calendar | 4-5 days | Phase 0 + fix 53 TS errors |
| 3 | Extract Architecture Explorer | 5-7 days | Phase 0 + fix 72 TS errors + Orbit integration decision |
| 4 | Finalize shared package | 2-3 days | All extractions complete |
| 5 | Clean up Search Core | 2-3 days | All extractions complete |
| Total | ~4-5 weeks |
Parallelization
Phases 1a, 1b, 1c can run in parallel (different engineers or different branches). Phase 2 and 3 are sequential (each reduces the monolith, making the next extraction cleaner).
Week 1: [Phase 0] → [Phase 1a: Kinetic] ──────────┐
→ [Phase 1b: Dream] ─────────────┤
→ [Phase 1c: Research Browser] ──┤
Week 2: ├→ [Phase 2: Calendar] ──┐
Week 3: │ │
Week 4: └─→ [Phase 3: Architecture] ──┐
Week 5: ├→ [Phase 4+5: Finalize]---
Discord Channel Mapping
| App | Channel | New/Existing | Purpose |
|---|---|---|---|
| Trajectory Search (Core) | `#trajectory-search` | Existing | Core search development |
| Trajectory Calendar | `#trajectory-calendar` | New | Calendar feature development |
| Kinetic Theater | `#kinetic-theater` | New | Motion visualization development |
| Dream Studio | `#dream-studio` | New | AI content generation development |
| Architecture Explorer | `#architecture-explorer` | New | Codebase intelligence development |
| Research Browser | `#research-browser` | New | Research browser development |
| @trajectory/shared | `#trajectory-shared` | New | Shared package coordination |
| All trajectory apps | `#trajectory-dev` | Existing or New | Cross-app coordination, integration issues |
---
Risk Register
| Risk | Impact | Likelihood | Mitigation |
|---|---|---|---|
| Shared type changes break multiple apps | High | High | CI runs all affected app builds on @trajectory/shared changes |
| Extraction breaks search functionality | High | Medium | Feature-flag extraction: keep dead code paths until new app verified |
| Rust backend splitting is complex | Medium | High | commands.rs is a monolith — split incrementally, one domain at a time |
| Architecture Explorer TS errors resist fixing | Medium | Medium | If >2 days stuck, delete Architecture views and rebuild from scratch |
| Research Browser overlaps with latent-browser | Low | Medium | Audit latent-browser first; if overlap >50 |
| Calendar Orbit coupling is deeper than visible | Medium | Medium | Audit all `invoke()` calls in calendar hooks for Orbit dependencies |
| 3 parallel extractions cause merge conflicts | Low | Low | Each extraction touches different files; conflicts unlikely |
---
Quality Gates (Per Extraction)
Before any extracted app merges to main:
- [ ] `npm run build` exits 0 (zero TS errors)
- [ ] `npm run test` passes (all existing tests)
- [ ] Source monolith still builds (`trajectory-search` builds with domain removed)
- [ ] No `@ts-ignore` or `@ts-expect-error` added
- [ ] Shared package properly imported (no copy-paste of shared code)
- [ ] README.md exists in new app directory
- [ ] Package.json has correct dependencies (no phantom deps from monolith)
- [ ] Conventional commit: `feat(trajectory): extract {app-name} as standalone app`
---
Open Questions
1. latent-browser overlap: Does `apps/trajectory/latent-browser/` overlap with Research Browser? If so, merge rather than create a new app.
2. ChainMemoryView: The 3D chain memory visualization (832 LOC) uses Three.js. Does it stay with Search Core (adds ~800KB bundle) or move to a shared lazy-loaded module?
3. Orbit Desktop merger: Should Architecture Explorer become part of `trajectory-orbit/orbit-desktop/` or remain standalone? The Orbit Desktop already exists with its own Rust backend.
4. Agent SDK coupling: Several extracted apps reference `@comp-core/agent-sdk`. Should each app bundle it, or should it be a peer dependency via @trajectory/shared?
5. Tauri version alignment: All extracted Tauri apps must use the same Tauri v2 version. Pin in workspace root?
6. Notes as shared or standalone: NotesView (856 LOC) with TipTap is used across domains. Should it be in @trajectory/shared (adds TipTap deps to shared package) or a standalone `@trajectory/notes` package?
---
End of decomposition plan.
Promotion Decision
Attach run IDs, datasets, metrics, and reproduction commands.
Source Anchor
Comp-Core/apps/trajectory/trajectory-search/docs/DECOMPOSITION-PLAN.md
Detected Structure
Method · Evaluation · References · Figures · Code Anchors · Architecture