Content manifest and import
Since Phase 4 the files below are the snapshot shipped with the application: the seed of the studio's database and what the public site serves until that database exists. Once the studio is in service, publication is decided there (immutable publications, see
INSTRUCTOR_STUDIO.mdandARCHITECTURE.md§6), imports are made from the studio, andcontent/publication.jsonis no longer the editorial layer of the running site. The « How to… » table further down describes the snapshot workflow only.
Files
| Path | Written by | Role |
|---|---|---|
content/course.manifest.json |
importer | Canonical manifest (Manifest schema). The site builds from it, with no access to the course repository. |
content/import/sessions/<id>/… |
importer | Imported sections: quiz.json, glossary.json, figures.json + figures/*.svg, lab.md, script.md, bibliography.json. |
content/import/report.json |
importer | Per-session status, warnings and the SHA-256 of every source file read. |
content/publication.json |
a human (later: the studio) | Editorial layer: publication state, visibility per section, slugs, licence, diagram visibility, redirects. Never written by the importer. |
content/paths.json |
a human | The four suggested learning paths (validated against prerequisites by tests). |
content/preview/overlay.json |
a human | Preview-only additions: the synthetic test capsule and the demonstration exercises. |
Schemas: src/modules/content-schema/schema.ts. Example manifest: the committed content/course.manifest.json itself.
Import
pnpm content:import --from /path/to/atlas-ai-mooc # or ATLAS_COURSE_REPO
pnpm content:import --from … --check # writes nothing; exit 1 if the snapshot is staleAdapter rules (scripts/lib/importer.ts, src/modules/content-schema/adapter.ts):
- Read-only on the course repository. Nothing from it is executed, compiled or
imported: YAML is parsed with the core schema, BibTeX and Markdown tables with small readers. - Authority. The course plan (
course.yaml: titles, parts, levels, outcomes, prerequisites, tags) is imported for all sessions. A session's material is read only if its ownmetadata.yamlsaysimplementedorvalidated. A missing, half-written or invalidmetadata.yamlis a warning, not an error: other people may be writing that directory. - Path safety. Every path is checked (
isSafeRelPath), resolved inside the repository, and its real path re-checked, so..and symlinks pointing outside are refused. Reads are size-limited. - Solutions.
labs/solution/is never opened. - Figures. Only SVG renders located inside the session directory, with a non-empty alt text, and passing
checkSvg(no script, event handler,foreignObject, external reference or entity). - Quiz.
choix-unique→single,vrai-faux→true-false(alsochoix-multiple,numériqueif they appear). Unknown types are skipped with a warning, never guessed. - Idempotent. Same input → byte-identical output, no timestamps; a second run writes nothing. Stale files under
content/import/are removed. Content hashes: per file, per session (source.hash), global (import.sourceHash). - Never publishes. Defaults are
planned(no material) ordraft(material present) and every sectionprivate. Onlycontent/publication.jsoncan raise a state or a visibility; the report warns when it refers to something that was not imported.
Publication model
States: planned · draft · preview · published · archived. Visibility of a section, capsule or resource: private · preview · public. Download: download: true + a licence (publication.json → license, or per resource) + not before releaseAfter (delayed release of solutions). The complete rule is buildView / canSee / canDownload in publication.ts; see ARCHITECTURE.md §3.
How to… (today, by editing content/publication.json, then rebuilding)
| Task | Change |
|---|---|
| Show a session in preview | "S02": { "publication": "preview", "sections": { "quiz": "preview", … } } |
| Publish a session | "publication": "published" and each approved section "public". Requires the instructor's review; nothing does this automatically. |
| Withdraw / roll back a publication | set the state back to draft (or archived to keep the URL with a notice), rebuild. Git history of publication.json is the audit trail until the studio exists. |
| Record the licence, enabling downloads | "license": "CC BY-NC-SA 4.0" (the owner's decision — not taken yet) |
| Rename a session URL | "slug": "01-nouveau-slug", "aliases": ["01-ancien-slug"] → permanent redirect from every alias |
| Add an arbitrary redirect | "redirects": [{ "from": "/ancien", "to": "/nouveau" }] |
| Publish a diagram | "diagrams": { "tokenisation": "public" } |
| Hide theme tags of unopened sessions | "exposeTags": false |
Default slugs are derived from the course plan: two-digit number + slugified short title (05-ingenierie-du-contexte). The repository's English slug and sNN always redirect to it.
Adding a session
Add it to the course repository's course.yaml (and its directory); run the import. The site needs no code change: routes, programme, map, search and sitemap are derived from the manifest. (The landing page's course map lays sessions out by part; very uneven parts would need a layout review.)
Not implemented
Videos and downloadable resources are not imported from the course repository (none exist): they are uploaded in the studio. Manifest diff, conflict handling and scheduled publication exist in the studio (Phase 4).