- Updated GOOGLE_EMBEDDING_DIMENSIONS to 3072 to match gemini-embedding-001 output
- Updated database schema embedding index from 768 to 3072 dimensions
- Recreated production database index with correct dimensions
- Added @vercel/analytics package for production analytics
- Added Analytics component to root layout
This fixes the galaxy visualization issue caused by dimension mismatch between
the embedding model output (3072) and the database index (768).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add type assertion for SurrealDB query results in debug/nodes route
- Install @types/three for Three.js type definitions
- Exclude tests directory from TypeScript compilation
- Wrap useSearchParams in Suspense boundary on login page (Next.js 16 requirement)
All routes now build successfully for production deployment.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Increase logo size (48x48 desktop, 56x56 mobile) for better visibility
- Add logo as favicon
- Add logo to mobile header
- Move user menu to navigation bars (sidebar on desktop, bottom bar on mobile)
- Fix desktop chat layout - container structure prevents voice controls cutoff
- Fix mobile bottom bar - use icon-only ActionIcons instead of truncated text buttons
- Hide Create Node/New Conversation buttons on mobile to save header space
- Make fixed header and voice controls work properly with containers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implemented the node editor page with AI-powered link suggestions using
vector similarity search. This feature allows users to create and edit
nodes while discovering semantically related content from their existing
nodes.
**Node Editor Page** (`app/editor/[id]/page.tsx`):
- Full-featured form with title and body fields using Mantine forms
- Pre-fill support from query parameters (for AI chat redirects)
- "Find Related" button to discover similar nodes via vector search
- "Publish Node" button to save nodes to ATproto + SurrealDB
- Real-time suggestions display with similarity scores
- Mantine notifications for user feedback
**Link Suggestion API** (`app/api/suggest-links/route.ts`):
- Authenticates using SurrealDB JWT from cookies
- Generates embeddings for draft text using Google AI (gemini-embedding-001)
- Performs vector similarity search using SurrealDB's cosine similarity
- Returns top 5 most similar nodes with scores
- Enforces row-level security (users can only search their own nodes)
- Comprehensive error handling with detailed logging
**UI Enhancements** (`app/layout.tsx`):
- Added @mantine/notifications package for toast notifications
- Integrated Notifications component into root layout
- Imported notifications styles for proper rendering
**Testing** (`tests/magnitude/10-linking.mag.ts`):
- Editor page rendering verification
- Pre-filled form from query params test
- Full publish workflow test (happy path)
- Form validation test (unhappy path)
**Technical Implementation**:
- Vector embeddings: 768-dimension vectors from gemini-embedding-001
- Similarity metric: Cosine similarity via SurrealDB vector functions
- Authentication: JWT-based with automatic row-level security
- Error handling: Proper HTTP status codes and user notifications
- Cookie domain: Uses 127.0.0.1 to match OAuth redirect URI
**Note**: Tests may fail if GOOGLE_AI_API_KEY is invalid. Update the key
in .env to enable full AI functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace manual OAuth implementation with official @atproto/oauth-client-node library to properly support DPoP (Demonstrating Proof of Possession) authentication.
Changes:
- Added @atproto/oauth-client-node dependency
- Created OAuth state store (SurrealDB-backed) for CSRF protection
- Created OAuth session store (SurrealDB-backed) for token persistence
- Created OAuth client singleton with localhost exception for development
- Rewrote /api/auth/login to use client.authorize()
- Rewrote /api/auth/callback to use client.callback() with DPoP
- Updated lib/auth/session.ts with getAuthenticatedAgent() for ATproto API calls
- Updated db/schema.surql with oauth_state and oauth_session tables
- Added scripts/apply-schema.js for database schema management
- Created plans/oauth-dpop-implementation.md with detailed implementation plan
- Removed legacy lib/auth/atproto.ts and lib/auth/oauth-state.ts
- Updated .env to use localhost exception (removed BLUESKY_CLIENT_ID)
The OAuth client now handles:
- PKCE code generation and verification
- DPoP proof generation and signing
- Automatic token refresh
- Session persistence across server restarts
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement the core write-through cache pattern for node creation.
This is the architectural foundation of the application.
Changes:
- Add @google/generative-ai dependency for embeddings
- Create lib/db.ts: SurrealDB connection helper with JWT auth
- Create lib/ai.ts: AI embedding generation using text-embedding-004
- Create app/api/nodes/route.ts: POST endpoint implementing write-through cache
Write-through cache flow:
1. Authenticate user via SurrealDB JWT
2. Publish node to ATproto PDS (source of truth)
3. Generate 768-dimensional embedding via Google AI
4. Cache node + embedding + links in SurrealDB
Updated schema to use 768-dimensional embeddings (text-embedding-004)
instead of 1536 dimensions.
Security:
- Row-level permissions enforced via SurrealDB JWT
- All secrets server-side only
- ATproto OAuth tokens from secure cookies
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Initialize Next.js 16 (App Router) project with all core dependencies:
- Next.js, React 19, TypeScript configuration
- Mantine UI components (@mantine/core, @mantine/hooks)
- ATproto SDK for Bluesky integration
- SurrealDB client (updated to latest non-deprecated version)
- Vercel AI SDK with Google AI provider
- Deepgram SDK for voice-to-text
- React Three Fiber for 3D visualization
- UMAP.js for dimensionality reduction
- Magnitude test framework for E2E testing
- Playwright for browser automation
Created basic app structure with homepage displaying "Ponderants" text.
Configured magnitude.config.ts for testing framework.
Added .example.env with all required environment variables.
Test: Smoke test verifies app boots and renders homepage.
Status: ✓ Test passed (8.4s)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>