| """ |
| smoke_test.py β Remote Environment Verification |
| Checks if the simulation engine is correctly installed and functional. |
| """ |
|
|
| import os |
| import sys |
|
|
| |
| 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})") |
| |
| |
| 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() |
|
|