{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Browser Agent Trust Receipt",
  "type": "object",
  "required": [
    "run_id",
    "workflow_version",
    "status",
    "source_coverage",
    "authority",
    "effects",
    "evidence",
    "cost"
  ],
  "properties": {
    "run_id": {
      "type": "string",
      "minLength": 1
    },
    "workflow_version": {
      "type": "string",
      "minLength": 1
    },
    "status": {
      "enum": [
        "VERIFIED",
        "FAILED",
        "UNKNOWN_RECONCILING",
        "ABSTAINED"
      ]
    },
    "source_coverage": {
      "type": "object",
      "required": [
        "expected",
        "checked",
        "complete"
      ],
      "properties": {
        "expected": {
          "type": "integer",
          "minimum": 0
        },
        "checked": {
          "type": "integer",
          "minimum": 0
        },
        "complete": {
          "type": "boolean"
        }
      }
    },
    "authority": {
      "type": "object",
      "required": [
        "action_class",
        "allowed_operations",
        "expires_at"
      ],
      "properties": {
        "action_class": {
          "type": "string"
        },
        "allowed_operations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "effects": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "effect_id",
          "state"
        ],
        "properties": {
          "effect_id": {
            "type": "string"
          },
          "state": {
            "enum": [
              "PLANNED",
              "REQUESTED",
              "COMMITTED",
              "FAILED",
              "UNKNOWN",
              "RECONCILING"
            ]
          }
        }
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "source",
          "authoritative",
          "current",
          "passed"
        ],
        "properties": {
          "source": {
            "type": "string"
          },
          "authoritative": {
            "type": "boolean"
          },
          "current": {
            "type": "boolean"
          },
          "independent": {
            "type": "boolean"
          },
          "passed": {
            "type": "boolean"
          }
        }
      }
    },
    "cost": {
      "type": "object",
      "required": [
        "cash_aud",
        "human_minutes"
      ],
      "properties": {
        "cash_aud": {
          "type": "number",
          "minimum": 0
        },
        "human_minutes": {
          "type": "number",
          "minimum": 0
        }
      }
    }
  }
}