Files
aventuriers-des-mots/data/schemas/save.schema.json
T
Denis Defolie d057c8ee77 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>
2026-10-11 16:47:28 +02:00

33 lines
952 B
JSON

{
"type": "object",
"required": [
"schema_version",
"profile_id",
"display_name",
"school_level",
"session_count",
"unlocked_regions",
"skills",
"rewards"
],
"additionalProperties": false,
"properties": {
"schema_version": { "type": "integer", "minimum": 1 },
"profile_id": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
"display_name": { "type": "string", "minLength": 1 },
"school_level": { "type": "string", "enum": ["CE1", "CE2"] },
"session_count": { "type": "integer", "minimum": 0 },
"unlocked_regions": { "type": "array", "items": { "type": "string" } },
"skills": { "type": "object" },
"rewards": {
"type": "object",
"required": ["stars", "items"],
"additionalProperties": false,
"properties": {
"stars": { "type": "integer", "minimum": 0 },
"items": { "type": "array", "items": { "type": "string" } }
}
}
}
}