docs: schema 2.1 guide, codes, changelog, and report

A guide page for the four registries: where entries live, how targets
point at them, the other new fields, the brace-reference table, what
students never see, the lecture and glossary pages, every new error and
lint rule, and the migration from terms.yaml and values.yaml. The setup
guide points at it.

The README covers glossary.yaml, the nine schemas, the 2.1 checks, the
glossary lint family and the note severity, the new lecture commands and
report sections, migrate glossary, and schema version 2.1. Module docs
and the changelog follow.

docs/design/2.1/CODES.md maps the specification's E, W, and I codes to
coursebank's messages and lint codes, each with its test, and REPORT.md
records what changed, the two remaining schema differences, every choice
made where the specification left room, and suggested changes to it. A
new test covers the validation messages the specification does not
number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
alexmandClaude committed 2026-11-16 12:31:01 -05:00
1 parent 6c07122fc5
commit b5cae6afac
11 files changed
+535 -29

No files matched your search

+40
View File
@@ -267,3 +267,43 @@ fn policy_levels_and_blueprints_are_keyed_by_level() {
reports(&issues, "policy.levels: `6` is not a level");
reports(&issues, "policy.blueprints: `module` counts items at `7`");
}
/// The checks the specification does not number: required text that is
/// present but empty, and numbers outside the range the schema gives.
#[test]
fn empty_required_text_and_out_of_range_numbers_are_errors() {
let mut c = course("required");
c.terms.get_mut("term-gap").unwrap().definition = " ".into();
c.equations.get_mut("eq-global-recurrence").unwrap().says = String::new();
c.values.get_mut("val-per-decade").unwrap().say = String::new();
c.misconceptions
.get_mut("mis-only-matches-count")
.unwrap()
.correction = String::new();
let lecture = c.lectures.get_mut("l09").unwrap();
lecture.materials[0].url = String::new();
lecture.readings[0].minutes = Some(0);
c.policy.levels.get_mut("3").unwrap().name = String::new();
c.policy.blueprints.get_mut("module").unwrap().minutes = Some(0.0);
c.policy.exam_conditions.as_mut().unwrap().seconds_per_item = Some(0.0);
let issues = c.validate();
reports(&issues, "term `term-gap`: empty definition");
reports(&issues, "equation `eq-global-recurrence`: empty says");
reports(&issues, "value `val-per-decade`: empty say");
reports(
&issues,
"misconception `mis-only-matches-count`: empty correction",
);
reports(&issues, "lecture `l09`: material 1 has no url");
reports(
&issues,
"lecture `l09` reading 1: minutes must be at least 1",
);
reports(&issues, "policy.levels: level 3 has an empty name");
reports(&issues, "policy.blueprints: `module` gives no time");
reports(
&issues,
"policy.exam_conditions: seconds_per_item must be above 0",
);
}