File size: 4,100 Bytes
542b994
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://a-11-oy.com/schemas/quant-claims/claim.v1.schema.json",
  "title": "SZL Quant External Claim Resolution v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "claim_id",
    "claim",
    "external_report",
    "protocol",
    "required_hardware_class",
    "measurement_receipt_id",
    "blocked_by",
    "szl_label",
    "szl_measured",
    "measurement_gate"
  ],
  "properties": {
    "schema_version": {"const": "szl.quant.claim/v1"},
    "claim_id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]{2,95}$"},
    "claim": {"type": "string", "minLength": 1, "maxLength": 240},
    "external_report": {
      "type": "object",
      "additionalProperties": false,
      "required": ["value", "units", "scope", "source"],
      "properties": {
        "value": {"type": "string", "minLength": 1, "maxLength": 120},
        "units": {"type": "string", "minLength": 1, "maxLength": 80},
        "scope": {"type": "string", "minLength": 1, "maxLength": 500},
        "source": {
          "type": "object",
          "additionalProperties": false,
          "required": ["organization", "title", "url", "kind"],
          "properties": {
            "organization": {"type": "string", "minLength": 1, "maxLength": 120},
            "title": {"type": "string", "minLength": 1, "maxLength": 240},
            "url": {"type": "string", "pattern": "^https://"},
            "kind": {
              "enum": ["OFFICIAL_VENDOR_REPORT", "OFFICIAL_RESEARCH", "OFFICIAL_DOCS", "OFFICIAL_MODEL_CARD", "ACADEMIC_PAPER"]
            }
          }
        }
      }
    },
    "protocol": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "metric", "unit", "description", "requires_energy"],
      "properties": {
        "id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]{2,95}$"},
        "metric": {"type": "string", "pattern": "^[a-z][a-z0-9_]{2,95}$"},
        "unit": {"type": "string", "minLength": 1, "maxLength": 80},
        "description": {"type": "string", "minLength": 1, "maxLength": 500},
        "requires_energy": {"type": "boolean"}
      }
    },
    "required_hardware_class": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]{2,95}$"},
    "measurement_receipt_id": {
      "oneOf": [
        {"type": "null"},
        {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}
      ]
    },
    "blocked_by": {
      "type": "array",
      "minItems": 1,
      "items": {"type": "string", "minLength": 1, "maxLength": 240},
      "uniqueItems": true
    },
    "szl_label": {"enum": ["ROADMAP", "MEASURED", "UNVERIFIED", "CONFLICT"]},
    "szl_measured": {
      "oneOf": [
        {"type": "null"},
        {
          "type": "object",
          "additionalProperties": false,
          "required": ["metric", "value", "unit", "estimator", "confidence_interval", "summary_tolerance"],
          "properties": {
            "metric": {"type": "string"},
            "value": {"type": "number"},
            "unit": {"type": "string"},
            "estimator": {"enum": ["mean", "median"]},
            "summary_tolerance": {"type": "number", "minimum": 0},
            "confidence_interval": {
              "oneOf": [
                {"type": "null"},
                {
                  "type": "array",
                  "prefixItems": [{"type": "number"}, {"type": "number"}],
                  "items": false,
                  "minItems": 2,
                  "maxItems": 2
                }
              ]
            }
          }
        }
      ]
    },
    "measurement_gate": {
      "type": "object",
      "additionalProperties": false,
      "required": ["promoted", "reason", "receipt_id"],
      "properties": {
        "promoted": {"type": "boolean"},
        "reason": {"type": "string", "minLength": 1, "maxLength": 240},
        "receipt_id": {
          "oneOf": [
            {"type": "null"},
            {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"}
          ]
        }
      }
    }
  }
}