MB-X Bilibili Pipeline
6 days ago fa807de6423d5a2b3781bc9ecdb12a8142358070
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
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "SHARED_CONTENT_PUBLISHER_CONFIG_V3",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "identity", "roots", "expected", "commit", "test_control"],
  "$defs": {
    "sha256": {"type": "string", "pattern": "^[0-9A-F]{64}$"},
    "releaseId": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "positiveInt": {"type": "integer", "minimum": 1},
    "relativePath": {"type": "string", "minLength": 1, "pattern": "^(?![/\\\\])(?!.*(?:^|[/\\\\])\\.\\.?($|[/\\\\])).+$"},
    "formalRow": {
      "type": "object", "additionalProperties": false,
      "required": ["member_id", "formal_relative_path", "artifact_type", "bytes", "sha256"],
      "properties": {
        "member_id": {"type": "string", "minLength": 1},
        "formal_relative_path": {"$ref": "#/$defs/relativePath"},
        "artifact_type": {"type": "string", "minLength": 1},
        "bytes": {"$ref": "#/$defs/positiveInt"},
        "sha256": {"$ref": "#/$defs/sha256"}
      }
    },
    "artifactRow": {
      "type": "object", "additionalProperties": false,
      "required": ["member_id", "relative_path", "formal_relative_path", "artifact_type", "commit_role", "bytes", "sha256"],
      "properties": {
        "member_id": {"type": "string", "minLength": 1},
        "relative_path": {"$ref": "#/$defs/relativePath"},
        "formal_relative_path": {"$ref": "#/$defs/relativePath"},
        "artifact_type": {"type": "string", "minLength": 1},
        "commit_role": {"enum": ["RELEASE_MEMBER", "CASE_CURRENT_INDEX"]},
        "bytes": {"$ref": "#/$defs/positiveInt"},
        "sha256": {"$ref": "#/$defs/sha256"}
      }
    },
    "destinationState": {
      "oneOf": [
        {
          "type": "object", "additionalProperties": false,
          "required": ["member_id", "formal_relative_path", "present", "object_type", "reparse", "bytes", "sha256"],
          "properties": {
            "member_id": {"type": "string", "minLength": 1},
            "formal_relative_path": {"$ref": "#/$defs/relativePath"},
            "present": {"const": true}, "object_type": {"const": "FILE"}, "reparse": {"const": false},
            "bytes": {"$ref": "#/$defs/positiveInt"}, "sha256": {"$ref": "#/$defs/sha256"}
          }
        },
        {
          "type": "object", "additionalProperties": false,
          "required": ["member_id", "formal_relative_path", "present", "object_type", "reparse", "bytes", "sha256"],
          "properties": {
            "member_id": {"type": "string", "minLength": 1},
            "formal_relative_path": {"$ref": "#/$defs/relativePath"},
            "present": {"const": false}, "object_type": {"const": "ABSENT"}, "reparse": {"const": false},
            "bytes": {"type": "null"}, "sha256": {"type": "null"}
          }
        }
      ]
    },
    "historyRow": {
      "type": "object", "additionalProperties": false,
      "required": ["relative_path", "bytes", "sha256"],
      "properties": {
        "relative_path": {"$ref": "#/$defs/relativePath"},
        "bytes": {"$ref": "#/$defs/positiveInt"},
        "sha256": {"$ref": "#/$defs/sha256"}
      }
    },
    "check": {
      "type": "object", "additionalProperties": false,
      "required": ["relative_path", "required_utf8_substrings"],
      "properties": {
        "relative_path": {"$ref": "#/$defs/relativePath"},
        "required_utf8_substrings": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
      }
    },
    "indexExpectation": {
      "type": "object", "additionalProperties": false,
      "required": ["bytes", "sha256", "required_utf8_substrings"],
      "properties": {
        "bytes": {"$ref": "#/$defs/positiveInt"}, "sha256": {"$ref": "#/$defs/sha256"},
        "required_utf8_substrings": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
      }
    }
  },
  "properties": {
    "schema_version": {"const": "SHARED_CONTENT_PUBLISHER_CONFIG_V3"},
    "identity": {
      "type": "object", "additionalProperties": false,
      "required": ["industry", "task_id", "case_id", "batch_id", "run_id", "attempt_id", "canonical_audit_id", "review_handoff_id", "release_id", "prior_release_id", "candidate_release_set_sha256", "operator"],
      "properties": {
        "industry": {"type": "string", "minLength": 1}, "task_id": {"type": "string", "minLength": 1},
        "case_id": {"type": "string", "minLength": 1}, "batch_id": {"type": "string", "minLength": 1},
        "run_id": {"type": "string", "minLength": 1}, "attempt_id": {"type": "string", "minLength": 1},
        "canonical_audit_id": {"type": "string", "pattern": "^AUDIT-"},
        "review_handoff_id": {"type": "string", "pattern": "^HANDOFF-"},
        "release_id": {"$ref": "#/$defs/releaseId"}, "prior_release_id": {"$ref": "#/$defs/releaseId"},
        "candidate_release_set_sha256": {"$ref": "#/$defs/sha256"}, "operator": {"type": "string", "minLength": 1}
      }
    },
    "roots": {
      "type": "object", "additionalProperties": false,
      "required": ["operation_root", "resolved_root", "volume_identity", "candidate_root", "case_current_index_path", "result_current_index_path", "ledger_path", "lock_path", "attempt_receipt_root", "history_root", "current_state_relative_path"],
      "properties": {
        "operation_root": {"type": "string", "minLength": 1}, "resolved_root": {"type": "string", "minLength": 1},
        "volume_identity": {"type": "string", "minLength": 1}, "candidate_root": {"$ref": "#/$defs/relativePath"},
        "case_current_index_path": {"$ref": "#/$defs/relativePath"}, "result_current_index_path": {"$ref": "#/$defs/relativePath"},
        "ledger_path": {"$ref": "#/$defs/relativePath"}, "lock_path": {"$ref": "#/$defs/relativePath"},
        "attempt_receipt_root": {"$ref": "#/$defs/relativePath"}, "history_root": {"$ref": "#/$defs/relativePath"},
        "current_state_relative_path": {"$ref": "#/$defs/relativePath"}
      }
    },
    "expected": {
      "type": "object", "additionalProperties": false,
      "required": ["ledger", "candidate", "prior", "destination_prior", "history", "case_current_index", "result_current_index", "current_state"],
      "properties": {
        "ledger": {
          "type": "object", "additionalProperties": false,
          "required": ["bytes", "sha256", "next_event_seq", "next_attempt_seq", "prior_attempt_id", "prior_terminal_state"],
          "properties": {
            "bytes": {"$ref": "#/$defs/positiveInt"}, "sha256": {"$ref": "#/$defs/sha256"},
            "next_event_seq": {"$ref": "#/$defs/positiveInt"}, "next_attempt_seq": {"$ref": "#/$defs/positiveInt"},
            "prior_attempt_id": {"type": "string", "minLength": 1}, "prior_terminal_state": {"type": "string", "minLength": 1}
          }
        },
        "candidate": {
          "type": "object", "additionalProperties": false,
          "required": ["manifest_relative_path", "manifest_bytes", "manifest_sha256", "current_manifest_relative_path", "current_manifest_bytes", "current_manifest_sha256", "manifest_self_formal_relative_path", "rows", "link_checks", "evidence_checks"],
          "properties": {
            "manifest_relative_path": {"$ref": "#/$defs/relativePath"}, "manifest_bytes": {"$ref": "#/$defs/positiveInt"},
            "manifest_sha256": {"$ref": "#/$defs/sha256"}, "current_manifest_relative_path": {"$ref": "#/$defs/relativePath"},
            "current_manifest_bytes": {"$ref": "#/$defs/positiveInt"}, "current_manifest_sha256": {"$ref": "#/$defs/sha256"},
            "manifest_self_formal_relative_path": {"$ref": "#/$defs/relativePath"},
            "rows": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/artifactRow"}},
            "link_checks": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/check"}},
            "evidence_checks": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/check"}}
          }
        },
        "prior": {
          "oneOf": [
            {
              "type": "object", "additionalProperties": false,
              "required": ["release_id", "manifest_formal_relative_path", "manifest_bytes", "manifest_sha256", "manifest_self_formal_relative_path", "release_set_sha256", "rows"],
              "properties": {
                "release_id": {"$ref": "#/$defs/releaseId"}, "manifest_formal_relative_path": {"$ref": "#/$defs/relativePath"},
                "manifest_bytes": {"$ref": "#/$defs/positiveInt"}, "manifest_sha256": {"$ref": "#/$defs/sha256"},
                "manifest_self_formal_relative_path": {"$ref": "#/$defs/relativePath"}, "release_set_sha256": {"$ref": "#/$defs/sha256"},
                "rows": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/formalRow"}}
              }
            },
            {
              "type": "object", "additionalProperties": false,
              "required": ["mode", "release_id", "release_set_sha256", "rows"],
              "properties": {
                "mode": {"const": "ABSENT_GENESIS_V1"},
                "release_id": {"$ref": "#/$defs/releaseId"},
                "release_set_sha256": {"$ref": "#/$defs/sha256"},
                "rows": {"type": "array", "maxItems": 0}
              }
            }
          ]
        },
        "destination_prior": {"type": "array", "minItems": 2, "items": {"$ref": "#/$defs/destinationState"}},
        "history": {
          "type": "object", "additionalProperties": false,
          "required": ["rows", "minimum_long_paths", "long_path_threshold"],
          "properties": {
            "rows": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/historyRow"}},
            "minimum_long_paths": {"type": "integer", "minimum": 0}, "long_path_threshold": {"$ref": "#/$defs/positiveInt"}
          }
        },
        "case_current_index": {
          "oneOf": [
            {"$ref": "#/$defs/indexExpectation"},
            {
              "type": "object", "additionalProperties": false,
              "required": ["present"], "properties": {"present": {"const": false}}
            }
          ]
        },
        "result_current_index": {
          "oneOf": [
            {
              "type": "object", "additionalProperties": false,
              "required": ["member_id", "formal_relative_path", "artifact_type", "bytes", "sha256", "required_utf8_substrings"],
              "properties": {
                "member_id": {"type": "string", "minLength": 1}, "formal_relative_path": {"$ref": "#/$defs/relativePath"},
                "artifact_type": {"type": "string", "minLength": 1}, "bytes": {"$ref": "#/$defs/positiveInt"},
                "sha256": {"$ref": "#/$defs/sha256"},
                "required_utf8_substrings": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
              }
            },
            {
              "type": "object", "additionalProperties": false,
              "required": ["member_id", "formal_relative_path", "artifact_type", "present", "required_utf8_substrings"],
              "properties": {
                "member_id": {"type": "string", "minLength": 1}, "formal_relative_path": {"$ref": "#/$defs/relativePath"},
                "artifact_type": {"type": "string", "minLength": 1}, "present": {"const": false},
                "required_utf8_substrings": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
              }
            }
          ]
        },
        "current_state": {
          "oneOf": [
            {
              "type": "object", "additionalProperties": false,
              "required": ["bytes", "sha256", "semantic_field", "semantic_value", "status_field", "status_value", "exit_code_field", "exit_code_value"],
              "properties": {
                "bytes": {"$ref": "#/$defs/positiveInt"}, "sha256": {"$ref": "#/$defs/sha256"},
                "semantic_field": {"type": "string", "minLength": 1}, "semantic_value": {},
                "status_field": {"type": "string", "minLength": 1}, "status_value": {},
                "exit_code_field": {"type": "string", "minLength": 1}, "exit_code_value": {}
              }
            },
            {
              "type": "object", "additionalProperties": false,
              "required": ["present"], "properties": {"present": {"const": false}}
            }
          ]
        }
      }
    },
    "commit": {
      "type": "object", "additionalProperties": false,
      "required": ["strategy", "staging_relative_path"],
      "properties": {
        "strategy": {"const": "DIRECT_STABLE_PATH_SET_V1"},
        "staging_relative_path": {"$ref": "#/$defs/relativePath"}
      }
    },
    "test_control": {
      "type": "object", "additionalProperties": false,
      "required": ["environment", "fault", "race_marker_relative_path", "fault_commit_after"],
      "properties": {
        "environment": {"enum": ["PRODUCTION", "ISOLATED_TEST"]},
        "fault": {"enum": ["NONE", "PAUSE_AFTER_LOCK", "DIRECT_FAIL_AFTER_COMMIT", "DIRECT_EXTRA_TARGET_AFTER_COMMIT", "DIRECT_PAUSE_AFTER_COMMIT", "DIRECT_INTERRUPT_AFTER_SNAPSHOT", "DIRECT_INTERRUPT_AFTER_PREPARED", "DIRECT_INTERRUPT_AFTER_VERIFIED", "DIRECT_INTERRUPT_BEFORE_FIRST_DESTINATION", "DIRECT_INTERRUPT_AFTER_COMMIT", "DIRECT_INTERRUPT_PREANCHOR", "DIRECT_IO_ERROR_PREANCHOR"]},
        "race_marker_relative_path": {"type": "string"},
        "fault_commit_after": {"type": ["integer", "null"], "minimum": 1}
      }
    }
  }
}