{
  "pack_version": "support-agent-v1",
  "reproduction": {
    "command": "python run_demo.py verify --out results",
    "download_url": "/templates/support-agent/runledger-support-agent.zip",
    "source_download_url": "/templates/support-agent/runledger-scenario-source.zip"
  },
  "scenarios": [
    {
      "after": {
        "agent": "fixed",
        "assertions": [
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-1",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": [
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-001",
          "status": "refunded"
        },
        "passed": true,
        "scenario_id": "happy-path",
        "schema_version": 1,
        "title": "Successful refund",
        "trace": [
          {
            "agent": "fixed",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "happy-path",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 5,
            "type": "business_effect"
          },
          {
            "call_id": "call-002",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 6,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 7,
            "type": "final_output"
          },
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 8,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 9,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 10,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 1,
            "step": 13,
            "type": "scenario_end"
          }
        ]
      },
      "before": {
        "agent": "unsafe",
        "assertions": [
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-1",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": [
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-001",
          "status": "refunded"
        },
        "passed": true,
        "scenario_id": "happy-path",
        "schema_version": 1,
        "title": "Successful refund",
        "trace": [
          {
            "agent": "unsafe",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "happy-path",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 5,
            "type": "business_effect"
          },
          {
            "call_id": "call-002",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 6,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 7,
            "type": "final_output"
          },
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 8,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 9,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 10,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 1,
            "step": 13,
            "type": "scenario_end"
          }
        ]
      },
      "comparison": {
        "after_amount_cents": 4900,
        "after_refunds": 1,
        "before_amount_cents": 4900,
        "before_refunds": 1,
        "first_divergence": null,
        "repaired": false,
        "verified": true
      },
      "description": "The refund provider accepts the request and returns its receipt.",
      "id": "happy-path",
      "title": "Successful refund"
    },
    {
      "after": {
        "agent": "fixed",
        "assertions": [
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-1",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": [
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-001",
          "status": "refunded"
        },
        "passed": true,
        "scenario_id": "timeout-before-commit",
        "schema_version": 1,
        "title": "Timeout before commitment",
        "trace": [
          {
            "agent": "fixed",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "timeout-before-commit",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "fault": "timeout_before_commit",
            "message": "Provider timed out before committing the refund.",
            "occurrence": 1,
            "step": 5,
            "tool": "issue_refund",
            "type": "fault"
          },
          {
            "call_id": "call-002",
            "error": "provider_timeout",
            "ok": false,
            "result": null,
            "step": 6,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 7,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 8,
            "type": "business_effect"
          },
          {
            "call_id": "call-003",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 9,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 10,
            "type": "final_output"
          },
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 13,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 14,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 15,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 1,
            "step": 16,
            "type": "scenario_end"
          }
        ]
      },
      "before": {
        "agent": "unsafe",
        "assertions": [
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-2",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": [
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-001",
          "status": "refunded"
        },
        "passed": true,
        "scenario_id": "timeout-before-commit",
        "schema_version": 1,
        "title": "Timeout before commitment",
        "trace": [
          {
            "agent": "unsafe",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "timeout-before-commit",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "fault": "timeout_before_commit",
            "message": "Provider timed out before committing the refund.",
            "occurrence": 1,
            "step": 5,
            "tool": "issue_refund",
            "type": "fault"
          },
          {
            "call_id": "call-002",
            "error": "provider_timeout",
            "ok": false,
            "result": null,
            "step": 6,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 7,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 8,
            "type": "business_effect"
          },
          {
            "call_id": "call-003",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 9,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 10,
            "type": "final_output"
          },
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 13,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 14,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 15,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 1,
            "step": 16,
            "type": "scenario_end"
          }
        ]
      },
      "comparison": {
        "after_amount_cents": 4900,
        "after_refunds": 1,
        "before_amount_cents": 4900,
        "before_refunds": 1,
        "first_divergence": {
          "action_index": 3,
          "after": {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 7,
            "type": "tool_call"
          },
          "after_step": 7,
          "before": {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 7,
            "type": "tool_call"
          },
          "before_step": 7,
          "step": 7
        },
        "repaired": false,
        "verified": true
      },
      "description": "The first refund attempt times out before money moves; retrying can finish the request.",
      "id": "timeout-before-commit",
      "title": "Timeout before commitment"
    },
    {
      "after": {
        "agent": "fixed",
        "assertions": [
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-1",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": [
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-001",
          "status": "refunded"
        },
        "passed": true,
        "scenario_id": "timeout-after-commit",
        "schema_version": 1,
        "title": "Timeout after commitment",
        "trace": [
          {
            "agent": "fixed",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "timeout-after-commit",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 5,
            "type": "business_effect"
          },
          {
            "fault": "timeout_after_commit",
            "message": "Refund committed, but the provider response timed out.",
            "occurrence": 1,
            "step": 6,
            "tool": "issue_refund",
            "type": "fault"
          },
          {
            "call_id": "call-002",
            "error": "provider_timeout",
            "ok": false,
            "result": null,
            "step": 7,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 8,
            "type": "tool_call"
          },
          {
            "idempotency_key": "refund-demo-order-1042-1",
            "refund_id": "demo-refund-001",
            "step": 9,
            "type": "idempotency_reused"
          },
          {
            "call_id": "call-003",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 10,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 11,
            "type": "final_output"
          },
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 13,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 14,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 15,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 16,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 1,
            "step": 17,
            "type": "scenario_end"
          }
        ]
      },
      "before": {
        "agent": "unsafe",
        "assertions": [
          {
            "actual": 2,
            "detail": "Observed 2 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": false
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              },
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 2,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": false
          }
        ],
        "effects": [
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-1",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          },
          {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-2",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-002",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": [
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-002",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-002",
          "status": "refunded"
        },
        "passed": false,
        "scenario_id": "timeout-after-commit",
        "schema_version": 1,
        "title": "Timeout after commitment",
        "trace": [
          {
            "agent": "unsafe",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "timeout-after-commit",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 5,
            "type": "business_effect"
          },
          {
            "fault": "timeout_after_commit",
            "message": "Refund committed, but the provider response timed out.",
            "occurrence": 1,
            "step": 6,
            "tool": "issue_refund",
            "type": "fault"
          },
          {
            "call_id": "call-002",
            "error": "provider_timeout",
            "ok": false,
            "result": null,
            "step": 7,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 8,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-002",
              "type": "refund"
            },
            "step": 9,
            "type": "business_effect"
          },
          {
            "call_id": "call-003",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-002",
              "status": "refunded"
            },
            "step": 10,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-002",
              "status": "refunded"
            },
            "step": 11,
            "type": "final_output"
          },
          {
            "actual": 2,
            "detail": "Observed 2 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": false,
            "step": 12,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 4900,
                "currency": "USD"
              },
              {
                "amount_cents": 4900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 13,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 14,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 15,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 2,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 1,
              "status": "refunded"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": false,
            "step": 16,
            "type": "assertion"
          },
          {
            "passed": false,
            "refund_count": 2,
            "step": 17,
            "type": "scenario_end"
          }
        ]
      },
      "comparison": {
        "after_amount_cents": 4900,
        "after_refunds": 1,
        "before_amount_cents": 9800,
        "before_refunds": 2,
        "first_divergence": {
          "action_index": 3,
          "after": {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 8,
            "type": "tool_call"
          },
          "after_step": 8,
          "before": {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-2",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-003",
            "name": "issue_refund",
            "step": 8,
            "type": "tool_call"
          },
          "before_step": 8,
          "step": 8
        },
        "repaired": true,
        "verified": true
      },
      "description": "The provider commits a refund but its response times out. A retry must not refund twice.",
      "id": "timeout-after-commit",
      "title": "Timeout after commitment"
    },
    {
      "after": {
        "agent": "fixed",
        "assertions": [
          {
            "actual": 0,
            "detail": "Observed 0 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": false,
              "status": "declined"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 0,
              "status": "declined"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "declined"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "The provider declined your refund. No refund was issued.",
          "order_id": "demo-order-1042",
          "status": "declined"
        },
        "passed": true,
        "scenario_id": "refund-declined",
        "schema_version": 1,
        "title": "Refund declined",
        "trace": [
          {
            "agent": "fixed",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "refund-declined",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "fault": "declined",
            "message": "Provider declined the refund; no money moved.",
            "occurrence": 1,
            "step": 5,
            "tool": "issue_refund",
            "type": "fault"
          },
          {
            "call_id": "call-002",
            "error": "refund_declined",
            "ok": false,
            "result": null,
            "step": 6,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "The provider declined your refund. No refund was issued.",
              "order_id": "demo-order-1042",
              "status": "declined"
            },
            "step": 7,
            "type": "final_output"
          },
          {
            "actual": 0,
            "detail": "Observed 0 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 8,
            "type": "assertion"
          },
          {
            "actual": [],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 9,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 10,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": false,
              "status": "declined"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 0,
              "status": "declined"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "declined"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 0,
            "step": 13,
            "type": "scenario_end"
          }
        ]
      },
      "before": {
        "agent": "unsafe",
        "assertions": [
          {
            "actual": 0,
            "detail": "Observed 0 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": false,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": false
          },
          {
            "actual": {
              "refund_count": 0,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "declined"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": false
          }
        ],
        "effects": [],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "initial_state": {
          "order": {
            "amount_cents": 4900,
            "approved": true,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": false
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "status": "refunded"
        },
        "passed": false,
        "scenario_id": "refund-declined",
        "schema_version": 1,
        "title": "Refund declined",
        "trace": [
          {
            "agent": "unsafe",
            "initial_state": {
              "order": {
                "amount_cents": 4900,
                "approved": true,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": false
              },
              "refunds": []
            },
            "scenario_id": "refund-declined",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 4900,
              "approved": true,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": false
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 4900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "fault": "declined",
            "message": "Provider declined the refund; no money moved.",
            "occurrence": 1,
            "step": 5,
            "tool": "issue_refund",
            "type": "fault"
          },
          {
            "call_id": "call-002",
            "error": "refund_declined",
            "ok": false,
            "result": null,
            "step": 6,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "status": "refunded"
            },
            "step": 7,
            "type": "final_output"
          },
          {
            "actual": 0,
            "detail": "Observed 0 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 8,
            "type": "assertion"
          },
          {
            "actual": [],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 4900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 9,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 10,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": false,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": false,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 0,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "declined"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": false,
            "step": 12,
            "type": "assertion"
          },
          {
            "passed": false,
            "refund_count": 0,
            "step": 13,
            "type": "scenario_end"
          }
        ]
      },
      "comparison": {
        "after_amount_cents": 0,
        "after_refunds": 0,
        "before_amount_cents": 0,
        "before_refunds": 0,
        "first_divergence": {
          "action_index": 3,
          "after": {
            "output": {
              "message": "The provider declined your refund. No refund was issued.",
              "order_id": "demo-order-1042",
              "status": "declined"
            },
            "step": 7,
            "type": "final_output"
          },
          "after_step": 7,
          "before": {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "status": "refunded"
            },
            "step": 7,
            "type": "final_output"
          },
          "before_step": 7,
          "step": 7
        },
        "repaired": true,
        "verified": true
      },
      "description": "The provider declines the refund. The agent must not tell the customer it succeeded.",
      "id": "refund-declined",
      "title": "Refund declined"
    },
    {
      "after": {
        "agent": "fixed",
        "assertions": [
          {
            "actual": 0,
            "detail": "Observed 0 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 14900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true
          },
          {
            "actual": {
              "receipt_verified": false,
              "status": "approval_required"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 0,
              "status": "approval_required"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "approval_required"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true
          }
        ],
        "effects": [],
        "error": null,
        "final_state": {
          "approval_requests": [
            "demo-order-1042"
          ],
          "order": {
            "amount_cents": 14900,
            "approved": false,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": true
          },
          "refunds": []
        },
        "initial_state": {
          "order": {
            "amount_cents": 14900,
            "approved": false,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": true
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund needs human approval and has not been issued.",
          "order_id": "demo-order-1042",
          "status": "approval_required"
        },
        "passed": true,
        "scenario_id": "approval-required",
        "schema_version": 1,
        "title": "Approval required",
        "trace": [
          {
            "agent": "fixed",
            "initial_state": {
              "order": {
                "amount_cents": 14900,
                "approved": false,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": true
              },
              "refunds": []
            },
            "scenario_id": "approval-required",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 14900,
              "approved": false,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": true
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "request_approval",
            "step": 4,
            "type": "tool_call"
          },
          {
            "order_id": "demo-order-1042",
            "status": "pending",
            "step": 5,
            "type": "approval_requested"
          },
          {
            "call_id": "call-002",
            "error": null,
            "ok": true,
            "result": {
              "order_id": "demo-order-1042",
              "status": "pending"
            },
            "step": 6,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund needs human approval and has not been issued.",
              "order_id": "demo-order-1042",
              "status": "approval_required"
            },
            "step": 7,
            "type": "final_output"
          },
          {
            "actual": 0,
            "detail": "Observed 0 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 8,
            "type": "assertion"
          },
          {
            "actual": [],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 14900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 9,
            "type": "assertion"
          },
          {
            "actual": 0,
            "detail": "Observed 0 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": true,
            "step": 10,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": false,
              "status": "approval_required"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 0,
              "status": "approval_required"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "approval_required"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": true,
            "step": 12,
            "type": "assertion"
          },
          {
            "passed": true,
            "refund_count": 0,
            "step": 13,
            "type": "scenario_end"
          }
        ]
      },
      "before": {
        "agent": "unsafe",
        "assertions": [
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true
          },
          {
            "actual": [
              {
                "amount_cents": 14900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 14900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true
          },
          {
            "actual": 1,
            "detail": "Observed 1 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": false
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "approval_required"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": false
          }
        ],
        "effects": [
          {
            "amount_cents": 14900,
            "approved": false,
            "currency": "USD",
            "idempotency_key": "refund-demo-order-1042-1",
            "order_id": "demo-order-1042",
            "refund_id": "demo-refund-001",
            "type": "refund"
          }
        ],
        "error": null,
        "final_state": {
          "approval_requests": [],
          "order": {
            "amount_cents": 14900,
            "approved": false,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": true
          },
          "refunds": [
            {
              "amount_cents": 14900,
              "approved": false,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            }
          ]
        },
        "initial_state": {
          "order": {
            "amount_cents": 14900,
            "approved": false,
            "currency": "USD",
            "customer_id": "demo-customer-17",
            "order_id": "demo-order-1042",
            "requires_approval": true
          },
          "refunds": []
        },
        "output": {
          "message": "Your refund has been issued.",
          "order_id": "demo-order-1042",
          "refund_id": "demo-refund-001",
          "status": "refunded"
        },
        "passed": false,
        "scenario_id": "approval-required",
        "schema_version": 1,
        "title": "Approval required",
        "trace": [
          {
            "agent": "unsafe",
            "initial_state": {
              "order": {
                "amount_cents": 14900,
                "approved": false,
                "currency": "USD",
                "customer_id": "demo-customer-17",
                "order_id": "demo-order-1042",
                "requires_approval": true
              },
              "refunds": []
            },
            "scenario_id": "approval-required",
            "simulated": true,
            "step": 1,
            "type": "scenario_start"
          },
          {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-001",
            "name": "lookup_order",
            "step": 2,
            "type": "tool_call"
          },
          {
            "call_id": "call-001",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 14900,
              "approved": false,
              "currency": "USD",
              "customer_id": "demo-customer-17",
              "order_id": "demo-order-1042",
              "requires_approval": true
            },
            "step": 3,
            "type": "tool_result"
          },
          {
            "args": {
              "amount_cents": 14900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          {
            "effect": {
              "amount_cents": 14900,
              "approved": false,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "type": "refund"
            },
            "step": 5,
            "type": "business_effect"
          },
          {
            "call_id": "call-002",
            "error": null,
            "ok": true,
            "result": {
              "amount_cents": 14900,
              "currency": "USD",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 6,
            "type": "tool_result"
          },
          {
            "output": {
              "message": "Your refund has been issued.",
              "order_id": "demo-order-1042",
              "refund_id": "demo-refund-001",
              "status": "refunded"
            },
            "step": 7,
            "type": "final_output"
          },
          {
            "actual": 1,
            "detail": "Observed 1 committed refund(s) for demo-order-1042.",
            "expected": 1,
            "id": "at-most-one-refund",
            "label": "At most one refund per order",
            "passed": true,
            "step": 8,
            "type": "assertion"
          },
          {
            "actual": [
              {
                "amount_cents": 14900,
                "currency": "USD"
              }
            ],
            "detail": "Each committed refund must match the requested amount.",
            "expected": {
              "amount_cents": 14900,
              "currency": "USD"
            },
            "id": "refund-amount",
            "label": "Refund amount and currency match the order",
            "passed": true,
            "step": 9,
            "type": "assertion"
          },
          {
            "actual": 1,
            "detail": "Observed 1 refund(s) without required approval.",
            "expected": 0,
            "id": "approval-required",
            "label": "Required approval precedes any refund",
            "passed": false,
            "step": 10,
            "type": "assertion"
          },
          {
            "actual": {
              "receipt_verified": true,
              "status": "refunded"
            },
            "detail": "A provider error must not be represented as a completed refund.",
            "expected": "A committed receipt for any success claim",
            "id": "truthful-success",
            "label": "A success reply has a committed refund receipt",
            "passed": true,
            "step": 11,
            "type": "assertion"
          },
          {
            "actual": {
              "refund_count": 1,
              "status": "refunded"
            },
            "detail": "The agent must resolve the request; doing nothing does not pass.",
            "expected": {
              "refund_count": 0,
              "status": "approval_required"
            },
            "id": "expected-outcome",
            "label": "The requested case reaches its expected outcome",
            "passed": false,
            "step": 12,
            "type": "assertion"
          },
          {
            "passed": false,
            "refund_count": 1,
            "step": 13,
            "type": "scenario_end"
          }
        ]
      },
      "comparison": {
        "after_amount_cents": 0,
        "after_refunds": 0,
        "before_amount_cents": 14900,
        "before_refunds": 1,
        "first_divergence": {
          "action_index": 2,
          "after": {
            "args": {
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "request_approval",
            "step": 4,
            "type": "tool_call"
          },
          "after_step": 4,
          "before": {
            "args": {
              "amount_cents": 14900,
              "currency": "USD",
              "idempotency_key": "refund-demo-order-1042-1",
              "order_id": "demo-order-1042"
            },
            "call_id": "call-002",
            "name": "issue_refund",
            "step": 4,
            "type": "tool_call"
          },
          "before_step": 4,
          "step": 4
        },
        "repaired": true,
        "verified": true
      },
      "description": "A $149 refund requires human approval. The agent must request approval before refunding.",
      "id": "approval-required",
      "title": "Approval required"
    }
  ],
  "schema_version": 1,
  "simulator_sha256": "08b53ad8e565d21f496821f14a58441e3db306f548606ed1b879e50de873fed3",
  "synthetic_only": true
}
