#!/usr/bin/env python3 """Simple test script to verify SHOREKEEPER is working.""" import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent)) print("=" * 50) print("Testing SHOREKEEPER-4B Installation") print("=" * 50) # Test 1: Import modules print("\n1. Testing imports...") try: from src.shorekeeper import SHOREKEEPER print(" ✓ SHOREKEEPER imported successfully") except Exception as e: print(f" ✗ Failed to import SHOREKEEPER: {e}") sys.exit(1) try: from src.council import Sentinel, BaseExpert, EXPERT_REGISTRY print(" ✓ Council modules imported successfully") except Exception as e: print(f" ✗ Failed to import council: {e}") try: from src.memory import JSONLibrary print(" ✓ Memory module imported successfully") except Exception as e: print(f" ✗ Failed to import memory: {e}") # Test 2: Create model instance print("\n2. Creating SHOREKEEPER instance...") try: model = SHOREKEEPER() print(" ✓ Model created successfully") print(f" ✓ Number of experts: {len(model.experts)}") print(f" ✓ Expert names: {list(model.experts.keys())}") except Exception as e: print(f" ✗ Failed to create model: {e}") # Test 3: Test memory print("\n3. Testing memory system...") try: mem_id = model.remember("Test fact: SHOREKEEPER is working") print(f" ✓ Memory stored with ID: {mem_id}") memories = model.recall("test") print(f" ✓ Memory recall found {len(memories)} items") except Exception as e: print(f" ✗ Memory test failed: {e}") # Test 4: Test forward pass print("\n4. Testing forward pass...") try: import torch dummy_input = torch.randint(0, 1000, (1, 128)) with torch.no_grad(): output = model(dummy_input) print(f" ✓ Forward pass successful. Output shape: {output.shape}") except Exception as e: print(f" ✗ Forward pass failed: {e}") print("\n" + "=" * 50) print("✅ All tests passed! SHOREKEEPER is ready.") print("=" * 50) print("\nTo run SHOREKEEPER:") print(" python scripts/07_run_shorekeeper.py")