-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-rlm-basic.sh
More file actions
executable file
·122 lines (101 loc) · 3.31 KB
/
test-rlm-basic.sh
File metadata and controls
executable file
·122 lines (101 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
# Basic RLM functionality test
echo "================================"
echo "Basic RLM End-to-End Test"
echo "================================"
echo ""
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Build first
echo "Building project..."
npm run build > /dev/null 2>&1
echo ""
echo "Test 1: Basic RLM Execution"
echo "----------------------------"
OUTPUT=$(stackmemory skills rlm "Create a hello world function" 2>&1)
echo "$OUTPUT" | head -20
# Check for key components
echo ""
echo "Checking key components:"
if echo "$OUTPUT" | grep -q "RLM execution completed"; then
echo -e "${GREEN}✓ RLM execution completed${NC}"
else
echo -e "${RED}✗ RLM execution did not complete${NC}"
fi
if echo "$OUTPUT" | grep -q "Created frame"; then
echo -e "${GREEN}✓ Frame created${NC}"
else
echo -e "${RED}✗ Frame not created${NC}"
fi
if echo "$OUTPUT" | grep -q "Closed frame"; then
echo -e "${GREEN}✓ Frame closed${NC}"
else
echo -e "${RED}✗ Frame not closed${NC}"
fi
if echo "$OUTPUT" | grep -q "planning subagent"; then
echo -e "${GREEN}✓ Planning subagent spawned${NC}"
else
echo -e "${RED}✗ Planning subagent not spawned${NC}"
fi
if echo "$OUTPUT" | grep -q "Review stage.*complete"; then
echo -e "${GREEN}✓ Review stage completed${NC}"
else
echo -e "${RED}✗ Review stage not completed${NC}"
fi
if echo "$OUTPUT" | grep -q "Quality threshold met"; then
echo -e "${GREEN}✓ Quality threshold met${NC}"
else
echo -e "${RED}✗ Quality threshold not met${NC}"
fi
if echo "$OUTPUT" | grep -q "mockMode: true"; then
echo -e "${GREEN}✓ Mock mode active${NC}"
else
echo -e "${RED}✗ Mock mode not active${NC}"
fi
echo ""
echo "Test 2: Execution Summary"
echo "-------------------------"
echo "$OUTPUT" | grep -A 10 "Execution Summary"
echo ""
echo "Test 3: Frame Persistence"
echo "-------------------------"
FRAMES_BEFORE=$(stackmemory status 2>&1 | grep -oE "Frames: [0-9]+" | awk '{print $2}')
stackmemory skills rlm "Test task for frame counting" > /dev/null 2>&1
FRAMES_AFTER=$(stackmemory status 2>&1 | grep -oE "Frames: [0-9]+" | awk '{print $2}')
echo "Frames before: ${FRAMES_BEFORE:-0}"
echo "Frames after: ${FRAMES_AFTER:-0}"
if [ "${FRAMES_AFTER:-0}" -gt "${FRAMES_BEFORE:-0}" ]; then
echo -e "${GREEN}✓ Frames persisted to database${NC}"
else
echo -e "${YELLOW}⚠ Frame count unchanged (may be cleaned up)${NC}"
fi
echo ""
echo "Test 4: Mock Subagent Responses"
echo "-------------------------------"
OUTPUT=$(stackmemory skills rlm "Create a REST API" 2>&1)
if echo "$OUTPUT" | grep -q "Mock .* subagent completed"; then
echo -e "${GREEN}✓ Mock subagents responding${NC}"
else
echo -e "${RED}✗ Mock subagents not responding${NC}"
fi
# Extract improvements if present
echo ""
echo "Improvements found:"
echo "$OUTPUT" | grep -A 5 "Improvements:" | head -6
echo ""
echo "Test 5: Error Handling"
echo "----------------------"
# This should handle gracefully even with problematic input
OUTPUT=$(stackmemory skills rlm "" 2>&1)
if echo "$OUTPUT" | grep -q "RLM execution completed\|failed"; then
echo -e "${GREEN}✓ Empty input handled gracefully${NC}"
else
echo -e "${RED}✗ Empty input caused crash${NC}"
fi
echo ""
echo "================================"
echo "Test Complete"
echo "================================"