Files
pplus-web/docs/app.md
T
alexm e092cb029c
Build, test, deploy / site (push) Failing after 15m13s
Initial commit
2026-11-12 22:24:02 -05:00

235 lines
58 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# What the app does
Programming+ takes a procedure from an idea to Mojo to the machine. This is the reference for the app itself: the three areas, their links and embeds, and what each part of the workspace does. For commands, see the [README](../README.md).
## The areas
The app has three areas, one workspace layout each (`src/core/areas.ts`, the `AREAS` table; the names are placeholders the owner can change in one line). A problem is one saved state shared by all three, so moving from one area to another carries the work along. The area comes from the route, not the state. Each area is its own page, reached from the nav and the home page; the toolbar names the area you are in and offers a switch only to an area that would show the open pane exactly as it is (`safeSwitches` in `src/core/areas.ts`): in practice Developer and Hardware on the same Mojo, and the Bridge's Mojo tab once the student's Mojo is its translation. A learner moving between areas therefore never finds the work changed by the move itself; **Edit in Developer** and **Open in Hardware** are the deliberate moves that carry work across.
| Area | For | Panes | Inspect tabs | Dock |
|---|---|---|---|---|
| **Bridge** (`bridge`) | taking a written problem or idea into Mojo | lingo, matho, pseudo, speco, Mojo | run, flowchart, data flow, prove, tests | setup, output, problems, compiler |
| **Developer** (`dev`) | Mojo coding | Mojo | run, flowchart, data flow, tests | setup, output, problems, compiler |
| **Hardware** (`hw`) | Mojo and x86-64 with the machine in view | Mojo, x86-64 | none: two panes, the code and the board, whose cards hold the run, registers, memory, caches, pipeline, chip, setup, output, problems and compiler | none |
Each catalog problem names the area it opens in (`area` on the exercise): Hardware for `asm-*` problems, Developer for ones that are only a Mojo program, Bridge for the rest. The panes a state is shown with come from the area, so a link made in one area opens in another on that area's first choice of pane. Layout (the dividers, the dock tab, what is folded) is kept per area (`layout: { bridge, dev, hw }` in the state). **Open in Hardware** on the compiler's listing puts a function into the x86-64 pane and switches area.
### The home page
The home page (`src/ui/home.ts`) opens with why the platform exists: work is done by human and artificial agents, producing code and analyses is cheap, and someone still has to take responsibility for the output, which takes knowing what it does step by step (the hero's sign-off panel lists who might have made it above the sentence that has to be signed). Under that reason the hero says what Programming+ is, in the sentence this document, the README and `index.html` share (`DESCRIPTION` in `src/core/site.ts`). Three columns follow (producing got cheap, ownership did not, the gap from novice to expert is where tools are missing), with AlphaFold as the example. Then each area gets a card with its name and tagline from `AREAS` and a sample the engines make on the spot, each in a window of the same height: the Bridge turns the mean, written as an equation, into pseudo, lingo and labeled Mojo through the same hub the panes use, with what each notation is beside its name, since this is where the names first appear; Developer shows the checker's advice on a moved-out value and the first steps of `count_base`; Hardware shows the registers and the cache line of the first load in `asm-two-pointers` on the teaching machine. **Why Mojo** says why it is the one real language: it reads plainly, it is compiled with strict rules there is always a precise answer to, it spans a first program to hand-written GPU kernels (which Programming+ does not show yet), and, as an opinion marked as one, we believe it will lead in the computational sciences. The notations section shows `count_base` in six even boxes, except matho, which cannot express it (B is a character) and says so. The problem list shows the areas each problem opens in (`areasFor` in `src/core/areas.ts`: its own area first, then the Bridge if it has lingo, matho, pseudo or speco, Developer if it has Mojo, Hardware if it has x86-64), with a link to each, and filters by area. The footer (`src/ui/footer.ts`, on the home page, the library and With Quarto) links the license and notices that `scripts/assemble.sh` ships with the site (`LICENSE.md`, `NOTICE.md`, `THIRD_PARTY.md`), says that Programming+ is not affiliated with or endorsed by Modular, links the source when `SOURCE_URL` in `src/core/site.ts` is set, shows the commit an assembled site was built from, and holds **What this site stores and sends** (`SITE_DATA`; `tests/site-data.test.mjs` holds each statement to the code).
### The Bridge workspace
Four languages are kept in step (see [Translation between languages](#translation-between-languages)): tabs run **lingo, matho, pseudo, speco**, then **Mojo (from pseudo)** set slightly apart.
- **Link state on every tab.** ✎ the pane you are editing (the others follow it), ⇄ in step, ⚠ not in step (the reason is in the tooltip and in the banner above the editor), nothing for a pane still **as authored** (nothing has been translated yet; the first edit makes that pane the authority).
- **Typing never fights the cursor.** The pane being edited is never rewritten. The other panes are brought up to date when their tab is shown, replacing only the part of the text that changed, so the cursor and scroll position of a pane stay put. Each such update is its own undo step (the editor's `setSynced`, a `sync` user event that history does not join to typing), so Ctrl+Z in a pane steps back to what it showed before the sync, and, as with any change to a pane, that pane then becomes the authority. Loading a problem is not an undoable edit.
- **A pane that is not in step** (matho for a `WHILE`; anything while the pane you edited does not read) keeps its last text, is read-only, and says why, with an **Edit anyway** button that makes it the authority. The stepper does not step a stale lingo or matho pane; it steps the pseudo.
- **Mojo (from pseudo)** is read-only, labeled *Generated from pseudo*, and computed from the pseudo on the fly (`Session.derivedMojo()`; the state's own `sources.mojo` is untouched). It steps in the Mojo interpreter, is checked, and **Compile & run** sends it to the real compiler. **Edit in Developer** copies it into the Developer area's Mojo pane (asking first if that pane holds something else) and records `mojoOrigin: 'generated'`; the first edit there makes it `'generated-edited'`, and the Mojo pane says so.
- **Prove and Tests** work on the hub's pseudo with the speco woven in, whichever pane you edited.
Every area is an IDE-style workspace: the language panes as tabs over one editor; under it the stepper and what runs next; beside it an inspect panel (the Run view, flowchart, data flow, proof, tests) whose tabs appear only when they apply to the pane; under everything a dock for the output, the problems, the real compiler's answer, and the machine model's numbers. A catalog of worked problems comes with it.
### The Hardware area
Two panes, and nothing shown twice. Everything the board shows is the model machine's (core's `src/engines/asm86/`): its cycle counts and cache behavior are a teaching model, not a measurement of a real processor, and the views say "on the model machine" where they state a cost. On the left the code (the Mojo and x86-64 tabs over one editor) and the stepper under it. On the right the **board** (`src/ui/hw/board.ts`), a set of cards in a two-column grid (twelve tracks, a half card spanning six): the course's own x86-64 views (`core/src/engines/asm86/views.js` and `hwviews.js`, the widgets the course pages use, with the course's stylesheets from `styles/course/`), mounted over the x86-64 pane's run and moved by the stepper, and the app's own views as cards too: Setup, Output, Problems, the Compiler, the Run view (for the Mojo pane), the counters, and the cache lines. The area has no inspect panel and no dock (`workspace: 'board'` in `AREAS`); Compile & run and a click on a diagnostic bring their card into view, adding it if the board does not show it.
**Arranging it.** Presets along the top set out cards that make sense to see at once. **+ Add a view** opens every card by group (Program, Registers and memory, Memory system, Time, The chip); click one to put it on the board or take it off. Drag a card by its title to move it (or use ↑ ↓), ↔ widens it to the whole row or narrows it to share one, × takes it off. The arrangement is kept per area (`layout.hw.board`, a list of `{ id, wide? }`, cleaned by `normalizeBoard`), and the preset buttons show which preset it is, if any. Every change is a pure function in `src/core/hardware.ts` (`moveItem`, `addItem`, `removeItem`, `toggleWide`, `presetOf`).
The presets:
- **Registers and memory**: a card per register the program touches (amber when the last instruction wrote it, with the value before), with every narrower name (`eax`, `ax`, `al`, `ah`) for the registers the program also uses at a narrower width; the flags, with the ones the last instruction read; the effective address as base + index × scale + displacement; the memory regions byte by byte with the load (blue) or store (purple) highlighted; and the stack as eight-byte slots with `rsp` and `rbp` marked.
- **Caches**: memory below the instruction set. **Cache lines** (the board's own view, `src/ui/hw/lines.ts`) shows, for each load and store of the last instruction, the whole line it touched as a row of bytes: the bytes this access used, the ones the program used before, the ones it uses later, and the ones it never uses, with where the line was found (an L1d hit, or the level it came from) and "used 8 of this line's 64 bytes". Beside it the course's L1d cache as sets and ways (hit green, miss red, the evicted line named), the hierarchy with the path each access took and running totals, and, with virtual memory on, the page walk and the TLB.
- **Pipeline**: time. The classic five-stage pipeline cycle by cycle (stalls amber, wrong-path fetches red, the whole run's lost cycles by cause), the micro-ops the last instruction became and the ports each can run on, what bounds the whole run (the dependency chain, the busiest ports, the front end), and the out-of-order timeline of when each instruction entered, ran and retired.
- **Whole chip**: the core from branch predictor to memory with the parts the last instruction used lit up, each lit edge with an arrowhead on the end its data reached (a load's data back up from wherever it was found to the load port, a fetch that missed back into L1i, a store out through the store buffer, the result into the registers from the port that produced it); the listing with each instruction's address and bytes beside the last instruction's machine code broken into prefix, REX, opcode, ModRM, SIB, displacement and immediate; and last, inside the out-of-order core (reorder buffer, ports, rename table, with its own cycle buttons), whose table grows and shrinks with what is in flight.
**The listing and the encoding as a pair.** When the two are next to each other at half width, `board.ts` marks them as a pair: on a board at least 960px wide they share a row two to one, and on a narrower one the encoding sits under the listing. The listing then scrolls in its own box, as tall as the encoding (300px when stacked), and keeps the instruction about to run in view; only that box scrolls, never the page.
**Nothing moves while stepping.** A card never gets shorter while one run is stepped: each keeps the tallest height it has reached as its minimum. When the board is built it first draws a spread of the run's steps (all of a short run, forty of a long one, always the last) before the browser paints, so views that grow with the run (the pipeline, the timeline) start at their final size. The minimums start over with a new run, machine or arrangement, and when the board's width changes. The same rule holds the Run view's panel of followed variables, and a string or list with no value yet keeps the height of its ruler. Elsewhere the boxes that change with each step have fixed sizes: what runs next (two lines, each cut with an ellipsis, the whole text in its tooltip), the loop status (one line), the register cards' "was" line, and in `styles/course/bridge.css` the core's caption, the address arithmetic and the cache-line list.
- **Mojo and the compiler**: the Run view of the Mojo pane, the real compiler's answer and listing (with Open in Hardware), the output and the problems.
- **Counters** (a card in any arrangement): the model machine's totals for the run, in the style of `perf stat`, and for code sent from the Compiler view what each Mojo line cost on it.
**Mojo and x86-64.** The two are tabs over the one editor, never split side by side. x86-64 sent from the Compiler view ends each instruction with `; mojo line N`, godbolt's own line table (`forSimulator` in `core/src/mojo/att.ts`); through it, clicking a line in either pane marks the matching lines in the other tab, lit when that tab is selected (`asmMojoLines` and `relateAsmMojo` in `src/core/hardware.ts`). A short note in the pane head says so; for x86-64 written by hand, which has no such table, it says the lines are not linked. The Mojo there carries its generated label and godbolt badge, as everywhere. Compiling needs the network; without a listing the area works on hand-written x86-64 alone.
The board's **machine** switch (also in the Setup card): `teaching` (caches small enough that misses happen on small data), `realistic` (shaped like a desktop core: 64-byte lines, an L3, a next-line prefetcher), or `ideal`; and **virtual memory** turns on paging with a TLB. The state stores it as one string (`machine: 'teaching+paging'`; `parseMachine` and `machineSpec` in `src/core/hardware.ts`), and the run hands it to the hardware model through the trace, so the board's views and the counters always describe the same machine. With virtual memory on, a line is the physical one and the access keeps the address the program wrote.
What each card mounts, with what options, and the frame each view draws at each step are decided DOM-free in `src/core/hardware.ts` and tested for every problem with assembly (`tests/hardware.test.mjs`); a view that throws says so in its own card and leaves the rest working. The course files draw dark on `body.quarto-dark`, so the app keeps exactly one of `quarto-light` and `quarto-dark` on `<body>`, matching the theme it shows (`src/ui/theme.ts`).
### Mojo badges
Two independent badges sit beside any Mojo the site shows (pane head, Compiler view, Mojo embeds, Share dialog):
- **Generated from pseudo** (or **Started from generated Mojo** once edited). `mojoProvenance` (`src/core/provenance.ts`) answers for every view: the Bridge's Mojo is always generated, elsewhere `PlayState.mojoOrigin` says. Generated Mojo starts with a header comment, so copying it keeps the warning. It never shows beside "verified on Mojo" (which is only for an exercise's own program). Only the Developer area's **I've reviewed this** button clears it (`Session.clearMojoOrigin`), taking the header comment off too; compiling and editing do not.
- **Compiled on godbolt**, with the outcome (ran, exit N / did not compile / timed out), the compiler and build level in the tooltip, or **Edited since compile**. It is keyed by a hash of source, input and build level (`compiledStatus` in `src/core/compiles.ts`), so a one-character edit, another level or another input removes it. Full answers are the newest 16 in `pplus.compiles`; a summary index (`pplus.compiled`, up to 300) lets the badge outlive them. Neither is in `PlayState`, a share link or a file: a link never claims a compile that this browser did not make. The badge means the compiler answered, not that the program is right.
### Best practices (the helper)
`core/src/mojo/practices.ts` (DOM-free) turns the gap between the translator's literal Mojo and the Mojo a person would write into things to learn from. It is **off by default in both the Bridge and the Developer area**: each area has its own switch (the toolbar's "Best practices" button), remembered in this browser (`pplus.practices.bridge`, `pplus.practices.dev`; `src/core/prefs.ts`), never in `PlayState` or a link. While a switch is off the rules never run (a spy test holds it to that) and nothing about them is shown. The translator never imports the helper, so the Bridge's Mojo is the same literal translation either way (a grep gate and a snapshot test keep it so).
A rule is `{ id, title, why, docUrl, example, apis, detect }`. The starting rules: declare-then-assign → `var n = …`; `x = x + 1` → `x += 1`; an index loop that only reads codepoints → `for cp in t.codepoint_slices()`; `raises` on a function that cannot raise; a never-changed number that sizes a loop → `comptime`; argument conventions (`imm` written out is the default; `mut` on an argument never changed); `reserve` before a loop that appends a known number of times; `name^` for a last use handed to a `var` argument; `.copy()` for a list copy that says so. (Mojo 1.1.0 renamed the `read` convention `imm`, so the helper says `imm`.)
- **Bridge:** the Best practices dock tab lists each finding with the Mojo line, the pseudo line it came from (the hub's line map), the reason, before and after, the manual link, and, where true, how to write the pseudo so the translator writes the better form. Clicking one lights both lines. The Mojo is read-only, so rewrites are shown, not applied. **Show idiomatic version** (in the Mojo tab, off until chosen) shows a copy with the safe rewrites applied, only if it passes the checker no worse than the literal one and the interpreter prints exactly what the literal one prints; it keeps the generated label ("Generated from pseudo, with N best-practice rewrites").
- **Developer:** findings are `note` diagnostics with origin "best practices" (never an error or a warning, so they never look like the compiler) in Problems and the gutter, each with a one-click fix where the rewrite is safe. A rule that cannot promise a safe rewrite (`comptime`) explains and leaves the editing to the student.
- **Tests** (`core/tests/practices.test.mjs`): every rule's example passes the checker, runs, and prints the same before and after, and the rule's fix turns one into the other; every method a rewrite names is in the harvested index; a false-positive gate runs the rules over Modular's own tested programs in `core/library/mojo/corpus/manual/` against a reviewed allowlist; each exercise's findings are pinned by a snapshot; applying every fix to each exercise's generated Mojo and each `core/library/mojo/local/` program keeps it checking and printing the same.
### Saved versions
A student can save the state of their work under a name and come back to any saved version from the **Versions** menu in every area's toolbar (`src/core/versions.ts`, DOM-free, storage injectable).
- **What a version holds:** every source, the link bookkeeping (`sync`), where the Mojo came from (`mojoOrigin`), the call, the input, the assembly setup and machine, and the build level, plus the area it was saved in, a name, and a time. Not the layout, the step, or the open tab: restoring a version changes the work and never where you are looking. (`EDITS`, which decides whether work differs from the problem as written, keeps leaving `sync` out; the version fingerprint adds it, so restoring brings the links back as they were.)
- **Where they live:** `localStorage`, one list per piece of work: `pplus.versions.<problemId>`, or `pplus.versions.ws.<workspaceId>` for work that began from a share link or a file (`PlayState.workspace` is added when such work is first saved, and the address is updated so a reload finds it). Every area shows the same list. At most 50 per list: when it is full the oldest automatic version makes room, and if only named ones are left the save is refused rather than delete one. The menu says when the browser's storage is nearly full.
- **Never losing work:** choosing a version, **Reset**, and **See the new version** first save work that no version holds as "Before switching (time)" or "Before reset (time)". If that save is refused, the switch does not happen.
- **A problem that changed under saved edits** shows a banner with **See the new version**: your edits become the version "My edits, before the problem changed" and the problem opens as it is now.
- **Between browsers:** Share → Download writes the state and, with a checkbox (on by default), its versions; Open… puts them in the right list and never overwrites a version that has the same id. A share link carries only the current state.
### The library
**Library** (`#/library`, `src/ui/library.ts`) lists every routine of pplus-library, as core's registry holds it (`#core/library/registry.js`, generated from the submodule `core/library`), grouped by module, each with a count of how its checks ended. A routine's page (`#/library/md.LennardJones`) shows the routine's pseudo, its cases with the results the pseudo gives, every check with its detail (cases, prover, fuzzer, generated Mojo, each reference implementation per way of running it, the proof), each reference's source with its note and tolerance, the Dafny proof, and the sources of the method. **Open in the Bridge** opens the routine as a problem with the id `lib:<module>.<Name>` (`src/core/library.ts`): its pseudo in the pseudo pane and its first case as the call, so it can be stepped through, which a program that only USEs it never does (a run steps over library routines; core's [docs/library.md](../core/docs/library.md)). Edits are saved per routine, like a problem's.
### With Quarto
`#/quarto` (`src/ui/quarto.ts`, linked from the nav, the footer, and a section of the home page that shows one shortcode beside the stepper it makes) is a gallery of the Quarto extension's shortcodes ([quarto/README.md](../quarto/README.md)). Each card shows what an author writes (the shortcode, and every program file it names, in tabs) and what the reader gets, drawn when the card scrolls into view by the same code `quarto render` runs: `renderStatic` for the rendered views and the machine, this app's own `#/embed/...` route in an iframe for the live ones. The cards can be filtered by kind (rendered with the page, the machine, live, text); one machine card has a menu of every `pplus-hw-<view>` and draws the one chosen. `#/quarto#<shortcode>` scrolls to a card, `#/quarto#setup` to the set-up steps. The page loads the extension's `pplus.css` and `pplus.js` from the site (`scripts/assemble.sh` copies the extension into `site/`), so the steppers and "make it live" behave exactly as on a Quarto page. The shortcodes, their options and the sample programs come from `src/quarto/shortcodes.ts` and `galleryFiles()`; `tests/quarto-gallery.test.mjs` renders every sample and holds each program in it to its header lines.
## Links
| URL | Opens |
|---|---|
| `/#/` | the home page: pitch, problems, reference |
| `/#/<area>/p/<problem>` | a catalog problem in an area (`bridge`, `dev` or `hw`), with the student's saved edits (localStorage) |
| `/#/<area>/s/<state>` | a shared state in an area: every pane, the call, the setup, the step — compressed into the link |
| `/#/embed/<view>/<state>` | one view, no chrome, for an `<iframe>` |
| `/#/embed/<view>/p/<problem>` | one view of a catalog problem |
| `/#/quarto` | With Quarto: the gallery of the Quarto extension's shortcodes (`#/quarto#<section>` scrolls to one) |
**What a link may hold.** Anyone can make a link, so the app reads one with limits (`LIMITS`, `decodeState` and `readStateFile` in `src/core/state.ts`): a blob of more than a million characters, one that unpacks to more than 2 MB (a decompression bomb), a `.pplus.json` larger than that, a link cut short or changed, and a file that is not a Programming+ state are each refused with a sentence that says which (`StateError`), before any engine sees them. A shared state (`#/<area>/s/...`) is the sender's work: it is never saved over this browser's own save for the problem it names, so opening someone's link to `count-base` cannot replace your `count-base` work (its saved versions still go to that problem's list, which only adds). A problem id in a state is only ever an id (`PROBLEM_ID`). A pane that an engine cannot read without failing (brackets nested tens of thousands deep, past what a parser's recursion can follow) gets one error, `engine-stop`, and the rest of the page keeps working (`Session.cached`); anything else that goes wrong while a page opens shows a page that says what, never a blank one.
**Work that takes the page down.** The engines stop a program that runs too long or makes values too large (core's [limits.md](../core/docs/limits.md)), but should a program still use up the tab's memory first, the browser kills the page. Saved work runs again as the page opens, so before it runs its save is marked busy in this tab (`src/core/guard.ts`, in `sessionStorage`), and the mark is cleared once the page has been idle for a moment and when it closes normally. A reload that finds the mark puts that save aside as a named version, "When the page stopped (time)", opens the problem as written, and says so; an embed drops the reader's edits instead. If a saved state makes the page fail in any other way, the page that says so offers the same: keep the work as a version and open the problem as written.
Nothing else is a route: `#/p/<problem>`, `#/s/<state>` and the other earlier forms open the home page, with a note at the foot of the page that there is no page at that address (`isUnknownRoute` in `src/core/state.ts`). A problem or library routine that does not exist, in the app or in an embed, is a page that says so; so is a link that does not open (below). `<view>` is `playground` (the whole workspace; `?area=dev` picks the area, Bridge by default or the problem's own), `trace`, `table`, `flow`, `data`, `life`, `proof`, `tests`, `problems`, `compiler`, `asm` (the machine numbers), or a pane name (`lingo`, `pseudo`, `speco`, `mojo`, `asm`) to show just that editor with its problems under it. Query parameters on an embed: `?t=12` parks the stepper, `?ro=1` makes the editor read-only; `area`, `panel`, `lang`, `build`, `machine`, `dock`, `docktab`, `editor`, `side`, `dockheight` and `theme` arrange the example as the playground's controls do (`applyEmbedParams` in `src/core/state.ts`).
A reader's edits in an embed are saved in their browser, in that embed's own save (one per embedded example, shared by pages that embed the same one), never in the app's save for the problem. Once they have changed something, **Reset** appears beside "open in Programming+" and puts the author's version back. An embed keeps a save only while it holds edits, so a reader who has not changed an example always sees the author's current version. A read-only embed (`?ro=1`) saves nothing.
The **Share** button in the app produces the app link, a ready-to-paste `<iframe>` for any view, and the Quarto shortcode for the same state (`{{< pplus-playground state=… >}}` or `{{< pplus-embed state=… view=… >}}`). Without the extension, in a Quarto page:
```html
<iframe src="https://pplus.scient.ing/#/embed/trace/p/match?t=12"
width="100%" height="520" style="border:1px solid #ccc;border-radius:8px"
loading="lazy" title="Programming+: find a pattern, stepped through"></iframe>
```
## The workspace
- **Step through**, with the tools a tutor would use at a whiteboard: the next line is called out before it runs with what it reads and writes; strings and lists draw as rulers with the position being read highlighted; every variable shows its previous value and a link to the step that changed it; click a line number for a breakpoint and run to it; jump by loop pass; **predict mode** asks what the next step will write before you take it and keeps score; play at any speed; export the trace as CSV (a cell that a spreadsheet would read as a formula, one starting with `=`, `+`, `-` or `@` that is not a number, is written with a leading apostrophe: `src/core/csv.ts`). Keyboard: → ← Shift+→ Home End Space B P, and ? in the toolbar lists them.
- **Light and dark**: the ☾/☀ button; follows the system until you choose. Embeds take `?theme=dark`.
- **A phone-width screen** (under 700px): the workspace fills the screen and shows one part at a time, chosen in a bar at the foot of the toolbar: **Code** (the panes with the stepper under them), **Run and views** (the side column, with the stepper's first row and what runs next above it) and **Setup and output** (the dock); in Hardware, **Code** and **Board**. Each part scrolls inside itself. **Run** shows the Run view, Compile & run and a click on a problem's tab show the dock (or the board), and a click on a line in a view shows the code. A wider screen never sees the bar, and every part stays where it is (`tests/narrow.test.mjs` holds the rules to the media query).
- **Table of values**: the table a student draws by hand, drawn by the machine: a column per step that changed something, a row per name, the new value in the cell, blank for unchanged; click a step to jump the stepper there; copy as text (tab-separated, with the same guard against formulas as the CSV).
- **Flowchart**: laid out from the structure of the pseudo (so loops loop and branches branch), each box shaded by how often its line ran in the last run, each loop labeled with its passes, each arrow out of a decision with how often it was taken; a box that never ran is dashed. Click a box to reveal its line; download as SVG.
- **Data flow**: inputs on the left, `RETURN` and `OUTPUT` on the right, one arrow per assignment that reads the one and writes the other, labeled with its line, dashed when a condition only decides whether it happens.
- **matho pane**: equations as a source language, written in LaTeX (`core/src/services/matho.ts`). One `FUNCTION` per equation; `\sum` and `\prod` become accumulator loops, subscripts become positions (with the 1-based shift when the sum starts at 1), `\begin{cases}` becomes `IF`/`ELSEIF`, Greek letters become names, references to earlier equations become calls hoisted out of loops when their arguments do not change. Every decision is a note on the equation's line; integrals, infinity, limits and derivatives are refused with the finite procedure to write instead. The trace steps the pseudo with the marker on the equation each step came from.
- **Numerics**: `SUM_OF MEAN_OF VARIANCE_OF STDEV_OF MEDIAN_OF DOT NORM_OF FILL CHOOSE RANDN FLOOR CEIL LOG10 SIN COS TAN ATAN2 PI()`, and `PARALLEL FOR`, a loop whose passes may run at once, checked at run time: two passes touching one location stop the run with a data race that names the location and the passes.
- **Mojo for every exercise with pseudo**: each has its Mojo in `core/library/mojo/local/`, so the Developer and Hardware areas always have something to show for it; `core/tests/mojo.test.mjs` runs each Mojo program in the interpreter and checks it prints what the exercise expects.
- **Panes**: the area's own (see the table above), dimmed when empty (a dimmed tab opens an empty pane to write in), as tabs over one editor (CodeMirror: search and replace with Ctrl+F, go to line with Ctrl+G, bracket matching, undo and redo; Tab indents, Ctrl+/ comments). The editor is never split: in the Bridge a short note in the pane head says the other tabs update as you type (lingo and matho update the pseudo, and the pseudo the Mojo made from it), and clicking a line marks the lines it became in the next tab down; Hardware does the same between Mojo and x86-64. Drag the dividers to resize (double-click resets); the widths, the dock tab, and what is folded are remembered in the share link.
- **The side column** is the inspect panel. Its tabs are offered only when they mean something for the pane (Prove for the pseudo family) and dimmed, with the reason, when the run has nothing for them yet.
- **The Run view** (the first tab, in the Bridge and the Developer area; `src/core/runview.ts`, drawn by `src/ui/views/run.ts`) is the whole run read top to bottom, one row per step: its number, its line, what ran (indented by call depth, with what it printed), and a column for each variable you **follow**, holding its value after that step: in color where the step wrote it (with the position, `[5, 6]`, when it wrote one element), faded where it carries over, underlined where the step reads it, hatched where it is not in scope. The lifecycle of the value a variable names (Mojo: made ●, copied ⧉, moved in ⇢, moved out ⇥, destroyed ✕) is marked in the same cell; events of values no column names are noted beside the step. Above the rows, the followed variables as they stand at the stepper's position, with a ruler for a string or list and a grid for a table, the element just written and the one about to be read marked. **+ variables** opens a picker of every variable in the run, by routine; until you choose, it follows the variables of the routine that does the most work. The choice is kept per area (`layout.follow`). "Only steps that change something" hides the rest. Click a row to step there; the stepper keeps its row in view. It replaces the Variables panel, the trace table, the table of values and the Lifetimes tab, which each showed part of this.
- **The Tests tab** is a fuzzer that shows its work (`core/src/common/fuzz.ts`, drawn by `src/ui/views/tests.ts`). For each routine (the pseudo's, with the speco woven in; or each Mojo function other than `main`) it lists **what each input must do** (finish within the step limit; raise no runtime error, or for Mojo no abort and no uncaught raise; keep every REQUIRE, ENSURE, INVARIANT, DECREASES and ASSERT, with inputs that break a REQUIRE skipped rather than failed; give the same answer when run again), **how the inputs were made** (each parameter's generator, with the values it tries first, and each strategy with how many inputs it made: edge cases in combination, every DNA string up to three letters for a routine that reads one, seeded random values, and mutations of the inputs that reached a line nothing earlier had reached, as a coverage-guided fuzzer does), each **failure** with the case that found it and every step of shrinking it to a smaller input that still fails the same way (the shrinking is greedy, so the input it ends on is the smallest it found, not always the smallest there is) (**Step through this input** puts that call in the call box and shows the run), the **lines reached** by how many inputs (a line no input reached is flagged), the **answers** given and how often, and **every case** run with its strategy, input, outcome, answer or error, and steps, filterable by outcome and strategy. The seed and the number of inputs (100 to 3,000) are chosen at the top; the same seed always makes the same inputs. `core/tests/fuzz.test.mjs` runs it on every exercise.
- **Views that follow the run**: the **Flowchart** shades by the run so far and marks the box that runs next; the **Data flow** lights up the names the next line reads and the name the last line wrote.
- **Step colors**: every step in the Run view and the "next" box is colored by what it does (writes a value, decides, loop control, enters a routine, returns, input or output, a value destroyed, raises or fails); the legend is in the inspect panel's tab row.
- **The stepper** is docked under the editor, at the editor column's width, as part of it: first, back, step, last, play and the slider; the loop-pass jumps, run to breakpoint, predict mode, only writes, speed and CSV; the loops in flight (or the machine's counts); and what runs next. It stays visible when the dock is folded.
- **The dock** under everything holds **Setup** (the call and the input lines for pseudo, lingo and matho; the build level and stdin for Mojo; the machine and the setup block for x86-64, in fixed-size boxes), Output, Problems (with the count on its tab), Compiler (Mojo) and Machine (the Hardware area's board); ▾ folds it away.
- **Hover** any word or symbol in any editor for its reference entry: keywords, built-ins, operators, English phrasings, speco symbols, instructions, registers, condition codes.
- **Language reference** at the bottom of the home page, rendered from core's `src/common/reference.ts`. Where an engine already holds a fact (keywords, built-ins, precedence, sentence forms, instruction glosses, condition codes, machine presets) the reference reads it from the engine; the tables written by hand carry examples, and core's `tests/reference.test.mjs` parses every statement, speco and setup example through the real parsers and runs every idiom against the output its note names, so an example cannot drift from the tool. The meanings beside the examples are written by hand, and no test reads them.
- **Save and load**: Share → Download writes `<title>.pplus.json`; Open… loads one back (here or on another machine). A `.pplus.json` file, a share link, or a `state=` shortcode from an earlier state format opens an empty workspace, and a save in the browser from an earlier format is discarded, so the problem opens as written; Programming+ makes no promise to keep old saves and links working. The share link and the embed code carry the same state.
- **Input**: the input box in Run setup feeds `INPUT` (pseudo) and `input()` (Mojo), one value per line; the lines travel in the share link.
## Translation between languages
Pseudo is the hub: every other notation translates to or from it, so four languages need six translators. The translators are DOM-free functions of text under `core/src/sync/`; `core/src/sync/types.ts` has their shapes and the line maps that say which input line each output line came from.
**pseudo → Mojo** (`core/src/sync/pseudo-to-mojo.ts`) is one way only, and its output is always labeled generated: the first line is `# Generated by Programming+ from pseudo. Not reviewed for Mojo best practices.` (`core/src/sync/header.ts`). It is an app-owned port of the Mojo half of the course engine's `translate.js`, and it is deliberately literal: `var n: Int` then `n = …`, `total = total + 1`, an index loop over codepoints. Idiomatic rewrites belong to the optional best-practices helper, so a student can see the difference.
- `def main()` is written from the pseudo's own lines, then from the call being run: `COUNT_BASE('A', "GATTACA")` becomes `print(count_base("A", "GATTACA"))`, with `TRUE` as `True`, a character as a one-letter `String`, and an integer given to a `FLOAT` parameter as `1.0`.
- `raises` is inferred (a dictionary read, `input()`, `atol`, a failed `ASSERT`, or a call to a routine that raises, transitively). Imports (`Set`, `sort`, the math functions) come from the harvested standard-library index, and only for names the translation uses.
- Where the notation has a built-in with no one-line Mojo spelling (`FORALL`, `EXISTS`, `SUM`, a set written by rule, `KEYS`, `SORTED`, `SPLIT`, `FILL`, `SLICE` of a String, the statistics), the translation writes a short loop just before the line that uses it. A fixed-length `ARRAY` is an append loop, as in the verified programs, because the interpreter does not run `List(length=…)`.
- It never invents Mojo. A line with no faithful spelling (a loop condition that would need such a loop, a built-in the standard library lacks) becomes `raise Error("not translated: pseudo line N")` and a `translate-gap` warning on the pseudo line; the program stops there instead of printing a plausible wrong answer. The pseudo's own mistakes (`unsupported`) are reported, not translated.
- Two behaviors differ by design, and a literal translation keeps Mojo's: dividing a `FLOAT` by zero stops the notation but gives `inf`, `-inf` or `nan` in Mojo (`nan` only for zero divided by zero), and `PARALLEL FOR` runs its passes in order with no race detector. Translation notes (`translate-divide`, `translate-each-order`, and so on) say so on the line.
`core/tests/sync-mojo.test.mjs` holds the translation to the pseudo: for every exercise with pseudo and every program in `core/library/pseudo/programs/`, the generated Mojo has no checker errors, runs in the interpreter, and prints what the pseudo prints (compared by value, not text: `TRUE` and `True`, `3` and `3.0`, a map's keys in any order). Programs it cannot hold to that are listed in the test with a reason (the interpreter declines random numbers and the math functions Mojo computes with routines of its own, such as `sin`, `cos`, `log` and `log10`; `EXACT` has no Mojo spelling; the checker is right about the two programs that read a variable with no value; dividing a FLOAT by zero and `PARALLEL FOR` differ by design), and `AGREE_AT_LEAST` is a floor that can only rise. A snapshot of the generated Mojo for every exercise is in `core/tests/snapshots/sync-mojo/`; when a change to the translator is wanted, run the test with `UPDATE_SNAPSHOTS=1` and review the diff.
**pseudo → lingo** (`core/src/sync/pseudo-to-lingo.ts`) writes the English that the lingo reader (`readSteps` in the course engine's `english.js`) understands, so the lingo pane can follow the pseudo pane. The grammar belongs to the reader, and the translator is held to it: before returning, it reads its own output back and checks that the same routines come out with the same kinds of input. If English cannot say something the way the reader needs it, the result is `unsupported` with a warning on the pseudo line, and the pane keeps its last good text instead of showing English that does not read.
- Names follow the reader's slots: a single letter or a Capitalized word. A name that is neither (`CURRENT_MAX`) has no English form yet.
- Each input is first written tersely, letting the steps show what it is. If the reader would take an input as something else, the translator adds a sentence saying what each input is ("L is a list of whole numbers.") and reads again.
- A name first set inside a block is given its value before the block, because English names are scoped by block.
- Left unsupported on purpose, each with its reason on the line: steps outside a routine (every English step belongs to a routine), records, `BYREF`, `REPEAT`, `PARALLEL FOR`, `DEFINE`, `CONSTANT`, a fixed-length `ARRAY`, maps keyed by a character, and `IN` over a String.
`core/tests/sync-lingo.test.mjs` holds it to that for every exercise, every corpus program, and the single-construct fixtures in `core/tests/helpers/sync-programs.mjs`: the English reads; lowering it back to pseudo gives a program with the same output and the same kind of stop; and writing English again from that pseudo gives the same text (comments aside). `SUPPORTED_AT_LEAST` is a floor that can only rise.
**pseudo → matho** (`core/src/sync/pseudo-to-matho.ts`) writes the equations, in LaTeX, for the programs that are equations, and refuses the rest. It recognizes the shapes the matho reader lowers: a `FUNCTION` that returns one value; an accumulator loop (`Total <- 0` then `Total <- Total + …`, or `1` and `*`) as `\sum` or `\prod`, with the bounds the reader uses (`FOR I <- 0 TO N` is `i=0` to `n-1`; a 1-based loop is `i=1` to `n`, and `X[I - 1]` is `x_i`); `FOR EACH` over an input list as a sum over a set; an `IF`/`ELSEIF` chain whose every branch returns as `\begin{cases}`; a call of an earlier function as a reference to its equation; and `SQRT`, `ABS`, `FLOOR`, `CEIL`, `CHOOSE`, `SIN`/`COS`/`TAN`/`EXP`/`LOG`/`LOG10`/`LOG2`, `MIN`, `MAX`, `PI()`, `DOT` and `NORM_OF`. Names given to values before the `RETURN` (the reader's hoisted calls, a temporary) are substituted where they are used.
- Everything else is `unsupported` with the construct and its line: "matho has no form for a WHILE loop (line 4)". An equation has a value, so output, input, text, a yes-or-no answer, a procedure, a record, steps outside a function, and a loop that does more than add up are all refused.
- Names. The reader makes `\bar{x}` into `X_BAR` and `\sigma` into `SIGMA`, so the pseudo has lost the student's spelling. The `NameMap` hint (`hints.names`, keyed by the upper-case pseudo name) carries it back; without one, `SIGMA` is `\sigma`, `X_BAR` is `\bar{x}`, a single letter is lower case, and a longer name is `\text{...}`. A hint is checked like everything else, and one that does not lower back to the function is refused.
- It never writes an equation that reads as something else. The LaTeX is lowered again by the matho reader and held to the pseudo: the same function names, inputs of the same kind, and the same values on three sets of sample inputs (stopping the same way where the pseudo stops). A program that fails is refused.
- Comments are not carried across. The lowering writes each equation as a comment above its function, and carrying that back would put a stale copy of the equation above the new one.
`core/tests/sync-matho.test.mjs` holds it to three checks on every equation set in `core/tests/helpers/sync-programs.mjs` (the sets `core/tests/matho.test.mjs` works by hand): the LaTeX reads, the pseudo it lowers to behaves like the original, and writing it again from that pseudo gives the same LaTeX. Two sets are listed as gaps with their reasons (a matrix row written `y_i`, and a second factorial whose counter the reader names `K2`); `SUPPORTED_AT_LEAST` is a floor that can only rise. Programs from the exercises and the corpus are accepted or refused the same way, with a located reason.
**The hub** (`core/src/sync/hub.ts`, tests in `core/tests/sync-hub.test.mjs`) puts the translators together. It is pure: a function of the texts it is given, with no DOM and no `localStorage`. `Session.setSource` hands an edit in a linked pane (lingo, matho, pseudo, speco) to it and applies the result in one change event; Mojo and x86-64 are stored as typed.
1. **The pane you edit is the authority** (`state.sync.authority`). The edit produces a new pseudo, directly or by lowering, and the other linked panes are regenerated from it. The pane that was edited is never rewritten, so typing never fights the cursor.
2. **Contracts ride along.** Lingo and matho cannot say contracts, so an edit in either weaves the speco into the pseudo it produced, and the speco is re-derived from that pseudo (`reconcileSpec`, which keeps claims about a routine or loop that is gone). An edit in speco replaces the pseudo's contracts with its own (`weave` in replace mode), and lingo and matho, which ignore contracts, follow.
3. **An authority with errors changes nothing.** If the edited pane does not read, every other pane keeps its text and is marked stale: "lingo line 3 does not read yet".
4. **A language that cannot say the program goes stale, not blank.** When a generator returns `unsupported` (matho has no form for a `WHILE` loop), that pane keeps its last text and is marked stale with the reason, until the program is expressible again.
5. **Mojo is produced only from pseudo**, as the literal translation, memoized by the pseudo and the call (`Session.derivedMojo()`); it is not stored.
6. **Opening a problem rewrites nothing.** Panes with text are shown as written; a linked pane that is empty is generated from the pseudo for display (`Session.source`), and reaches the saved state only with the first edit. Until then `state.sync` is absent and a pane's link state is "authored".
7. **Line maps compose through the hub.** `SyncHub.relate(maps, from, line, to)` answers which lines of one pane match a line of another, going through the pseudo; `Session.lineMaps()` has the maps of the last cascade.
`state.sync` (`{ authority, stale, names }`) is part of the saved state and the share link. It is bookkeeping, not an edit: a state whose texts are the problem's own is unedited whatever `sync` says. `names` is the student's spelling of equation names (`\overline{x}`), so a trip through pseudo restores it.
**Coverage.** `core/tests/sync-coverage.test.mjs` runs all three translators over every exercise, corpus program and fixture and writes [sync-coverage.md](../core/docs/sync-coverage.md): how many each says completely, and, for every program it cannot say, what it has no form for. Each translator has a floor in the test.
## Mojo
The distinction that shapes it: [Mojo Quest](https://quest.mojolang.org) teaches you to *write* Mojo, with the compiler as the judge; Programming+ shows you what Mojo *does when it runs*: every step of a run in its own interpreter (which reads a subset of Mojo and says why when it declines a program), the life of every value (made, copied, moved, borrowed, destroyed), and the instructions the compiler produced, stepped on a model machine. The + is those views.
Programming+ is pinned to **Mojo 1.2.0** (`mojo_1_2_0` on [Compiler Explorer](https://godbolt.org)). Core's checker and interpreter are held to the real compiler's answers on every program in core's corpus; for any other program, Compile & run asks the compiler. Programming+ ships no compiler and never claims a program compiles without asking one.
**The Mojo pane** is edited like the pseudo: highlighting built from the compiler's own token table (docstrings across lines, the ownership words `imm`/`mut`/`out`/`deinit`/`var`/`ref`, the transfer `^`, and the words Mojo has removed, such as `fn`, underlined), the VS Code extension's indentation rule, Ctrl+/ for comments, and hover text for the ownership vocabulary. Before compiling, Programming+'s own checker (`core/src/mojo/`) reports what it is certain the compiler would: code at file scope, an empty body, an untyped parameter, a method without self, no `main`, an implicit declaration, an unknown name (with the compiler's import hint), removed syntax such as `fn`, each in the compiler's own words. `core/tests/mojo-check.test.mjs` scores it against godbolt: it may never report an error on a program the compiler accepts, or one the compiler did not make. Code it cannot read yet gets a note, not an error.
**Compile & run** (Ctrl+Enter on the Mojo pane) sends the program to godbolt.org in one request: the compiler's answer, the program's output (the input box feeds `input()`), and the listing. What leaves the browser is the Mojo pane's text, the input box's lines, and the build flags (`mojoRequestBody` in core's `src/services/godbolt.ts`), and nothing else: no title, problem, other pane or anything stored. The first Compile & run in a browser says so and asks (`src/ui/consent.ts`; the answer is kept in this browser as `pplus.send.godbolt`, never in a link or a file), and the Compiler view says it under its button until something has been compiled. One thing differs from the Run view there: in Mojo 1.1.0 and 1.2.0 every `input()` opens its own buffered reader, so on the compiler's side, where the input arrives all at once, the first `input()` takes every line and a second one raises `EOF`. The Run view hands out one line per call, as a terminal does ([core/docs/trust.md](../core/docs/trust.md)). The Compiler view says so where it matters: when a program that may call `input()` more than once (two call sites, a call in a loop or a comprehension, or a call in a function other than `main`, read from the text with core's Mojo lexer: `inputReads` in `src/core/inputnote.ts`) was sent with input, a note under its output explains why the compiler's run may stop with `EOF` where the Run view does not. The **Compiler** view shows them. The compiler's messages land on their lines with its fix-its as one-click fixes (an implicit copy offers "transferring the value with '^'" or "copy it explicitly with '.copy()'"). The listing is grouped by function, your own first, in Intel syntax translated from godbolt's AT&T (or the original). **Send to x86-64 pane** puts one function, and the functions of yours it calls, on the model machine with its arguments' registers ready and the listing's read-only strings placed in memory; each call into the standard library becomes a stub that stops the run where the real program would enter the library, and says so. `core/docs/asm-coverage.md` is the census of every instruction compiled Mojo uses against what the machine models (everything but 256-bit AVX2), and `core/tests/asm-coverage.test.mjs` keeps it that way. Build "as written" (`-O0`, the default, which keeps every function you wrote) or "optimized" (what `mojo build` does: small functions fold into their callers). An edit after compiling marks the answer stale rather than showing it on the wrong lines. Compile & run (or **Compile again**) on work this browser already has godbolt's answer for, the same source, input and build level, sends nothing: it shows that answer again and says so, with **Ask again** to send the same program anyway (`Session.keptCompile`, `reuseCompile`). A request that failed is not kept as an answer. **Step through** runs the Mojo pane in Programming+'s own interpreter (`core/src/mojo/interp.ts`): line by line, with the variables it follows, what each line reads and writes, loop passes, breakpoints, and each value's lifetime, in the Run view. `core/tests/mojo-run.test.mjs` holds it to godbolt: on every program godbolt ran, it prints exactly what that run printed, or declines and says why. A program outside that set can still run here although the compiler rejects it (`Int(3.9)` on a literal, for one), so Compile & run is the word on whether a program compiles.
**How it is built.** Every build is asked for with the arguments core's pin states, `--target-cpu x86-64-v3 --fp-mode contract=off`, before the level the student chose (`-O0`, or the compiler's default): the listing is the same whichever of godbolt's machines answers and stays inside what the Hardware area's model machine knows, and a multiply is never fused with an add, so a decimal result is the one the Run view shows. The summary line of a compile shows the arguments. `mojo build` on a reader's own machine targets its own processor and may fuse, so its listing and its last digit can differ ([core/docs/trust.md](../core/docs/trust.md)).
**An exercise's Mojo** is a program in `core/library/mojo/local/`, named by the exercise's `mojoProgram`. `corpus.py verify` checks it on godbolt, and the pane's badge says "verified on Mojo 1.2.0" only when godbolt's answer passed the program's own expectation.
**The corpus** behind all of this (the compiler's own words, Modular's tested programs, our probes, and godbolt's stored answers) is described in [mojo-corpus.md](../core/docs/mojo-corpus.md).
## speco
The course's contracts (`REQUIRE`, `ENSURE`, `INVARIANT`, `DECREASES`) can only live inside pseudocode. The speco pane lets a student write them as a separate document, in math notation, and **weaves** them into the pseudocode before proving:
```
SPEC COUNT_BASE(B, T)
ENSURE result = |{ K ∈ [0, |T|) : T[K] = B }|
LOOP FOR I
INVARIANT Total = |{ K ∈ [0, I) : T[K] = B }|
```
`∀ ∃ Σ ∈ ∧ ∨ ¬ ≤ ≥ ≠ = |…|` lower to `FORALL EXISTS SUM IN AND OR NOT <= >= != == LENGTH(…)`. `LOOP FOR I`, `LOOP WHILE`, or `LOOP 2` names the loop an invariant belongs to. Contracts already in the pseudocode are shown in the pane and never duplicated. The proof view reports each obligation against the speco line it came from.
**Where speco is going.** The next stage lets the same claims live as comments on the pseudo and the Mojo a student already has (`# @requires`, `# @ensures`, `# @invariant` on the line they govern), so a specification never has to be a separate document. Checking is two-layered and honest about which layer answered: every claim is evaluated on every step of the interpreter's run and on the generated inputs (a runtime check: "held on 300 inputs", or a small input that broke it), and the claims the prover can read are handed to it, so an obligation shows as *proved*, *tested*, or *broken*, never conflated.
**Speco and pseudo are two views of one set of contracts** (`core/src/services/speco.ts`), and neither loses a claim:
- `extractSpec(pseudo)` reads the contracts out of the pseudo as a speco document.
- `weave(pseudo, spec)` inserts a speco's claims, never duplicating what is there. This is what the proof view uses. `weave(pseudo, spec, { replace: true })` is the other mode, for when the speco is the authority: for each `SPEC` unit it first removes the routine's `REQUIRE`/`ENSURE`/`DECREASES` and the `INVARIANT`/`DECREASES` of every loop the unit selects, then inserts the speco's. Routines and loops the speco does not name are left alone.
- `reconcileSpec(pseudo, previous)` is the speco that follows the pseudo when the pseudo is edited: what the pseudo says, plus every claim the previous speco made about a routine or loop the pseudo no longer has. Those stay, under a `// kept:` comment that says why, with a warning on their line; they return to the routine or loop when it comes back, even before the pseudo has written them. A contract deleted in the pseudo, from a spec that was not waiting, is deleted from the speco too.
These laws are tested in `core/tests/sync-speco.test.mjs`, for `count-base-proved`, `match-proved`, and every corpus program with contracts: `extract(weave(P, extract(P))) === extract(P)`; weaving twice changes nothing; a speco woven into the same pseudo with its contracts removed, then extracted, comes back (and the contracts written are the original's, up to spelling); and reconciling is a fixed point. Holding the laws found one bug, now fixed: a symbol just inside a bracket, `(∀ K …)`, was lowered to `( FORALL K …)`, so the text drifted by a space on every round trip.
## Known limits
- The engines live in pplus-core, the `core/` submodule ([engines.md](../core/docs/engines.md)). The prover is meant to be sound, and is incomplete: it proves only what follows on every path it examined. `core/tests/prover-soundness.test.mjs` holds it to every known hole (the regression programs in `core/library/pseudo/prover/`) and to every corpus program; an audit in November 2026 closed 18 rules that proved what a run breaks. English is still lowered to pseudo through text. The pseudo parser, checker, interpreter and prover are strict TypeScript; the English reader, the analysis, the coach and the course's page widgets are still JavaScript (core's [engines.md](../core/docs/engines.md#the-prover)).
- The assembly pane takes the course's Intel-syntax subset; directives and `[rip + label]` are not supported yet.
- Student work is kept in this browser only (`localStorage`); Share → Download makes a file of it. The footer's **What this site stores and sends** lists everything kept and everything sent.