π Terraphim Novel Autocomplete Testing Scripts
This directory contains comprehensive bash scripts for testing the Novel editor autocomplete integration with Terraphim's knowledge graph system.
π Scripts Overview
π― Quick Start (Recommended)
Interactive menu with common testing scenarios. Perfect for getting started quickly!
π§ Main Testing Script
Comprehensive startup script with full control over services and configuration.
π Stop Script
Clean shutdown of all testing services with graceful or force stop options.
π§ͺ Integration Tests
Validation script to test MCP server integration and autocomplete functionality.
π Quick Start Guide
Method 1: Interactive Menu (Easiest)
Choose from preset configurations:
- Full Testing - Everything you need
- MCP Only - Backend development
- Desktop Development - UI work
- Tests Only - Validation
- Status Check - See what's running
- Stop Services - Clean shutdown
Method 2: Direct Commands
# Full testing environment
# Development environment
# Check what's running
# Stop everything
π§ Advanced Usage
Start Full Testing Environment
Starts:
- MCP Server on port 8001
- Desktop Tauri app
- Runs integration tests
- Shows real-time status
Custom Port Configuration
Start Only MCP Server
Development Mode (No Tests)
Stop All Services
Force Stop (If Normal Stop Fails)
Check Service Status
π Command Reference
start-autocomplete-test.sh Options
-h, --help Show help message
-m, --mcp-only Start only MCP server
-a, --axum-only Start only Axum server
-d, --desktop-only Start only desktop app
-t, --test-only Run only integration tests
-p, --port PORT Set MCP server port (default: 8001)
-w, --web-port PORT Set web server port (default: 3000)
--no-desktop Skip desktop app startup
--no-tests Skip integration tests
--verbose Enable verbose loggingstop-autocomplete-test.sh Options
-h, --help Show help message
-s, --status Check status of running services
-f, --force Force kill all processesquick-start-autocomplete.sh Arguments
full Full testing environment
mcp MCP server only
dev Development environment
test Run tests only
status Check service status
stop Stop all services
custom Custom configurationπ Services & Ports
| Service | Default Port | URL | Purpose | |---------|-------------|-----|---------| | MCP Server | 8001 | http://127.0.0.1:8001 | Autocomplete API | | Axum Server | Dynamic | N/A | Alternative backend | | Desktop App | N/A | Tauri Window | Novel editor UI |
π Monitoring & Logs
Log Files
logs/mcp_server.log - MCP server output
logs/axum_server.log - Axum server output
logs/desktop_app.log - Desktop app outputProcess IDs
pids/mcp_server.pid - MCP server PID
pids/axum_server.pid - Axum server PID
pids/desktop_app.pid - Desktop app PIDReal-time Monitoring
# Watch MCP server logs
# Watch all logs
# Check process status
| π§ͺ Testing Workflow
1. Start Services
2. Wait for "Ready" Message
Look for:
π Terraphim Novel Autocomplete Testing Environment Ready!3. Test in Desktop App
- Open Tauri window (should appear automatically)
- Navigate to editor page
- Click "Demo" button
- Type
/terraphimin editor - Verify dropdown appears with suggestions
4. Validate with Integration Tests
Tests run automatically, or manually:
5. Stop Services
π Troubleshooting
Common Issues
"Port already in use"
# Check what's using the port
# Kill existing process
# Or use force stop
"MCP server not responding"
# Check MCP server logs
# Restart just MCP server
"Desktop app won't start"
# Check desktop logs
# Ensure dependencies installed
&&
# Try building Tauri
&& "No autocomplete suggestions"
- Verify MCP server is running:
./stop-autocomplete-test.sh --status - Check backend connection in UI status panel
- Try known terms: "terraphim", "graph", "role"
- Verify role has knowledge graph data
Debug Mode
# Enable verbose logging
# Check all process statuses
# Manual MCP test
π― Testing Scenarios
1. Developer Workflow
Goal: Test autocomplete during development
# Starts MCP + Desktop, no tests
# Good for iterative development2. CI/CD Pipeline
Goal: Automated testing
# Runs integration tests only
# Perfect for automated validation3. Backend Development
Goal: Test MCP server changes
# Just MCP server with detailed logs
# Test with curl or integration script4. Full System Test
Goal: End-to-end validation
# Complete environment with tests
# Comprehensive validationβοΈ Configuration
Environment Variables
# Custom MCP port
# Custom web port
# Verbose Rust logging
# Skip setup promptsPrerequisites Check
Scripts automatically verify:
- β Rust/Cargo installation
- β Node.js/Yarn installation
- β Required commands (curl, lsof)
- β Correct directory structure
π Success Indicators
MCP Server Ready
β
MCP server is ready!
π Testing autocomplete_terms...
β
autocomplete_terms workingDesktop App Ready
β
Desktop app started (PID: 12345)
β’ Desktop App: Starting (Tauri window should appear)Integration Tests Pass
β
MCP server responding
β
autocomplete_terms working
β
autocomplete_with_snippets working
π Autocomplete integration is ready!π Additional Resources
- Implementation Details:
NOVEL_AUTOCOMPLETE_FIXES.md - Autocomplete Demo:
desktop/AUTOCOMPLETE_DEMO.md - Configuration Options:
desktop/src/lib/config/autocomplete.ts - Custom Extension:
desktop/src/lib/Editor/TerraphimSuggestion.ts
π€ Contributing
When modifying the testing scripts:
- Test all scenarios before committing
- Update this README if adding new options
- Maintain backward compatibility when possible
- Add proper error handling and user feedback
- Follow the existing color scheme and formatting
π Support
If you encounter issues with the testing scripts:
- Check logs in the
logs/directory - Run status check:
./stop-autocomplete-test.sh --status - Try force stop/restart:
./stop-autocomplete-test.sh --force - Review troubleshooting section above
- Open an issue with log files and error messages
Happy Testing! π The scripts are designed to make Novel editor autocomplete testing as smooth as possible.