{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Deep Agentic Rubric Assessment",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "rubric_version",
    "merchant",
    "assessed_at",
    "deep_score",
    "checks"
  ],
  "properties": {
    "rubric_version": {
      "const": "dar-0.2"
    },
    "merchant": {
      "type": "string",
      "minLength": 3
    },
    "assessed_at": {
      "type": "string",
      "format": "date-time"
    },
    "deep_score": {
      "type": "null"
    },
    "checks": {
      "type": "array",
      "minItems": 1,
      "maxItems": 88,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/check"
      }
    }
  },
  "$defs": {
    "check": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "result",
        "evidence_level",
        "observed_at",
        "environment",
        "method",
        "source_url",
        "artifacts",
        "metrics"
      ],
      "properties": {
        "id": {
          "enum": [
            "CAT-01",
            "CAT-02",
            "CAT-03",
            "CAT-04",
            "CHK-01",
            "CHK-02",
            "CHK-03",
            "CHK-04",
            "AUTH-01",
            "AUTH-02",
            "AUTH-03",
            "AUTH-04",
            "IDEM-01",
            "IDEM-02",
            "IDEM-03",
            "IDEM-04",
            "EVT-01",
            "EVT-02",
            "EVT-03",
            "EVT-04",
            "OPS-01",
            "OPS-02",
            "OPS-03",
            "OPS-04",
            "DISC-01",
            "DISC-02",
            "DISC-03",
            "DISC-04",
            "HTML-01",
            "HTML-02",
            "HTML-03",
            "HTML-04",
            "BROW-01",
            "BROW-02",
            "BROW-03",
            "BROW-04",
            "FACT-01",
            "FACT-02",
            "FACT-03",
            "FACT-04",
            "FIND-01",
            "FIND-02",
            "FIND-03",
            "FIND-04",
            "FORM-01",
            "FORM-02",
            "FORM-03",
            "FORM-04",
            "CART-01",
            "CART-02",
            "CART-03",
            "CART-04",
            "SHIP-01",
            "SHIP-02",
            "SHIP-03",
            "SHIP-04",
            "ACCT-01",
            "ACCT-02",
            "ACCT-03",
            "ACCT-04",
            "PRIV-01",
            "PRIV-02",
            "PRIV-03",
            "PRIV-04",
            "SEC-01",
            "SEC-02",
            "SEC-03",
            "SEC-04",
            "TOOL-01",
            "TOOL-02",
            "TOOL-03",
            "TOOL-04",
            "REL-01",
            "REL-02",
            "REL-03",
            "REL-04",
            "LOC-01",
            "LOC-02",
            "LOC-03",
            "LOC-04",
            "FDBK-01",
            "FDBK-02",
            "FDBK-03",
            "FDBK-04",
            "EVAL-01",
            "EVAL-02",
            "EVAL-03",
            "EVAL-04"
          ]
        },
        "result": {
          "enum": [
            "pass",
            "fail",
            "unknown",
            "not_applicable"
          ]
        },
        "evidence_level": {
          "enum": [
            "verified",
            "documented",
            "claimed",
            "none"
          ]
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        },
        "environment": {
          "enum": [
            "public",
            "sandbox",
            "documentation",
            "audit"
          ]
        },
        "method": {
          "type": "string",
          "minLength": 1
        },
        "source_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "artifacts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metrics": {
          "type": "object"
        },
        "scope_reason": {
          "type": "string",
          "minLength": 1
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "result": {
                "enum": [
                  "pass",
                  "fail"
                ]
              }
            },
            "required": [
              "result"
            ]
          },
          "then": {
            "properties": {
              "evidence_level": {
                "const": "verified"
              },
              "environment": {
                "enum": [
                  "public",
                  "sandbox",
                  "audit"
                ]
              },
              "artifacts": {
                "type": "array",
                "minItems": 1
              },
              "metrics": {
                "type": "object",
                "minProperties": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "result": {
                "const": "not_applicable"
              }
            },
            "required": [
              "result"
            ]
          },
          "then": {
            "required": [
              "scope_reason"
            ]
          }
        }
      ]
    }
  }
}
