SPB Git

Repository Public MIT Research preview

architecture.md 8.2 KB

# Architecture

How the repository is organised, what generates what, and how to build it. Specification: CLAUDE.md.

# Principles

  1. Single sources of truth. A fact is written once and propagated by code.
  2. Everything reproducible. Decks, figures, numbers, reports and catalogs are rebuilt by make.
  3. Honest status. Readiness is computed from evidence (reports/STATUS.md), not declared.
  4. Offline by default. Building, testing and running labs need no network and no account.

# Sources of truth and what they generate

Source (edit this) Generator Generated (do not edit)
course.yaml — identity, author, affiliation, language, parts, 24 sessions, outcomes, prerequisites tools/sync_course.py latex/atlas-course.tex; metadata.yaml and README.md of planned sessions
course.yaml + session metadata + build reports tools/generate_catalog.py docs/curriculum.md, assets/shared-diagrams/ATLAS-F26-carte-du-cours.tex, site/catalog.json, reports/STATUS.md, reports/status.json
sessions/SXX/quizzes/questions.yaml tools/render_docs.py quizzes/explanations.md
sessions/SXX/figures/manifest.yaml tools/render_docs.py, tools/validate_assets.py --write accessibility/alt-text.md, assets/asset-register.csv
session demo code (e.g. demos/src/atlas_s01/corpus.py) the session's export script figure data files figures/src/*-donnees.tex
brand/colors.tex, brand/typography.tex loaded by latex/atlas-colors.sty, latex/atlas-theme.sty every deck and figure

--check on each generator fails when an output is stale; make lint and CI run these checks.

# Directory map

text
course.yaml            single source of truth for identity and curriculum
brand/                 palette, typography, logo source, identity guide
latex/                 class (atlas-beamer.cls), theme, colour system, figure studio, accessibility helpers
  components/          boxes, structural frames, code listings
  tikz-library/        shared visual grammar (styles, token rows, context bands) and original icons
  pgfplots-library/    plot styles
  templates/           standalone figure wrapper
assets/                shared diagrams, icon sheet, font manifest, asset register
datasets/              synthetic datasets and provenance
sessions/SXX-slug/     one self-contained session (see CLAUDE.md §3)
tools/                 build, generators, validators (Python: standard library + PyYAML; Pillow optional)
tests/                 repository-level tests (pytest)
docs/                  this documentation
reports/               machine- and human-readable status and QA reports
site/                  catalog data for a future static site (optional, not a prerequisite)
dist/                  generated PDFs, previews and build directories (ignored by git)

# LaTeX layering

text
sessions/SXX/slides/main.tex
  └─ \documentclass{atlas-beamer}          options: print | handout | notes
       └─ atlas-theme.sty                   fonts, babel (french), frame chrome, footer attribution, progress bar
            ├─ atlas-colors.sty  ← brand/colors.tex        semantic colours, dark and print values
            ├─ typography.tex    ← brand/                  Fira Sans/Mono by file name, Latin Modern fallback
            ├─ atlas-figures.sty ← tikz-library/, pgfplots-library/
            ├─ atlas-accessibility.sty                      language metadata, status marks, term macros
            ├─ atlas-course.tex  ← course.yaml (generated)  author, institution, course titles
            └─ components/       boxes, frames (title, section, roadmap, references, closing), code

Figure sources are plain tikzpicture files. The same file is \input in a deck through \AtlasDiagram and rendered alone through latex/templates/figure-standalone.tex (dark and print). Files are found through TEXINPUTS, set by tools/build.py and by each session's slides/.latexmkrc.

Engine: LuaLaTeX via latexmk, bibliography with biblatex + biber. Builds set SOURCE_DATE_EPOCH for stable PDF dates.

# Build and quality pipeline

text
make sync → make slides / handouts / notes → make preview → make lint → make test → make catalog
                                                └ contact sheets for HUMAN review → qa/results.json
Target Tool Output
make setup tools/check_toolchain.py list of present and missing components (installs nothing)
make slides [SESSION=] tools/build.py slides dist/slides/SXX.pdf, reports/build-SXX.json
make handouts / make notes tools/build.py slides --variant … SXX-handout.pdf (light, overlays collapsed), SXX-notes.pdf
make figures tools/build.py figures, shared figures/rendered/*.pdf, .png, .svg, -print.*
make preview tools/render_preview.py dist/preview/SXX/page-NN.png, contact sheets, PDF checks
make demo / make demos tools/validate_labs.py --demo-only --show demo output
make test / make tests pytest repository tests + session tests
make lint all validate_*.py, --check generators reports/*.json
make links tools/validate_links.py --online reports/links.json (needs network)
make catalog tools/generate_catalog.py curriculum, course map, status
make qa all of the above everything
make clean — removes dist/ and caches only

# What the validators enforce

  • structure — required files per status, metadata vs course.yaml, instructor attribution, sequential slide IDs with speaker notes, no placeholder text, French learner-facing files, honest validated label, no media files, video-duration estimates.
  • latex — shared macros defined, \input/figure/citation integrity, bibliography fields, French frame titles, type-scale minimum, no \includegraphics; after a build: no errors, undefined references, missing glyphs, font fallback or overflow.
  • assets — manifest completeness, renders present, register in sync, no stock/raster/media files, secret scan.
  • quizzes — schema, answer keys, explanations, distractor rationales, outcome coverage, question variety, slide references.
  • accessibility — WCAG contrast of the palette in both modes, alt-text length, generated files current, captions template honesty, PDF metadata.
  • links — source registry completeness; optional online resolution.
  • labs — demos run and match their documented output, tests pass, solutions do not leak, safe commands, offline, cross-platform notes.

Subjective quality (composition, clarity, pacing) is reviewed by a person looking at the rendered slides and recorded in sessions/SXX/qa/results.json. Automated checks never stand in for that review.

# Toolchain

Component Version used for the current build Notes
TeX Live 2026 (LuaHBTeX 1.24.0) packages: beamer, pgf/tikz, pgfplots, tcolorbox, biblatex, fontspec, unicode-math, babel-french, csquotes, standalone, colortbl, booktabs, listings, fira, firamath
latexmk, biber from the TeX distribution
Poppler pdftoppm, pdfinfo, pdffonts, pdftotext, pdftocairo previews and PDF checks
Python 3.14 locally; labs are written for 3.10+ requirements-dev.txt: PyYAML, pytest, Pillow (pinned)
make, git system on Windows without make, call python tools/… directly

CI (.github/workflows/): quality-gates (no TeX needed), labs-test (Linux, macOS, Windows × Python 3.10 and 3.12), latex-build (TeX Live container). CI has not yet run: the repository has no remote. The workflows are scaffolding until the first push.

# Extending

  • New session: follow CONTRIBUTING.md; copy the structure of sessions/S01-what-is-an-llm/.
  • New reusable figure primitive: add a style or pic to latex/tikz-library/, document it in docs/visual-design-system.md, add it to the icon sheet if it is an icon.
  • New validator rule: add it to the relevant tools/validate_*.py, with a test in tests/.
  • Translation (en-CA): learner-facing strings are isolated in .tex section files, YAML and Markdown; code, figure geometry and tooling are language-neutral. See docs/accessibility.md.
Files main
Menu

Theme