Instructor studio
Status: built and tested locally (2026-11-22). Not deployed. The studio lives at /admin. Everything below is exercised by the automated tests named in TESTING.md; what is partial or untested is listed at the end.
Who can publish
| Role | Can | Cannot |
|---|---|---|
| Propriétaire (owner — the instructor) | everything: edit, upload, import, publish, schedule, roll back, withdraw, archive, export, manage editors, passkeys and sessions | — |
| Éditeur-publieur (publisher) | edit, upload, import, publish, schedule, roll back, withdraw, archive | manage access, export |
| Auteur (author) | edit, upload, import as draft, private preview | publish anything, manage access, export |
Roles are enforced on the server for every page and every API call (src/lib/studio/guard.ts, src/lib/studio/api.ts); the interface only reflects them. There is no password and no learner account: the public site never reads or sets a cookie.
Enrolling a passkey
- First passkey — on the server, in a shell:
pnpm studio enrol --name "Simon-Pierre Boucher". It prints a one-time link (/admin/enrolement?jeton=…, 30 minutes, single use; only its SHA-256 is stored). Open it on the device that will hold the passkey (Touch ID, Face ID or device passcode) and press « Créer une clé d’accès sur cet appareil ». - Another device for the same person:
pnpm studio enrol --editor <id>(ids:pnpm studio editors), or in the studio, Accès → Lien pour une nouvelle clé. - Another person: Accès → Autoriser une nouvelle personne (name + role). The link is shown once; send it through a safe channel.
- Lost device:
pnpm studio enrol --editor <id> --recovery— using that link deletes the editor's previous passkeys and closes their sessions. - Revoking: Accès lists passkeys and open sessions; a passkey or a session can be revoked, an editor disabled (their sessions close at once). The last passkey of the last owner cannot be revoked.
Sessions last 12 hours, 2 hours when idle. Cookie atlas_studio: HttpOnly, SameSite=Strict, Secure on HTTPS, Path=/admin.
The model in one page
- Working copy — what the studio edits: sessions, sections (quiz, glossary, references, laboratory, narration script, figures), capsules, resources, course settings. Nothing of it is public.
- Publication — an immutable snapshot of one session (or of the plan), with a date from which it is live. The public site is built only from the snapshots in force. Publishing, rolling back, withdrawing and archiving each add an entry to a history that is never rewritten.
- Plan (Cours et plan) — what visitors see for sessions that are not published: the list of sessions with titles, outcomes, prerequisites; parts; licence; public diagrams; redirects. It changes only when the plan is published.
- Workflow of a session: Brouillon → Aperçu (readable in the private preview, eligible for publication) → Programmée (snapshot taken, live at a date) / Publiée → Archivée. A draft opens nowhere, not even in the private preview.
- Visibility of each item (section, capsule, resource): Privé (editor only) · Aperçu seulement (also in the private preview) · Public à la publication (part of the next snapshot). A snapshot contains only public items.
Adding a session
Séances → Nouvelle séance (title, short title, part, level). It is created as a draft at the end of the course; move it with the arrows. Fill the Fiche (outcomes, prerequisites, effort, address). It enters the public programme as « À venir » when the plan is published (Cours et plan → Publier le plan). Sessions normally come from the course repository instead (see below).
Uploading a master and getting adaptive streams
- Open the session → Capsules vidéo → Nouvelle capsule.
- Drop the master (MP4, MOV, MKV, WebM — up to
ATLAS_MAX_MASTER_GB, 40 GB by default) on the capsule. The browser sends it in 4 MiB pieces, each with its SHA-256; an interrupted transfer resumes (« Reprendre l’envoi », pieces are kept two days); a file already stored is recognised before any byte is sent and reused. - The server assembles the file, checks its content against its extension (magic bytes), stores it untouched as
masters/<sha256>.<ext>and queues an encode. The worker validates it with ffprobe and produces HLS renditions (360p / 720p / 1080p by default — never above the source; a 4K master is delivered at 1080p unlessATLAS_LADDERadds a rung), an MP4 fallback (≤ 720p), a poster and thumbnails. Progress, failure and « Relancer » are on the capsule and under Traitements. - The capsule becomes « Prête ». Each encode has its own directory: replacing the video never changes what is already online.
Attaching captions, transcript, chapters
On the capsule: choose the language (BCP 47, fr-CA by default) and drop a .vtt. The file is validated (header, timing syntax, negative or reversed times, overlapping or out-of-order cues, cues after the end of the video; warnings for reading speed and coverage). An invalid file is refused with the list of errors. « En tirer la transcription » derives the searchable transcript from the cues; a transcript can also be imported from .vtt or .json. « Vérifier le minutage » plays the encoded video with the track and highlights the current cue. « Chapitres » edits the chapter list. A capsule cannot be published without French captions and a transcript.
Syncing from the course repository
Importation. Two sources: a checkout readable on the server (ATLAS_COURSE_REPO, button « Lire le dépôt et comparer »), or an uploaded snapshot (.zip or .tar.gz, e.g. git archive --format=tar.gz -o cours.tar.gz HEAD). The repository is read as data (never executed; solutions are never read; the archive is extracted with limits, without links). The studio then shows, field by field and section by section, what would change: Mise à jour (you did not touch it), Conflit (changed here and there — your version is kept unless you tick « Prendre celle du dépôt »), Ajout, Absent du dépôt. Applying requires a confirmation, lands as drafts, never publishes and never touches what is online. Applying the same source twice changes nothing. LaTeX slides are not compiled by the platform: export the PDF in the course repository and attach it as a resource.
Slides of a session (interactive viewer)
Every session page can show the session's slides in an online viewer (previous/next, keyboard, swipe, outline, overview grid, presentation mode, dark/light variant, direct link to a slide, text version of each slide, local resume). Slides are a section of the session — « Diapositives » — with its own visibility, so a session can be « Diapositives en ligne » while its videos, quiz and laboratory are still to come. Such a session is not counted as published.
Source. The course repository's web exports, one page per slide: dist/slides/SXX-web.pdf (dark) and SXX-web-light.pdf (light), built there by make web. Slide identifiers, kinds and section titles are read from slides/main.tex and slides/sections/*.tex (structure markers only); figure descriptions from figures/manifest.yaml. Speaker notes (speaker-notes.md, \note{…}, SXX-notes.pdf) are never opened; the deck format has no field for them.
Format (measured, S01–S10). One SVG per slide and per theme (pdftocairo -svg: text as outlines, sharp at any size, renders in Chromium and WebKit) plus a 480 px WebP thumbnail per slide and theme for the overview. Per session: 37–44 slides, 8.5–10.4 MB of SVG for the two themes (1.4–1.7 MB once gzip-compressed, which is the gateway's job), about 1 MB of thumbnails, pack 2.5–3.1 MB. Rejected: WebP at 1920 px (80–150 KB per slide and theme, not compressible further, blurry in presentation mode on large screens).
1. Build packs — on a machine with poppler (brew install poppler) and the course repository; about 5 s per session:
pnpm slides:build --from /chemin/vers/atlas-ai-mooc --out /tmp/atlas-packs # every session that has both PDFs
pnpm slides:build --from … --out … --sessions S01,S02 # or some→ <out>/SXX-slides.tar.gz (and <out>/SXX/). A table prints pages, sizes, identified slides and warnings (e.g. sources that do not account for the PDF's pages: kinds are then read from the pages and identifiers omitted — never guessed).
2. Import packs — where the studio's data lives; needs Node only, no poppler:
pnpm studio slides-import /tmp/atlas-packs/S01-slides.tar.gz /tmp/atlas-packs/S02-slides.tar.gz …
pnpm studio slides-import --from-repo /chemin/vers/atlas-ai-mooc # build + import in one step, on a machine with poppleror, in the studio: session → Contenus → « Importer un paquet de diapositives ». Every file is checked against the pack's checksums, every SVG inspected (no script, handler or external reference), and the deck is installed under ATLAS_DATA_DIR/slides/<session>/<deck>/. Slides arrive private. A new deck never overwrites an older one: what is online keeps its files until the session is published again.
3. Publish the slides, and only them
pnpm studio slides-publish S01 S02 S03 S04 S05 S06 S07 S08 S09 S10 # reversible: pnpm studio slides-unpublish S01 …For each session: the « Diapositives » section becomes public and the session is published. The command refuses a session where anything else is marked public (quiz, laboratory, glossary, a capsule…): nothing is half-published. In the studio the same is done with the visibility menu of « Diapositives », then Publication → Publier maintenant…; the confirmation lists exactly what goes out. Each publication is in the session's history (rollback, « Retirer du site… ») and in the journal. slides-unpublish withdraws a session that offered only its slides, or republishes the session without them.
PDF download. Not offered by the viewer unless a resource of type « Diapositives » is published for the session with download enabled and a licence is recorded (the existing gate).
Not built: slide ↔ quiz cross-links (« Revoir la diapositive »): the quiz format of the platform does not carry the slides: field of the course's questions yet. Synchronising slides with a video. Editing slide text in the studio.
Publishing, scheduling, rolling back
Session → Publication. The panel lists what will become public, what stays in the studio, and what blocks. « Publier maintenant… » and « Programmer… » each open a confirmation; nothing happens before it. The public site changes at the next request — no rebuild, no restart. Rolling back: in Historique des publications, « Remettre en ligne… » on an earlier version puts that snapshot back (as a new history entry). « Retirer du site… » returns the session to « À venir »; « Archiver… » shows a withdrawal notice. Rolling back changes what the public sees, not the working copy. The plan has the same history under Cours et plan.
Other screens
Tableau de bord (counts, to-do, schedule, running jobs, storage, system state incl. ffmpeg and worker, broken files) · Traitements (queue, cancel, retry) · Outils (rebuild search index, link and integrity check, caption validation, export) · Journal (who, when, what, with the state before and after) · Accès.
Partial, untested or absent
- MDX and image/diagram embedding in the Markdown editor: not built. The editor is Markdown (GFM tables, highlighted code, KaTeX from
$$…$$) with live preview; raw HTML and images are deliberately not rendered. - Quiz editor: form editing for single choice, multiple choice, true/false and numeric; the five other exercise types are edited as JSON (validated against the same schema) and previewed with the public engine.
- Figures cannot be edited or uploaded in the studio: they come from the repository import; only their visibility is set.
- Glossary and bibliography editors: built; only the glossary editor is driven by the end-to-end test.
- Parts are edited as a list (id, titles); no drag-and-drop anywhere (ordering uses up/down buttons).
- Restoring an earlier publication into the working copy: not built (rollback is public-side only).
- Waveforms, automatic poster choice, slide/video synchronisation: not built.
- Backup/restore from the browser: deliberately not offered (command line only); the studio lists existing backups.
- Real passkeys on real devices (Touch ID, iPhone, synced keys): not verified — the tests use Chromium's virtual authenticator.
- Uploads of real multi-gigabyte masters through the production gateway: not verified (largest file tested: 12 MB in three pieces, locally).