You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prove that EVERY function in REPL, TUI, Server, and Desktop is fully functional through systematic testing with documented evidence.
1. TUI REPL Component Testing
1.1 Command Coverage Matrix
Command
Parameters
Test Input
Expected Output
Status
/search
<query>
/search rust async
List of documents with relevance scores
⏳
/config show
None
/config show
Display current configuration JSON
⏳
/config set
<key> <value>
/config set theme darkula
Configuration updated message
⏳
/role list
None
/role list
List all available roles
⏳
/role select
<role_name>
/role select TerraphimEngineer
Role switched confirmation
⏳
/graph
Optional <role>
/graph
Display knowledge graph statistics
⏳
/chat
<message>
/chat Hello, how are you?
AI response
⏳
/summarize
<target>
/summarize document.md
Document summary
⏳
/autocomplete
<query>
/autocomplete terr
List of suggestions
⏳
/extract
<text>
/extract "Find patterns in this text"
Extracted entities
⏳
/find
<pattern>
/find TODO
List of matches
⏳
/replace
<old> <new>
/replace foo bar
Replacement results
⏳
/thesaurus
None
/thesaurus
Thesaurus statistics
⏳
/help
Optional <command>
/help search
Command documentation
⏳
/quit
None
/quit
Clean exit
⏳
1.2 TUI Test Script
#!/bin/bash# test_tui_repl.sh
BINARY="./target/release/terraphim-tui"
TEST_LOG="tui_test_results.log"# Test each command
commands=(
"/help""/role list""/config show""/search test""/graph""/thesaurus""/quit"
)
forcmdin"${commands[@]}";doecho"Testing: $cmd"| tee -a $TEST_LOGecho"$cmd"| timeout 5 $BINARY repl 2>&1| tee -a $TEST_LOGecho"---"| tee -a $TEST_LOGdone
2. Server API Component Testing
2.1 Endpoint Coverage Matrix
Method
Endpoint
Request Body
Expected Response
Status
GET
/health
None
"OK"
⏳
GET
/config
None
Config JSON with status
⏳
POST
/config
Config JSON
Updated config
⏳
POST
/search
{"query": "test", "role": "Default"}
Search results
⏳
POST
/chat
{"message": "Hello", "conversation_id": "123"}
Chat response
⏳
GET
/graph/<role>
None
Graph nodes and edges
⏳
GET
/thesaurus/<role>
None
Thesaurus data
⏳
POST
/autocomplete
{"query": "ter", "role": "Default"}
Suggestions
⏳
GET
/documents
None
Document list
⏳
POST
/documents
Document JSON
Created document
⏳
GET
/roles
None
Available roles
⏳
POST
/role/select
{"role": "TerraphimEngineer"}
Role switched
⏳
2.2 Server Test Script
#!/bin/bash# test_server_api.sh
SERVER_URL="http://localhost:8000"
TEST_LOG="server_test_results.log"# Start server
./target/release/terraphim_server &
SERVER_PID=$!
sleep 3
# Test endpointsecho"Testing Health Check"| tee -a $TEST_LOG
curl -s "$SERVER_URL/health"| tee -a $TEST_LOGecho -e "\n\nTesting Config GET"| tee -a $TEST_LOG
curl -s "$SERVER_URL/config"| python3 -m json.tool | tee -a $TEST_LOGecho -e "\n\nTesting Search POST"| tee -a $TEST_LOG
curl -s -X POST "$SERVER_URL/search" \
-H "Content-Type: application/json" \
-d '{"query": "test", "role": "Default"}'| python3 -m json.tool | tee -a $TEST_LOG# Cleanupkill$SERVER_PID
3. Desktop Application Testing
3.1 UI Component Coverage Matrix
Component
Feature
Test Action
Expected Result
Status
Role Selector
Dropdown display
Click dropdown
Shows all roles
⏳
Role change
Select different role
Theme changes
⏳
Persistence
Restart app
Role selection saved
⏳
System Tray
Icon display
Check system tray
Icon visible
⏳
Menu display
Right-click icon
Shows menu
⏳
Role selection
Select role from menu
UI updates
⏳
Show/Hide
Click toggle
Window visibility
⏳
Quit
Click quit
App closes
⏳
Search Tab
Navigation
Click Search tab
Search interface
⏳
Query input
Type search query
Text appears
⏳
Search execution
Press Enter
Results display
⏳
Result interaction
Click result
Document opens
⏳
Chat Tab
Navigation
Click Chat tab
Chat interface
⏳
New conversation
Click New
Empty conversation
⏳
Send message
Type and send
Message appears
⏳
Receive response
Wait for AI
Response appears
⏳
Context management
Add context
Context listed
⏳
Graph Tab
Navigation
Click Graph tab
Graph visualization
⏳
Graph rendering
View graph
Nodes and edges
⏳
Zoom/Pan
Mouse actions
Graph moves
⏳
Node interaction
Click node
Node details
⏳
3.2 Desktop Test Script
#!/bin/bash# test_desktop_app.sh
APP_PATH="/Users/alex/projects/terraphim/terraphim-ai/target/release/bundle/macos/Terraphim Desktop.app"
TEST_LOG="desktop_test_results.log"# Launch app
open "$APP_PATH"
sleep 5
# Use AppleScript for UI automation (macOS specific)
osascript <<EOFtell application "System Events" tell process "Terraphim Desktop" # Test role selector click pop up button 1 of window 1 delay 1 click menu item "TerraphimEngineer" of menu 1 of pop up button 1 of window 1 delay 2 # Log result do shell script "echo 'Role selector: TESTED' >> $TEST_LOG" end tellend tellEOF
4. Integration Testing
4.1 Desktop ↔ Server Communication
# Start server
./target/release/terraphim_server &
SERVER_PID=$!# Launch desktop in server mode
TERRAPHIM_SERVER_URL="http://localhost:8000" open "$APP_PATH"# Test API calls from desktop# Monitor network traffic to verify communication
4.2 Configuration Persistence
# Modify configuration
curl -X POST "$SERVER_URL/config" -d '{"selected_role": "TerraphimEngineer"}'# Restart components and verify config loaded
4.3 Thesaurus Loading
# Select role with KG enabled# Verify thesaurus loads# Test autocomplete functionality
5. Error Handling Testing
5.1 Invalid Input Tests
Component
Test Case
Input
Expected Behavior
Status
TUI
Invalid command
/foobar
Error message
⏳
TUI
Missing params
/search
Usage help
⏳
Server
Malformed JSON
{invalid}
400 Bad Request
⏳
Server
Unknown endpoint
/api/unknown
404 Not Found
⏳
Desktop
Invalid role
Select non-existent
Error handling
⏳
5.2 Error Test Script
#!/bin/bash# test_error_handling.sh# Test invalid TUI commandsecho"/invalid_command"| ./target/release/terraphim-tui repl 2>&1| grep -i error
# Test invalid API requests
curl -X POST "$SERVER_URL/search" -d "invalid json" -v 2>&1| grep "400"# Test missing config
rm -f ~/.terraphim/config.json
./target/release/terraphim_server 2>&1| grep -i "default"