"""Test that the two-agent demo runs without crashing."""

from agenlang.demo import run_demo


def test_demo_runs_and_returns_ser():
    ser = run_demo()
    assert ser["execution_id"].startswith("urn:agenlang:exec:")
    assert ser["resource_usage"]["joules_used"] == 84.0
    assert ser["safety_checks"]["capability_violations"] == 0
    assert ser["settlement_receipt"]["joule_recipient"] == "agent-beta"
