Spaces:
Running
Running
Download verify_final.py from ManojR19/scalarhackatthon: direct link, hf CLI and curl.
- Browser
- Download file 1.39 kB
-
https://huggingface.co/spaces/ManojR19/scalarhackatthon/resolve/main/verify_final.py
- Command line
-
hf download hf://spaces/ManojR19/scalarhackatthon/verify_final.py
-
curl -L -o verify_final.py https://huggingface.co/spaces/ManojR19/scalarhackatthon/resolve/main/verify_final.py
1.39 kB
| from environment import EmailTriageEnv, SovereignAgent, run_episode | |
| import json | |
| def verify_system_integrations(): | |
| print("STARTING LOCAL SOVEREIGN VERIFICATION (v5.5.0)\n" + "="*50) | |
| # Initialize env | |
| env = EmailTriageEnv(enable_crisis=True, seed=42) | |
| agent = SovereignAgent() | |
| # Execute 1 Full Episode | |
| print("[1/3] Executing Simulation Episode...") | |
| metrics = run_episode(agent, env, verbose=False) | |
| # Check Logic Consistency | |
| print("[2/3] Analyzing Lattice Rewards...") | |
| total_r = metrics['total_reward'] | |
| logic_s = metrics['avg_logic'] | |
| causal_v = metrics['causal_violations'] | |
| # Report Conditions | |
| print("\n[3/3] FINAL METRICS REPORT:") | |
| norm_score = env.grader().score | |
| print(f" - Total Reward (Raw) : {total_r:.4f}") | |
| print(f" - Expert Score (Norm): {norm_score:.4f} (OpenEnv Compliance: {'PASSED' if 0.01 <= norm_score <= 0.99 else 'FAILED'})") | |
| print(f" - Logic Score : {logic_s:.4f} (Process Supervision: {'EXCELLENT' if logic_s > 0.8 else 'VALID'})") | |
| print(f" - Causal Integrity: {'SECURE' if causal_v == 0 else f'VIOLATED ({causal_v})'}") | |
| print(f" - Crisis Outcome: {'RESOLVED' if metrics['crisis_resolved'] else 'HANDLED'}") | |
| print("\n[SUCCESS] SYSTEM VERIFIED: All enterprise nuances and metrics conditions are active.") | |
| if __name__ == "__main__": | |
| verify_system_integrations() | |