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,129 @@
{
"$id": "https://coursebank.dev/schema/references.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "The works the course cites, by citation key. One fragment of the course file; see course.schema.json for the whole.",
"properties": {
"references": {
"additionalProperties": {
"additionalProperties": false,
"properties": {
"arxiv": {
"description": "Bare arXiv id: 2301.00001.",
"type": "string"
},
"authors": {
"description": "Authors as `Family, Given`, in printed order.",
"items": {
"type": "string"
},
"type": "array"
},
"base_url": {
"description": "Prefix a reading's `path` is joined to, so the citation key appears once instead of once per reading.",
"type": "string"
},
"container": {
"description": "Journal, edited volume, or series.",
"type": "string"
},
"doi": {
"description": "Bare DOI: 10.1038/nature12373. For a manuscript this is usually the only link worth storing, since a reading list resolves it to doi.org.",
"pattern": "^(doi:|https?://(dx\\.)?doi\\.org/)?10\\.",
"type": "string"
},
"edition": {
"description": "Edition as printed: 7th.",
"type": "string"
},
"isbn": {
"type": "string"
},
"issue": {
"type": "string"
},
"kind": {
"description": "Kind of work, following BibTeX entry types.",
"enum": [
"book",
"chapter",
"article",
"preprint",
"thesis",
"website",
"software",
"dataset",
"video",
"other"
],
"type": "string"
},
"label": {
"description": "Short form a reading list shows, such as KKW. One work per label.",
"minLength": 1,
"type": "string"
},
"note": {
"description": "Access notes: reserve shelf, license.",
"type": "string"
},
"pages": {
"description": "Pages of the work, not of a reading.",
"type": "string"
},
"pmcid": {
"description": "PubMed Central id, which hosts the full text: PMC3084216.",
"type": "string"
},
"pmid": {
"description": "PubMed id, which hosts a record about the work: 21471563.",
"pattern": "^[0-9]+$",
"type": "string"
},
"publisher": {
"type": "string"
},
"role": {
"description": "required for a course text; supplemental for background.",
"enum": [
"required",
"supplemental"
],
"type": "string"
},
"title": {
"description": "Full title.",
"minLength": 1,
"type": "string"
},
"url": {
"description": "Canonical URL for the whole work.",
"type": "string"
},
"volume": {
"type": "string"
},
"year": {
"description": "Year of publication.",
"type": "integer"
}
},
"required": [
"title"
],
"type": "object"
},
"description": "Works by citation key.",
"type": "object"
},
"schema_version": {
"description": "Format version; currently 2.0. Declared in course.yaml; fragments inherit it.",
"type": [
"string",
"number"
]
}
},
"title": "coursebank references file",
"type": "object"
}