Grand Diomande Research · Full HTML Reader

AI Handoff Document: Trajectory Control Center

You are receiving a project at a critical inflection point. The **Trajectory Control Center** is a unified Tauri desktop application that combines:

Agents That Account for Themselves technical note experiment writeup candidate score 44 .md

Full Public Reader

AI Handoff Document: Trajectory Control Center

Executive Summary

You are receiving a project at a critical inflection point. The Trajectory Control Center is a unified Tauri desktop application that combines:

1. RAG++ Knowledge Retrieval - Semantic search over 107K+ memory turns
2. Idea Vault - Research ideas lifecycle management
3. Orbit Integration - Project orchestration

The core integration is complete. You are now tasked with implementing the enhancement roadmap that adds:
- Timeline & Calendar views for idea evolution tracking
- Multi-source import pipeline
- Knowledge base integration (RAG++ enrichment)
- Idea linking and evolution graphs

---

Table of Contents

1. [Project Context](#1-project-context)
2. [System Architecture](#2-system-architecture)
3. [Codebase Map](#3-codebase-map)
4. [What Has Been Completed](#4-what-has-been-completed)
5. [Current State](#5-current-state)
6. [What Needs to Be Done](#6-what-needs-to-be-done)
7. [Critical Files to Read](#7-critical-files-to-read)
8. [Technical Reference](#8-technical-reference)
9. [Conventions & Patterns](#9-conventions--patterns)
10. [Known Issues & Constraints](#10-known-issues--constraints)
11. [Continuation Instructions](#11-continuation-instructions)

---

1. Project Context

1.1 The Computational Choreography Ecosystem

This project exists within a larger ecosystem called Computational Choreography (Comp-Core), which is a discipline for real-time embodied intelligence. The ecosystem has three architectural layers:

LayerNameResponsibility
DisciplineComputational ChoreographyOverarching framework
OSTrajectoryOSLong-horizon meaning, identity persistence, cross-session coherence
EngineEchelonReal-time embodied physics, millisecond latency, continuous fields

1.2 TrajectoryOS Components

TrajectoryOS consists of:

1. RAG++ (`core/cc-rag-plus-plus/`) - Unified knowledge fabric with 5D trajectory coordinates
2. Orbit (`apps/trajectory/trajectory-orbit/`) - Project orchestrator and context router
3. Prompt Logger - Captures prompts from Claude, Cursor, Codex into `memory_turns` table
4. CognitiveTwin - ML model learning user reasoning patterns
5. Idea Vault (`core/cc-idea-vault/`) - Research ideas lifecycle management

1.3 The Integration Story

Previously, these were separate systems:
- Trajectory Search: Tauri app for RAG++ search
- Idea Vault: Standalone Next.js app

We have now unified them into the Trajectory Control Center — a single desktop app with tabbed navigation.

---

2. System Architecture

2.1 High-Level Architecture

┌─────────────────────────────────────────────────────────────────────────────────┐
│                          TRAJECTORY CONTROL CENTER                               │
│                            (Tauri Desktop App)                                   │
├─────────────────────────────────────────────────────────────────────────────────┤
│                                                                                  │
│   ┌──────────────────────────────────────────────────────────────────────────┐  │
│   │                         React Frontend (TypeScript)                       │  │
│   │  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌──────────┐ ┌─────────┐           │  │
│   │  │ Search  │ │  Ideas  │ │ Claims  │ │Artifacts │ │ Actions │           │  │
│   │  │   Tab   │ │   Tab   │ │   Tab   │ │   Tab    │ │   Tab   │           │  │
│   │  └────┬────┘ └────┬────┘ └────┬────┘ └────┬─────┘ └────┬────┘           │  │
│   │       │           │           │            │            │                │  │
│   │       └───────────┴───────────┴────────────┴────────────┘                │  │
│   │                               │                                          │  │
│   │                      React Hooks Layer                                   │  │
│   │       ┌─────────────────────────────────────────────────────┐           │  │
│   │       │ useSearch │ useIdeas │ useClaims │ useVaultStats    │           │  │
│   │       └─────────────────────────────────────────────────────┘           │  │
│   └──────────────────────────────────────────────────────────────────────────┘  │
│                                    │                                             │
│                           Tauri IPC Bridge                                       │
│                                    │                                             │
│   ┌──────────────────────────────────────────────────────────────────────────┐  │
│   │                         Rust Backend (Tauri)                              │  │
│   │  ┌────────────────────────────────────────────────────────────────────┐  │  │
│   │  │                        commands.rs                                  │  │  │
│   │  │  • search_context      • get_vault_stats    • run_proposer         │  │  │
│   │  │  • get_projects        • create_idea        • run_skeptic          │  │  │
│   │  │  • get_inbox           • list_ideas         • link_artifact        │  │  │
│   │  │  • generate_action     • create_claim       • ...14 total          │  │  │
│   │  └────────────────────────────────────────────────────────────────────┘  │  │
│   └──────────────────────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────────────────────────┘
                                     │
                                     │ HTTPS
                                     ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│                              CLOUD SERVICES                                      │
├─────────────────────────────────────────────────────────────────────────────────┤
│                                                                                  │
│   ┌────────────────────────────────┐    ┌────────────────────────────────┐      │
│   │         RAG++ Service          │    │        Orbit Server            │      │
│   │   (Cloud Run - GCP)            │    │   (Cloud Run - GCP)            │      │
│   │                                │    │                                │      │
│   │  /api/rag/search               │    │  /api/projects                 │      │
│   │  /api/rag/health               │    │  /api/inbox                    │      │
│   │  /api/idea-vault/*             │    │  /api/inference/generate       │      │
│   │                                │    │                                │      │
│   └────────────────────────────────┘    └────────────────────────────────┘      │
│              │                                      │                            │
│              └──────────────────┬───────────────────┘                            │
│                                 │                                                │
│                                 ▼                                                │
│   ┌────────────────────────────────────────────────────────────────────────┐    │
│   │                         Supabase (PostgreSQL)                          │    │
│   │  • memory_turns (107K+ rows)  • ideas           • artifacts            │    │
│   │  • claude_prompts             • chains          • reviews              │    │
│   │  • orbit_projects             • claims          • evolution_events     │    │
│   └────────────────────────────────────────────────────────────────────────┘    │
│                                                                                  │
└─────────────────────────────────────────────────────────────────────────────────┘

2.2 Data Flow

User Query
    │
    ▼
┌─────────────────┐
│  React Frontend │
│  (SearchBar)    │
└────────┬────────┘
         │ invoke('search_context', { query, ... })
         ▼
┌─────────────────┐
│  Rust Commands  │
│  (commands.rs)  │
└────────┬────────┘
         │ reqwest::get(RAG_URL/api/rag/search)
         ▼
┌─────────────────┐
│  RAG++ Service  │
│  (FastAPI)      │
└────────┬────────┘
         │ pgvector similarity search
         ▼
┌─────────────────┐
│   Supabase      │
│ (memory_turns)  │
└────────┬────────┘
         │ results with trajectory coords
         ▼
┌─────────────────┐
│  Frontend       │
│  (ResultList)   │
└─────────────────┘

---

3. Codebase Map

3.1 Repository Structure

[home]/Desktop/Comp-Core/
│
├── apps/
│   └── trajectory/
│       ├── trajectory-search/          ★ PRIMARY WORK AREA ★
│       │   ├── src/                    # React frontend
│       │   │   ├── App.tsx             # Main app with tabs
│       │   │   ├── components/         # UI components
│       │   │   │   ├── tabs/           # Tab navigation
│       │   │   │   ├── ideas/          # Idea management
│       │   │   │   ├── claims/         # Claim management
│       │   │   │   ├── artifacts/      # Artifact display
│       │   │   │   └── views/          # Tab content views
│       │   │   ├── hooks/              # React hooks
│       │   │   │   ├── useSearch.ts
│       │   │   │   ├── useIdeas.ts     # NEW
│       │   │   │   └── useClaims.ts    # NEW
│       │   │   └── lib/
│       │   │       └── types.ts        # TypeScript types
│       │   ├── src-tauri/              # Rust backend
│       │   │   └── src/
│       │   │       ├── main.rs         # Command registration
│       │   │       └── commands.rs     # All Tauri commands
│       │   ├── docs/
│       │   │   ├── IDEA_VAULT_INTEGRATION.md    # Integration docs
│       │   │   └── IDEA_VAULT_ENHANCEMENTS.md   # Enhancement roadmap
│       │   ├── README.md
│       │   └── CHANGELOG.md
│       │
│       ├── trajectory-orbit/           # Orbit orchestrator
│       │   ├── crates/                 # Rust crates
│       │   │   ├── orbit-core/
│       │   │   └── orbit-server/
│       │   └── orbit-mcp-bridge/       # MCP tools for AI
│       │
│       └── trajectory-os/              # TrajectoryOS scripts
│           ├── bin/tos                 # CLI tool
│           └── docs/
│               └── ARCHITECTURE.md
│
├── core/
│   ├── cc-rag-plus-plus/               ★ RAG++ SERVICE ★
│   │   ├── rag_plusplus/
│   │   │   ├── service/
│   │   │   │   ├── app.py              # FastAPI app
│   │   │   │   └── idea_vault.py       # Idea Vault routes
│   │   │   ├── core/
│   │   │   │   ├── memory_retriever.py
│   │   │   │   └── generation_engine.py
│   │   │   └── primitives/             # RAG++ primitives
│   │   │       ├── query_intent.py
│   │   │       ├── quality_reranker.py
│   │   │       └── policy_injector.py
│   │   ├── migrations/
│   │   │   └── 003_idea_vault_schema.sql
│   │   └── docs/
│   │       ├── IMPLEMENTATION_REPORT.md
│   │       └── IMPLEMENTATION_OS.md
│   │
│   └── cc-idea-vault/                  # Idea Vault Rust core
│       ├── src/
│       │   ├── schema/                 # Domain types
│       │   │   ├── idea.rs
│       │   │   ├── claim.rs
│       │   │   └── artifact.rs
│       │   ├── lifecycle/              # State machines
│       │   │   ├── idea_state.rs
│       │   │   └── claim_state.rs
│       │   └── agents/                 # AI agents
│       │       ├── proposer.rs
│       │       └── skeptic.rs
│       └── docs/
│           └── IMPLEMENTATION_PLAN.md
│
└── docs/
    └── architecture/                   # Architecture docs
        └── core/
            ├── 00-OVERVIEW.md
            ├── 08-RAG_PLUS_PLUS.md
            └── 09-ORBIT.md

3.2 Key File Counts

DirectoryPurposeFiles
`trajectory-search/src/`React frontend47 files
`trajectory-search/src-tauri/src/`Rust backend3 files
`cc-rag-plus-plus/rag_plusplus/`RAG++ service~50 files
`cc-idea-vault/src/`Idea Vault core~20 files
`trajectory-orbit/crates/`Orbit crates~55 files

---

4. What Has Been Completed

4.1 Idea Vault Integration (COMPLETE)

The standalone Idea Vault Next.js app has been unified into Trajectory Search:

Rust Backend Additions (`commands.rs`):
- 9 new type definitions: `Idea`, `Chain`, `Claim`, `Review`, `Artifact`, `VaultStats`, `ProposerResponse`, `SkepticResponse`
- 14 new Tauri commands covering full CRUD for ideas, claims, reviews, artifacts

TypeScript Additions (`types.ts`):
- All Idea Vault types mirrored in TypeScript
- `Tab` type for navigation

New React Hooks:
- `useIdeas` - Ideas CRUD, filtering, categorization
- `useClaims` - Claims management
- `useChain` - Chain management
- `useAgents` - Proposer/Skeptic agent execution
- `useVaultStats` - Vault statistics

New React Components:
- `tabs/TabNavigation`, `TabButton`
- `ideas/IdeaCard`, `NewIdeaModal`, `IdeaDetailModal`, `IdeasToolbar`
- `claims/ClaimCard`, `ClaimsToolbar`
- `artifacts/ArtifactCard`
- `views/SearchView`, `IdeasView`, `ClaimsView`, `ArtifactsView`, `ActionsView`

App.tsx Refactor:
- Tabbed navigation with 5 tabs
- Keyboard shortcuts (⌘1-5 for tabs, ⌘N for new idea)
- StatusBar shows vault stats

Cleanup:
- Removed standalone `apps/idea-vault/` Next.js app

4.2 Previous Work (Historical Context)

This project has a rich history. Key milestones:

1. RAG++ Implementation - Built the unified knowledge fabric with 5D trajectory coordinates
2. Prompt Logger MCP - Captures prompts from Claude, Cursor, Codex
3. Orbit Server - Project orchestrator deployed to Cloud Run
4. CognitiveTwin - ML model for learning reasoning patterns
5. Echelon - Real-time motion processing engine
6. DELL - Dual-equilibrium latent learning for motion
7. Mocopi Integration - Sony motion capture sensor pipeline
8. Architecture Documentation - Comprehensive docs in `docs/architecture/`

---

5. Current State

5.1 What Works

FeatureStatusNotes
RAG++ Search✅ Working107K+ memory turns searchable
Orbit Projects✅ WorkingLists local and cloud projects
Inbox✅ WorkingDispatch items to Claude/Cursor
Ideas CRUD✅ WorkingCreate, list, update status
Claims CRUD✅ WorkingCreate, verify, falsify
AI Agents✅ WorkingProposer and Skeptic
Tab Navigation✅ Working5 tabs with keyboard shortcuts
StatusBar✅ WorkingShows health + vault stats

5.2 What Doesn't Work Yet

FeatureStatusNotes
Timeline View❌ Not StartedEnhancement Phase 1
Calendar View❌ Not StartedEnhancement Phase 2
Multi-Source Import❌ Not StartedEnhancement Phase 3
Knowledge Enrichment❌ Not StartedEnhancement Phase 4
Idea Linking❌ Not StartedEnhancement Phase 5
Evolution Events❌ Not StartedBackend logging needed

5.3 Known Bugs

1. Claims are not persisted - `useClaims` maintains local state only (no API call to list claims)
2. Chain creation - Needs API endpoint to get chain by idea ID
3. Artifacts list - No API endpoint to list all artifacts

---

6. What Needs to Be Done

6.1 Enhancement Roadmap Overview

The enhancement plan is detailed in `apps/trajectory/trajectory-search/docs/IDEA_VAULT_ENHANCEMENTS.md`.

Summary:

PhaseFocusDurationPriority
1Timeline FoundationWeek 1HIGH
2Calendar ViewWeek 1-2HIGH
3Import PipelineWeek 2MEDIUM
4Knowledge IntegrationWeek 2-3HIGH
5Linking & GraphWeek 3MEDIUM
6Polish & IntegrationWeek 4MEDIUM

6.2 Phase 1: Timeline Foundation

Goal: Add event logging and timeline visualization

Backend Tasks:
- [ ] Add `evolution_events` table to Supabase
- [ ] Create event logging on all Idea Vault mutations
- [ ] Add API endpoints:
- `POST /api/idea-vault/events` - Log event
- `GET /api/idea-vault/events?start={date}&end={date}` - Get events
- `GET /api/idea-vault/timeline/{idea_id}` - Get idea timeline

Frontend Tasks:
- [ ] Add `useTimeline` hook
- [ ] Create `TimelineView` component
- [ ] Create `TimelineEvent` component
- [ ] Create `TimelineScrubber` component
- [ ] Add Timeline tab (⌘6)

Data Structures:

typescript
interface EvolutionEvent {
  id: string;
  timestamp: string;
  event_type: 'idea_created' | 'idea_status_changed' | 'claim_added' | 'claim_verified' | 'claim_falsified' | 'review_added' | 'artifact_linked';
  entity_id: string;
  entity_type: 'idea' | 'claim' | 'review' | 'artifact';
  metadata: Record<string, unknown>;
}

6.3 Phase 2: Calendar View

Goal: Activity heatmap and review reminders

Backend Tasks:
- [ ] Add calendar aggregation endpoint:
- `GET /api/idea-vault/calendar/{year}/{month}` - Monthly data
- [ ] Add review reminders system:
- `GET /api/idea-vault/reminders` - Upcoming reviews

Frontend Tasks:
- [ ] Create `CalendarView` component
- [ ] Create `CalendarDay` component with heatmap
- [ ] Create `ActivityHeatmap` component
- [ ] Create `ReviewReminders` component
- [ ] Add Calendar tab (⌘7)

6.4 Phase 3: Import Pipeline

Goal: Import ideas from multiple sources

Backend Tasks:
- [ ] Add import job endpoints:
- `POST /api/idea-vault/import` - Start import
- `GET /api/idea-vault/import/{job_id}` - Job status

Frontend Tasks:
- [ ] Implement clipboard detection
- [ ] Create `ImportModal` wizard
- [ ] Create `SourceSelector` component
- [ ] Create `ImportPreview` component
- [ ] Add global hotkey (⌘⇧I)

Supported Sources:
- Clipboard (URLs, text, code)
- Files (Markdown, Org-mode, JSON)
- Conversation context (RAG++ results)

6.5 Phase 4: Knowledge Integration

Goal: Auto-enrich ideas with RAG++ context

Backend Tasks:
- [ ] Create enrichment pipeline:
- `POST /api/idea-vault/ideas/{id}/enrich` - Trigger enrichment
- [ ] Add semantic deduplication:
- `GET /api/idea-vault/deduplicate?text={text}` - Check duplicates
- [ ] Add related ideas endpoint:
- `GET /api/idea-vault/ideas/{id}/related` - Similar ideas

Frontend Tasks:
- [ ] Create `EnrichmentPanel` component
- [ ] Create `RelatedContext` component (RAG++ turns)
- [ ] Create `RelatedIdeas` component
- [ ] Create `GeneratedClaims` component
- [ ] Add keyboard shortcut (⌘E)

Enrichment Pipeline:
1. Semantic search RAG++ for related turns
2. Extract related ideas by embedding similarity
3. Generate claims using enhanced Proposer
4. Auto-tag based on content analysis

6.6 Phase 5: Linking & Graph

Goal: Connect ideas in an evolution graph

Backend Tasks:
- [ ] Add `idea_links` table
- [ ] Add linking endpoints:
- `POST /api/idea-vault/ideas/{id}/link` - Create link
- `GET /api/idea-vault/ideas/{id}/links` - Get links

Frontend Tasks:
- [ ] Create `IdeaLinkGraph` visualization
- [ ] Create `LinkModal` component
- [ ] Add keyboard shortcut (⌘L)

Link Types:
- `spawned` - Idea spawned from parent
- `related` - Semantically similar
- `merged` - Ideas combined
- `supersedes` - New idea replaces old

6.7 New Keyboard Shortcuts to Implement

ShortcutAction
`⌘6`Switch to Timeline tab
`⌘7`Switch to Calendar tab
`⌘⇧I`Quick capture (global)
`⌘⇧V`Import from clipboard
`⌘E`Enrich selected idea
`⌘L`Link selected ideas

---

7. Critical Files to Read

7.1 START HERE (Priority Order)

Read these files in order to understand the project:

1. This Document - You're reading it
2. Enhancement Roadmap:

   apps/trajectory/trajectory-search/docs/IDEA_VAULT_ENHANCEMENTS.md

3. Integration Documentation:

   apps/trajectory/trajectory-search/docs/IDEA_VAULT_INTEGRATION.md

4. Main App Code:

   apps/trajectory/trajectory-search/src/App.tsx
   apps/trajectory/trajectory-search/src/components/index.ts

5. Rust Commands:

   apps/trajectory/trajectory-search/src-tauri/src/commands.rs
   apps/trajectory/trajectory-search/src-tauri/src/main.rs

7.2 Understanding RAG++

core/cc-rag-plus-plus/
├── rag_plusplus/service/app.py              # FastAPI entry point
├── rag_plusplus/service/idea_vault.py       # Idea Vault routes
├── rag_plusplus/core/memory_retriever.py    # Search logic
├── migrations/003_idea_vault_schema.sql     # Database schema
├── docs/IMPLEMENTATION_REPORT.md            # Implementation details
└── docs/IMPLEMENTATION_OS.md                # TrajectoryOS integration

7.3 Understanding Orbit

apps/trajectory/trajectory-orbit/
├── crates/orbit-core/src/lib.rs             # Core types
├── crates/orbit-server/src/main.rs          # Server entry
├── orbit-mcp-bridge/app/tools/              # MCP tools
└── ARCHITECTURE.md                           # Architecture overview

7.4 Understanding Idea Vault Core

core/cc-idea-vault/
├── src/schema/idea.rs                       # Idea type
├── src/schema/claim.rs                      # Claim type
├── src/schema/artifact.rs                   # Artifact type
├── src/lifecycle/idea_state.rs              # State machine
├── src/agents/proposer.rs                   # Proposer agent
└── docs/IMPLEMENTATION_PLAN.md              # Implementation plan

7.5 Understanding TrajectoryOS

apps/trajectory/trajectory-os/
├── bin/tos                                  # CLI tool
└── docs/
    ├── ARCHITECTURE.md                      # System architecture
    └── AI_INTEGRATION_GUIDE.md              # AI integration guide

7.6 Architecture Documentation

docs/architecture/core/
├── 00-OVERVIEW.md                           # System overview
├── 08-RAG_PLUS_PLUS.md                      # RAG++ details
├── 09-ORBIT.md                              # Orbit details
└── diagrams/                                # ASCII/HTML diagrams

---

8. Technical Reference

8.1 Service URLs

ServiceURL
RAG++`https://rag-plusplus-274020562532.us-central1.run.app`
Orbit`https://orbit-server-274020562532.us-central1.run.app`
SupabaseProject ID in `.env` files

8.2 API Endpoints Summary

RAG++ Search:

GET  /api/rag/search?query={q}&limit={n}&min_depth={d}
GET  /api/rag/health

Idea Vault:

GET  /api/idea-vault/health
GET  /api/idea-vault/stats
POST /api/idea-vault/ideas
GET  /api/idea-vault/ideas
GET  /api/idea-vault/ideas/{id}
PATCH /api/idea-vault/ideas/{id}/status
POST /api/idea-vault/chains
GET  /api/idea-vault/chains/{id}
POST /api/idea-vault/claims
GET  /api/idea-vault/claims/{id}
PATCH /api/idea-vault/claims/{id}/status
POST /api/idea-vault/reviews
POST /api/idea-vault/artifacts
POST /api/idea-vault/agents/proposer
POST /api/idea-vault/agents/skeptic

Orbit:

GET  /health
GET  /api/projects
GET  /api/inbox
POST /api/inbox/{id}/dispatch
POST /api/inference/generate

8.3 Tauri Commands

Existing (11):
- `search_context`, `get_stats`, `get_health`
- `get_projects`, `open_project`
- `get_inbox`, `dispatch_inbox_item`
- `generate_action`
- `dispatch_to_claude`, `dispatch_to_cursor`, `dispatch_to_cli`

New (14):
- `get_vault_stats`
- `create_idea`, `list_ideas`, `get_idea`, `update_idea_status`
- `create_chain`, `get_chain`
- `create_claim`, `get_claim`, `update_claim_status`
- `create_review`
- `link_artifact`
- `run_proposer`, `run_skeptic`

8.4 TypeScript Types

typescript
// Status types
type IdeaStatus = 'inbox' | 'workbench' | 'resolved' | 'deprecated';
type ClaimStatus = 'active' | 'falsified' | 'verified' | 'deprecated';
type ReviewType = 'assumption' | 'counterexample' | 'evidence' | 'logic' | 'clarification' | 'alternative';
type ArtifactType = 'code' | 'experiment' | 'dataset' | 'figure' | 'document';
type Tab = 'search' | 'ideas' | 'claims' | 'artifacts' | 'actions';

// Core interfaces
interface Idea { id, text, status, created_at, updated_at }
interface Chain { id, idea_id, event_count, claim_count, review_count }
interface Claim { id, chain_id, text, status, evidence? }
interface Review { id, chain_id, review_type, content, agent_id? }
interface Artifact { id, chain_id, artifact_type, storage_path, has_complete_metadata }
interface VaultStats { event_count, idea_count, claim_count, active_claims, verified_claims, falsified_claims }

8.5 Database Schema

Key Tables:

sql
-- memory_turns (107K+ rows)
CREATE TABLE memory_turns (
  id UUID PRIMARY KEY,
  conversation_id UUID,
  content TEXT,
  role TEXT,
  embedding VECTOR(1536),
  trajectory JSONB,  -- 5D coordinates
  metadata JSONB,
  created_at TIMESTAMPTZ
);

-- ideas
CREATE TABLE ideas (
  id UUID PRIMARY KEY,
  text TEXT NOT NULL,
  status TEXT DEFAULT 'inbox',
  created_at TIMESTAMPTZ,
  updated_at TIMESTAMPTZ
);

-- chains
CREATE TABLE chains (
  id UUID PRIMARY KEY,
  idea_id UUID REFERENCES ideas(id),
  event_count INT DEFAULT 0,
  claim_count INT DEFAULT 0,
  review_count INT DEFAULT 0
);

-- claims
CREATE TABLE claims (
  id UUID PRIMARY KEY,
  chain_id UUID REFERENCES chains(id),
  text TEXT NOT NULL,
  status TEXT DEFAULT 'active',
  evidence TEXT
);

---

9. Conventions & Patterns

9.1 Code Style

Rust:
- Use `thiserror` for error types
- Use `serde` for serialization
- Commands return `Result<T, String>`
- Timeout all HTTP requests (10s default, 30s for agents)

TypeScript:
- Functional components only
- Use hooks for state management
- Tailwind CSS for styling
- Framer Motion for animations

React Patterns:
- `ExpandableCard` pattern for collapsible cards
- `Modal` pattern for dialogs (see `NewIdeaModal`)
- Color scheme: zinc-900 background, violet accents

9.2 File Naming

  • Components: `PascalCase.tsx`
  • Hooks: `useCamelCase.ts`
  • Utils: `camelCase.ts`
  • Types: inline in `types.ts`

9.3 Component Structure

src/components/
├── feature/              # Feature folder
│   ├── index.ts          # Exports
│   ├── FeatureCard.tsx   # Main component
│   ├── FeatureModal.tsx  # Modal
│   └── FeatureToolbar.tsx # Toolbar

9.4 Hook Structure

typescript
export function useFeature() {
  const [items, setItems] = useState<Item[]>([]);
  const [isLoading, setIsLoading] = useState(true);
  const [error, setError] = useState<string | null>(null);

  const refresh = useCallback(async () => { ... }, []);
  const create = useCallback(async (data) => { ... }, []);
  const update = useCallback(async (id, data) => { ... }, []);

  useEffect(() => { refresh(); }, [refresh]);

  return { items, isLoading, error, refresh, create, update };
}

---

10. Known Issues & Constraints

10.1 Technical Constraints

1. Tauri IPC is async - All commands are async, use `await invoke()`
2. No WebSocket support yet - Polling for updates, not real-time
3. Claims not persisted to API - Local state only in current implementation
4. No list artifacts endpoint - Need to implement

10.2 API Limitations

1. No chain-by-idea-id endpoint - Currently must know chain ID
2. No batch operations - Create/update one at a time
3. No search within Idea Vault - Full list only

10.3 UI Limitations

1. No dark/light theme toggle - Dark mode only
2. No mobile responsive - Desktop only (Tauri)
3. Limited error handling - Some errors silently fail

10.4 Performance Notes

  • RAG++ search typically returns in 200-500ms
  • Idea Vault operations are fast (< 100ms)
  • Agent operations (Proposer/Skeptic) can take 5-30s

---

11. Continuation Instructions

11.1 Development Setup

bash
# Navigate to project
cd [home]/Desktop/Comp-Core/apps/trajectory/trajectory-search

# Install dependencies
npm install

# Run in development
npm run tauri dev

11.2 Starting Point

1. Read the enhancement document first:

   docs/IDEA_VAULT_ENHANCEMENTS.md

2. Start with Phase 1 (Timeline Foundation):
- Add `evolution_events` table
- Add event logging to mutations
- Create `TimelineView` component

3. Follow the phased approach - Don't skip phases

11.3 Testing

bash
# Type check
npx tsc --noEmit

# Build frontend
npm run build

# Build Tauri app
npm run tauri build

11.4 Key Decisions Already Made

1. Unified app over separate apps - One Tauri app, not multiple
2. Tabs over routes - In-app navigation, not URL routing
3. Hooks over Redux - React hooks for state management
4. Tailwind over CSS modules - Utility-first CSS
5. Framer Motion for animations - Consistent animation library

11.5 What NOT to Do

1. Don't create new apps - Enhance the existing one
2. Don't add new state management - Use existing hooks pattern
3. Don't change the color scheme - Stick to zinc/violet
4. Don't add routing - Use tabs, not routes
5. Don't add server-side rendering - It's a Tauri desktop app

---

Appendix A: File Checksums (for verification)

FileLinesLast Modified
`App.tsx`~1802026-01-01
`commands.rs`~9502026-01-01
`types.ts`~2002026-01-01
`IDEA_VAULT_INTEGRATION.md`~6202026-01-01
`IDEA_VAULT_ENHANCEMENTS.md`~7002026-01-01

---

Appendix B: Contact & Resources

Repository: `[home]/Desktop/Comp-Core`

Cloud Services:
- GCP Project: `rag-plusplus` / `orbit-server`
- Supabase: Check `.env` for credentials

Documentation:
- This document: `docs/AI_HANDOFF_TRAJECTORY_CONTROL_CENTER.md`
- Architecture: `docs/architecture/core/`
- RAG++: `core/cc-rag-plus-plus/docs/`

---

Document generated: 2026-01-01
Last updated by: Claude (Cursor Agent)
Project version: v0.3.0

Promotion Decision

Attach run IDs, datasets, metrics, and reproduction commands.

Source Anchor

projects/Documentation/02-projects/trajectory-os/AI_HANDOFF.md

Detected Structure

Method · Evaluation · References · Figures · Code Anchors · Architecture