-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_memory_review.py
More file actions
executable file
·172 lines (139 loc) · 4.82 KB
/
verify_memory_review.py
File metadata and controls
executable file
·172 lines (139 loc) · 4.82 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/usr/bin/env python3
"""
Verification script for memory system review changes.
This script verifies:
1. SimpleMemoryStore shows deprecation warning
2. Documentation exists
3. Migration guide exists
"""
import sys
import warnings
from pathlib import Path
# Add src to path
sys.path.insert(0, str(Path(__file__).parent / "src"))
def test_deprecation_warning():
"""Verify SimpleMemoryStore shows deprecation warning."""
print("=" * 70)
print("TEST 1: Deprecation Warning in Code")
print("=" * 70)
# Check if the warning is present in the source code
simple_memory_path = Path(__file__).parent / "src" / "uacs" / "memory" / "simple_memory.py"
if not simple_memory_path.exists():
print("❌ simple_memory.py not found")
return False
content = simple_memory_path.read_text()
checks = [
("warnings import", "import warnings" in content),
("warnings.warn call", "warnings.warn(" in content),
("DeprecationWarning", "DeprecationWarning" in content),
("deprecated docstring", "deprecated::" in content.lower()),
("v0.3.0 mention", "0.3.0" in content),
("v1.0.0 removal", "1.0.0" in content),
]
all_pass = True
for check_name, result in checks:
if result:
print(f"✅ {check_name} present")
else:
print(f"❌ {check_name} missing")
all_pass = False
return all_pass
def test_documentation_exists():
"""Verify documentation files exist."""
print("\n" + "=" * 70)
print("TEST 2: Documentation Files")
print("=" * 70)
repo_root = Path(__file__).parent
files_to_check = [
"MEMORY_SYSTEM_REVIEW.md",
"docs/MIGRATION_SIMPLE_TO_SEMANTIC.md",
"README.md"
]
all_exist = True
for file_path in files_to_check:
full_path = repo_root / file_path
if full_path.exists():
print(f"✅ {file_path} exists")
else:
print(f"❌ {file_path} missing")
all_exist = False
return all_exist
def test_readme_content():
"""Verify README mentions Semantic API."""
print("\n" + "=" * 70)
print("TEST 3: README Content")
print("=" * 70)
readme_path = Path(__file__).parent / "README.md"
content = readme_path.read_text()
checks = [
("Semantic API mention", "Semantic API" in content),
("Deprecation notice", "deprecated" in content.lower() or "Deprecated" in content),
("Migration guide link", "MIGRATION_SIMPLE_TO_SEMANTIC" in content),
]
all_pass = True
for check_name, result in checks:
if result:
print(f"✅ {check_name}")
else:
print(f"❌ {check_name}")
all_pass = False
return all_pass
def test_review_document_structure():
"""Verify review document has expected sections."""
print("\n" + "=" * 70)
print("TEST 4: Review Document Structure")
print("=" * 70)
review_path = Path(__file__).parent / "MEMORY_SYSTEM_REVIEW.md"
if not review_path.exists():
print("❌ Review document not found")
return False
content = review_path.read_text()
expected_sections = [
"Executive Summary",
"SimpleMemoryStore",
"Semantic API",
"Comparison",
"Recommendations",
"Findings",
]
all_found = True
for section in expected_sections:
if section in content:
print(f"✅ Section: {section}")
else:
print(f"❌ Missing section: {section}")
all_found = False
return all_found
def main():
"""Run all verification tests."""
print("\n" + "🔍 MEMORY SYSTEM REVIEW VERIFICATION")
print("=" * 70 + "\n")
results = {
"Deprecation Warning": test_deprecation_warning(),
"Documentation Files": test_documentation_exists(),
"README Content": test_readme_content(),
"Review Document": test_review_document_structure(),
}
print("\n" + "=" * 70)
print("SUMMARY")
print("=" * 70)
for test_name, passed in results.items():
status = "✅ PASS" if passed else "❌ FAIL"
print(f"{status} - {test_name}")
all_passed = all(results.values())
print("\n" + "=" * 70)
if all_passed:
print("✅ ALL TESTS PASSED")
print("=" * 70)
print("\nChanges are ready for review:")
print("1. ✅ Deprecation warning added to SimpleMemoryStore")
print("2. ✅ Comprehensive review document created")
print("3. ✅ Migration guide with examples created")
print("4. ✅ README updated to guide users to Semantic API")
return 0
else:
print("❌ SOME TESTS FAILED")
print("=" * 70)
return 1
if __name__ == "__main__":
sys.exit(main())