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

+7 -6
View File
@@ -5,7 +5,7 @@
//
// node scripts/check-pages.mjs /path/to/site/programmingplus [more folders ...]
//
// Set PPLUS_DIR to use another checkout's dist/; set CHECK_FILES_ONLY=1 to only check that the files
// Set PPLUS_DIR to use another checkout's dist/ (and its core/dist/); set CHECK_FILES_ONLY=1 to only check that the files
// the shortcodes name exist (no engine needed).
//
// A program file may carry expectations in comment lines at the top:
@@ -84,16 +84,17 @@ if (!pplusDir) {
// 2. every program parses, runs, and prints what it says
const dist = path.join(pplusDir, 'dist');
const { studyOf, runPseudo } = await import(pathToFileURL(path.join(dist, 'services/pseudo.js')));
const { removedSyntax } = await import(pathToFileURL(path.join(dist, 'mojo/check.js')));
const { MOJO_VERSION } = await import(pathToFileURL(path.join(dist, 'mojo/generated/pin.js')));
const coreDist = path.join(pplusDir, 'core', 'dist'); // pplus-core, built beside the app
const { studyOf, runPseudo } = await import(pathToFileURL(path.join(coreDist, 'services/pseudo.js')));
const { removedSyntax } = await import(pathToFileURL(path.join(coreDist, 'mojo/check.js')));
const { MOJO_VERSION } = await import(pathToFileURL(path.join(coreDist, 'mojo/generated/pin.js')));
const mojoVersion = (() => { const r = spawnSync('mojo', ['--version'], { encoding: 'utf8' }); return r.status === 0 ? r.stdout.trim() : null; })();
if (programs.some((f) => f.endsWith('.mojo'))) {
if (!mojoVersion) console.log(' (note) no mojo compiler on the PATH: .mojo files are checked for removed syntax only. Run inside pixi to build and run them.');
else if (!mojoVersion.includes(MOJO_VERSION)) console.log(` (warning) ${mojoVersion} is not the pinned Mojo ${MOJO_VERSION}; results may not match the site`);
}
const { readLingo, lowerLingo, runLingo } = await import(pathToFileURL(path.join(dist, 'services/lingo.js')));
const { parseMatho, lowerMatho, runMatho } = await import(pathToFileURL(path.join(dist, 'services/matho.js')));
const { readLingo, lowerLingo, runLingo } = await import(pathToFileURL(path.join(coreDist, 'services/lingo.js')));
const { parseMatho, lowerMatho, runMatho } = await import(pathToFileURL(path.join(coreDist, 'services/matho.js')));
function header(text) {
const h = { expect: [], input: [], questions: [], stops: null };