Repository Public
1# Instructor studio23**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.45## Who can publish67| Role | Can | Cannot |8|---|---|---|9| **Propriétaire** (owner — the instructor) | everything: edit, upload, import, publish, schedule, roll back, withdraw, archive, export, manage editors, passkeys and sessions | — |10| **Éditeur-publieur** (publisher) | edit, upload, import, publish, schedule, roll back, withdraw, archive | manage access, export |11| **Auteur** (author) | edit, upload, import as draft, private preview | publish anything, manage access, export |1213Roles 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.1415## Enrolling a passkey16171. **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 ».182. **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é*.193. **Another person**: *Accès → Autoriser une nouvelle personne* (name + role). The link is shown once; send it through a safe channel.204. **Lost device**: `pnpm studio enrol --editor <id> --recovery` — using that link deletes the editor's previous passkeys and closes their sessions.215. **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.2223Sessions last 12 hours, 2 hours when idle. Cookie `atlas_studio`: HttpOnly, SameSite=Strict, Secure on HTTPS, `Path=/admin`.2425## The model in one page2627- **Working copy** — what the studio edits: sessions, sections (quiz, glossary, references, laboratory, narration script, figures), capsules, resources, course settings. Nothing of it is public.28- **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.29- **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.30- **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.31- **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.3233## Adding a session3435*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).3637## Uploading a master and getting adaptive streams38391. Open the session → *Capsules vidéo* → *Nouvelle capsule*.402. 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.413. 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 unless `ATLAS_LADDER` adds a rung), an MP4 fallback (≤ 720p), a poster and thumbnails. Progress, failure and « Relancer » are on the capsule and under *Traitements*.424. The capsule becomes « Prête ». Each encode has its own directory: replacing the video never changes what is already online.4344## Attaching captions, transcript, chapters4546On 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.**4748## Syncing from the course repository4950*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.5152## Slides of a session (interactive viewer)5354Every 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.5556**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.5758**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).5960**1. Build packs** — on a machine with poppler (`brew install poppler`) and the course repository; about 5 s per session:61```bash62pnpm slides:build --from /chemin/vers/atlas-ai-mooc --out /tmp/atlas-packs # every session that has both PDFs63pnpm slides:build --from … --out … --sessions S01,S02 # or some64```65→ `<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).6667**2. Import packs** — where the studio's data lives; needs Node only, no poppler:68```bash69pnpm studio slides-import /tmp/atlas-packs/S01-slides.tar.gz /tmp/atlas-packs/S02-slides.tar.gz …70pnpm studio slides-import --from-repo /chemin/vers/atlas-ai-mooc # build + import in one step, on a machine with poppler71```72or, 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.7374**3. Publish the slides, and only them**75```bash76pnpm studio slides-publish S01 S02 S03 S04 S05 S06 S07 S08 S09 S10 # reversible: pnpm studio slides-unpublish S01 …77```78For 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.7980**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).8182**Not built:** synchronising slides with a video. Editing slide text in the studio. (Slide ↔ quiz cross-links exist since the interactive lessons: see below.)8384## Interactive lesson of a session (« Leçon interactive »)8586A second layer that can go online on top of the slides, session by session: the session page becomes a lesson to read and manipulate. Ladder of a session: **slides only → slides + interactive lesson (lesson, quiz, glossary, lab instructions) → later, videos.** A session with its lesson online and no video shows « Leçon interactive en ligne » and is **not** counted as published (the rule is stated on the landing page and on the programme).8788**What a lesson is.** The deck's sections in order (`\AtlasSection`), each with: the words of its slides as real text (lead, definitions, « à retenir », warnings, lists, tables, comparisons, listings — converted from the deck sources), each slide one click away (« Voir la diapositive », and « Ouvrir en mode diapositives » ↔ « Lire dans la leçon »), the explorables and library diagrams attached to a slide of the section, the vocabulary the section uses (README glossary), the outcomes it covers (README mapping table), and « Vérifiez votre compréhension »: the quiz questions whose `slides:` field cites the section (a question is asked at the end of the *last* section it draws on), each with « Revoir la diapositive ». The full quiz stays at the bottom of the page. The laboratory shows its instructions and its starter files **to read**; nothing is downloadable while the course has no licence.8990**Never imported:** `slides/speaker-notes.md`, every `\note{…}` of the deck sources (removed before parsing), `labs/solution/`, `labs/rubric.md`, `video/` (narration script). The builder reads an allow-list of files only (`metadata.yaml`, `README.md`, `slides/main.tex`, `slides/sections/*.tex`, `quizzes/questions.yaml`, `labs/instructions.md`, `labs/starter/*` text files), refuses links, and never executes anything. Only sessions whose `metadata.yaml` says `implemented` or `validated` are built; a half-written directory is skipped with its reason. Quiz answer keys are part of a pack (the quiz is formative and corrected in the browser, spec §8) and are unreachable until the quiz is published.9192**1. Build packs** — anywhere the course repository is (Node only, about a second for all sessions):93```bash94pnpm lessons:build --from /chemin/vers/atlas-ai-mooc --out /tmp/atlas-lessons # every implemented session95pnpm lessons:build --from … --out … --sessions S01,S0296```97→ `<out>/SXX-lesson.json` (60–130 kB), deterministic and hashed: same repository, same file. The table prints sections, steps, questions placed, terms, explorables, and warnings (e.g. a question that cites no slide stays in the full quiz only).9899**2. Import packs** — where the studio's data lives:100```bash101pnpm studio lessons-import /tmp/atlas-lessons/S01-lesson.json /tmp/atlas-lessons/S02-lesson.json …102pnpm studio lessons-import --from-repo /chemin/vers/atlas-ai-mooc [--sessions S01,S02] # build + import in one step103```104or, in the studio: session → *Contenus* → « Importer un paquet de leçon ». The pack's hash is recomputed, its cross-references checked, and four sections are installed: **Leçon interactive**, **Quiz** (now with slide references), **Glossaire**, **Laboratoire**. Everything arrives **private**, or keeps the visibility it had. A quiz, glossary or lab text **edited in the studio is kept** (reported; `--force` takes the pack's). Importing twice changes nothing. Nothing is published.105106**3. Publish the lesson layer, and only it**107```bash108pnpm studio lessons-publish S01 S02 S03 # reversible: pnpm studio lessons-unpublish S01 …109```110For each session: lesson, quiz, glossary and lab instructions become public and the session is published again. **Refused** when the slides are not online (the lesson shows them: `slides-publish` first), and when the publication would also release anything else marked public in the studio. In the studio the same is done with the visibility menus of the four sections, then *Publication → Publier maintenant…*. `lessons-unpublish` puts the session back to slides only (the four sections go back to « Aperçu seulement »). Every step is in the session's history and in the journal.111112**Explorables.** In-browser re-implementations (TypeScript) of a session's demonstration; nothing runs on the server and nothing is stored. Each one's numbers are tested against values produced by the course's own Python code (`tests/fixtures/explorables/*.json`, regenerated by hand with `python3 scripts/fixtures/explorables_fixtures.py <course repo> tests/fixtures/explorables`). A pack lists the explorables available when it was built: **a new explorable reaches a session only through a rebuilt pack, re-imported and re-published.** Available today: S01 (2), S02 (3), S03 (2); six diagrams of the existing library are placed in S05, S06, S07, S09, S11, S12 and say they are generic. See `IMPLEMENTATION_STATUS.md` for what is not built.113114## Publishing, scheduling, rolling back115116Session → *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*.117118## Other screens119120*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*.121122## Partial, untested or absent123124- **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.125- **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.126- **Figures** cannot be edited or uploaded in the studio: they come from the repository import; only their visibility is set.127- **Glossary and bibliography editors**: built; only the glossary editor is driven by the end-to-end test.128- **Parts** are edited as a list (id, titles); no drag-and-drop anywhere (ordering uses up/down buttons).129- **Restoring an earlier publication into the working copy**: not built (rollback is public-side only).130- **Waveforms, automatic poster choice, slide/video synchronisation**: not built.131- **Backup/restore from the browser**: deliberately not offered (command line only); the studio lists existing backups.132- Real passkeys on real devices (Touch ID, iPhone, synced keys): **not verified** — the tests use Chromium's virtual authenticator.133- Uploads of real multi-gigabyte masters through the production gateway: **not verified** (largest file tested: 12 MB in three pieces, locally).134