What programs mean (the languages, translators, Mojo checker and
interpreter, prover, fuzzer, machine model, catalog problems and the Mojo
corpus with godbolt's stored answers) was mixed into the site's tree, so a
change to the prover and a change to a button went through the same gate
and the same docs. This moves all of it under core/, laid out as its own
repository, ready to be extracted with its history and pinned here as a
git submodule.
- core/: src/{engines,services,sync,mojo,exercises,curriculum,common},
mojo/, syntax/mojo.xml, its tests (with Workspace and workForProblem in
place of the site's Session), scripts (corpus pipeline, play, the
exercise and probe starters, engines export/diff), and its docs
(engines, trust, mojo-corpus, exercises, coverage). Its own pixi.toml,
package.json, README, AGENTS.md and CI workflow.
- core/tests/boundary.test.mjs: library modules use no DOM, import no
page widget, and import nothing outside src/.
- core/scripts/cli.mjs: pixi run cli check|run|prove|fuzz|translate.
- core/scripts/dafny.py: Dafny 4.11.0 pinned by version and SHA-256 per
platform, fetched into .tools/ (pixi run dafny-fetch, pixi run dafny).
- The site imports core only as #core/<path>.js: an import map in
index.html, "imports" in package.json for node, core's declarations for
tsc. The site's TypeScript builds core first (npm run build).
- assemble.sh, the Quarto engine copy, the render cache key, check-pages,
quarto-export and quarto-css read core/dist and core/mojo; quarto-css
copies core's syntax/mojo.xml into the extension.
- Site tests that covered engines moved to core; the rest keep Session.
- README, AGENTS.md, docs/app.md, docs/deploy.md and the CI workflow
describe the split (checkout with submodules; core's tests and corpus
status run against the pinned commit).
Gate: site 110 pass; core 307 pass; corpus status --strict passes.
Manual check: the assembled site opens Bridge (count-base-proved),
Developer and Hardware (count-base) with the editor, the stepper and the
board, and no module errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
2.8 KiB
styles/course
Stylesheets from the course site (static/css/ in its repository), copied here unchanged so the vendored engines' widgets (pplus-core's core/src/engines/asm86/views.js and hwviews.js: registers, memory, caches, pipeline, the out-of-order core) can be shown in the app with the look they have on the course pages. index.html loads them, and the Hardware area's machine board (src/ui/hw/board.ts) is what uses them.
| File here | Course path | What it holds | sha256 |
|---|---|---|---|
tokens.css |
static/css/base/tokens.css |
--course-* roles and the --viz-* chart palette that shared/viz.js and the hardware views read |
b2f40ca21e0f0a38aaf3dd096ec91e8afeb2455742f1fe255577cbaecd01a745 |
kit.css |
static/css/widgets/kit.css |
the --w-* tokens and controls shared by the widget families |
51b46da837fcf64d20fd497458d2328a1e896913a2d2fededab198b58e889790 |
asm86.css |
static/css/widgets/asm86.css |
every .a86-* rule the x86-64 widgets use (needs kit.css first) |
dba269f466b33be7621a2156a0db386d24b89927cf3bfa00397b8af58759e576 |
bridge.css |
(ours) | gives the course files the page colors and fonts they expect, from the app's tokens |
The Quarto extension ships the same three files in quarto/_extensions/pplus/course/, with the board's adjustments from bridge.css (its :root block left out, since a Quarto page has those colors already) as pplus-hw.css; pixi run quarto-css copies them, and tests/quarto.test.mjs fails while the copies differ.
tests/course-css.test.mjs checks that each copied file still has the hash above, so a local edit cannot slip in: a change belongs in the course repository, then copy the file again and update its hash here.
Using them
Load in this order, after styles.css: bridge.css, tokens.css, kit.css, asm86.css. Then:
- The theme. The course files switch to dark on
body.quarto-dark, and they follow the operating system only when the body has neitherquarto-lightnorquarto-dark. The app therefore puts exactly one of those classes on<body>, matching the theme it shows:syncBodyTheme()insrc/ui/theme.ts(the choice itself is the purethemeBodyClass(), tested intests/hardware.test.mjs) runs at load, on every theme change, on a host page's forced theme, and when the system preference changes. Without that, a light app on a dark system would draw dark widgets. - The root class. The widgets build their own
.a86root, so their rules cannot touch the rest of the app. - The pseudocode lab (
pseudo-lab.css) is not copied: the app draws its own views for pseudo and does not use the engine'sviews.jsfor it.
Updating
Copy the three files from the course repository's static/css/ (paths in the table), run sha256sum styles/course/*.css, put the new hashes in the table above, and run pixi run test.