-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_basic.py
More file actions
executable file
·108 lines (98 loc) · 3.38 KB
/
test_basic.py
File metadata and controls
executable file
·108 lines (98 loc) · 3.38 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
#!/usr/bin/env python3
"""Basic test of the synthesis pool system."""
import sys
from datetime import date
# Test imports
try:
from models import TimestampConfidence, DecayState, SynthesisType
print("✓ Models imported successfully")
except Exception as e:
print(f"✗ Error importing models: {e}")
sys.exit(1)
try:
from operations import feed_memory, observe_pool, harvest_synthesis, query_memory
print("✓ Operations imported successfully")
except Exception as e:
print(f"✗ Error importing operations: {e}")
sys.exit(1)
# Test feeding a memory
print("\n--- Testing FEED operation ---")
try:
memory = feed_memory(
timestamp_actual=date(2024, 12, 15),
timestamp_confidence=TimestampConfidence.EXACT,
source_type="journal",
raw="Difficult conversation with manager about project scope and boundaries",
layers="work|self",
tags="conflict,growth,boundaries",
toxicity=4,
nutrient_density=3,
decay_state=DecayState.FRESH
)
print(f"✓ Memory fed: {memory.id}")
print(f" Date: {memory.timestamp_actual}")
print(f" Toxicity: {memory.toxicity} | Nutrient: {memory.nutrient_density}")
except Exception as e:
print(f"✗ Error feeding memory: {e}")
import traceback
traceback.print_exc()
# Test feeding another memory
try:
memory2 = feed_memory(
timestamp_actual=date(2024, 12, 20),
timestamp_confidence=TimestampConfidence.EXACT,
source_type="recall",
raw="Realized I've been saying yes to everything. Need better boundaries.",
layers="work|self",
tags="boundaries,realization,growth",
toxicity=3,
nutrient_density=4,
decay_state=DecayState.FRESH
)
print(f"✓ Memory fed: {memory2.id}")
except Exception as e:
print(f"✗ Error feeding second memory: {e}")
# Test observing pool
print("\n--- Testing OBSERVE operation ---")
try:
state = observe_pool()
print(f"✓ Pool observed")
print(f" Health: {state.health.value}")
print(f" Matter count: {state.matter_count}")
print(f" Active synthesis: {state.active_synthesis}")
except Exception as e:
print(f"✗ Error observing pool: {e}")
import traceback
traceback.print_exc()
# Test querying
print("\n--- Testing QUERY operation ---")
try:
results = query_memory(layers=["work"])
print(f"✓ Query executed: found {len(results)} entries")
except Exception as e:
print(f"✗ Error querying: {e}")
import traceback
traceback.print_exc()
# Test harvesting
print("\n--- Testing HARVEST operation ---")
try:
synthesis = harvest_synthesis(
synthesis_type=SynthesisType.MEDICINE,
derived_from="mm_001,mm_002",
concentration=4,
label="Boundary Protocol",
description="Framework for maintaining work boundaries and protecting energy",
application="Implement in future roles to prevent burnout and maintain work-life balance"
)
print(f"✓ Synthesis harvested: {synthesis.id}")
print(f" Type: {synthesis.type.value}")
print(f" Label: {synthesis.label}")
except Exception as e:
print(f"✗ Error harvesting: {e}")
import traceback
traceback.print_exc()
print("\n✓ All basic tests completed successfully!")
print("\nData files created in data/ directory:")
print(" - memory_matter.csv")
print(" - synthesis_outputs.csv")
print(" - pool_states.csv")