v1 roadmap format#54
Merged
Merged
Conversation
Derssa
approved these changes
Jul 14, 2026
10 tasks
OthmaneZ05
added a commit
that referenced
this pull request
Jul 18, 2026
* feat(backend): add roadmap format JSON Schema (schemaVersion 1) and TS types * feat(roadmaps): add reference example roadmap * feat(backend): add roadmap schema validation function, tests and CLI * feat(frontend): add roadmap types (documented copy of backend source of truth) * docs: add roadmap format reference (fields, validators, i18n, versioning policy)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Introduces the open roadmap file format (versioned JSON Schema) — the foundation for guided, auto-corrected learning roadmaps in Torollo.
A roadmap is a purely declarative, versioned JSON file:
Roadmap → steps[] → { instruction, hints[], solution?, validators[] }, where a validator is inert data{ type, params }— nothing in a roadmap file is ever executed. This format is the public contract that the upcoming validation engine and roadmap player will consume, and that community-written content will target.What this PR adds:
backend/src/modules/learning/format/roadmap.schema.json—schemaVersion: 1required (const), strictadditionalProperties: falseeverywhere so hand-written files fail on typos,$idset to the raw GitHub URL for editor autocompletion. Emitted tobackend/distviaresolveJsonModule, so the future roadmap loader gets it at runtime for free.backend/src/modules/learning/format/roadmapTypes.ts, documented KEEP-IN-SYNC copy infrontend/src/shared/types/roadmap.ts(same deliberate-duplication policy as the existingProjecttype).validateRoadmap(data)(pure, no I/O) — every error points at the faulty field: missing required fields are named, unknown fields get a "check for typos" hint, unsupportedschemaVersiongets an explicit rejection, duplicate step ids report both positions.cd backend && npm run roadmap:validate -- <file>(exit 0/1).roadmaps/example-first-architecture.json: 4 steps, one step with 2 hints + solution, one step with 2 validators of different types, stable slug ids decoupled from position.docs/roadmap-format.md: philosophy, copy-pasteable quick start, field-by-field reference, the 8 v1 validator types with their params, the name-based targeting convention (nodes are referenced by canvas name, never by runtime ids), the i18n decision (one language per file; a translation is a separate file with the sameid), and the versioning policy (v1 frozen at merge — any field change ⇒schemaVersion: 2; new validatortypes are NOT schema changes).New runtime dependency:
ajv^8 (backend). No CI changes, no root package changes, no frontend build changes.Types of Changes
Verification & Testing
Automated Checks
npm run lintsuccessfully with no errorsnpm run buildsuccessfully with no compilation errorsnpm testsuccessfully (all tests pass)Backend: 53 tests green (18 new — including one embedding all 8 validator types with their documented params, and one asserting the example file structurally keeps covering the format's reference requirements so it can't silently regress). Frontend: 107 tests green, no regression.
Manual Verification
npm run roadmap:validate -- ../roadmaps/example-first-architecture.json→OK ... (roadmap "example-first-architecture", 4 steps).schemaVersion: 2→/schemaVersion: unsupported schemaVersion 2 — this version of Torollo reads schemaVersion 1titel→(root): unknown field "titel" — check for typos+ missingtitlenamed.docs/roadmap-format.mdalone, in under 15 minutes.Checklist