Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,42 @@ All notable changes to `learn-content-engine`. The format is inspired by

## [Unreleased]

## [0.42.2] - 2026-10-22

### `x-schema-version` moves with every schema change, and only then (engine#279)

0.42.1 changed a schema description and kept `x-schema-version` at 1.19,
although the counter bumps on every change to the schema definition,
description-only edits included (docs/lesson-format.md, since #139). Two
different contents were published as 1.19, and a consumer that compares the
number to see whether the definition moved saw nothing.

- **1.20.** Both schema files move to 1.20, in lockstep as always; the
content is 0.42.1's. `quality-rules.json` and `grading-presets.json` carry
the new `$schema-version`.
- **A ledger gate, both directions.** `src/__fixtures__/schema-baseline/schema-version-ledger.json`
maps each version to the digest of the schema set's content (both files,
`$id` and `x-schema-version` removed). `src/schema-version-ledger.test.ts`,
part of `make release-check`, fails when:
- the content changes under an unchanged number;
- a number rises without a change;
- the two files are out of lockstep;
- two rows share a digest.
Seeded negative probes cover each case, on a ledger that is consistent by
construction. Before the bump the test failed on this repository with "the
schema content changed but x-schema-version is still 1.19".
- **History.** A check over every release tag found content that changed
under an unchanged number seven times. Five predate the rule: 0.7.0, 0.8.1
and 0.8.2, 0.14.0, 0.20.0. Two came after it: 0.24.1 (1.14) and 0.42.1
(1.19). A number that rose without a change never occurred.
- **Docs name no version where none is needed.** README, `concepts.md`,
`architecture.md`, `comparative-analysis.md` and the three blog posts in
both languages no longer state the current schema or package version; the
schema file states it. A diagram in `comparative-analysis.md` still said
"schema 1.15" four versions later, out of reach of the version-claims gate.
The manifest `schema_version` default in `lesson-format.md` stays: authors
need it, and it keeps the version-claims gate from scanning blind.

## [0.42.1] - 2026-10-22

### A parametric variable's description says what the engine does (engine#277)
Expand All @@ -19,7 +55,9 @@ description now names both helpers and that the random source is a parameter.
Consumers that render the schema's descriptions carried the false sentence:
adaptive-learner's generated lesson-format reference publishes it in eight
languages and follows on its next re-pin. No type, field or rule changes;
`x-schema-version` stays 1.19.
`x-schema-version` stays 1.19. *Correction (0.42.2): this was wrong. A
description-only edit bumps `x-schema-version` too (docs/lesson-format.md);
0.42.2 gives this content its number, 1.20.*

### The self-hosted Mermaid bundle ships the notices of everything it contains (engine#274)

Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ a **new `ExerciseType` now starts here**:
run `make sync-types` to regenerate `src/types/lesson-schema.generated.ts`.
The [byte baseline](src/schema-baseline.test.ts) intentionally goes red on a
schema change - update it in the same commit so the change is deliberate.
Every schema change, description-only included, bumps `x-schema-version`
in both schema files (they move in lockstep) and adds a row to the
[version ledger](src/__fixtures__/schema-baseline/schema-version-ledger.json);
the [ledger test](src/schema-version-ledger.test.ts) names the digest to add
and fails on a change without a bump and on a bump without a change (engine#279).
2. Mirror the new type's cross-field rule in `src/rules.ts` (RED first: add a
rejecting negative test, then implement) with `E-*`/`W-*` rule ids + catalog
rows. A message that names a value (a term, an id, a count) also passes it as
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Beyond validity it checks a lesson against the shared quality minimums
instance (`resolveExerciseVariables`) and maps a lesson run's percent to the
verdict of its set's `evaluation` block (`gradeFor`), so every consumer gets
the same answer.
Tracks the lesson schema, currently **v1.19**.
Ships the lesson schema it validates against (`schema/lesson.schema.json`; its version is `x-schema-version` there).

## Install

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Three classes, and they are not equally urgent:
(see [schema-version policy](concepts.md#schema-version-policy-additive)), so
content authored against an older version stays valid under a newer one: a
manifest that declares `schema_version: "1.2"` keeps validating although the
manifest schema_version field currently defaults to 1.7. A repo that does not
field's default has moved on since. A repo that does not
want the new field does not need the release.
- **New error rules.** These move the pin, because content that was valid
before can be invalid after. Rare under the additive policy, but not
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/de/did-we-reinvent-the-wheel.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [benchmark, architecture, interoperability, documentation]

*Eine fremde KI hat unsere Content-Engine gegen QTI, H5P, Moodle, Canvas und Duolingo gebenchmarkt und Lücken gefunden, die längst geschlossen waren. Die Korrektur war kein Code. Dann kam die ehrliche Frage, die ehrliche Antwort, und ein Fehler, den nur die Content-Repositories fangen konnten.*

`learn-content-engine` · Schema aktuell v1.19 · framework-agnostisches TypeScript
`learn-content-engine` · framework-agnostisches TypeScript

## Ein Benchmark von außen

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/de/one-source-many-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Drei Dinge bleiben in dem, was Sie schreiben, bewusst getrennt: der **Inhalt** (

Sie müssen dieses JSON nicht von Hand schreiben. Die Referenz-App liefert einen **Lektions-Editor** mit, der dem Wort "einfach" entwachsen ist: der klassische vierstufige Assistent (Metadaten, Karten, Übungen, Speichern & Teilen), ein Buch-Pfad, der eingefügte oder hochgeladene Lehrbuchkapitel in Wissens-Lektionen verwandelt, ein Erweiterungs-Zweig, der selbst benotete Quizze und Diktate ohne JSON autorierbar macht, und ein Bearbeitungsmodus. All das erzeugt Lektionen in demselben kanonischen Schema und kann sogar direkt aus der App einen Pull Request gegen ein Content-Repository öffnen; [Teil 3 der Serie](create-a-lesson-in-the-app.md) geht jeden Pfad durch. Was darüber hinaus **geplant** ist, ist ein reicherer, auf Lehrende zugeschnittener Editor für die schwereren Fälle (größere Sets). Beides ändert das Modell nicht: Die Quelle bleibt der Vertrag, und jeder Editor (einfach oder reich) ist nur ein weiteres Werkzeug, das ihn liest und schreibt.

> **Additiv als Prinzip.** Das Schema ist versioniert (aktuell 1.19) und wächst nur additiv: Neue Felder sind optional, eine letztes Jahr geschriebene Lektion validiert also heute noch. Sie werden nie gezwungen, Inhalte zu migrieren, nur weil sich das Schema bewegt hat.
> **Additiv als Prinzip.** Das Schema ist versioniert (`x-schema-version`) und wächst nur additiv: Neue Felder sind optional, eine letztes Jahr geschriebene Lektion validiert also heute noch. Sie werden nie gezwungen, Inhalte zu migrieren, nur weil sich das Schema bewegt hat.

## Validierung ist Rechtschreibprüfung für Test-Logik

Expand Down
4 changes: 2 additions & 2 deletions docs/blog/de/schema-first-content-engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ tags: [architecture, schema-design, typescript, content-engineering]

*Wie `learn-content-engine` ein stabiles Kern-Schema behält und trotzdem Raum für pädagogische Erfindung lässt: durch eine harte Linie zwischen dem Vertrag, den es besitzt, und den Regeln, die seine Consumer besitzen.*

`learn-content-engine` · Schema aktuell v1.19 · framework-agnostisches TypeScript
`learn-content-engine` · framework-agnostisches TypeScript

## Das Content-Schema-Dilemma

`learn-content-engine` ist eine framework-agnostische TypeScript-Bibliothek, die Lerninhalte parst und validiert: Sprachkurse zuallererst, wobei ein `domain`-Feld (seit Engine 0.20.0 ein kontrolliertes Vokabular aus bekannten Werten plus other) dieselbe Form auch andere Wissensgebiete tragen lässt (Technik-Kurse, Führerschein-Vorbereitung, Psychologie). Sie verwandelt Rohquellen (Lektions-JSON plus eine `manifest.yaml`) in eine kanonische interne Form, und sie ist die einzige Quelle der Wahrheit für das Lektions-Schema, aktuell Version 1.19.
`learn-content-engine` ist eine framework-agnostische TypeScript-Bibliothek, die Lerninhalte parst und validiert: Sprachkurse zuallererst, wobei ein `domain`-Feld (seit Engine 0.20.0 ein kontrolliertes Vokabular aus bekannten Werten plus other) dieselbe Form auch andere Wissensgebiete tragen lässt (Technik-Kurse, Führerschein-Vorbereitung, Psychologie). Sie verwandelt Rohquellen (Lektions-JSON plus eine `manifest.yaml`) in eine kanonische interne Form, und sie ist die einzige Quelle der Wahrheit für das Lektions-Schema.

Der Kern ist bewusst klein. Kein Rendering, keine Persistenz, kein Netzwerk; die Laufzeit-Abhängigkeiten sind ein YAML-Parser und ein JSON-Schema-Validator, und der XML-Parser des QTI-Adapters sitzt hinter einem eigenen Subpath, sodass er den Kern-Import nie berührt. Seit 0.29.0 haben auch die Semantikregeln einen eigenen Subpath, ohne den JSON-Schema-Validator, sodass eine Browser-App sie ausführen kann, ohne ihn mitzutragen. Was er bietet, ist reine Validierung und Transformation. Dieser Minimalismus ist der Punkt, und er erzwingt eine harte Frage: *Wie entwickelt man ein Content-Schema weiter, ohne jeden Consumer zu brechen, der davon abhängt?*

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/did-we-reinvent-the-wheel.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [benchmark, architecture, interoperability, documentation]

*An outside AI benchmarked our content engine against QTI, H5P, Moodle, Canvas and Duolingo and found gaps we had already closed. The fix was not code. Then came the honest question, the honest answer, and one bug that only the content repositories could catch.*

`learn-content-engine` · schema currently v1.19 · framework-agnostic TypeScript
`learn-content-engine` · framework-agnostic TypeScript

## A benchmark from outside

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/one-source-many-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Three things stay deliberately separate in what you write: the **content** (the

You don't have to write that JSON by hand. The reference app ships a **lesson creator** that has outgrown the word "simple": the classic four-step wizard (metadata, cards, exercises, save & share), a book path that turns pasted or uploaded textbook chapters into knowledge lessons, an extension branch that makes even graded quizzes and dictation authorable without JSON, and an edit mode. All of it produces lessons in this same canonical schema and can even open a pull request against a content repository directly from the app; part 3 of the series walks through every path. What is **planned** beyond it is a richer, teacher-facing editor for the heavier cases (larger sets). Neither changes the model: the source stays the contract, and every editor (simple or rich) is just one more tool that reads and writes it.

> **Additive by policy.** The schema is versioned (currently 1.19) and only grows additively: new fields are optional, so a lesson written last year still validates today. You are never forced to migrate content just because the schema moved.
> **Additive by policy.** The schema is versioned (`x-schema-version`) and only grows additively: new fields are optional, so a lesson written last year still validates today. You are never forced to migrate content just because the schema moved.

## Validation is spell-check for test logic

Expand Down
4 changes: 2 additions & 2 deletions docs/blog/schema-first-content-engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ tags: [architecture, schema-design, typescript, content-engineering]

*How `learn-content-engine` keeps a stable core schema and still leaves room for pedagogical invention: by drawing a hard line between the contract it owns and the rules its consumers own.*

`learn-content-engine` · schema currently v1.19 · framework-agnostic TypeScript
`learn-content-engine` · framework-agnostic TypeScript

## The content-schema dilemma

`learn-content-engine` is a framework-agnostic TypeScript library that parses and validates learning content: language courses foremost, though a `domain` field (a known-values-plus-other vocabulary since engine 0.20.0) lets the same shape carry other knowledge domains (tech courses, driving-test prep, psychology). It turns raw sources (lesson JSON plus a `manifest.yaml`) into a canonical internal shape, and it is the single source of truth for the lesson schema, currently version 1.19.
`learn-content-engine` is a framework-agnostic TypeScript library that parses and validates learning content: language courses foremost, though a `domain` field (a known-values-plus-other vocabulary since engine 0.20.0) lets the same shape carry other knowledge domains (tech courses, driving-test prep, psychology). It turns raw sources (lesson JSON plus a `manifest.yaml`) into a canonical internal shape, and it is the single source of truth for the lesson schema.

The core is deliberately small. No rendering, no persistence, no networking; its runtime dependencies are a YAML parser and a JSON-Schema validator, and the QTI adapter's XML parser sits behind its own subpath so it never enters the core import. Since 0.29.0 the semantic rules have a subpath of their own too, without the JSON-Schema validator, so a browser app can run them without carrying it. What it offers is pure validation and transformation. That minimalism is the point, and it forces one hard question: *how do you evolve a content schema without breaking every consumer that depends on it?*

Expand Down
12 changes: 6 additions & 6 deletions docs/comparative-analysis.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# **Comparative Analysis of Exercise Types in E-Learning Platforms**
**Benchmark Study for the `learn-content-engine` (package 0.42.1, lesson schema currently 1.19)**
**Benchmark Study for the `learn-content-engine`**

**Version:** 1.9
**Date:** September 23, 2026
Expand All @@ -11,7 +11,7 @@

## **Executive Summary**

This document presents a systematic comparative analysis of exercise types across established e-learning platforms (Moodle, H5P, QTI 3.0, Canvas LMS, Duolingo) in the context of the `learn-content-engine`. Two version numbers matter and are easy to conflate: the npm package is at **0.42.1**, the lesson schema it validates against is currently **1.19** (`x-schema-version` in `schema/lesson.schema.json`). This document benchmarks the schema's exercise types.
This document presents a systematic comparative analysis of exercise types across established e-learning platforms (Moodle, H5P, QTI 3.0, Canvas LMS, Duolingo) in the context of the `learn-content-engine`. Two version numbers matter and are easy to conflate: the npm package version and the version of the lesson schema it validates against (`x-schema-version` in `schema/lesson.schema.json`). This document benchmarks the schema's exercise types.

The analysis demonstrates that the engine, with its six core exercise types (`matching`, `picture_choice`, `free_text`, `word_tiles`, `cloze`, `multiple_choice`), fully covers the **global standard for text-based foundational assessments**.

Expand Down Expand Up @@ -191,15 +191,15 @@ flowchart LR
Author[Content author] -->|lesson JSON| Core
Author -->|lesson JSON with requires_extensions| Ref
subgraph Engine[learn-content-engine]
Core[Core types: schema 1.15, ExerciseType enum]
Core[Core types: ExerciseType enum]
Ref[Reference extensions: src/examples/ext-ref-*]
end
Core -->|guaranteed to load| App[adaptive-learner]
Ref -->|adopted under the app's vendor namespace| App
Ref -.->|consumer-parity gate| Core
```

| **Exercise Type Category** | **Moodle** | **H5P** | **QTI 3.0** | **Duolingo** | **learn-content-engine (schema currently 1.19)** |
| **Exercise Type Category** | **Moodle** | **H5P** | **QTI 3.0** | **Duolingo** | **learn-content-engine** |
|----------------------------|------------|---------|-------------|--------------|----------------------------------|
| **Multiple / Single Choice** | ✓ | ✓ | ✓ | ✓ | ✓ Core (`multiple_choice`, `picture_choice`) |
| **Fill-in-the-Blank (Cloze)** | ✓ | ✓ | ✓ | ✓ | ✓ Core (`cloze`) |
Expand Down Expand Up @@ -534,7 +534,7 @@ stateDiagram-v2
## **7. Didactic Framework**

### 7.1 Bloom's Taxonomy
The core types (schema currently 1.19) primarily cover the lower levels:
The core types primarily cover the lower levels:
- **Remembering:** `free_text`, `cloze`, `matching`
- **Understanding:** `multiple_choice`, `picture_choice`
- **Applying:** `word_tiles` (limited)
Expand Down Expand Up @@ -584,7 +584,7 @@ The extensions enable **Constructive Alignment** (Biggs, 1996): Teaching/learnin

## **8. Conclusion**

The `learn-content-engine` (package 0.42.1, schema currently 1.19) is in an **excellent strategic position**:
The `learn-content-engine` is in an **excellent strategic position**:
1. **Standard Parity:** The six core exercise types fully cover the global standard for text-based foundational assessments, and the boundary speaks QTI 2.x and QTI 3.0.
2. **Architectural Maturity:** The `ext:` concept matches modern best practices (QTI 3.0 PCI) and prevents schema bloat.
3. **Didactic Growth Potential:** Every gap this analysis identified is covered, as a reference extension or as the core `variables` field; the higher Bloom levels are reachable without compromising core stability.
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ inherited by the set's lessons unless a lesson declares its own.

## Schema-version policy (additive)

The lesson schema is versioned (`x-schema-version`, currently `1.19`) and evolves
The lesson schema is versioned (`x-schema-version`) and evolves
**additively**: new fields are optional, so **older content stays valid under a
newer schema**. For example, v1.5 added the inline `examples` field; a v1.4
lesson without `examples` validates unchanged under v1.5. v1.6 added the native
Expand Down
7 changes: 6 additions & 1 deletion docs/lesson-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,12 @@ lockstep and changes nothing else, so `schema_version`'s default stays at
`purpose` (what `bridge` lifts) and two line breaks restored after v1.16
(engine#182). v1.19 (engine#242) adds an exercise field, `case_sensitive`;
the manifest schema moves its `x-schema-version` in lockstep and changes
nothing else. When comparing your pin
nothing else. v1.20 is a description-only edit again (engine#277, the
`ExerciseVariable` description). Release 0.42.1 first published it under
1.19, against this rule, and 0.42.2 gives it its number. Since 0.42.2 a
ledger test enforces the rule in both directions (engine#279,
`src/schema-version-ledger.test.ts`): content that changes under an
unchanged number fails, and so does a number that rises without a change. When comparing your pin
against a new engine release, `x-schema-version` tells you the schema
DEFINITION moved; `schema_version` tells you whether your MANIFESTS need a
field update.
Expand Down
2 changes: 1 addition & 1 deletion docs/schema-diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ false ordering sentence survived in this repo for weeks.

<!-- GENERATED:schema-diagrams BEGIN - do not edit by hand, run scripts/generate-schema-diagrams.mjs -->

<!-- schema x-schema-version: 1.19 -->
<!-- schema x-schema-version: 1.20 -->

### 1. Content structure (generated)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "learn-content-engine",
"version": "0.42.1",
"version": "0.42.2",
"description": "Framework-agnostic TypeScript engine that parses lesson content from pluggable sources into a canonical lesson object.",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion schema/content-manifest.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,5 +481,5 @@
],
"title": "ContentManifest",
"type": "object",
"x-schema-version": "1.19"
"x-schema-version": "1.20"
}
Loading
Loading