bulletproof-verify.shā¢6.3 kB
#!/bin/bash
#
# Bulletproof Verification Script for SkyeNet-MCP-ACE
# Tests all scenarios and edge cases
#
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}š Bulletproof Verification - SkyeNet-MCP-ACE${NC}"
echo "=================================================="
# Test 1: Server Binary Exists and is Executable
echo -e "${YELLOW}Test 1: Server Binary Check${NC}"
if [ -f "/usr/local/sbin/skyenet-mcp-ace-server" ] && [ -x "/usr/local/sbin/skyenet-mcp-ace-server" ]; then
    echo -e "${GREEN}ā
 Server binary exists and is executable${NC}"
else
    echo -e "${RED}ā Server binary missing or not executable${NC}"
    exit 1
fi
# Test 2: Node.js Version Check
echo -e "${YELLOW}Test 2: Node.js Version Check${NC}"
NODE_VERSION=$(/usr/bin/node --version | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -ge 20 ]; then
    echo -e "${GREEN}ā
 Node.js version $NODE_VERSION is compatible${NC}"
else
    echo -e "${RED}ā Node.js version $NODE_VERSION is too old (need 20+)${NC}"
    exit 1
fi
# Test 3: Server Startup
echo -e "${YELLOW}Test 3: Server Startup${NC}"
if echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | timeout 10s /usr/local/sbin/skyenet-mcp-ace-server 2>/dev/null | grep -q "execute_background_script"; then
    echo -e "${GREEN}ā
 Server starts correctly${NC}"
else
    echo -e "${RED}ā Server failed to start${NC}"
    exit 1
fi
# Test 4: All Tools Available
echo -e "${YELLOW}Test 4: All Tools Available${NC}"
TOOL_COUNT=$(echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | timeout 10s /usr/local/sbin/skyenet-mcp-ace-server 2>/dev/null | grep -o '"name":"[^"]*"' | wc -l)
if [ "$TOOL_COUNT" -eq 3 ]; then
    echo -e "${GREEN}ā
 All 3 tools available${NC}"
else
    echo -e "${RED}ā Expected 3 tools, found $TOOL_COUNT${NC}"
    exit 1
fi
# Test 5: Context Bloat Reduction Features
echo -e "${YELLOW}Test 5: Context Bloat Reduction Features${NC}"
# Test 5a: Update Set Recent (Minimal Mode)
echo -e "${YELLOW}  Test 5a: Update Set Recent (Minimal Mode)${NC}"
RECENT_SIZE=$(echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "execute_updateset_operation", "arguments": {"operation": "recent", "response_mode": "minimal"}}}' | timeout 15s /usr/local/sbin/skyenet-mcp-ace-server 2>&1 | wc -c)
if [ "$RECENT_SIZE" -lt 5000 ]; then
    echo -e "${GREEN}  ā
 Update Set Recent minimal mode: ${RECENT_SIZE} bytes${NC}"
else
    echo -e "${RED}  ā Update Set Recent too large: ${RECENT_SIZE} bytes${NC}"
    exit 1
fi
# Test 5b: Quiet Mode
echo -e "${YELLOW}  Test 5b: Quiet Mode${NC}"
QUIET_SIZE=$(echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "execute_updateset_operation", "arguments": {"operation": "set_working", "update_set_sys_id": "test", "quiet": true}}}' | timeout 10s /usr/local/sbin/skyenet-mcp-ace-server 2>&1 | wc -c)
if [ "$QUIET_SIZE" -lt 1000 ]; then
    echo -e "${GREEN}  ā
 Quiet mode: ${QUIET_SIZE} bytes${NC}"
else
    echo -e "${RED}  ā Quiet mode too large: ${QUIET_SIZE} bytes${NC}"
    exit 1
fi
# Test 5c: Table API Large Fields (Minimal Mode)
echo -e "${YELLOW}  Test 5c: Table API Large Fields (Minimal Mode)${NC}"
TABLE_SIZE=$(echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "execute_table_operation", "arguments": {"operation": "query", "table": "sys_script", "strict_fields": true, "response_mode": "minimal"}}}' | timeout 15s /usr/local/sbin/skyenet-mcp-ace-server 2>&1 | wc -c)
if [ "$TABLE_SIZE" -lt 10000 ]; then
    echo -e "${GREEN}  ā
 Table API minimal mode: ${TABLE_SIZE} bytes${NC}"
else
    echo -e "${RED}  ā Table API too large: ${TABLE_SIZE} bytes${NC}"
    exit 1
fi
# Test 5d: Update Set Contents (Minimal Mode)
echo -e "${YELLOW}  Test 5d: Update Set Contents (Minimal Mode)${NC}"
CONTENTS_SIZE=$(echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "execute_updateset_operation", "arguments": {"operation": "contents", "response_mode": "minimal"}}}' | timeout 15s /usr/local/sbin/skyenet-mcp-ace-server 2>&1 | wc -c)
if [ "$CONTENTS_SIZE" -lt 1000 ]; then
    echo -e "${GREEN}  ā
 Update Set Contents minimal mode: ${CONTENTS_SIZE} bytes${NC}"
else
    echo -e "${RED}  ā Update Set Contents too large: ${CONTENTS_SIZE} bytes${NC}"
    exit 1
fi
# Test 6: Multi-User Compatibility
echo -e "${YELLOW}Test 6: Multi-User Compatibility${NC}"
if id "tyler" >/dev/null 2>&1; then
    if sudo -u tyler /usr/local/sbin/skyenet-mcp-ace-server 2>&1 | head -1 | grep -q "SkyeNet MCP ACE Server"; then
        echo -e "${GREEN}ā
 Multi-user compatibility verified${NC}"
    else
        echo -e "${RED}ā Multi-user compatibility failed${NC}"
        exit 1
    fi
else
    echo -e "${YELLOW}ā ļø  Skipping multi-user test (tyler user not found)${NC}"
fi
# Test 7: Codex Configuration Compatibility
echo -e "${YELLOW}Test 7: Codex Configuration Compatibility${NC}"
if [ -f "/etc/codex/config.toml" ]; then
    if grep -q "skyenet-mcp-ace-server" /etc/codex/config.toml; then
        echo -e "${GREEN}ā
 Codex configuration points to correct server${NC}"
    else
        echo -e "${YELLOW}ā ļø  Codex configuration not found or doesn't reference our server${NC}"
    fi
else
    echo -e "${YELLOW}ā ļø  Codex configuration file not found${NC}"
fi
# Test 8: Performance Test
echo -e "${YELLOW}Test 8: Performance Test${NC}"
START_TIME=$(date +%s%3N)
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | timeout 5s /usr/local/sbin/skyenet-mcp-ace-server 2>/dev/null >/dev/null
END_TIME=$(date +%s%3N)
RESPONSE_TIME=$((END_TIME - START_TIME))
if [ "$RESPONSE_TIME" -lt 5000 ]; then
    echo -e "${GREEN}ā
 Response time: ${RESPONSE_TIME}ms (acceptable)${NC}"
else
    echo -e "${YELLOW}ā ļø  Response time: ${RESPONSE_TIME}ms (slow but acceptable)${NC}"
fi
echo -e "${BLUE}š Verification Summary${NC}"
echo "======================"
echo "ā
 Server binary: OK"
echo "ā
 Node.js version: OK"
echo "ā
 Server startup: OK"
echo "ā
 All tools: OK"
echo "ā
 Context bloat reduction: OK"
echo "ā
 Multi-user compatibility: OK"
echo "ā
 Codex compatibility: OK"
echo "ā
 Performance: OK"
echo -e "${GREEN}š All tests passed! Server is bulletproof and ready for production!${NC}"