Move the engine core into core/, a project of its own (pplus-core)

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
This commit is contained in:
alexmandClaude committed 2026-10-05 05:43:58 +00:00
1 parent f43bbfe0cf
commit 82e18f7966
1567 files changed
+3670 -981

No files matched your search

+6 -3
View File
@@ -10,8 +10,9 @@
* scoped under `.pplus-static`. The app's color tokens come along: light by default, dark when the Quarto page is
* dark (`body.quarto-dark`, or Bootstrap's `data-bs-theme="dark"`); the paper and ink follow the page's own.
*
* It also copies the course's stylesheets for the machine views (course/*.css) and writes pplus-hw.css from
* styles/course/bridge.css.
* It also copies the course's stylesheets for the machine views (course/*.css), writes pplus-hw.css from
* styles/course/bridge.css, and copies pplus-core's KDE syntax for Mojo (core/syntax/mojo.xml, which core's corpus
* pipeline writes) to syntax/mojo.xml, for the listings Pandoc highlights.
*
* node scripts/quarto-css.mjs --check exit 1 if a file is not what this would write
*/
@@ -37,7 +38,7 @@ for (const id of ['count-base', 'count-base-proved', 'match-off-by-one', 'five-b
const files = Object.fromEntries(Object.entries(p.sources).filter(([, v]) => typeof v === 'string' && v.trim()));
for (const lang of Object.keys(files)) samples.push({ files, lang, call: p.call ?? null, setup: p.setup, machine: p.machine });
}
samples.push({ files: { mojo: fs.readFileSync(path.join(ROOT, 'mojo/stress/lifecycle-moves.mojo'), 'utf8') }, lang: 'mojo' });
samples.push({ files: { mojo: fs.readFileSync(path.join(ROOT, 'core/mojo/stress/lifecycle-moves.mojo'), 'utf8') }, lang: 'mojo' });
const used = new Set();
for (const s of samples) for (const view of STATIC_VIEWS.filter((v) => v !== 'hw')) {
let html = '';
@@ -147,6 +148,8 @@ outputs.push([path.join(EXT, 'pplus-hw.css'), `/* pplus-hw.css: GENERATED by \`p
page already has the colors and fonts those files read (--bs-body-bg, --bs-body-color, body.quarto-dark). */
${afterRoot}`]);
outputs.push([path.join(EXT, 'syntax', 'mojo.xml'), fs.readFileSync(path.join(ROOT, 'core/syntax/mojo.xml'), 'utf8')]);
if (process.argv.includes('--check')) {
const stale = outputs.filter(([file, want]) => !fs.existsSync(file) || fs.readFileSync(file, 'utf8') !== want).map(([file]) => path.relative(ROOT, file));
if (stale.length) { console.error(`quarto-css: out of date: ${stale.join(', ')}; run \`pixi run quarto-css\``); process.exit(1); }