feat(schema): 2.1 types, fragments, and JSON Schemas

Add the term, equation, value, and misconception registries
(src/model/course/glossary.rs) and the new optional fields on objectives,
targets, lectures, readings, bank options, and policy. Load registry
entries from objective files, glossary.yaml, and course.yaml, with one
definition site per id as for every other registry. Port every edit in
docs/design/2.1/build_schemas.py into the hand-written schema builders,
add glossary.schema.json, and test the generated schemas against the
targets; the only differences are two 2.0 spellings the code already had.

The 2.0 example fragments load and validate unchanged. The 2.1 example
bank gains `status: draft`, which every coursebank item requires.
tests/docs.rs skips docs/design/, which holds design records rather than
guide pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
alexmandClaude committed 2026-11-16 11:55:18 -05:00
1 parent 15175f64fd
commit 51a2fd235f
47 files changed
+10568 -55

No files matched your search

+3 -18
View File
@@ -425,10 +425,6 @@ mod tests {
"L1.1".into(),
Lecture {
title: "Enthalpy".into(),
date: None,
unit: None,
slides_url: None,
teaches: Vec::new(),
readings: vec![
Reading {
reference: Some("kuriyan2013molecules".into()),
@@ -449,6 +445,7 @@ mod tests {
..Reading::default()
},
],
..Lecture::default()
},
);
c
@@ -456,16 +453,7 @@ mod tests {
/// The non-defaulted half of an objective, so the fixtures stay short.
fn objective_defaults() -> Objective {
Objective {
text: String::new(),
unit: None,
lectures: Vec::new(),
order: None,
level_ceiling: None,
prerequisites: Vec::new(),
tags: Vec::new(),
assessed: true,
}
Objective::default()
}
#[test]
@@ -553,10 +541,7 @@ After this lecture, you should be able to do the following.
objective: "lo-binding".into(),
lectures: objective.lectures,
order: Some(order),
level_ceiling: None,
prerequisites: Vec::new(),
tags: Vec::new(),
assessed: true,
..Target::default()
},
);
}
+1
View File
@@ -1263,6 +1263,7 @@ mod tests {
explanation: Some("Only at constant volume.".into()),
hint: Some("Reconsider what stays constant in an open flask.".into()),
misconception: Some("Uses the constant-volume result.".into()),
misconception_id: None,
error_type: None,
defensible: false,
defense: None,