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

+115
View File
@@ -0,0 +1,115 @@
# Translation coverage
<!-- Written by tests/sync-coverage.test.mjs. Do not edit; rerun `npm test` to refresh. -->
Each translator in `src/sync/` is run over every exercise with pseudo (17), every program in `tests/corpus/` (48), and 17 one-construct fixtures (`tests/helpers/sync-programs.mjs`). 3 of the 82 have pseudo that does not read, by design (they teach the notation's error messages), and are left out below. That leaves **79 programs**.
| From pseudo to | Says it completely | Says it with a gap or a checker error | Cannot say it |
| --- | ---: | ---: | ---: |
| Mojo | 77 | 2 | 0 |
| lingo | 31 | 0 | 48 |
| matho | 3 | 0 | 76 |
Mojo is a program-for-program translation that always produces something: a line with no faithful spelling becomes a visible `raise Error("not translated: pseudo line N")` and a warning. Lingo and matho must read back as the same program, so what they cannot say exactly they refuse, with the construct and its line, and the pane keeps its last good text.
## Mojo: lines that become a visible gap
These programs translate, with the listed lines left as a `raise Error`.
Nothing.
## Mojo: programs the translator refuses
Pseudo the course itself rejects is not translated.
Nothing.
## lingo: what English has no sentence for
English is read by `readSteps`, whose grammar has no sentence for these.
| What it has no form for | Programs | Which |
| --- | ---: | --- |
| steps outside a routine (every English step belongs to a routine) | 46 | 01-arithmetic.pseudo, 02-temperature.pseudo, 03-compound-interest.pseudo, 04-gcd-recursion.pseudo, and 42 more |
| a fixed-length ARRAY | 4 | ex:edit-distance, 05-primes-sieve.pseudo, 11-matrix-multiply.pseudo, 15-game-of-life.pseudo |
| a BYREF parameter | 3 | 06-fibonacci-memo.pseudo, 10-insertion-sort.pseudo, 26-swap-byref.pseudo |
| a HASHMAP whose values are not counts | 3 | ex:translate-codons, 13-stack-brackets.pseudo, 39-constants-codons.pseudo |
| a change to this part of a value | 2 | ex:edit-distance, 16-running-stats.pseudo |
| a DEFINE set | 2 | ex:translate-codons, 21-sets.pseudo |
| a loop step that is not a whole number written out | 2 | 05-primes-sieve.pseudo, 39-constants-codons.pseudo |
| a record | 2 | 12-records.pseudo, 16-running-stats.pseudo |
| a record type | 2 | 12-records.pseudo, 16-running-stats.pseudo |
| REMOVE(...) | 2 | 13-stack-brackets.pseudo, 14-queue-bfs.pseudo |
| the built-in ROWS | 2 | 11-matrix-multiply.pseudo, 15-game-of-life.pseudo |
| this kind of position | 2 | ex:edit-distance, 15-game-of-life.pseudo |
| a CONSTANT | 1 | 39-constants-codons.pseudo |
| a Field value | 1 | 12-records.pseudo |
| PARALLEL FOR | 1 | 43-parallel-map.pseudo |
| REPEAT ... UNTIL, which English reads as a loop that tests first | 1 | 46-projectile.pseudo |
| the built-in CHOOSE | 1 | 47-binomial-and-ph.pseudo |
| the built-in CHR | 1 | 08-caesar.pseudo |
| the built-in COS | 1 | 46-projectile.pseudo |
| the built-in FILL | 1 | 43-parallel-map.pseudo |
| the built-in LOG10 | 1 | 47-binomial-and-ph.pseudo |
| the built-in SIN | 1 | 46-projectile.pseudo |
| the built-in SPLIT | 1 | 40-text-builtins.pseudo |
| the built-in TO_INTEGER | 1 | 22-binary-to-decimal.pseudo |
| the built-in TO_STRING | 1 | 22-binary-to-decimal.pseudo |
## matho: what is not an equation
An equation lowers to one `FUNCTION` that returns a value; a program with output, text, a loop that does more than add up, or steps outside a function is not one.
| What it has no form for | Programs | Which |
| --- | ---: | --- |
| steps outside a function (an equation is a function) | 42 | 01-arithmetic.pseudo, 02-temperature.pseudo, 03-compound-interest.pseudo, 04-gcd-recursion.pseudo, and 38 more |
| a function that answers LIST (equations answer numbers) | 5 | ex:match, ex:match-proved, ex:match-off-by-one, ex:match-reset, and 1 more |
| a function that answers STRING (equations answer numbers) | 5 | ex:revcomp, fixture:string-build, fixture:slice, fixture:case, and 1 more |
| a function that answers BOOL (equations answer numbers) | 3 | ex:binary-search, fixture:early-return, fixture:forall |
| a loop that is not adding up or multiplying one value (FOR) | 3 | ex:best-position, fixture:loop-down, fixture:break-continue |
| the input T, which is not a number or a list of numbers | 3 | ex:first-unknown, ex:gc-fraction, fixture:set |
| a DEFINE set | 2 | ex:translate-codons, 21-sets.pseudo |
| a function that answers HASHMAP (equations answer numbers) | 2 | ex:tally, ex:kmers |
| a record type | 2 | 12-records.pseudo, 16-running-stats.pseudo |
| the input A, which is not a number or a list of numbers | 2 | ex:hamming, ex:edit-distance |
| the input B, which is not a number or a list of numbers | 2 | ex:count-base, ex:count-base-proved |
| a CONSTANT | 1 | 39-constants-codons.pseudo |
| a loop with a STEP | 1 | fixture:loop-step |
| a position that is not a loop counter plus or minus a number | 1 | fixture:min-max |
| a PROCEDURE | 1 | fixture:procedure |
| a WHILE loop | 1 | fixture:div-mod |
## matho: the equation sets
Each set in `tests/matho.test.mjs` is lowered to pseudo by the matho reader, written back as equations by `pseudoToMatho`, and checked: 26 of 28 round-trip.
| Equation set | Round-trips | Why not |
| --- | :---: | --- |
| mean-and-variance | yes | |
| mean | yes | |
| sum-from-one | yes | |
| sum-no-bounds | yes | |
| binomial | yes | |
| height | yes | |
| kinetic | yes | |
| gravity | yes | |
| omega | yes | |
| normal-density | yes | |
| ph | yes | |
| log2 | yes | |
| ln-and-log | yes | |
| factorial | yes | |
| choose | no | the loop counter K2 (matho writes it as a single letter) |
| cosine | yes | |
| distance | yes | |
| matrix-row | no | a two-dimensional position that is not two loop counters |
| nested-sums | yes | |
| relu | yes | |
| piecewise | yes | |
| calls-an-earlier-equation | yes | |
| sum-over-a-set | yes | |
| floor | yes | |
| ceiling | yes | |
| absolute | yes | |
| max-min | yes | |
| mod | yes | |