File size: 1,494 Bytes
77da5ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
smoke_test.py β€” Remote Environment Verification
Checks if the simulation engine is correctly installed and functional.
"""

import os
import sys

# Ensure parent directory is in path for core imports
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

def smoke_test():
    print("πŸ” Starting LifeStack Remote Smoke Test...")
    
    try:
        from core.lifestack_env import LifeStackEnv, LifeStackAction
        from agent.conflict_generator import TaskGenerator
        print("βœ… Core modules imported successfully.")
    except ImportError as e:
        print(f"❌ Import failed: {e}")
        sys.exit(1)

    try:
        env = LifeStackEnv()
        generator = TaskGenerator()
        task = generator.generate(domain="flight_crisis", difficulty=1)
        obs = env.reset(task=task)
        print(f"βœ… Environment reset successful (Task: {task.goal})")
        
        # Test a simple action
        action = LifeStackAction(
            action_type="rest",
            target="mental_wellbeing",
            metric_changes={"mental_wellbeing.stress_level": -5.0},
            resource_cost={}
        )
        obs = env.step(action)
        print(f"βœ… Environment step successful (Step: {obs.step}, Reward: {obs.reward:.4f})")
    except Exception as e:
        print(f"❌ Execution failed: {e}")
        sys.exit(1)

    print("\nπŸš€ SMOKE TEST PASSED: LifeStack is ready for deployment.")

if __name__ == "__main__":
    smoke_test()