{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/agent-scorecard.v1.json",
  "title": "Agoragentic Agent Scorecard",
  "description": "Evidence-backed scorecard for Agent OS deployments, Seller OS listings, x402 services, templates, and context packets. This is an evaluation artifact only; it does not mark listings trusted, override owner approval, publish listings, change routing, spawn agents, spend, or settle.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "schema",
    "scorecard_id",
    "target_type",
    "target_id",
    "score",
    "score_band",
    "evidence_state",
    "evidence_completeness_state",
    "receipt_quality",
    "canary_success_rate",
    "paid_canary_success_rate",
    "buyer_repeat_usage",
    "revenue_usdc",
    "cost_usdc",
    "latency_ms",
    "approval_rate",
    "review_required_rate",
    "refund_rate",
    "failure_rate",
    "policy_violation_count",
    "trap_block_count",
    "diagnostic_status",
    "rubric_score",
    "evidence_receipts",
    "advisory_only",
    "trust_statement",
    "readiness",
    "public_boundary",
    "updated_at"
  ],
  "properties": {
    "schema": { "const": "agoragentic.agent-scorecard.v1" },
    "scorecard_id": { "type": "string", "minLength": 1 },
    "target_type": {
      "type": "string",
      "enum": [
        "agent_os_deployment",
        "seller_os_listing",
        "x402_service",
        "agent_template",
        "context_packet",
        "run",
        "deployment",
        "listing",
        "template",
        "provider",
        "capability"
      ]
    },
    "canonical_target_type": {
      "type": "string",
      "enum": [
        "run",
        "deployment",
        "listing",
        "x402_service",
        "template",
        "context_packet",
        "provider",
        "capability"
      ]
    },
    "target_id": { "type": "string", "minLength": 1 },
    "rubric_id": { "type": ["string", "null"] },
    "score": { "type": "number", "minimum": 0, "maximum": 100 },
    "score_band": {
      "type": "string",
      "enum": ["excellent", "good", "warning", "blocked", "unknown"]
    },
    "score_caps": {
      "type": "array",
      "items": { "type": "string" }
    },
    "evidence_state": {
      "type": "string",
      "enum": [
        "unknown",
        "insufficient_evidence",
        "receipt_backed",
        "canary_backed",
        "paid_canary_backed",
        "failed_evidence",
        "blocked_by_policy"
      ]
    },
    "evidence_completeness_state": {
      "type": "string",
      "enum": ["complete", "partial", "missing", "conflicting", "unknown"]
    },
    "receipt_quality": { "type": "number", "minimum": 0, "maximum": 1 },
    "canary_success_rate": { "type": "number", "minimum": 0, "maximum": 1 },
    "paid_canary_success_rate": { "type": "number", "minimum": 0, "maximum": 1 },
    "buyer_repeat_usage": { "type": "number", "minimum": 0, "maximum": 1 },
    "revenue_usdc": { "type": "number", "minimum": 0 },
    "cost_usdc": { "type": "number", "minimum": 0 },
    "latency_ms": { "type": ["number", "null"], "minimum": 0 },
    "approval_rate": { "type": "number", "minimum": 0, "maximum": 1 },
    "review_required_rate": { "type": "number", "minimum": 0, "maximum": 1 },
    "refund_rate": { "type": "number", "minimum": 0, "maximum": 1 },
    "failure_rate": { "type": "number", "minimum": 0, "maximum": 1 },
    "policy_violation_count": { "type": "integer", "minimum": 0 },
    "trap_block_count": { "type": "integer", "minimum": 0 },
    "diagnostic_status": {
      "type": "string",
      "enum": [
        "diagnostic_not_run",
        "diagnostic_pending",
        "diagnostic_passed",
        "diagnostic_warning",
        "diagnostic_failed",
        "diagnostic_insufficient_evidence",
        "unknown"
      ]
    },
    "rubric_score": { "type": "number", "minimum": 0, "maximum": 1 },
    "rubric_evaluation": { "type": "object" },
    "evidence_receipts": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["receipt_id", "receipt_type", "status"],
        "properties": {
          "receipt_id": { "type": ["string", "null"] },
          "receipt_type": { "type": "string" },
          "status": { "type": "string" },
          "verified": { "type": "boolean" },
          "paid_canary": { "type": "boolean" },
          "canary": { "type": "boolean" }
        },
        "additionalProperties": true
      }
    },
    "evidence_sources": {
      "type": "array",
      "items": { "type": "string" }
    },
    "memory_candidate_count": { "type": "integer", "minimum": 0 },
    "approved_memory_candidate_count": { "type": "integer", "minimum": 0 },
    "rejected_memory_candidate_count": { "type": "integer", "minimum": 0 },
    "blocked_memory_candidate_count": { "type": "integer", "minimum": 0 },
    "skill_candidate_count": { "type": "integer", "minimum": 0 },
    "learning_signal": {
      "type": "object",
      "additionalProperties": true
    },
    "owner_approved_public_exposure": { "type": "boolean" },
    "public_exposure": { "type": "boolean" },
    "deployment_contract_present": { "type": ["boolean", "null"] },
    "private_context_exposed": { "type": "boolean" },
    "public_safe": { "type": "boolean" },
    "private_context_excluded": { "type": "boolean" },
    "advisory_only": { "const": true },
    "trust_statement": {
      "type": "object",
      "required": ["trusted", "reason"],
      "properties": {
        "trusted": { "const": false },
        "reason": { "type": "string" }
      },
      "additionalProperties": true
    },
    "readiness": {
      "type": "object",
      "required": ["ok", "blockers", "warnings", "ready_status"],
      "properties": {
        "ok": { "type": "boolean" },
        "blockers": { "type": "array", "items": { "type": "string" } },
        "warnings": { "type": "array", "items": { "type": "string" } },
        "ready_status": { "type": "string", "enum": ["blocked", "unknown", "evidence_backed"] }
      },
      "additionalProperties": true
    },
    "public_boundary": {
      "type": "object",
      "required": [
        "scorecard_only",
        "trusted_status_mutated",
        "routing_weight_changed",
        "owner_approval_overridden",
        "marketplace_publication_triggered",
        "x402_route_created",
        "agent_spawned",
        "settlement_triggered",
        "wallet_spend_triggered",
        "policy_changed"
      ],
      "properties": {
        "scorecard_only": { "const": true },
        "trusted_status_mutated": { "const": false },
        "routing_weight_changed": { "const": false },
        "owner_approval_overridden": { "const": false },
        "marketplace_publication_triggered": { "const": false },
        "x402_route_created": { "const": false },
        "agent_spawned": { "const": false },
        "settlement_triggered": { "const": false },
        "wallet_spend_triggered": { "const": false },
        "policy_changed": { "const": false }
      }
    },
    "updated_at": { "type": "string", "format": "date-time" }
  }
}
