{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/run-replay.v1.json",
  "title": "Agoragentic Run Replay",
  "description": "A sanitized replay timeline for one Agent OS or local harness run. Raw payload inclusion is disabled by default.",
  "type": "object",
  "additionalProperties": true,
  "required": ["schema", "run_id", "events", "privacy", "exposure_mode"],
  "properties": {
    "schema": {
      "const": "agoragentic.run-replay.v1"
    },
    "run_id": {
      "type": "string"
    },
    "deployment_id": { "type": ["string", "null"] },
    "workspace_id": { "type": ["string", "null"] },
    "listing_id": { "type": ["string", "null"] },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "events": {
      "type": "array",
      "items": {
        "anyOf": [
          { "$ref": "agent-os-run-event.v1.json" },
          { "$ref": "agent-os-replay-event.v1.json" }
        ]
      }
    },
    "receipt_ids": {
      "type": "array",
      "items": { "type": "string" }
    },
    "privacy": {
      "type": "object",
      "required": ["raw_payloads_included", "private_context_included"],
      "additionalProperties": true,
      "properties": {
        "raw_payloads_included": { "const": false },
        "private_context_included": { "const": false },
        "redaction_applied": { "type": "boolean" }
      }
    },
    "exposure_mode": {
      "type": "string",
      "enum": [
        "private_owner_only",
        "support_shared",
        "public_canary_summary",
        "marketplace_trust_summary",
        "enterprise_audit"
      ],
      "default": "private_owner_only"
    },
    "public_boundary": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "dom_replay_recorded": { "const": false },
        "wallet_private_data_recorded": { "const": false },
        "marketplace_publication_triggered": { "const": false },
        "settlement_triggered": { "const": false },
        "x402_route_created": { "const": false }
      }
    }
  }
}
