Add JSON schemas, data validator, and first CE1 content

Introduces a generic JSON-Schema-subset validator in GDScript
(scripts/data/schema_validator.gd) used both by `make validate-data`
and, later, by ExerciseEngine at load time, plus semantic_checks.gd
for cross-field constraints a schema can't express (answer index
bounds, at least one faulty token in sentence correction, word count
matching between a dictation's target_text and its annotations).

Schemas cover rule, exercise (dispatched per type: multiple_choice,
sentence_correction), dictation, curriculum, and save (save.schema.json
is not yet wired into validate-data; saves live in user://, handled
at the Profiles/Saves step).

First draft content for the CE1 "accord_adjectif" rule (one rule, two
multiple-choice exercises, one sentence correction, one dictation,
one curriculum entry) exercises the full pipeline end to end and
seeds docs/review/content-review.md, regenerated by the new
tools/generate_content_review.py (`make content-review`).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Denis Defolie
2026-10-11 16:47:28 +02:00
parent a1f749de40
commit d057c8ee77
31 changed files with 938 additions and 35 deletions
+8 -2
View File
@@ -2,9 +2,11 @@ GODOT_BIN := .godot-bin/godot
VENV := .venv
GDLINT := $(VENV)/bin/gdlint
GDFORMAT := $(VENV)/bin/gdformat
PYRIGHT := $(VENV)/bin/pyright
PYTHON := $(VENV)/bin/python3
GD_SOURCES := autoload scripts tests
.PHONY: setup run lint format validate-data test check export-linux export-windows
.PHONY: setup run lint format validate-data test check content-review export-linux export-windows
setup:
tools/setup.sh
@@ -14,6 +16,7 @@ run:
lint:
$(GDLINT) $(GD_SOURCES)
$(PYRIGHT) tools/
format:
$(GDFORMAT) $(GD_SOURCES)
@@ -22,10 +25,13 @@ validate-data:
$(GODOT_BIN) --headless --path . -s res://scripts/data/validate_data_cli.gd
test:
$(GODOT_BIN) --headless --path . -s res://addons/gut/gut_cmdln.gd -gdir=res://tests -gexit
$(GODOT_BIN) --headless --path . -s res://addons/gut/gut_cmdln.gd -gdir=res://tests -ginclude_subdirs -gexit
check: lint validate-data test
content-review:
$(PYTHON) tools/generate_content_review.py
export-linux:
@echo "Export Linux : pas encore configure (voir Ordre de construction, etape 6)."
@exit 1