@altnovatrail/spec 0.0.0-stage → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1844 @@
1
+ // Code generated by tools/types from format/schemas; DO NOT EDIT.
2
+
3
+ /**
4
+ * The types of the module format, major version 0, generated from the schemas of version 0.1 in
5
+ * format/schemas by tools/types (R72 and R73 in spec's docs/decisions.md): the same types as the Go
6
+ * package formatv0, by the same names. The schemas decide what is valid: a type gives the shape of
7
+ * a value alone, and code that reads a value from elsewhere checks it against its schema first. A
8
+ * field the object always holds is required; any other is optional, among them each field that only
9
+ * some branches of a schema give. The open view of each part is in open,
10
+ * `@altnovatrail/spec/formatv0/open`.
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+
15
+ // The types of canonical-view.schema.json.
16
+
17
+ /**
18
+ * CanonicalView is the type of canonical-view.schema.json.
19
+ *
20
+ * The canonical view of a module, the server part of its package (section 25 of the format text):
21
+ * each part of the module as its file gives it, a part that a module has many of as an object by
22
+ * local ID, the tier of each skill, and the numbers of every instance of each template. module-kit
23
+ * builds it from the module's folder by the format version that the manifest names, and so does
24
+ * spec's CI for the vectors of packages; sim reads it by these types. No field of it is open: the
25
+ * learner's app gets the open view of a part from the server, never the canonical view.
26
+ */
27
+ export interface CanonicalView {
28
+ /**
29
+ * The manifest, manifest.yaml. Its module_format_version names the version by which the whole
30
+ * view is read.
31
+ */
32
+ readonly manifest: Manifest;
33
+ /**
34
+ * The skill graph, skill-graph.yaml, when the module has one.
35
+ */
36
+ readonly skill_graph?: SkillGraph;
37
+ /**
38
+ * The tier of each skill of the skill graph, which section 12 computes from its prerequisites:
39
+ * there when the module has a skill graph, and only then.
40
+ */
41
+ readonly skill_tiers?: SkillTiers;
42
+ /**
43
+ * The trap catalog, traps.yaml, when the module has one.
44
+ */
45
+ readonly traps?: Traps;
46
+ /**
47
+ * The technique catalog, techniques.yaml, when the module has one.
48
+ */
49
+ readonly techniques?: Techniques;
50
+ /**
51
+ * The solving steps, solving-steps.yaml, when the module has them.
52
+ */
53
+ readonly solving_steps?: SolvingSteps;
54
+ /**
55
+ * The tasks of the module, when it has any, each under its local ID.
56
+ */
57
+ readonly tasks?: Readonly<Record<TaskID, Task>>;
58
+ /**
59
+ * The lessons of the module, when it has any, each under its local ID.
60
+ */
61
+ readonly lessons?: Readonly<Record<LessonID, Lesson>>;
62
+ /**
63
+ * The instances of the templates among the tasks, when there is one, each template's under its
64
+ * local ID. The server picks the instance of an attempt among them and puts its numbers in the
65
+ * place of the template's placeholders, and so runs no Starlark when an attempt begins.
66
+ */
67
+ readonly instances?: Readonly<Record<TaskID, readonly Numbers[]>>;
68
+ }
69
+
70
+ /**
71
+ * SkillTiers is the type of canonical-view.schema.json#/$defs/skill_tiers.
72
+ *
73
+ * The tier of every skill of a skill graph, by the skill's local ID (section 12).
74
+ */
75
+ export type SkillTiers = Readonly<Record<SkillID, number>>;
76
+
77
+ /**
78
+ * Numbers is the type of canonical-view.schema.json#/$defs/numbers.
79
+ *
80
+ * The numbers of an instance of a template: every parameter, every derived number and every result
81
+ * of the solver of the template, by its name (sections 23 and 24).
82
+ */
83
+ export type Numbers = Readonly<Record<TemplateName, number>>;
84
+
85
+ // The types of manifest.schema.json.
86
+
87
+ /**
88
+ * Manifest is the type of manifest.schema.json.
89
+ *
90
+ * The manifest of a module, manifest.yaml at the root of its folder: the format version the module
91
+ * is written in, its ID and version, what it is called and teaches, whom it is for, the bands of
92
+ * its difficulty scale, its languages, the anchor skills it builds on, the settings of its canvas,
93
+ * its authors and its license, and the templates of the rungs of its hint ladder. Every field is
94
+ * open, since the learner's app shows them.
95
+ */
96
+ export interface Manifest {
97
+ /**
98
+ * The version of the module format the module is written in, "0.1": the module is checked, built
99
+ * and run by it. It stands at the root of the manifest in every version of the format, so that a
100
+ * reader finds it before it knows which schemas to read the module by.
101
+ */
102
+ readonly module_format_version: ModuleFormatVersion;
103
+ /**
104
+ * The module's ID: novatrail/olympiad-math.
105
+ */
106
+ readonly id: ModuleID;
107
+ /**
108
+ * The module's version, X.Y.Z.
109
+ */
110
+ readonly version: ModuleVersion;
111
+ /**
112
+ * What the module is called, in its explanation language.
113
+ */
114
+ readonly title: Text;
115
+ /**
116
+ * What the module teaches.
117
+ */
118
+ readonly subject: Subject;
119
+ /**
120
+ * Whom the module is for: its age categories and, for a module written for school grades, those
121
+ * grades.
122
+ */
123
+ readonly audience: Audience;
124
+ /**
125
+ * The bands of the module's difficulty scale, from the easiest: each task names its band and a
126
+ * difficulty from 1 to 5 within it. A module with tasks has them.
127
+ */
128
+ readonly bands?: readonly Band[];
129
+ /**
130
+ * The languages of the module.
131
+ */
132
+ readonly languages: Languages;
133
+ /**
134
+ * The anchor skills of the shared taxonomy that the module's skills need: exactly those that its
135
+ * skill graph names as prerequisites. A module whose skills need none leaves this field out.
136
+ */
137
+ readonly dependencies?: readonly SharedTaxonomy[];
138
+ /**
139
+ * The settings of the module's canvas, the same for each of its tasks.
140
+ */
141
+ readonly canvas?: CanvasSettings;
142
+ /**
143
+ * Who wrote the module.
144
+ */
145
+ readonly authors: readonly Author[];
146
+ /**
147
+ * The license of the module's content: Apache-2.0 for an official module.
148
+ */
149
+ readonly license: License;
150
+ /**
151
+ * The templates of rungs 1 and 2 of the hint ladder, in order, in the module's explanation
152
+ * language: what the learner reads after a wrong answer when the tutor's question did not come or
153
+ * did not pass its checks, and neither a trap text nor a trap's advice fits. A module with an
154
+ * item with a verdict has them.
155
+ */
156
+ readonly rung_templates?: readonly Text[];
157
+ }
158
+
159
+ /**
160
+ * Audience is the type of manifest.schema.json#/properties/audience.
161
+ *
162
+ * Whom the module is for: its age categories and, for a module written for school grades, those
163
+ * grades.
164
+ */
165
+ export interface Audience {
166
+ /**
167
+ * The age categories that the module suits. The platform offers the module only to learners in
168
+ * one of them.
169
+ */
170
+ readonly age_categories: readonly AgeCategory[];
171
+ /**
172
+ * The school grades that the module is written for. A module that names them asks the learner's
173
+ * grade, and the answer may be one it does not name. Unlike the age categories, grades close
174
+ * nothing: the module and its skills stay open to a learner of any grade.
175
+ */
176
+ readonly grades?: readonly Grade[];
177
+ }
178
+
179
+ /**
180
+ * Band is the type of manifest.schema.json#/properties/bands/items.
181
+ */
182
+ export interface Band {
183
+ /**
184
+ * The band's ID, by which a task names it.
185
+ */
186
+ readonly id: BandID;
187
+ /**
188
+ * What the band is called, in the module's explanation language: Grades 1–2.
189
+ */
190
+ readonly title: Text;
191
+ /**
192
+ * The school grades the band's tasks are written for, in a module that names grades: a learner of
193
+ * one of them starts in this band.
194
+ */
195
+ readonly grades?: readonly Grade[];
196
+ }
197
+
198
+ /**
199
+ * Languages is the type of manifest.schema.json#/properties/languages.
200
+ *
201
+ * The languages of the module.
202
+ */
203
+ export interface Languages {
204
+ /**
205
+ * The explanation language: the one language in which the module explains and the tutor speaks
206
+ * with the learner. Every text of the module is in it, except the material of a language module,
207
+ * which is in its target language.
208
+ */
209
+ readonly explanation: LanguageTag;
210
+ /**
211
+ * The target language: the one that a language module teaches. Other modules have none.
212
+ */
213
+ readonly target?: LanguageTag;
214
+ }
215
+
216
+ /**
217
+ * CanvasSettings is the type of manifest.schema.json#/properties/canvas.
218
+ *
219
+ * The settings of the module's canvas, the same for each of its tasks.
220
+ */
221
+ export interface CanvasSettings {
222
+ /**
223
+ * The height in px that a digit or a letter of the learner's writing has on the crop that goes to
224
+ * be read: 32 unless given.
225
+ *
226
+ * @defaultValue 32
227
+ */
228
+ readonly digit_height?: number;
229
+ }
230
+
231
+ /**
232
+ * Author is the type of manifest.schema.json#/properties/authors/items.
233
+ */
234
+ export interface Author {
235
+ /**
236
+ * The name of an author: a person or an organization.
237
+ */
238
+ readonly name: Text;
239
+ }
240
+
241
+ // The types of common.schema.json.
242
+
243
+ /**
244
+ * ModuleFormatVersion is the type of common.schema.json#/$defs/module_format_version.
245
+ *
246
+ * A version of the module format, MAJOR.MINOR, written as a string: "0.1".
247
+ */
248
+ export type ModuleFormatVersion = string;
249
+
250
+ /**
251
+ * ModuleID is the type of common.schema.json#/$defs/module_id.
252
+ *
253
+ * The ID of a module, <publisher>/<name>, each a name in kebab-case that begins with a letter:
254
+ * novatrail/olympiad-math. The publisher owns the namespace its modules' names are in. Neither name
255
+ * is one that Windows reserves for a device, such as con or lpt1, since an ID may name a folder.
256
+ */
257
+ export type ModuleID = string;
258
+
259
+ /**
260
+ * ModuleVersion is the type of common.schema.json#/$defs/module_version.
261
+ *
262
+ * The version of a module in Semantic Versioning 2.0.0, X.Y.Z, with no pre-release and no build
263
+ * metadata, written as a string: "1.2.0".
264
+ */
265
+ export type ModuleVersion = string;
266
+
267
+ /**
268
+ * Text is the type of common.schema.json#/$defs/text.
269
+ *
270
+ * A text of the module for people to read, in its explanation language. Not empty.
271
+ */
272
+ export type Text = string;
273
+
274
+ /**
275
+ * Subject is the type of common.schema.json#/$defs/subject.
276
+ *
277
+ * The code of a subject: what a module teaches.
278
+ */
279
+ export type Subject = "mathematics" | "physics" | "writing";
280
+
281
+ /**
282
+ * AgeCategory is the type of common.schema.json#/$defs/age_category.
283
+ *
284
+ * An age category: under 13; from 13 to the age of digital consent in the learner's country; from
285
+ * that age to 18; 18 and over.
286
+ */
287
+ export type AgeCategory = "under_13" | "from_13_to_consent" | "from_consent_to_18" | "adult";
288
+
289
+ /**
290
+ * Grade is the type of common.schema.json#/$defs/grade.
291
+ *
292
+ * A school grade, from 1 to 12, as the module's author counts them: the platform does not map the
293
+ * grades of one country to another's.
294
+ */
295
+ export type Grade = number;
296
+
297
+ /**
298
+ * BandID is the type of common.schema.json#/$defs/band_id.
299
+ *
300
+ * The ID of a band of the module's difficulty scale, of the form of a local ID and unique among its
301
+ * bands. A band is no entry of the module, and no full ID names it.
302
+ */
303
+ export type BandID = LocalID;
304
+
305
+ /**
306
+ * LocalID is the type of common.schema.json#/$defs/local_id.
307
+ *
308
+ * The local ID of a skill, task, trap, technique or lesson: unique among the module's entries of
309
+ * its kind, in kebab-case, beginning with a letter, at most 64 characters, and not a name that
310
+ * Windows reserves for a device, since a local ID may name a file: counting-gaps.
311
+ */
312
+ export type LocalID = string;
313
+
314
+ /**
315
+ * LanguageTag is the type of common.schema.json#/$defs/language_tag.
316
+ *
317
+ * A language as a BCP 47 tag (RFC 5646) of a language subtag, an optional script and an optional
318
+ * region, each in the letter case of the registry: en, zh-Hans, pt-BR, es-419. Written in quotes
319
+ * when it is no, which YAML 1.1 reads as false.
320
+ */
321
+ export type LanguageTag = string;
322
+
323
+ /**
324
+ * License is the type of common.schema.json#/$defs/license.
325
+ *
326
+ * A license as an identifier of the SPDX License List, such as Apache-2.0 or CC-BY-SA-4.0: letters,
327
+ * digits, . and -.
328
+ */
329
+ export type License = string;
330
+
331
+ /**
332
+ * SkillID is the type of common.schema.json#/$defs/skill_id.
333
+ *
334
+ * The local ID of a skill.
335
+ */
336
+ export type SkillID = LocalID;
337
+
338
+ /**
339
+ * TrapID is the type of common.schema.json#/$defs/trap_id.
340
+ *
341
+ * The local ID of a trap.
342
+ */
343
+ export type TrapID = LocalID;
344
+
345
+ /**
346
+ * TechniqueID is the type of common.schema.json#/$defs/technique_id.
347
+ *
348
+ * The local ID of a technique.
349
+ */
350
+ export type TechniqueID = LocalID;
351
+
352
+ /**
353
+ * TaskID is the type of common.schema.json#/$defs/task_id.
354
+ *
355
+ * The local ID of a task.
356
+ */
357
+ export type TaskID = LocalID;
358
+
359
+ /**
360
+ * StatementPart is the type of common.schema.json#/$defs/statement_part.
361
+ *
362
+ * A part of a text that the learner reads — a statement, a solution or an explanation: a paragraph,
363
+ * or a picture with what it shows and its size.
364
+ */
365
+ export interface StatementPart {
366
+ /**
367
+ * A paragraph, as plain text.
368
+ */
369
+ readonly text?: Text;
370
+ /**
371
+ * A picture, by its path from media/.
372
+ */
373
+ readonly picture?: PicturePath;
374
+ /**
375
+ * What the picture shows, in words: a screen reader reads it, and it stands in the picture's
376
+ * place until the picture comes. Empty for a picture that only decorates.
377
+ */
378
+ readonly alt?: string;
379
+ /**
380
+ * The width the picture is shown at, in CSS px; narrower when the text it stands in is.
381
+ */
382
+ readonly width?: number;
383
+ /**
384
+ * The height the picture is shown at, in CSS px, in proportion to its width.
385
+ */
386
+ readonly height?: number;
387
+ }
388
+
389
+ /**
390
+ * PicturePath is the type of common.schema.json#/$defs/picture_path.
391
+ *
392
+ * The path of a picture from the module's media/ folder: a media path whose extension is .png, .jpg
393
+ * or .webp.
394
+ */
395
+ export type PicturePath = MediaPath;
396
+
397
+ /**
398
+ * MediaPath is the type of common.schema.json#/$defs/media_path.
399
+ *
400
+ * The path of a media file from the module's media/ folder: names in kebab-case that begin with a
401
+ * letter, joined by /, and the extension of the file's format — .png, .jpg, .webp or .mp3. No name
402
+ * is one that Windows reserves for a device. pictures/ladder.png.
403
+ */
404
+ export type MediaPath = string;
405
+
406
+ /**
407
+ * Canvas is the type of common.schema.json#/$defs/canvas.
408
+ *
409
+ * A canvas: its kind, and the grid of a handwriting sheet.
410
+ */
411
+ export interface Canvas {
412
+ /**
413
+ * The canvas kind: a handwriting sheet, a free sheet of 1000 × 1400 units; or a workbook, lines
414
+ * of items with boxes for the answers.
415
+ */
416
+ readonly kind: CanvasKind;
417
+ /**
418
+ * The grid of a handwriting sheet: squares, lines or dots; squares unless given.
419
+ *
420
+ * @defaultValue "squares"
421
+ */
422
+ readonly grid?: CanvasGrid;
423
+ /**
424
+ * The step of the grid of a handwriting sheet, in its units: 50 unless given.
425
+ *
426
+ * @defaultValue 50
427
+ */
428
+ readonly grid_step?: number;
429
+ }
430
+
431
+ /**
432
+ * CanvasKind is the type of common.schema.json#/$defs/canvas/properties/kind.
433
+ *
434
+ * The canvas kind: a handwriting sheet, a free sheet of 1000 × 1400 units; or a workbook, lines of
435
+ * items with boxes for the answers.
436
+ */
437
+ export type CanvasKind = "handwriting_sheet" | "workbook";
438
+
439
+ /**
440
+ * CanvasGrid is the type of common.schema.json#/$defs/canvas/properties/grid.
441
+ *
442
+ * The grid of a handwriting sheet: squares, lines or dots; squares unless given.
443
+ */
444
+ export type CanvasGrid = "squares" | "lines" | "dots";
445
+
446
+ /**
447
+ * SheetRectangle is the type of common.schema.json#/$defs/sheet_rectangle.
448
+ *
449
+ * A rectangle of the handwriting sheet, in its units of 1000 × 1400 from the top left corner.
450
+ */
451
+ export interface SheetRectangle {
452
+ /**
453
+ * How far the rectangle begins from the left edge of the sheet, in its units.
454
+ */
455
+ readonly left: number;
456
+ /**
457
+ * How far the rectangle begins from the top edge of the sheet, in its units.
458
+ */
459
+ readonly top: number;
460
+ /**
461
+ * The width of the rectangle, in units of the sheet.
462
+ */
463
+ readonly width: number;
464
+ /**
465
+ * The height of the rectangle, in units of the sheet.
466
+ */
467
+ readonly height: number;
468
+ }
469
+
470
+ /**
471
+ * LessonID is the type of common.schema.json#/$defs/lesson_id.
472
+ *
473
+ * The local ID of a lesson.
474
+ */
475
+ export type LessonID = LocalID;
476
+
477
+ // The types of shared-taxonomy.schema.json.
478
+
479
+ /**
480
+ * SharedTaxonomy is the type of shared-taxonomy.schema.json.
481
+ *
482
+ * The vocabulary of anchor skills: the skills that belong to no module and that modules name to
483
+ * build on one another. Its instance is the ID of an anchor skill, core.<name>: a skill of a module
484
+ * names one among its prerequisites or in teaches, and a manifest in its dependencies. It describes
485
+ * no part of a module, and it refuses an ID that names no anchor skill. Each anchor skill is a
486
+ * branch of oneOf, with its ID, its title and its description, all in English; the description is
487
+ * normative, since it is what the skill means.
488
+ */
489
+ export type SharedTaxonomy = "core.multiplication-table" | "core.division-with-remainder" | "core.fractions-of-a-whole" | "core.linear-equations";
490
+
491
+ // The types of skill-graph.schema.json.
492
+
493
+ /**
494
+ * SkillGraph is the type of skill-graph.schema.json.
495
+ *
496
+ * The skill graph of a module, skill-graph.yaml at the root of its folder: the module's skills,
497
+ * what a learner needs before each one, how the platform can know a learner's command of each,
498
+ * which anchor skills of the shared taxonomy each one teaches, the names of the tiers, and the
499
+ * skills that the module had once and has no more. The tier of a skill is computed from the
500
+ * prerequisites, never written, and module-kit puts it into the module's package. Every field is
501
+ * open but retired_skills, since the skill map shows them.
502
+ */
503
+ export interface SkillGraph {
504
+ /**
505
+ * The names of the tiers, in order from tier 1. The tiers past the last name are shown by their
506
+ * numbers, and a name past the last tier names none.
507
+ */
508
+ readonly tiers?: readonly Text[];
509
+ /**
510
+ * The module's skills, each under its local ID. Their order carries no meaning.
511
+ */
512
+ readonly skills: Readonly<Record<SkillID, Skill>>;
513
+ /**
514
+ * The skills that earlier versions of the module had and this one has no more, under the IDs they
515
+ * had: the table by which a learner's progress moves to the skills of this version. An entry
516
+ * stays in every later version, and its ID never names another skill.
517
+ */
518
+ readonly retired_skills?: Readonly<Record<SkillID, RetiredSkill>>;
519
+ }
520
+
521
+ /**
522
+ * Skill is the type of skill-graph.schema.json#/properties/skills/additionalProperties.
523
+ *
524
+ * A skill of the module, under its local ID.
525
+ */
526
+ export interface Skill {
527
+ /**
528
+ * What the skill is called, in the module's explanation language.
529
+ */
530
+ readonly title: Text;
531
+ /**
532
+ * What a learner who has the skill can do, in the module's explanation language.
533
+ */
534
+ readonly description?: Text;
535
+ /**
536
+ * The skills that a learner needs before this one, all of them: skills of the module by local ID,
537
+ * and anchor skills of the shared taxonomy by their IDs. A skill with none leaves this field out.
538
+ */
539
+ readonly prerequisites?: readonly string[];
540
+ /**
541
+ * The anchor skills of the shared taxonomy that this skill teaches: a learner who has this skill
542
+ * can do what the description of each says. Other modules build on them, and the learner model
543
+ * decides by such skills whether a learner has them. A skill that teaches none leaves this field
544
+ * out.
545
+ */
546
+ readonly teaches?: readonly SharedTaxonomy[];
547
+ /**
548
+ * How the platform can know a learner's command of the skill: verdict, when its tasks are checked
549
+ * against a key or a predicate; rubric, when work on it gets feedback by the author's rubric and
550
+ * no verdict; none, when it is practised and not assessed.
551
+ */
552
+ readonly assessability: SkillAssessability;
553
+ }
554
+
555
+ /**
556
+ * SkillAssessability is the type of
557
+ * skill-graph.schema.json#/properties/skills/additionalProperties/properties/assessability.
558
+ *
559
+ * How the platform can know a learner's command of the skill: verdict, when its tasks are checked
560
+ * against a key or a predicate; rubric, when work on it gets feedback by the author's rubric and no
561
+ * verdict; none, when it is practised and not assessed.
562
+ */
563
+ export type SkillAssessability = "verdict" | "rubric" | "none";
564
+
565
+ /**
566
+ * RetiredSkill is the type of
567
+ * skill-graph.schema.json#/properties/retired_skills/additionalProperties.
568
+ *
569
+ * A retired skill, under the local ID it had.
570
+ */
571
+ export interface RetiredSkill {
572
+ /**
573
+ * The skills of this version that took over what the retired skill taught: one for a skill
574
+ * renamed, several for a skill split. Empty when none did: then a learner's progress in it moves
575
+ * to no skill.
576
+ */
577
+ readonly replaced_by: readonly SkillID[];
578
+ }
579
+
580
+ // The types of traps.schema.json.
581
+
582
+ /**
583
+ * Traps is the type of traps.schema.json.
584
+ *
585
+ * The trap catalog of a module, traps.yaml at the root of its folder: the typical mistakes that the
586
+ * module's tasks catch, each under its local ID, with what the mistake is, the skills it belongs to
587
+ * and what to advise on it. A task names only a trap of the catalog, so that a wrong answer becomes
588
+ * a diagnosis that can be counted. Every field is closed, since a trap tells what mistake a task
589
+ * expects.
590
+ */
591
+ export interface Traps {
592
+ /**
593
+ * The module's traps, each under its local ID. Their order carries no meaning.
594
+ */
595
+ readonly traps: Readonly<Record<TrapID, Trap>>;
596
+ }
597
+
598
+ /**
599
+ * Trap is the type of traps.schema.json#/properties/traps/additionalProperties.
600
+ *
601
+ * A trap of the module, under its local ID.
602
+ */
603
+ export interface Trap {
604
+ /**
605
+ * What the mistake is, in the module's explanation language: AI reads it to suggest the trap from
606
+ * the learner's work, and the learner's progress names the mistakes that repeat by it.
607
+ */
608
+ readonly description: Text;
609
+ /**
610
+ * The skills of the module that the mistake belongs to, by local ID. A trap that belongs to no
611
+ * skill leaves this field out.
612
+ */
613
+ readonly skills?: readonly SkillID[];
614
+ /**
615
+ * What to advise the adult or the learner on this mistake, in the module's explanation language:
616
+ * the learner's progress gives it beside a trap that repeats, and it is the fallback text of the
617
+ * first two rungs after a wrong value of the trap that has no text of its own.
618
+ */
619
+ readonly trap_advice: Text;
620
+ }
621
+
622
+ // The types of techniques.schema.json.
623
+
624
+ /**
625
+ * Techniques is the type of techniques.schema.json.
626
+ *
627
+ * The technique catalog of a module, techniques.yaml at the root of its folder: the ways of solving
628
+ * that the module names and teaches, each under its local ID, with its title and what it is. A task
629
+ * names the techniques that help in it, and which those are is closed, in the task. Every field of
630
+ * the catalog is open, as the skills of the skill graph are.
631
+ */
632
+ export interface Techniques {
633
+ /**
634
+ * The module's techniques, each under its local ID. Their order carries no meaning, and this
635
+ * version gives them no numbers.
636
+ */
637
+ readonly techniques: Readonly<Record<TechniqueID, Technique>>;
638
+ }
639
+
640
+ /**
641
+ * Technique is the type of techniques.schema.json#/properties/techniques/additionalProperties.
642
+ *
643
+ * A technique of the module, under its local ID.
644
+ */
645
+ export interface Technique {
646
+ /**
647
+ * What the technique is called, in the module's explanation language.
648
+ */
649
+ readonly title: Text;
650
+ /**
651
+ * What the technique is and when it helps, in the module's explanation language.
652
+ */
653
+ readonly description?: Text;
654
+ }
655
+
656
+ // The types of solving-steps.schema.json.
657
+
658
+ /**
659
+ * SolvingSteps is the type of solving-steps.schema.json.
660
+ *
661
+ * The solving steps of a module, solving-steps.yaml at the root of its folder: the frame through
662
+ * which the tutor leads a learner within a task, step by step, each with its title, what of the
663
+ * task it gives and when it ends. Every task of the module goes through the same steps. Every field
664
+ * is open, since the learner's app leads the steps itself.
665
+ */
666
+ export interface SolvingSteps {
667
+ /**
668
+ * The steps, in order, each named by its place, from 1.
669
+ */
670
+ readonly steps: readonly Step[];
671
+ }
672
+
673
+ /**
674
+ * Step is the type of solving-steps.schema.json#/$defs/step.
675
+ *
676
+ * A solving step: what the learner does in it, what of the task it gives, and when it ends.
677
+ */
678
+ export interface Step {
679
+ /**
680
+ * What the learner does in the step, in the module's explanation language.
681
+ */
682
+ readonly title: Text;
683
+ /**
684
+ * What of the task the step gives the learner: givens, the task's givens and unknown, which the
685
+ * learner ticks; techniques, the task's techniques, which the server gives when the step begins.
686
+ * A step that gives neither leaves this field out.
687
+ */
688
+ readonly gives?: readonly StepGives[];
689
+ /**
690
+ * When the step ends, by an event on the learner's device and with no key: givens_ticked, once
691
+ * the learner has ticked every given and the unknown; answer_slots_filled, once every answer slot
692
+ * of the task holds something of the learner's; none, when the learner moves on.
693
+ */
694
+ readonly exit_condition: StepExitCondition;
695
+ }
696
+
697
+ /**
698
+ * StepGives is the type of solving-steps.schema.json#/$defs/step/properties/gives/items.
699
+ */
700
+ export type StepGives = "givens" | "techniques";
701
+
702
+ /**
703
+ * StepExitCondition is the type of solving-steps.schema.json#/$defs/step/properties/exit_condition.
704
+ *
705
+ * When the step ends, by an event on the learner's device and with no key: givens_ticked, once the
706
+ * learner has ticked every given and the unknown; answer_slots_filled, once every answer slot of
707
+ * the task holds something of the learner's; none, when the learner moves on.
708
+ */
709
+ export type StepExitCondition = "givens_ticked" | "answer_slots_filled" | "none";
710
+
711
+ // The types of task.schema.json.
712
+
713
+ /**
714
+ * Task is the type of task.schema.json.
715
+ *
716
+ * A task of a module, tasks/<id>.yaml in its folder: its statement, its canvas, its items with
717
+ * their answer slots, each with the check that says what is right in it, the skills it trains, its
718
+ * band and difficulty, and, when they are fewer than the module's, the age categories it is for;
719
+ * and what helps the learner on the way: what the statement gives and asks, the techniques that
720
+ * help, the traps that AI may suggest, a simpler case for each item, the solution and the phrases
721
+ * that give the answer away. The ID, the statement, the canvas, the items, the givens and the
722
+ * unknown are open, since the learner's app shows them, but for the skills and the simpler case of
723
+ * an item and the check of each answer slot; those, the skills, the band, the difficulty, the age
724
+ * categories, the techniques, the traps, the solution, the leak phrases and the template are
725
+ * closed, since the server reads them. A task with a template is a template of tasks: each attempt
726
+ * gets one instance of it, with numbers in the place of its placeholders.
727
+ */
728
+ export interface Task {
729
+ /**
730
+ * The task's local ID: the name of its file, without .yaml.
731
+ */
732
+ readonly id: TaskID;
733
+ /**
734
+ * The statement of the task, what the learner reads: paragraphs and pictures in order, in the
735
+ * module's explanation language. Whether it stands above the canvas or on it is the canvas kind's
736
+ * to decide.
737
+ */
738
+ readonly statement: readonly StatementPart[];
739
+ /**
740
+ * The canvas of the task, one for all its items: its kind and the kind's settings.
741
+ */
742
+ readonly canvas: Canvas;
743
+ /**
744
+ * The items of the task, each named by its place, from 1. On a handwriting sheet an item has
745
+ * answer slots; on a workbook it is a line of text and boxes.
746
+ */
747
+ readonly items: readonly Item[];
748
+ /**
749
+ * What the statement gives, each a short text in the module's explanation language: the chips
750
+ * that the learner ticks at a solving step that gives them, and what a hint asked for gives
751
+ * before the first answer.
752
+ */
753
+ readonly givens?: readonly Text[];
754
+ /**
755
+ * What the task asks to find, in the module's explanation language: the chip that the learner
756
+ * ticks beside the givens.
757
+ */
758
+ readonly unknown?: Text;
759
+ /**
760
+ * The skills that the task trains and needs, for each item that names none of its own.
761
+ */
762
+ readonly skills: Skills;
763
+ /**
764
+ * The band of the module's difficulty scale that the task is in, by its ID in the manifest.
765
+ */
766
+ readonly band: BandID;
767
+ /**
768
+ * How hard the task is within its band, from 1 to 5.
769
+ */
770
+ readonly difficulty: number;
771
+ /**
772
+ * The age categories that the task suits, when they are fewer than the module's: the platform
773
+ * gives the task only to learners in one of them. Without it, the task suits the module's
774
+ * audience.
775
+ */
776
+ readonly age_categories?: readonly AgeCategory[];
777
+ /**
778
+ * The techniques of the module's technique catalog that help in the task, by local ID. The server
779
+ * gives them at a solving step that gives them or on request: a technique's title tells how to
780
+ * solve the task.
781
+ */
782
+ readonly techniques?: readonly TechniqueID[];
783
+ /**
784
+ * The traps of the module's trap catalog that AI may suggest from the kind of mistake in the
785
+ * learner's work, by local ID. A trap that a wrong value shows is named in the check instead,
786
+ * among its trap values.
787
+ */
788
+ readonly traps?: readonly TrapID[];
789
+ /**
790
+ * How the task is solved, in parts as the statement is: paragraphs and pictures. The learner sees
791
+ * it once the task is solved, and AI reads it to find the first mistake in the learner's work. A
792
+ * task with an item with a verdict has one.
793
+ */
794
+ readonly solution?: readonly StatementPart[];
795
+ /**
796
+ * Phrases that give the answer away beyond the keys themselves, which the leak check searches for
797
+ * in every text that the learner sees before the task is solved: an answer in words, a key that
798
+ * its item shows already, the answer to a predicate.
799
+ */
800
+ readonly leak_phrases?: readonly Text[];
801
+ /**
802
+ * What makes the task a template: its parameters, the numbers derived from them, the constraint
803
+ * on their combinations and its solver. Each attempt gets one instance of the template, picked by
804
+ * the seed of the attempt, and the learner's app never gets the template itself.
805
+ */
806
+ readonly template?: Template;
807
+ }
808
+
809
+ /**
810
+ * Item is the type of task.schema.json#/$defs/item.
811
+ *
812
+ * An item of the task: on a handwriting sheet, its answer slots and what it asks; on a workbook, a
813
+ * line of text and boxes.
814
+ */
815
+ export interface Item {
816
+ /**
817
+ * What the item asks, on a handwriting sheet, beside its answer slots: a) or a question.
818
+ */
819
+ readonly text?: Text;
820
+ /**
821
+ * The answer slots of an item on a handwriting sheet, each named by its place in the item, from
822
+ * 1.
823
+ */
824
+ readonly answer_slots?: readonly AnswerSlot[];
825
+ /**
826
+ * An item of a workbook: pieces of text and boxes in order, as 7 × [ ] = 56, and at least one
827
+ * box. Its boxes are its answer slots, each named by its place among them, from 1.
828
+ */
829
+ readonly line?: readonly LinePart[];
830
+ /**
831
+ * The skills that this item trains and needs, in place of the task's.
832
+ */
833
+ readonly skills?: Skills;
834
+ /**
835
+ * A similar case, simpler than the item, that the learner reads at the third rung of the hint
836
+ * ladder when the tutor's words do not come.
837
+ */
838
+ readonly simpler_case?: Text;
839
+ }
840
+
841
+ /**
842
+ * AnswerSlot is the type of task.schema.json#/$defs/answer_slot.
843
+ *
844
+ * An answer slot of an item on a handwriting sheet: its binding, the zone or the options that the
845
+ * binding needs, and its check.
846
+ */
847
+ export interface AnswerSlot {
848
+ /**
849
+ * Where and how the learner gives the answer on a handwriting sheet: anywhere on it, where AI
850
+ * finds the final answer; the whole sheet, a work as a whole, such as an essay; in a zone of it;
851
+ * or by choosing one of the options.
852
+ */
853
+ readonly binding: AnswerSlotBinding;
854
+ /**
855
+ * The check of the answer slot: what is right in it, and how the platform tells. Closed, the kind
856
+ * too: the learner's app does not get it.
857
+ */
858
+ readonly check: Check;
859
+ /**
860
+ * The zone of the sheet where the learner writes the answer.
861
+ */
862
+ readonly zone?: SheetRectangle;
863
+ /**
864
+ * The options the learner chooses from, in the order they are shown.
865
+ */
866
+ readonly options?: readonly Text[];
867
+ }
868
+
869
+ /**
870
+ * AnswerSlotBinding is the type of task.schema.json#/$defs/answer_slot/properties/binding.
871
+ *
872
+ * Where and how the learner gives the answer on a handwriting sheet: anywhere on it, where AI finds
873
+ * the final answer; the whole sheet, a work as a whole, such as an essay; in a zone of it; or by
874
+ * choosing one of the options.
875
+ */
876
+ export type AnswerSlotBinding = "anywhere" | "sheet" | "zone" | "choice";
877
+
878
+ /**
879
+ * Check is the type of task.schema.json#/$defs/check.
880
+ *
881
+ * The check of an answer slot: its kind and the kind's parameters. Section 15 of the format text
882
+ * says how each kind reads the value and gives its verdict.
883
+ */
884
+ export interface Check {
885
+ /**
886
+ * The check kind: a number, a fraction, a choice, a predicate on a whole number, or a rubric,
887
+ * which gives feedback and no verdict.
888
+ */
889
+ readonly kind: CheckKind;
890
+ /**
891
+ * The right answer, as a string: a number for number, a simple fraction for fraction, one of the
892
+ * options for choice.
893
+ */
894
+ readonly key?: string;
895
+ /**
896
+ * Of a number: the words that may follow it in the answer, as rungs in 7 rungs.
897
+ */
898
+ readonly units?: readonly Text[];
899
+ /**
900
+ * Of a fraction: any fraction of the key's value is right, or only one in lowest terms; any
901
+ * unless given.
902
+ *
903
+ * @defaultValue "any"
904
+ */
905
+ readonly form?: CheckForm;
906
+ /**
907
+ * Of a choice written by hand: the options the learner writes one of, such as the signs <, > and
908
+ * =.
909
+ */
910
+ readonly options?: readonly Text[];
911
+ /**
912
+ * Of a number, a fraction or a choice: the wrong values that the author knows, each with the trap
913
+ * it shows, compared with the value read as the key is.
914
+ */
915
+ readonly trap_values?: readonly TrapValue[];
916
+ /**
917
+ * Of a predicate: a Starlark expression on value, the whole number read, that is True for every
918
+ * right answer.
919
+ */
920
+ readonly predicate?: string;
921
+ /**
922
+ * Of a rubric: what the work is given feedback by.
923
+ */
924
+ readonly criteria?: readonly Criterion[];
925
+ }
926
+
927
+ /**
928
+ * CheckKind is the type of task.schema.json#/$defs/check/properties/kind.
929
+ *
930
+ * The check kind: a number, a fraction, a choice, a predicate on a whole number, or a rubric, which
931
+ * gives feedback and no verdict.
932
+ */
933
+ export type CheckKind = "number" | "fraction" | "choice" | "predicate" | "rubric";
934
+
935
+ /**
936
+ * CheckForm is the type of task.schema.json#/$defs/check/properties/form.
937
+ *
938
+ * Of a fraction: any fraction of the key's value is right, or only one in lowest terms; any unless
939
+ * given.
940
+ */
941
+ export type CheckForm = "any" | "reduced";
942
+
943
+ /**
944
+ * TrapValue is the type of task.schema.json#/$defs/trap_value.
945
+ *
946
+ * A wrong value that the author knows, with the trap it shows.
947
+ */
948
+ export interface TrapValue {
949
+ /**
950
+ * The wrong value, as the key is written: for a choice, one of its options other than the key.
951
+ */
952
+ readonly value: string;
953
+ /**
954
+ * The trap that this wrong value shows, by its local ID in the module's trap catalog.
955
+ */
956
+ readonly trap: TrapID;
957
+ /**
958
+ * What the learner reads after this wrong value: it names the mistake rather than retelling the
959
+ * solution. Without it, the trap's advice stands in.
960
+ */
961
+ readonly text?: Text;
962
+ }
963
+
964
+ /**
965
+ * Criterion is the type of task.schema.json#/$defs/criterion.
966
+ *
967
+ * A criterion of a rubric: one thing the work is given feedback by.
968
+ */
969
+ export interface Criterion {
970
+ /**
971
+ * The criterion, in the module's explanation language.
972
+ */
973
+ readonly text: Text;
974
+ }
975
+
976
+ /**
977
+ * WrittenCheck is the type of task.schema.json#/$defs/written_check.
978
+ *
979
+ * The check of an answer written by hand, in a box, in a zone or anywhere on the sheet: a choice
980
+ * among them holds its own options.
981
+ */
982
+ export type WrittenCheck = Check;
983
+
984
+ /**
985
+ * SheetCheck is the type of task.schema.json#/$defs/sheet_check.
986
+ *
987
+ * The check of the whole sheet: a rubric.
988
+ */
989
+ export type SheetCheck = Check;
990
+
991
+ /**
992
+ * ChosenCheck is the type of task.schema.json#/$defs/chosen_check.
993
+ *
994
+ * The check of a choice by tapping: its options are the answer slot's, and the check holds none.
995
+ */
996
+ export type ChosenCheck = Check;
997
+
998
+ /**
999
+ * LinePart is the type of task.schema.json#/$defs/line_part.
1000
+ *
1001
+ * A piece of a line: a piece of text, or a box with its check.
1002
+ */
1003
+ export interface LinePart {
1004
+ /**
1005
+ * A piece of the line's text.
1006
+ */
1007
+ readonly text?: Text;
1008
+ /**
1009
+ * A box of the line, an answer slot where the learner writes the answer.
1010
+ */
1011
+ readonly binding?: LinePartBinding;
1012
+ /**
1013
+ * The check of the box: what is right in it, and how the platform tells, the answer being written
1014
+ * by hand. Closed, the kind too: the learner's app does not get it.
1015
+ */
1016
+ readonly check?: WrittenCheck;
1017
+ }
1018
+
1019
+ /**
1020
+ * LinePartBinding is the type of task.schema.json#/$defs/line_part/properties/binding.
1021
+ *
1022
+ * A box of the line, an answer slot where the learner writes the answer.
1023
+ */
1024
+ export type LinePartBinding = "box";
1025
+
1026
+ /**
1027
+ * Skills is the type of task.schema.json#/$defs/skills.
1028
+ *
1029
+ * The primary and supporting skills of a task or an item.
1030
+ */
1031
+ export interface Skills {
1032
+ /**
1033
+ * The skills of the module, by local ID, that are trained: a wrong answer is evidence against
1034
+ * them.
1035
+ */
1036
+ readonly primary: readonly SkillID[];
1037
+ /**
1038
+ * The skills that the answer needs and that a wrong answer does not count against: skills of the
1039
+ * module by local ID, or anchor skills of the shared taxonomy by their IDs.
1040
+ */
1041
+ readonly supporting?: readonly string[];
1042
+ }
1043
+
1044
+ /**
1045
+ * Template is the type of task.schema.json#/$defs/template.
1046
+ *
1047
+ * A template of tasks: parameters with their domains, the numbers derived from them, the constraint
1048
+ * that picks the combinations that are its instances, and the solver that finds what no expression
1049
+ * gives.
1050
+ */
1051
+ export interface Template {
1052
+ /**
1053
+ * The parameters of the template, each by its name with its domain. Their combinations are
1054
+ * counted through in the order of their names, the first changing slowest.
1055
+ */
1056
+ readonly parameters: Readonly<Record<TemplateName, Domain>>;
1057
+ /**
1058
+ * The derived numbers of the template, each by its name with the expression that computes it from
1059
+ * the parameters, such as legs: "2 * chickens + 4 * rabbits".
1060
+ */
1061
+ readonly derived?: Readonly<Record<TemplateName, TemplateExpression>>;
1062
+ /**
1063
+ * A bool expression of the parameters and the derived numbers that holds for the combinations
1064
+ * that give an instance. Without it, every combination gives one.
1065
+ */
1066
+ readonly constraint?: TemplateExpression;
1067
+ /**
1068
+ * The solver of the template: a program of Starlark that finds, by search, numbers of each
1069
+ * instance that no expression gives, such as its key. Its results are named as the parameters and
1070
+ * the derived numbers are, and stand in placeholders too.
1071
+ */
1072
+ readonly solver?: Solver;
1073
+ }
1074
+
1075
+ /**
1076
+ * TemplateName is the type of task.schema.json#/$defs/template_name.
1077
+ *
1078
+ * The name of a parameter or a derived number: lowercase letters, digits and _, beginning with a
1079
+ * letter, at most 14 characters long so that {name} fits a key, and no keyword or reserved word of
1080
+ * Starlark.
1081
+ */
1082
+ export type TemplateName = string;
1083
+
1084
+ /**
1085
+ * Domain is the type of task.schema.json#/$defs/domain.
1086
+ *
1087
+ * The integers that a parameter takes, from from to to, both included.
1088
+ */
1089
+ export interface Domain {
1090
+ /**
1091
+ * The least integer that the parameter takes.
1092
+ */
1093
+ readonly from: number;
1094
+ /**
1095
+ * The greatest integer that the parameter takes. A domain whose to is below its from is empty,
1096
+ * and its template has no instance.
1097
+ */
1098
+ readonly to: number;
1099
+ }
1100
+
1101
+ /**
1102
+ * TemplateExpression is the type of task.schema.json#/$defs/template_expression.
1103
+ *
1104
+ * An expression of the narrow subset of Starlark of section 23 of the format text: integers and
1105
+ * names, + - * // %, comparisons, and, or and not.
1106
+ */
1107
+ export type TemplateExpression = string;
1108
+
1109
+ /**
1110
+ * Solver is the type of task.schema.json#/$defs/solver.
1111
+ *
1112
+ * A program of Starlark that finds numbers of each instance of a template by search, as the solvers
1113
+ * of mathtrail-standalone do, and the names of the numbers that it finds.
1114
+ */
1115
+ export interface Solver {
1116
+ /**
1117
+ * The program of Starlark, at most 8192 characters long, that defines solve(numbers): given the
1118
+ * numbers that the open fields of an instance show, it returns a dict of the results, each a name
1119
+ * with its int.
1120
+ */
1121
+ readonly program: string;
1122
+ /**
1123
+ * The names of the results that solve returns for every instance, exactly these. A result stands
1124
+ * only in a key or a trap value of a number or a fraction, in the solution and in a leak phrase.
1125
+ */
1126
+ readonly results: readonly TemplateName[];
1127
+ }
1128
+
1129
+ // The types of lesson.schema.json.
1130
+
1131
+ /**
1132
+ * Lesson is the type of lesson.schema.json.
1133
+ *
1134
+ * A lesson of a module: a sequence that its author made — explanations, worked examples and tasks,
1135
+ * in order — and the skills of the module that it teaches. The skill graph orders the lessons.
1136
+ */
1137
+ export interface Lesson {
1138
+ /**
1139
+ * The lesson's local ID: the name of its file, without .yaml.
1140
+ */
1141
+ readonly id: LessonID;
1142
+ /**
1143
+ * What the lesson is called, in the module's explanation language. The learner sees it before
1144
+ * every task of the lesson, and the leak check searches it for their keys.
1145
+ */
1146
+ readonly title: Text;
1147
+ /**
1148
+ * The skills of the module, by local ID, that the lesson teaches. Every task of the lesson trains
1149
+ * one of them as a primary skill.
1150
+ */
1151
+ readonly skills: readonly SkillID[];
1152
+ /**
1153
+ * The age categories that the lesson suits, when they are fewer than the module's: the platform
1154
+ * gives the lesson only to a learner whom the lesson and each of its tasks suit.
1155
+ */
1156
+ readonly age_categories?: readonly AgeCategory[];
1157
+ /**
1158
+ * The segments of the lesson, in the author's order: explanations, worked examples and tasks. No
1159
+ * two are the same.
1160
+ */
1161
+ readonly segments: readonly Segment[];
1162
+ }
1163
+
1164
+ /**
1165
+ * Segment is the type of lesson.schema.json#/$defs/segment.
1166
+ *
1167
+ * A segment of a lesson: an explanation, a worked example or a task, by its one field.
1168
+ */
1169
+ export interface Segment {
1170
+ /**
1171
+ * An explanation: paragraphs and pictures that the learner reads, in order, in the module's
1172
+ * explanation language.
1173
+ */
1174
+ readonly explanation?: readonly StatementPart[];
1175
+ /**
1176
+ * A worked example: an example solved before the learner's eyes, on a handwriting sheet.
1177
+ */
1178
+ readonly worked_example?: WorkedExample;
1179
+ /**
1180
+ * A task of the module, by its local ID. The next segment begins when the task ends.
1181
+ */
1182
+ readonly task?: TaskID;
1183
+ }
1184
+
1185
+ /**
1186
+ * WorkedExample is the type of lesson.schema.json#/$defs/worked_example.
1187
+ *
1188
+ * A worked example of a lesson: no task, with no answer slots and no key.
1189
+ */
1190
+ export interface WorkedExample {
1191
+ /**
1192
+ * What the example asks: paragraphs and pictures in order, as a task's statement.
1193
+ */
1194
+ readonly statement: readonly StatementPart[];
1195
+ /**
1196
+ * The sheet that the author's demo is shown on: a handwriting sheet and its grid. The learner
1197
+ * does not write on it.
1198
+ */
1199
+ readonly canvas: Canvas;
1200
+ /**
1201
+ * The author's demo: the parts of how the example is solved, in order, which the learner opens
1202
+ * one at a time and may hide.
1203
+ */
1204
+ readonly demo: readonly DemoPart[];
1205
+ }
1206
+
1207
+ /**
1208
+ * DemoPart is the type of lesson.schema.json#/$defs/demo_part.
1209
+ *
1210
+ * A part of the author's demo: a paragraph; a picture beside the sheet, with what it shows and its
1211
+ * size; or a picture on the sheet, with what it shows and its area.
1212
+ */
1213
+ export interface DemoPart {
1214
+ /**
1215
+ * A paragraph of the demo, as plain text.
1216
+ */
1217
+ readonly text?: Text;
1218
+ /**
1219
+ * A picture of the demo, by its path from media/.
1220
+ */
1221
+ readonly picture?: PicturePath;
1222
+ /**
1223
+ * What the picture shows, in words: a screen reader reads it, and it stands in the picture's
1224
+ * place until the picture comes. Empty for a picture that only decorates.
1225
+ */
1226
+ readonly alt?: string;
1227
+ /**
1228
+ * The width that a picture beside the sheet is shown at, in CSS px.
1229
+ */
1230
+ readonly width?: number;
1231
+ /**
1232
+ * The height that a picture beside the sheet is shown at, in CSS px, in proportion to its width.
1233
+ */
1234
+ readonly height?: number;
1235
+ /**
1236
+ * The area of the sheet that a picture on the sheet is shown in, at its size, on the canvas layer
1237
+ * of the author's demo.
1238
+ */
1239
+ readonly area?: SheetRectangle;
1240
+ }
1241
+
1242
+ // The types of index-vector.schema.json.
1243
+
1244
+ /**
1245
+ * IndexVector is the type of index-vector.schema.json.
1246
+ *
1247
+ * A release of modules that a test vector of the module index gives, index.yaml beside the modules/
1248
+ * it releases (sections 9 and 26 of the format text): the index of the release before it, the
1249
+ * release's tag and its withdrawals, and either the index that the release builds or the rule of
1250
+ * the index by which the build is refused. An implementation builds the package of each module and
1251
+ * the index, and gets exactly these, whatever the order of keys.
1252
+ */
1253
+ export interface IndexVector {
1254
+ /**
1255
+ * The index of the release before this one. The first release of modules has none, and leaves
1256
+ * this field out.
1257
+ */
1258
+ readonly previous?: ModuleIndex;
1259
+ /**
1260
+ * The tag of this release, which a new entry names.
1261
+ */
1262
+ readonly release: Release;
1263
+ /**
1264
+ * The versions that the release withdraws from publication, by module ID and version. A release
1265
+ * that withdraws none leaves this field out.
1266
+ */
1267
+ readonly withdrawals?: Readonly<Record<ModuleID, Readonly<Record<ModuleVersion, WithdrawalReason>>>>;
1268
+ /**
1269
+ * The index that the release builds, when it builds one.
1270
+ */
1271
+ readonly index?: ModuleIndex;
1272
+ /**
1273
+ * The rule of the index by which the build is refused, when it is: the case breaks that rule and
1274
+ * no other.
1275
+ */
1276
+ readonly refusal?: IndexVectorRefusal;
1277
+ }
1278
+
1279
+ /**
1280
+ * IndexVectorRefusal is the type of index-vector.schema.json#/properties/refusal.
1281
+ *
1282
+ * The rule of the index by which the build is refused, when it is: the case breaks that rule and no
1283
+ * other.
1284
+ */
1285
+ export type IndexVectorRefusal = "module-index.entries-kept" | "module-index.one-package" | "module-index.known-withdrawals";
1286
+
1287
+ // The types of module-index.schema.json.
1288
+
1289
+ /**
1290
+ * ModuleIndex is the type of module-index.schema.json.
1291
+ *
1292
+ * The module index, module-index.json, a file of each release of modules (section 26 of the format
1293
+ * text): every published version of every module, each by the digest of its package, with the
1294
+ * release whose files hold it, the anchor skills it teaches and, when it has been withdrawn from
1295
+ * publication, why. A release builds it from the index of the release before it, and the release
1296
+ * workflow of .github signs it. Its members and those of an entry keep their places and meanings in
1297
+ * every version of the format, so that the index carries the entries of every version; a reader of
1298
+ * another version reads them by their places, not by this schema.
1299
+ */
1300
+ export interface ModuleIndex {
1301
+ /**
1302
+ * The format version by which the index was built. It stands at the root of the index in every
1303
+ * version of the format, as it does in a manifest and an inventory.
1304
+ */
1305
+ readonly module_format_version: ModuleFormatVersion;
1306
+ /**
1307
+ * Every module that a release of modules has published, under its ID.
1308
+ */
1309
+ readonly modules: Readonly<Record<ModuleID, Readonly<Record<ModuleVersion, Entry>>>>;
1310
+ }
1311
+
1312
+ /**
1313
+ * Entry is the type of module-index.schema.json#/$defs/entry.
1314
+ *
1315
+ * What the index says of one published version of a module.
1316
+ */
1317
+ export interface Entry {
1318
+ /**
1319
+ * The format version that the package's inventory names, by which the package is read. It stands
1320
+ * in every entry in every version of the format, so that a reader finds it before it reads the
1321
+ * package.
1322
+ */
1323
+ readonly module_format_version: ModuleFormatVersion;
1324
+ /**
1325
+ * The digest of the version's package: the digest of the canonical text of its inventory (section
1326
+ * 25).
1327
+ */
1328
+ readonly package_digest: Digest;
1329
+ /**
1330
+ * The tag of the release of modules whose files hold the package: the release that first
1331
+ * published it.
1332
+ */
1333
+ readonly release: Release;
1334
+ /**
1335
+ * The anchor skills that the skills of the version's skill graph teach, each once, in the order
1336
+ * of the code units of their IDs. A version whose skills teach none leaves this field out.
1337
+ */
1338
+ readonly teaches?: readonly AnchorSkillID[];
1339
+ /**
1340
+ * When a release has withdrawn the version from publication, the reason of the withdrawal. It
1341
+ * stays in every later index, with the same reason.
1342
+ */
1343
+ readonly withdrawn?: WithdrawalReason;
1344
+ }
1345
+
1346
+ /**
1347
+ * Release is the type of module-index.schema.json#/$defs/release.
1348
+ *
1349
+ * The tag of a release of modules, vX.Y.Z, as every NovaTrail repository numbers its releases.
1350
+ */
1351
+ export type Release = string;
1352
+
1353
+ /**
1354
+ * AnchorSkillID is the type of module-index.schema.json#/$defs/anchor_skill_id.
1355
+ *
1356
+ * The ID of an anchor skill, core.<name>, in the form of the shared taxonomy's IDs. The index takes
1357
+ * the form and not the vocabulary itself, so that an entry stays valid after a later version of the
1358
+ * format removes the anchor skill it names.
1359
+ */
1360
+ export type AnchorSkillID = string;
1361
+
1362
+ /**
1363
+ * WithdrawalReason is the type of module-index.schema.json#/$defs/withdrawal_reason.
1364
+ *
1365
+ * Why a version was withdrawn: wrong_key, a key or a predicate of it gives wrong verdicts;
1366
+ * answer_leak, a text that the learner sees gives an answer away; unsuitable_content, it holds
1367
+ * content that does not suit the learners it may reach. A reader takes a version as withdrawn
1368
+ * whatever the reason, also one that a later version of the format adds.
1369
+ */
1370
+ export type WithdrawalReason = "wrong_key" | "answer_leak" | "unsuitable_content";
1371
+
1372
+ // The types of inventory.schema.json.
1373
+
1374
+ /**
1375
+ * Digest is the type of inventory.schema.json#/$defs/digest.
1376
+ *
1377
+ * A digest: sha256: and the SHA-256 of the bytes, in 64 lowercase hexadecimal digits.
1378
+ */
1379
+ export type Digest = string;
1380
+
1381
+ /**
1382
+ * Inventory is the type of inventory.schema.json.
1383
+ *
1384
+ * The inventory of a module's package, inventory.json (section 25 of the format text): the module's
1385
+ * format version, ID and version, and the digest and size of each of the package's two parts — the
1386
+ * server part, which is the canonical view, and the device part, which a listing of its files
1387
+ * names. The digest of the package is the digest of its inventory.
1388
+ */
1389
+ export interface Inventory {
1390
+ /**
1391
+ * The format version that the module's manifest names, by which the package is read. It stands at
1392
+ * the root of the inventory in every version of the format, so that a reader finds it before it
1393
+ * knows how to read the rest.
1394
+ */
1395
+ readonly module_format_version: ModuleFormatVersion;
1396
+ /**
1397
+ * The module's ID, as its manifest names it.
1398
+ */
1399
+ readonly id: ModuleID;
1400
+ /**
1401
+ * The module's version, as its manifest names it.
1402
+ */
1403
+ readonly version: ModuleVersion;
1404
+ /**
1405
+ * The server part, server.json: the canonical text of the canonical view.
1406
+ */
1407
+ readonly server_part: Descriptor;
1408
+ /**
1409
+ * The device part, by its listing, device.json: the canonical text of the listing of its files.
1410
+ */
1411
+ readonly device_part: Descriptor;
1412
+ }
1413
+
1414
+ /**
1415
+ * Descriptor is the type of inventory.schema.json#/$defs/descriptor.
1416
+ *
1417
+ * What names bytes of a package: their digest and their size.
1418
+ */
1419
+ export interface Descriptor {
1420
+ /**
1421
+ * The digest of the bytes.
1422
+ */
1423
+ readonly digest: Digest;
1424
+ /**
1425
+ * How many bytes there are.
1426
+ */
1427
+ readonly size: number;
1428
+ }
1429
+
1430
+ /**
1431
+ * DeviceListing is the type of inventory.schema.json#/$defs/device_listing.
1432
+ *
1433
+ * The listing of a package's device part, device.json: every file of it, each named by its digest
1434
+ * and size.
1435
+ */
1436
+ export interface DeviceListing {
1437
+ /**
1438
+ * LICENSE, the text of the module's license.
1439
+ */
1440
+ readonly license: Descriptor;
1441
+ /**
1442
+ * NOTICE, the notices of the licenses, when the module has one.
1443
+ */
1444
+ readonly notice?: Descriptor;
1445
+ /**
1446
+ * The files of media/, when the module has any, each by its path from media/.
1447
+ */
1448
+ readonly media?: Readonly<Record<MediaPath, Descriptor>>;
1449
+ }
1450
+
1451
+ // The types of leak-vector.schema.json.
1452
+
1453
+ /**
1454
+ * LeakVector is the type of leak-vector.schema.json.
1455
+ *
1456
+ * A test vector of the leak check, vectors/leaks/<case>.yaml: a task, and texts that the learner
1457
+ * might see, each with every key and leak phrase of the task that the leak check finds in it
1458
+ * (section 20 of the format text). It describes no part of a module.
1459
+ */
1460
+ export interface LeakVector {
1461
+ /**
1462
+ * The task whose keys and leak phrases the leak check searches for. It is no template: a template
1463
+ * is searched through its instances, which the vectors of templates pin.
1464
+ */
1465
+ readonly task: Task;
1466
+ /**
1467
+ * The texts searched, each a case of the vector.
1468
+ */
1469
+ readonly texts: readonly SearchedText[];
1470
+ }
1471
+
1472
+ /**
1473
+ * SearchedText is the type of leak-vector.schema.json#/$defs/searched_text.
1474
+ *
1475
+ * A text searched, and what the leak check finds in it.
1476
+ */
1477
+ export interface SearchedText {
1478
+ /**
1479
+ * A text that the learner might see, as it is written.
1480
+ */
1481
+ readonly text: string;
1482
+ /**
1483
+ * Every key and leak phrase of the task that the leak check finds in the text, as the task writes
1484
+ * them, in any order: empty when it finds none.
1485
+ */
1486
+ readonly leaks: readonly string[];
1487
+ }
1488
+
1489
+ // The types of package-vector.schema.json.
1490
+
1491
+ /**
1492
+ * PackageVector is the type of package-vector.schema.json.
1493
+ *
1494
+ * The package that a test vector of packages gives, package.yaml beside the module/ it is of
1495
+ * (sections 9 and 25 of the format text): the module's server part, the listing of its device part,
1496
+ * its inventory and its digest. An implementation builds the package of module/ and gets exactly
1497
+ * these, whatever the order of keys. The results of a solver are the vector's, in the instances of
1498
+ * the server part.
1499
+ */
1500
+ export interface PackageVector {
1501
+ /**
1502
+ * The server part: the canonical view of the module.
1503
+ */
1504
+ readonly server_part: CanonicalView;
1505
+ /**
1506
+ * The listing of the device part.
1507
+ */
1508
+ readonly device_part: DeviceListing;
1509
+ /**
1510
+ * The inventory of the package.
1511
+ */
1512
+ readonly inventory: Inventory;
1513
+ /**
1514
+ * The digest of the package: the digest of the canonical text of its inventory.
1515
+ */
1516
+ readonly digest: Digest;
1517
+ }
1518
+
1519
+ // The types of random-vector.schema.json.
1520
+
1521
+ /**
1522
+ * RandomVector is the type of random-vector.schema.json.
1523
+ *
1524
+ * A test vector of the generator (section 22 of the format text): the start of a stream — two
1525
+ * words, and the seed and names of the place of randomness whose stream it is — and the functions
1526
+ * called on the stream, in order, each with its arguments and the value it gives.
1527
+ */
1528
+ export interface RandomVector {
1529
+ /**
1530
+ * The seed of the place of randomness whose stream this is. With it come its names, and the state
1531
+ * is the one they derive.
1532
+ */
1533
+ readonly seed?: Unsigned;
1534
+ /**
1535
+ * The names of the place of randomness, in order: each a string that is not empty and holds no |.
1536
+ */
1537
+ readonly names?: readonly string[];
1538
+ /**
1539
+ * The two words that start the stream, as the generator takes them: those that the seed and the
1540
+ * names derive, when they are given.
1541
+ */
1542
+ readonly state: RandomState;
1543
+ /**
1544
+ * The functions called on the stream, in order, each with its arguments and the value it gives.
1545
+ */
1546
+ readonly draws: readonly Draw[];
1547
+ }
1548
+
1549
+ /**
1550
+ * Unsigned is the type of random-vector.schema.json#/$defs/unsigned.
1551
+ *
1552
+ * An unsigned integer of 64 bits, from 0 to 18446744073709551615, in decimal digits with no leading
1553
+ * zero: a YAML number holds an integer of 53 bits at most.
1554
+ */
1555
+ export type Unsigned = string;
1556
+
1557
+ /**
1558
+ * RandomState is the type of random-vector.schema.json#/properties/state.
1559
+ *
1560
+ * The two words that start the stream, as the generator takes them: those that the seed and the
1561
+ * names derive, when they are given.
1562
+ */
1563
+ export interface RandomState {
1564
+ /**
1565
+ * The high word of the state that starts the stream.
1566
+ */
1567
+ readonly high: Unsigned;
1568
+ /**
1569
+ * The low word of the state that starts the stream.
1570
+ */
1571
+ readonly low: Unsigned;
1572
+ }
1573
+
1574
+ /**
1575
+ * Draw is the type of random-vector.schema.json#/$defs/draw.
1576
+ *
1577
+ * A function called on the stream, by its one field, with its arguments and the value it gives.
1578
+ */
1579
+ export interface Draw {
1580
+ /**
1581
+ * The next integer of the stream.
1582
+ */
1583
+ readonly integer?: IntegerDraw;
1584
+ /**
1585
+ * An integer below a bound.
1586
+ */
1587
+ readonly below?: BelowDraw;
1588
+ /**
1589
+ * An integer between two, both included.
1590
+ */
1591
+ readonly between?: BetweenDraw;
1592
+ /**
1593
+ * A number from 0 up to 1, never 1.
1594
+ */
1595
+ readonly fraction?: FractionDraw;
1596
+ /**
1597
+ * An order of the integers from 0 up to a count.
1598
+ */
1599
+ readonly permutation?: PermutationDraw;
1600
+ }
1601
+
1602
+ /**
1603
+ * IntegerDraw is the type of random-vector.schema.json#/$defs/draw/properties/integer.
1604
+ *
1605
+ * The next integer of the stream.
1606
+ */
1607
+ export interface IntegerDraw {
1608
+ /**
1609
+ * The integer.
1610
+ */
1611
+ readonly value: Unsigned;
1612
+ }
1613
+
1614
+ /**
1615
+ * BelowDraw is the type of random-vector.schema.json#/$defs/draw/properties/below.
1616
+ *
1617
+ * An integer below a bound.
1618
+ */
1619
+ export interface BelowDraw {
1620
+ /**
1621
+ * The bound, from 1.
1622
+ */
1623
+ readonly bound: Unsigned;
1624
+ /**
1625
+ * The integer, from 0 to the bound less one.
1626
+ */
1627
+ readonly value: Unsigned;
1628
+ }
1629
+
1630
+ /**
1631
+ * BetweenDraw is the type of random-vector.schema.json#/$defs/draw/properties/between.
1632
+ *
1633
+ * An integer between two, both included.
1634
+ */
1635
+ export interface BetweenDraw {
1636
+ /**
1637
+ * The least integer it may give.
1638
+ */
1639
+ readonly from: Signed;
1640
+ /**
1641
+ * The greatest integer it may give.
1642
+ */
1643
+ readonly to: Signed;
1644
+ /**
1645
+ * The integer.
1646
+ */
1647
+ readonly value: Signed;
1648
+ }
1649
+
1650
+ /**
1651
+ * Signed is the type of random-vector.schema.json#/$defs/signed.
1652
+ *
1653
+ * A signed integer of 64 bits, from -9223372036854775808 to 9223372036854775807, in decimal digits
1654
+ * with no leading zero.
1655
+ */
1656
+ export type Signed = string;
1657
+
1658
+ /**
1659
+ * FractionDraw is the type of random-vector.schema.json#/$defs/draw/properties/fraction.
1660
+ *
1661
+ * A number from 0 up to 1, never 1.
1662
+ */
1663
+ export interface FractionDraw {
1664
+ /**
1665
+ * The number: a multiple of 2^-53, which a double holds exactly and which a reader compares as a
1666
+ * double.
1667
+ */
1668
+ readonly value: number;
1669
+ }
1670
+
1671
+ /**
1672
+ * PermutationDraw is the type of random-vector.schema.json#/$defs/draw/properties/permutation.
1673
+ *
1674
+ * An order of the integers from 0 up to a count.
1675
+ */
1676
+ export interface PermutationDraw {
1677
+ /**
1678
+ * How many integers it orders.
1679
+ */
1680
+ readonly count: number;
1681
+ /**
1682
+ * The integers from 0 to the count less one, in the order it gives.
1683
+ */
1684
+ readonly value: readonly number[];
1685
+ }
1686
+
1687
+ // The types of template-vector.schema.json.
1688
+
1689
+ /**
1690
+ * TemplateVector is the type of template-vector.schema.json.
1691
+ *
1692
+ * A test vector of templates (sections 23 and 24 of the format text): a template, the number of its
1693
+ * instances, the names that its solver gets, when it has one, and attempts, each with its seed, the
1694
+ * numbers of the instance that the seed picks, and that instance. An implementation counts the
1695
+ * instances, picks the instance of each seed, runs the solver on it, replaces the placeholders, and
1696
+ * gets exactly these.
1697
+ */
1698
+ export interface TemplateVector {
1699
+ /**
1700
+ * The template: a task with a template, which breaks no rule of a task.
1701
+ */
1702
+ readonly task: Task;
1703
+ /**
1704
+ * The number of the template's instances: the combinations of its parameters for which its
1705
+ * constraint holds.
1706
+ */
1707
+ readonly count: number;
1708
+ /**
1709
+ * The names of the numbers that solve gets on each instance, in any order: the parameters and the
1710
+ * derived numbers whose placeholders stand in the open fields of the template. A vector has them
1711
+ * when its template has a solver, and only then, and they may be none.
1712
+ */
1713
+ readonly inputs?: readonly TemplateName[];
1714
+ /**
1715
+ * Attempts on the template, each by its seed, with the instance that the seed picks.
1716
+ */
1717
+ readonly attempts: readonly Attempt[];
1718
+ }
1719
+
1720
+ /**
1721
+ * Attempt is the type of template-vector.schema.json#/$defs/attempt.
1722
+ *
1723
+ * An attempt on the template: its seed, and the instance that the seed picks.
1724
+ */
1725
+ export interface Attempt {
1726
+ /**
1727
+ * The seed of the attempt, whose place of randomness with the names template, the task's ID and
1728
+ * instance picks the instance.
1729
+ */
1730
+ readonly seed: Unsigned;
1731
+ /**
1732
+ * The numbers of the instance: every parameter, every derived number and every result of the
1733
+ * solver of the template, by its name.
1734
+ */
1735
+ readonly numbers: Numbers;
1736
+ /**
1737
+ * The instance that the seed picks: the template with its numbers, the solver's results among
1738
+ * them, in the place of its placeholders, and without its template.
1739
+ */
1740
+ readonly instance: Task;
1741
+ }
1742
+
1743
+ // The types of tier-vector.schema.json.
1744
+
1745
+ /**
1746
+ * TierVector is the type of tier-vector.schema.json.
1747
+ *
1748
+ * A test vector of tiers (sections 12 and 25 of the format text): a skill graph and the tier of
1749
+ * each of its skills. An implementation computes the tiers from the prerequisites and gets exactly
1750
+ * these.
1751
+ */
1752
+ export interface TierVector {
1753
+ /**
1754
+ * The skill graph, whose prerequisites among the module's skills run in no cycle.
1755
+ */
1756
+ readonly skill_graph: SkillGraph;
1757
+ /**
1758
+ * The tier of every skill of the graph, as the canonical view holds it.
1759
+ */
1760
+ readonly skill_tiers: SkillTiers;
1761
+ }
1762
+
1763
+ // The types of verdict-vector.schema.json.
1764
+
1765
+ /**
1766
+ * VerdictVector is the type of verdict-vector.schema.json.
1767
+ *
1768
+ * A test vector of a check kind's verdicts, vectors/verdicts/<kind>/<case>.yaml: an item of a task
1769
+ * whose answer slots are checked by that kind, and readings of it, each the value read in every
1770
+ * answer slot, with the verdict and the trap that each answer slot gets and the verdict that the
1771
+ * item gets (section 15 of the format text). It describes no part of a module.
1772
+ */
1773
+ export interface VerdictVector {
1774
+ /**
1775
+ * The item: on a handwriting sheet its answer slots, on a workbook its line, and every answer
1776
+ * slot with its check.
1777
+ */
1778
+ readonly item: Item;
1779
+ /**
1780
+ * The readings of the item, each a case of the vector.
1781
+ */
1782
+ readonly readings: readonly Reading[];
1783
+ }
1784
+
1785
+ /**
1786
+ * Reading is the type of verdict-vector.schema.json#/$defs/reading.
1787
+ *
1788
+ * A reading of the item: the values read in its answer slots, and the verdicts they give.
1789
+ */
1790
+ export interface Reading {
1791
+ /**
1792
+ * The value read in each answer slot of the item, in the order of the answer slots, and the
1793
+ * verdict that each gets.
1794
+ */
1795
+ readonly answer_slots: readonly SlotReading[];
1796
+ /**
1797
+ * The verdict that the item gets, made of its answer slots' verdicts.
1798
+ */
1799
+ readonly verdict: Verdict;
1800
+ }
1801
+
1802
+ /**
1803
+ * SlotReading is the type of verdict-vector.schema.json#/$defs/slot_reading.
1804
+ *
1805
+ * The value read in an answer slot, and its verdict: with the reason, when it is unreadable, and
1806
+ * with the trap, when it matches one.
1807
+ */
1808
+ export interface SlotReading {
1809
+ /**
1810
+ * The value read in the answer slot, as it is written, or null when nothing was read.
1811
+ */
1812
+ readonly value: string | null;
1813
+ /**
1814
+ * The verdict that the answer slot gets.
1815
+ */
1816
+ readonly verdict: Verdict;
1817
+ /**
1818
+ * Why the answer slot is unreadable: nothing was read, or the value is not in the notation of the
1819
+ * check kind.
1820
+ */
1821
+ readonly reason?: SlotReadingReason;
1822
+ /**
1823
+ * The trap that the value matches among the trap values of the answer slot's check: only for a
1824
+ * value that is not yet right.
1825
+ */
1826
+ readonly trap?: TrapID;
1827
+ }
1828
+
1829
+ /**
1830
+ * Verdict is the type of verdict-vector.schema.json#/$defs/verdict.
1831
+ *
1832
+ * A verdict: correct; not yet; unreadable, which asks the learner to write again; or unchecked,
1833
+ * when the check could not run.
1834
+ */
1835
+ export type Verdict = "correct" | "not_yet" | "unreadable" | "unchecked";
1836
+
1837
+ /**
1838
+ * SlotReadingReason is the type of
1839
+ * verdict-vector.schema.json#/$defs/slot_reading/properties/reason.
1840
+ *
1841
+ * Why the answer slot is unreadable: nothing was read, or the value is not in the notation of the
1842
+ * check kind.
1843
+ */
1844
+ export type SlotReadingReason = "blank" | "notation";