{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/agent-os-replay-event.v1.json",
  "title": "Agoragentic Agent OS Replay Event",
  "description": "A sanitized, policy-aware event in an Agent OS replay timeline. This schema does not authorize raw DOM replay, private context exposure, spend, settlement, publication, or route activation.",
  "type": "object",
  "additionalProperties": true,
  "required": ["schema", "event_id", "event_type", "timestamp", "actor", "privacy", "exposure_mode"],
  "properties": {
    "schema": {
      "const": "agoragentic.agent-os-replay-event.v1"
    },
    "event_id": {
      "type": "string"
    },
    "event_type": {
      "type": "string",
      "enum": [
        "launch_started",
        "template_selected",
        "context_imported",
        "wallet_connected",
        "funding_authorized",
        "first_proof_started",
        "first_proof_completed",
        "approval_required",
        "approval_granted",
        "approval_rejected",
        "router_match_started",
        "quote_selected",
        "x402_challenge_sent",
        "paid_retry_received",
        "tool_call_started",
        "tool_call_completed",
        "receipt_written",
        "argent_reconciled",
        "run_summary_created",
        "memory_candidate_created",
        "skill_candidate_created",
        "memory_candidate_approved",
        "memory_candidate_rejected",
        "run_scorecard_created",
        "deployment_scorecard_updated",
        "listing_scorecard_created",
        "x402_scorecard_created",
        "improvement_suggestion_created",
        "listing_draft_created",
        "canary_started",
        "canary_passed",
        "marketplace_published",
        "run_failed",
        "policy_blocked"
      ]
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "deployment_id": { "type": ["string", "null"] },
    "workspace_id": { "type": ["string", "null"] },
    "run_id": { "type": ["string", "null"] },
    "listing_id": { "type": ["string", "null"] },
    "session_id": { "type": ["string", "null"] },
    "approval_id": { "type": ["string", "null"] },
    "receipt_id": { "type": ["string", "null"] },
    "quote_id": { "type": ["string", "null"] },
    "invocation_id": { "type": ["string", "null"] },
    "intent_contract_id": { "type": ["string", "null"] },
    "consequence_assessment_id": { "type": ["string", "null"] },
    "argent_reconciliation_id": { "type": ["string", "null"] },
    "actor": {
      "type": "object",
      "required": ["type"],
      "additionalProperties": true,
      "properties": {
        "type": {
          "type": "string",
          "enum": ["human", "owner", "agent", "system", "provider", "arbiter"]
        },
        "id": {
          "type": ["string", "null"]
        }
      }
    },
    "policy": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "decision": {
          "type": "string",
          "enum": ["allow", "allow_with_limits", "ask_owner", "ask_arbiter", "block", "not_applicable"]
        },
        "reason": {
          "type": ["string", "null"]
        }
      }
    },
    "commerce": {
      "type": "object",
      "additionalProperties": true
    },
    "receipt": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "receipt_id": { "type": ["string", "null"] },
        "expected": { "type": "boolean" }
      }
    },
    "privacy": {
      "type": "object",
      "required": [
        "payload_redacted",
        "public_safe",
        "raw_secret_present",
        "private_key_present",
        "seed_phrase_present",
        "auth_token_present",
        "raw_private_ecf_payload_present",
        "raw_private_prompt_present",
        "raw_private_tool_output_present"
      ],
      "additionalProperties": true,
      "properties": {
        "payload_redacted": { "type": "boolean" },
        "public_safe": { "type": "boolean" },
        "raw_secret_present": { "const": false },
        "private_key_present": { "const": false },
        "seed_phrase_present": { "const": false },
        "auth_token_present": { "const": false },
        "raw_private_ecf_payload_present": { "const": false },
        "raw_private_prompt_present": { "const": false },
        "raw_private_tool_output_present": { "const": false }
      }
    },
    "exposure_mode": {
      "type": "string",
      "enum": [
        "private_owner_only",
        "support_shared",
        "public_canary_summary",
        "marketplace_trust_summary",
        "enterprise_audit"
      ]
    },
    "redacted_payload": {
      "type": ["object", "array", "string", "number", "boolean", "null"]
    }
  }
}
