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

@@ -0,0 +1,25 @@
# What `coursebank migrate glossary --terms terms.yaml --values values.yaml` should write (field order may differ).
# Dropped and reported: terms[decade].first (L2.1) and values[per-decade].lectures ([L2.1, L2.4, L2.5]), both derived
# from targets in 2.1; renamed ids decade -> term-decade and per-decade -> val-per-decade.
terms:
term-decade:
term: decade
definition: a factor of ten in a concentration ratio or an equilibrium constant
kind: coined
textbook:
- { term: order of magnitude, ref: KKW, locator: "§10.10" }
- { term: ten-fold }
variants: [decades]
exam_wording: ten-fold
status: proposed
values:
val-per-decade:
name: free energy per ten-fold concentration ratio at 37 °C
value: 6
units: kJ/mol
say: about 6 kJ/mol
exact: 5.9
source: { ref: KKW, locator: "§10.10" }
conflicts: ['5\.7\s*kJ', '5\.8\s*kJ']
recall: true
status: proposed
@@ -0,0 +1,13 @@
schema_version: "1.0"
terms:
- id: decade
course: decade
variants: [decades]
kind: coined
textbook:
- { term: order of magnitude, ref: KKW, locator: "§10.10" }
- { term: ten-fold }
meaning: a factor of ten in a concentration ratio or an equilibrium constant
first: L2.1
exam_wording: ten-fold
status: proposed
@@ -0,0 +1,13 @@
schema_version: "1.0"
values:
- id: per-decade
name: free energy per ten-fold concentration ratio at 37 °C
value: 6
units: kJ/mol
say: about 6 kJ/mol
exact: 5.9
source: { ref: KKW, locator: "§10.10" }
lectures: [L2.1, L2.4, L2.5]
conflicts: ['5\.7\s*kJ', '5\.8\s*kJ']
recall: true
status: proposed