File size: 8,831 Bytes
e1ced61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://explicit-learning.local/schemas/intervention_group.schema.json",
  "title": "Question-preserving visual intervention group",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "group_id",
    "base_id",
    "source",
    "source_revision",
    "source_native_id",
    "split",
    "subject",
    "question",
    "question_sha256",
    "choices",
    "choices_sha256",
    "full_answer_raw",
    "full_answer_canonical",
    "answer_type",
    "views",
    "provenance",
    "quality"
  ],
  "properties": {
    "schema_version": {"const": 2},
    "group_id": {"$ref": "#/$defs/sha256"},
    "base_id": {"$ref": "#/$defs/sha256"},
    "source": {"type": "string", "minLength": 1},
    "source_revision": {"type": "string", "pattern": "^[a-f0-9]{40}$"},
    "source_native_id": {"type": "string", "minLength": 1},
    "split": {"type": "string", "enum": ["train", "validation", "certified_eval"]},
    "subject": {"type": ["string", "null"]},
    "question": {"type": "string", "minLength": 1},
    "question_sha256": {"$ref": "#/$defs/sha256"},
    "choices": {
      "type": "array",
      "items": {"$ref": "#/$defs/choice"}
    },
    "choices_sha256": {"$ref": "#/$defs/sha256"},
    "full_answer_raw": {"type": ["string", "number", "boolean"]},
    "full_answer_canonical": {"type": ["string", "number", "boolean"]},
    "answer_type": {
      "type": "string",
      "enum": ["multiple_choice", "integer", "number", "expression", "short_text", "boolean"]
    },
    "dependency_depth": {"type": ["integer", "null"], "minimum": 0},
    "views": {
      "type": "array",
      "minItems": 2,
      "items": {"$ref": "#/$defs/view"}
    },
    "provenance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "resource_manifest_sha256",
        "pipeline_code_commit",
        "pipeline_config_sha256",
        "renderer_version",
        "answer_normalizer_version"
      ],
      "properties": {
        "resource_manifest_sha256": {"$ref": "#/$defs/sha256"},
        "pipeline_code_commit": {"type": "string", "pattern": "^[a-f0-9]{40}$"},
        "pipeline_config_sha256": {"$ref": "#/$defs/sha256"},
        "renderer_version": {"type": "string", "minLength": 1},
        "answer_normalizer_version": {"type": "string", "minLength": 1},
        "dependency_proposal_id": {"type": ["string", "null"]},
        "license_gate": {"type": ["string", "null"]}
      }
    },
    "quality": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "full_verified",
        "question_choices_unchanged",
        "decontaminated",
        "pixel_audit_passed",
        "artifact_free",
        "label_source",
        "certificate_valid",
        "model_agreement_is_gold"
      ],
      "properties": {
        "full_verified": {"const": true},
        "question_choices_unchanged": {"const": true},
        "decontaminated": {"const": true},
        "pixel_audit_passed": {"const": true},
        "artifact_free": {"const": true},
        "label_source": {"const": "executor_certificate"},
        "certificate_valid": {"const": true},
        "model_agreement_is_gold": {"const": false},
        "reference_executor_agreement": {"type": "boolean"}
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {"split": {"const": "certified_eval"}},
        "required": ["split"]
      },
      "then": {
        "properties": {
          "quality": {
            "required": ["reference_executor_agreement"],
            "properties": {
              "reference_executor_agreement": {"const": true}
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "choice": {
      "type": "object",
      "additionalProperties": false,
      "required": ["key", "text"],
      "properties": {
        "key": {"type": "string", "minLength": 1},
        "text": {"type": "string", "minLength": 1}
      }
    },
    "image": {
      "type": "object",
      "additionalProperties": false,
      "required": ["image_index", "path", "sha256", "width", "height"],
      "properties": {
        "image_index": {"type": "integer", "minimum": 0},
        "path": {"type": "string", "minLength": 1},
        "sha256": {"$ref": "#/$defs/sha256"},
        "width": {"type": "integer", "minimum": 1},
        "height": {"type": "integer", "minimum": 1},
        "diff_mask_path": {"type": ["string", "null"]},
        "diff_mask_sha256": {
          "anyOf": [{"$ref": "#/$defs/sha256"}, {"type": "null"}]
        }
      }
    },
    "region": {
      "type": "object",
      "additionalProperties": false,
      "required": ["region_id", "image_index", "bbox_xyxy", "source"],
      "properties": {
        "region_id": {"type": "string", "minLength": 1},
        "image_index": {"type": "integer", "minimum": 0},
        "bbox_xyxy": {
          "type": "array",
          "prefixItems": [
            {"type": "number"},
            {"type": "number"},
            {"type": "number"},
            {"type": "number"}
          ],
          "minItems": 4,
          "maxItems": 4
        },
        "source": {
          "type": "string",
          "enum": [
            "source_annotation",
            "structured_renderer",
            "paddleocr_vl_1_6",
            "classic_cv"
          ]
        }
      }
    },
    "automatedAudit": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "proposer_label_id",
        "verifier_label_id",
        "certificate_id",
        "reconciliation"
      ],
      "properties": {
        "proposer_label_id": {"type": ["string", "null"]},
        "verifier_label_id": {"type": ["string", "null"]},
        "certificate_id": {"$ref": "#/$defs/sha256"},
        "reconciliation": {
          "const": "executor_certificate_confirmed"
        }
      }
    },
    "view": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "view_id",
        "role",
        "state",
        "operator",
        "images",
        "question_sha256",
        "choices_sha256",
        "target_raw",
        "target_canonical",
        "regions",
        "render_manifest_sha256",
        "certificate_id",
        "certification_tier",
        "automated_audit"
      ],
      "properties": {
        "view_id": {"type": "string", "minLength": 1},
        "role": {
          "type": "string",
          "enum": ["POSITIVE", "TARGET_EVIDENCE", "TARGET_REFERENT", "CONTROL", "SUBSTITUTE"]
        },
        "state": {
          "type": "string",
          "enum": ["FULL", "A_SAME", "A_CHANGED", "U_MISSING", "U_INVALID"]
        },
        "operator": {
          "type": "string",
          "enum": [
            "NONE",
            "REDACT_SOLID_V1",
            "REDACT_BLUR_V1",
            "CLEAN_DELETE_V1",
            "SUBSTITUTE_V1",
            "CONTROL_MATCHED_V1"
          ]
        },
        "images": {
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "#/$defs/image"}
        },
        "question_sha256": {"$ref": "#/$defs/sha256"},
        "choices_sha256": {"$ref": "#/$defs/sha256"},
        "target_raw": {"type": ["string", "number", "boolean"]},
        "target_canonical": {"type": ["string", "number", "boolean"]},
        "regions": {
          "type": "array",
          "items": {"$ref": "#/$defs/region"}
        },
        "render_manifest_sha256": {"$ref": "#/$defs/sha256"},
        "certificate_id": {"$ref": "#/$defs/sha256"},
        "certification_tier": {
          "type": "string",
          "enum": ["C1_SOURCE_NATIVE", "C2_DUAL_COMPILED"]
        },
        "automated_audit": {"$ref": "#/$defs/automatedAudit"},
        "executor_name": {"type": ["string", "null"]},
        "executor_result_sha256": {
          "anyOf": [{"$ref": "#/$defs/sha256"}, {"type": "null"}]
        },
        "held_out_renderer": {"type": "boolean"}
      },
      "allOf": [
        {
          "if": {
            "properties": {"state": {"const": "FULL"}},
            "required": ["state"]
          },
          "then": {
            "properties": {
              "role": {"const": "POSITIVE"},
              "operator": {"const": "NONE"}
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {"enum": ["U_MISSING", "U_INVALID"]}
            },
            "required": ["state"]
          },
          "then": {
            "properties": {
              "target_raw": {"const": "<UNANSWERABLE>"},
              "target_canonical": {"const": "<UNANSWERABLE>"}
            }
          }
        }
      ]
    }
  }
}