Repository navigation
Expand file tree
/
Copy pathexport.schema.json
More file actions
284 lines (284 loc) · 11.5 KB
/
Copy pathexport.schema.json
File metadata and controls
284 lines (284 loc) · 11.5 KB
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "coding-study progress export",
"description": "The file `cstudy export` writes and `cstudy import` reads. Any 1.x imports an export of any earlier 1.x, so a table or a column that a later schema added may be missing from an older export. Spec: docs/specs/cli.md#cstudy-export",
"type": "object",
"additionalProperties": false,
"required": ["format", "version", "schema_version", "exported_at", "tables"],
"properties": {
"format": { "const": "coding-study-progress" },
"version": { "description": "Changes only when the export changes incompatibly", "const": 1 },
"schema_version": {
"description": "The last migration applied to the database the rows came from",
"type": "integer",
"minimum": 1
},
"exported_at": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"
},
"tables": {
"description": "Every table of progress.db but `meta` and the AI preview's `ai_calls` and `ai_consents`, this machine's state, each as its rows in insertion order",
"type": "object",
"additionalProperties": false,
"properties": {
"attempts": { "type": "array", "items": { "$ref": "#/$defs/attempt" } },
"test_runs": { "type": "array", "items": { "$ref": "#/$defs/test_run" } },
"schedule": { "type": "array", "items": { "$ref": "#/$defs/schedule_entry" } },
"bench_runs": { "type": "array", "items": { "$ref": "#/$defs/bench_run" } },
"submissions": { "type": "array", "items": { "$ref": "#/$defs/submission" } },
"level_unlocks": { "type": "array", "items": { "$ref": "#/$defs/level_unlock" } },
"guide_reads": { "type": "array", "items": { "$ref": "#/$defs/guide_read" } },
"ai_reviews": { "type": "array", "items": { "$ref": "#/$defs/ai_review" } }
}
}
},
"$defs": {
"id": { "type": "integer", "minimum": 1 },
"count": { "type": "integer", "minimum": 0 },
"level": { "type": "integer", "minimum": 1 },
"text": { "type": "string" },
"optional_text": { "type": ["string", "null"] },
"optional_count": { "type": ["integer", "null"], "minimum": 0 },
"optional_level": { "type": ["integer", "null"], "minimum": 1 },
"number": { "type": "number" },
"optional_number": { "type": ["number", "null"] },
"attempt": {
"description": "A row of `attempts`; `levels_passed` and `levels_total` are in an export of schema 6 or later",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"slug",
"lang",
"mode",
"status",
"started_at",
"ended_at",
"first_pass_at",
"time_limit_s",
"rating",
"grade",
"hints_used",
"solution_revealed",
"level_unlocked",
"stub_path",
"archive_path",
"notes"
],
"properties": {
"id": { "$ref": "#/$defs/id" },
"slug": { "$ref": "#/$defs/text" },
"lang": { "description": "Null when the problem is not autograded", "enum": ["python", "typescript", "java", "kotlin", "go", "rust", null] },
"mode": { "enum": ["new", "review", "mock"] },
"status": { "enum": ["in_progress", "passed", "failed", "abandoned"] },
"started_at": { "$ref": "#/$defs/text" },
"ended_at": { "$ref": "#/$defs/optional_text" },
"first_pass_at": { "$ref": "#/$defs/optional_text" },
"time_limit_s": { "$ref": "#/$defs/optional_count" },
"rating": { "enum": ["easy", "ok", "hard", null] },
"grade": { "type": ["integer", "null"], "minimum": 0, "maximum": 3 },
"hints_used": { "$ref": "#/$defs/count" },
"solution_revealed": { "$ref": "#/$defs/count" },
"level_unlocked": { "$ref": "#/$defs/optional_level" },
"stub_path": { "$ref": "#/$defs/optional_text" },
"archive_path": { "$ref": "#/$defs/optional_text" },
"notes": { "$ref": "#/$defs/optional_text" },
"levels_passed": { "$ref": "#/$defs/optional_count" },
"levels_total": { "$ref": "#/$defs/optional_count" }
}
},
"test_run": {
"description": "A row of `test_runs`; `levels_passed` is in an export of schema 6 or later",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"attempt_id",
"ran_at",
"code_hash",
"total",
"passed",
"failed",
"errored",
"timed_out",
"tle",
"time_limit",
"duration_ms"
],
"properties": {
"id": { "$ref": "#/$defs/id" },
"attempt_id": { "$ref": "#/$defs/id" },
"ran_at": { "$ref": "#/$defs/text" },
"code_hash": { "$ref": "#/$defs/text" },
"total": { "$ref": "#/$defs/count" },
"passed": { "$ref": "#/$defs/count" },
"failed": { "$ref": "#/$defs/count" },
"errored": { "$ref": "#/$defs/count" },
"timed_out": { "$ref": "#/$defs/count" },
"tle": { "$ref": "#/$defs/count" },
"time_limit": { "description": "`5x`, `1500ms`, or null when off", "$ref": "#/$defs/optional_text" },
"duration_ms": { "$ref": "#/$defs/count" },
"levels_passed": { "$ref": "#/$defs/optional_count" }
}
},
"schedule_entry": {
"description": "A row of `schedule`; `levels` is in an export of schema 6 or later",
"type": "object",
"additionalProperties": false,
"required": ["slug", "ease", "interval_days", "reps", "lapses", "due_on", "last_grade", "updated_at"],
"properties": {
"slug": { "$ref": "#/$defs/text" },
"ease": { "$ref": "#/$defs/number" },
"interval_days": { "$ref": "#/$defs/count" },
"reps": { "$ref": "#/$defs/count" },
"lapses": { "$ref": "#/$defs/count" },
"due_on": { "$ref": "#/$defs/text" },
"last_grade": { "type": "integer", "minimum": 0, "maximum": 3 },
"updated_at": { "$ref": "#/$defs/text" },
"levels": { "description": "A JSON array as text, from level 2; null before", "$ref": "#/$defs/optional_text" }
}
},
"bench_run": {
"description": "A row of `bench_runs`; `sizes`, `results` and `env` hold JSON as text",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"attempt_id",
"slug",
"lang",
"ran_at",
"code_hash",
"sizes",
"results",
"user_time_band",
"user_mem_band",
"slope",
"r2",
"reference_id",
"ratio",
"verdict",
"confidence",
"env"
],
"properties": {
"id": { "$ref": "#/$defs/id" },
"attempt_id": { "description": "Null for a run of the references alone", "type": ["integer", "null"], "minimum": 1 },
"slug": { "$ref": "#/$defs/text" },
"lang": { "$ref": "#/$defs/text" },
"ran_at": { "$ref": "#/$defs/text" },
"code_hash": { "$ref": "#/$defs/optional_text" },
"sizes": { "$ref": "#/$defs/text" },
"results": { "$ref": "#/$defs/text" },
"user_time_band": { "$ref": "#/$defs/optional_text" },
"user_mem_band": { "$ref": "#/$defs/optional_text" },
"slope": { "$ref": "#/$defs/optional_number" },
"r2": { "$ref": "#/$defs/optional_number" },
"reference_id": { "$ref": "#/$defs/optional_text" },
"ratio": { "$ref": "#/$defs/optional_number" },
"verdict": { "enum": ["optimal", "near-optimal", "suboptimal", "unknown"] },
"confidence": { "enum": ["high", "medium", "low"] },
"env": { "$ref": "#/$defs/text" }
}
},
"submission": {
"description": "A row of `submissions`; `levels` holds JSON as text",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"attempt_id",
"submitted_at",
"code_hash",
"graded_up_to",
"every_level",
"levels",
"total",
"passed",
"failed",
"errored",
"timed_out",
"duration_ms"
],
"properties": {
"id": { "$ref": "#/$defs/id" },
"attempt_id": { "$ref": "#/$defs/id" },
"submitted_at": { "$ref": "#/$defs/text" },
"code_hash": { "$ref": "#/$defs/text" },
"graded_up_to": { "$ref": "#/$defs/level" },
"every_level": { "description": "1 when graded_up_to was the unlocked level, else 0", "enum": [0, 1] },
"levels": { "$ref": "#/$defs/text" },
"total": { "$ref": "#/$defs/count" },
"passed": { "$ref": "#/$defs/count" },
"failed": { "$ref": "#/$defs/count" },
"errored": { "$ref": "#/$defs/count" },
"timed_out": { "$ref": "#/$defs/count" },
"duration_ms": { "$ref": "#/$defs/count" }
}
},
"level_unlock": {
"description": "A row of `level_unlocks`",
"type": "object",
"additionalProperties": false,
"required": ["attempt_id", "level", "unlocked_at"],
"properties": {
"attempt_id": { "$ref": "#/$defs/id" },
"level": { "$ref": "#/$defs/level" },
"unlocked_at": { "$ref": "#/$defs/text" }
}
},
"guide_read": {
"description": "A row of `guide_reads`",
"type": "object",
"additionalProperties": false,
"required": ["slug", "read_at"],
"properties": {
"slug": { "$ref": "#/$defs/text" },
"read_at": { "description": "The first time the guide was marked read", "$ref": "#/$defs/text" }
}
},
"ai_review": {
"description": "A row of `ai_reviews`, in an export of schema 8 or later: an AI review record, a public record of format 1 (docs/specs/ai.md#the-record); `items` holds JSON as text",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"attempt_id",
"format",
"created_at",
"provider",
"model",
"prompt_version",
"rubric_sha256",
"notes_sha256",
"items",
"summary",
"quotes_dropped",
"input_tokens",
"output_tokens",
"cost_usd",
"dismissed_at"
],
"properties": {
"id": { "$ref": "#/$defs/id" },
"attempt_id": { "$ref": "#/$defs/id" },
"format": { "description": "The record's format; a later format is a new value", "type": "integer", "minimum": 1 },
"created_at": { "$ref": "#/$defs/text" },
"provider": { "description": "anthropic, google, openai or openrouter when written; kept as text so a later provider imports", "$ref": "#/$defs/text" },
"model": { "$ref": "#/$defs/text" },
"prompt_version": { "description": "The instructions' version, such as review-1", "$ref": "#/$defs/text" },
"rubric_sha256": { "description": "The rubric version: the SHA-256 of rubric.md as reviewed against", "$ref": "#/$defs/sha256" },
"notes_sha256": { "description": "The SHA-256 of the notes reviewed", "$ref": "#/$defs/sha256" },
"items": { "description": "JSON: [{number, area, criterion, verdict, evidence, gaps}] in rubric order", "$ref": "#/$defs/text" },
"summary": { "$ref": "#/$defs/text" },
"quotes_dropped": { "$ref": "#/$defs/count" },
"input_tokens": { "$ref": "#/$defs/optional_count" },
"output_tokens": { "$ref": "#/$defs/optional_count" },
"cost_usd": { "description": "As the provider reported it, in US dollars", "$ref": "#/$defs/optional_number" },
"dismissed_at": { "$ref": "#/$defs/optional_text" }
}
},
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
}
}