Make this repository the engines' home; the course copies from here

Whether the engines' changes went back to the course or the course took
them from here was an open question (docs/engines.md). Soundness fixes to
the prover cannot wait for a round trip through a repository with no engine
tests, so this repository now owns the engines.

- pixi run engines-export <course>/static builds and writes every engine
  module into the course's static/js/: JavaScript modules as written,
  TypeScript ones (logic, solver, vcgen) as built, without source maps.
- pixi run engines-diff now shows what the course has not taken yet,
  comparing the file the course would receive with its copy. Both scripts
  share the list of modules in scripts/engines-files.mjs.
- docs/engines.md describes the ownership, the prover's three modules and
  its number model, the soundness tests and the bugs found so far, the
  changes the course receives with the next export, and how to export.
- AGENTS.md gains a hard rule: never let the prover call something proved
  that a run breaks, with how to add a soundness regression first.
- docs/app.md's Known limits no longer sends engine fixes upstream.

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 03:33:58 +00:00
1 parent 6a2973ba1f
commit 9e318a1eb5
4 files changed
+140 -35

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
/**
* The engine modules this repository owns, and the file of each that the course receives:
* src/engines/<dir>/<name>.js as written, or dist/engines/<dir>/<name>.js for a module written in
* TypeScript. Shared by engines-diff and engines-export.
*/
import fs from 'node:fs';
import path from 'node:path';
export const ENGINE_DIRS = ['pseudo', 'asm86', 'shared'];
/** Every engine module: { dir, file, label, ours, built }. */
export function engineModules(root) {
const out = [];
for (const dir of ENGINE_DIRS) {
const src = path.join(root, 'src/engines', dir);
for (const f of fs.readdirSync(src).sort()) {
if (f.endsWith('.js')) out.push({ dir, file: f, label: `src/engines/${dir}/${f}`, ours: path.join(src, f), built: false });
else if (f.endsWith('.ts') && !f.endsWith('.d.ts')) {
const js = f.replace(/\.ts$/, '.js');
out.push({ dir, file: js, label: `src/engines/${dir}/${f}`, ours: path.join(root, 'dist/engines', dir, js), built: true });
}
}
}
return out;
}