$ python dispatcher.py calls-good.json
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_1",
      "ok": true,
      "result": {
        "order_id": "DEMO-1001",
        "status": "processing"
      },
      "error": null
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_1",
      "decision": "completed",
      "code": null
    }
  ],
  "executor_invocations": 1,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-extra.json
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_2",
      "ok": false,
      "result": null,
      "error": "invalid_arguments"
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_2",
      "decision": "rejected",
      "code": "invalid_arguments"
    }
  ],
  "executor_invocations": 0,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-unknown.json
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_3",
      "ok": false,
      "result": null,
      "error": "unknown_tool"
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_3",
      "decision": "rejected",
      "code": "unknown_tool"
    }
  ],
  "executor_invocations": 0,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-foreign.json
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_4",
      "ok": false,
      "result": null,
      "error": "not_available"
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_4",
      "decision": "rejected",
      "code": "not_available"
    }
  ],
  "executor_invocations": 1,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-foreign.json --actor bob
exit=0
{
  "actor_fixture": "bob",
  "results": [
    {
      "id": "call_4",
      "ok": true,
      "result": {
        "order_id": "DEMO-1002",
        "status": "delivered"
      },
      "error": null
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_4",
      "decision": "completed",
      "code": null
    }
  ],
  "executor_invocations": 1,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-good.json --actor viewer
exit=0
{
  "actor_fixture": "viewer",
  "results": [
    {
      "id": "call_1",
      "ok": false,
      "result": null,
      "error": "permission_denied"
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_1",
      "decision": "rejected",
      "code": "permission_denied"
    }
  ],
  "executor_invocations": 0,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-good.json --disable-tool
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_1",
      "ok": false,
      "result": null,
      "error": "tool_disabled"
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_1",
      "decision": "rejected",
      "code": "tool_disabled"
    }
  ],
  "executor_invocations": 0,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-repeat.json
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_5",
      "ok": true,
      "result": {
        "order_id": "DEMO-1001",
        "status": "processing"
      },
      "error": null
    },
    {
      "id": "call_5",
      "ok": false,
      "result": null,
      "error": "duplicate_call_id"
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_5",
      "decision": "completed",
      "code": null
    },
    {
      "index": 1,
      "id": "call_5",
      "decision": "rejected",
      "code": "duplicate_call_id"
    }
  ],
  "executor_invocations": 1,
  "max_calls": 4,
  "limit_reached": false,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-limit.json
exit=0
{
  "actor_fixture": "alice",
  "results": [
    {
      "id": "call_6",
      "ok": true,
      "result": {
        "order_id": "DEMO-1001",
        "status": "processing"
      },
      "error": null
    },
    {
      "id": "call_7",
      "ok": true,
      "result": {
        "order_id": "DEMO-1001",
        "status": "processing"
      },
      "error": null
    },
    {
      "id": "call_8",
      "ok": true,
      "result": {
        "order_id": "DEMO-1001",
        "status": "processing"
      },
      "error": null
    },
    {
      "id": "call_9",
      "ok": true,
      "result": {
        "order_id": "DEMO-1001",
        "status": "processing"
      },
      "error": null
    }
  ],
  "audit": [
    {
      "index": 0,
      "id": "call_6",
      "decision": "completed",
      "code": null
    },
    {
      "index": 1,
      "id": "call_7",
      "decision": "completed",
      "code": null
    },
    {
      "index": 2,
      "id": "call_8",
      "decision": "completed",
      "code": null
    },
    {
      "index": 3,
      "id": "call_9",
      "decision": "completed",
      "code": null
    },
    {
      "index": 4,
      "decision": "blocked",
      "code": "call_limit"
    }
  ],
  "executor_invocations": 4,
  "max_calls": 4,
  "limit_reached": true,
  "real_model_calls": 0,
  "external_writes": 0,
  "authenticated": false
}

$ python dispatcher.py calls-invalid.json
exit=2
{"ok": false, "error": "invalid_json"}
