Fix infra and security issues (#6, #7, #15, #16, #22, #25)

This commit is contained in:
Antigravity Agent
2026-05-26 00:43:07 +00:00
parent 29a3450cb7
commit afa632819e
24 changed files with 2112 additions and 251 deletions
+2 -2
View File
@@ -33,14 +33,14 @@ class TestKAIROSTemporalEngine(unittest.TestCase):
"""Test temporalize method works."""
import asyncio
engine = KAIROSTemporalEngine()
result = asyncio.run(engine.temporalize("test phrase"))
result = engine.temporalize("test phrase")
self.assertIsNotNone(result)
def test_reset(self):
"""Test reset works."""
import asyncio
engine = KAIROSTemporalEngine()
asyncio.run(engine.temporalize("test phrase"))
engine.temporalize("test phrase")
engine.reset()
self.assertEqual(engine.coherence, 1.0)
self.assertEqual(engine.integration_count, 0)
+9
View File
@@ -180,6 +180,13 @@ class TestPersistence(unittest.TestCase):
self.assertEqual(len(lines), 5)
try:
import sentence_transformers
HAS_SENTENCE_TRANSFORMERS = True
except ImportError:
HAS_SENTENCE_TRANSFORMERS = False
@unittest.skipIf(not HAS_SENTENCE_TRANSFORMERS, "sentence-transformers missing")
class TestPhaseEncoder(unittest.TestCase):
"""Step 2: Phase encoder tests."""
@@ -209,6 +216,7 @@ class TestPhaseEncoder(unittest.TestCase):
self.assertEqual(len(result), 384) # all-MiniLM-L6-v2 dimension
@unittest.skipIf(not HAS_SENTENCE_TRANSFORMERS, "sentence-transformers missing")
class TestRetrieval(unittest.TestCase):
"""Step 3: Retrieval tests."""
@@ -329,6 +337,7 @@ class TestRetrieval(unittest.TestCase):
self.assertGreater(high_score, low_score)
@unittest.skipIf(not HAS_SENTENCE_TRANSFORMERS, "sentence-transformers missing")
class TestIntegration(unittest.TestCase):
"""End-to-end integration tests."""
+2 -2
View File
@@ -28,7 +28,7 @@ async def test_token_clock_spacing():
# 2. Simulate an LLM streaming 10 tokens
# Using normal temporalize() which should respect the implicit clock mode
for i in range(10):
await engine.temporalize(f"token_{i}")
engine.temporalize(f"token_{i}")
# Check the final timestamp
final_time = engine._timestamps[-1]
@@ -50,7 +50,7 @@ async def test_temporalize_stream():
tokens = ["I", "am", "Solaria", "and", "I", "am", "continuous"]
# Stream the tokens
states = await engine.temporalize_stream(tokens, start_time=start_time)
states = engine.temporalize_stream(tokens, start_time=start_time)
assert len(states) == 7
+1 -1
View File
@@ -51,7 +51,7 @@ async def test_full_fieldprint_pipeline(tmp_path):
]
for phrase in phrases:
state = await engine.temporalize(phrase)
state = engine.temporalize(phrase)
# 3. Force Memory Encoding
# The coherence should have spiked. We manually encode a core memory.