Files
pplus-web/pixi.toml
T
alexmandClaude 0d313f989d 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
2026-10-05 03:33:58 +00:00

66 lines
7.6 KiB
TOML

# Programming+ — every command a person runs, in one place.
#
# pixi run <task> [args] list them all: `pixi task list`
#
# The README's "Commands" table lists every task here; tests/tasks.test.mjs
# keeps the two in step. Without pixi, `npm install && npm test` builds and
# tests the app with whatever node and python3 are on the PATH (that is what
# CI does); everything else assumes the pinned environment below.
[workspace]
authors = ["Alex Maldonado <alex@scient.ing>"]
channels = ["https://conda.modular.com/max/", "conda-forge"]
name = "programming-plus"
platforms = ["linux-64", "osx-arm64"]
version = "0.1.0"
[dependencies]
mojo = "==1.1.0" # the compiler the corpus is pinned to (mojo/pin.json)
nodejs = ">=26.10.0,<26.11" # the app's build and tests; the quest processor needs >= 22.6
python = ">=3.14.7,<3.15" # the corpus pipeline (standard library only)
[tasks]
# --- build and test the app ------------------------------------------------
install = { cmd = "npm install", inputs = ["package.json"], outputs = ["node_modules/.package-lock.json"], description = "Install TypeScript (the only npm dependency)" }
build = { cmd = "npx tsc -p tsconfig.json", depends-on = ["install"], description = "Compile src/ to dist/" }
watch = { cmd = "npx tsc -p tsconfig.json --watch", depends-on = ["install"], description = "Rebuild dist/ on every change" }
check = { cmd = "npx tsc -p tsconfig.json --noEmit", depends-on = ["install"], description = "Type-check only" }
dev = { cmd = "python -m http.server 4173", depends-on = ["build"], description = "Build, then serve the app on http://localhost:4173" }
test = { cmd = "node --test tests/*.test.mjs", depends-on = ["build"], description = "Build, then run every test (the corpus pipeline's Python tests included)" }
check-pages = { cmd = "node scripts/check-pages.mjs {{ dir }}", args = ["dir"], depends-on = ["build"], description = "Run every program embedded in the Quarto pages under <dir> (quarto/README.md)" }
engines-diff = { cmd = "node scripts/engines-diff.mjs {{ static }}", args = ["static"], depends-on = ["build"], description = "Show what a course checkout's static/ directory has not taken yet from src/engines/ and styles/course/ (docs/engines.md)" }
engines-export = { cmd = "node scripts/engines-export.mjs {{ static }}", args = ["static"], depends-on = ["build"], description = "Copy the engines this repository owns into a course checkout's static/js/, TypeScript modules as built (docs/engines.md)" }
# --- write content ---------------------------------------------------------
new-exercise = { cmd = "node scripts/new-exercise.mjs {{ id }}", args = ["id"], description = "Start an exercise: mojo/local/<id>.mojo and src/exercises/<id>.ts, registered in index.ts" }
new-probe = { cmd = "node scripts/mojo/new-program.mjs probe {{ name }} \"{{ question }}\"", args = ["name", "question"], description = "Start mojo/probes/<name>.mojo: one question about the pinned compiler" }
new-stress = { cmd = "node scripts/mojo/new-program.mjs stress {{ name }} \"{{ about }}\"", args = ["name", "about"], description = "Start mojo/stress/<name>.mojo: realistic Mojo that tests the interpreter" }
play = { cmd = "node scripts/play.mjs {{ name }}", args = ["name"], depends-on = ["install"], description = "For mojo/local/<name>.mojo: run, verify on godbolt, build, list the assembly, test" }
play-watch = { cmd = "node scripts/play.mjs {{ name }} --watch", args = ["name"], depends-on = ["install"], description = "The same, again on every save (tests off)" }
quarto-export = { cmd = "node scripts/quarto-export.mjs {{ name }} {{ dir }}", args = ["name", "dir"], depends-on = ["build"], description = "Copy mojo/local/<name>.mojo, its x86-64 and setup beside a Quarto page, and print the shortcode" }
quarto-css = { cmd = "node scripts/quarto-css.mjs", depends-on = ["build"], description = "Regenerate quarto/_extensions/pplus/pplus-views.css: the app's rules for what the rendered views draw" }
quarto-engine = { cmd = "node scripts/quarto-engine.mjs {{ dir }}", args = ["dir"], depends-on = ["build"], description = "Copy a built Programming+ into a site's _extensions/pplus/engine, for the rendered views (quarto/README.md)" }
quarto-example = { cmd = "quarto render quarto", depends-on = ["build"], description = "Render the example site in quarto/example with every shortcode (needs Quarto on the PATH)" }
# --- the Mojo corpus (docs/mojo-corpus.md) ---------------------------------
mojo-verify = { cmd = "python scripts/mojo/corpus.py verify", description = "Ask godbolt about every program with no answer yet (network)" }
mojo-verify-item = { cmd = "python scripts/mojo/corpus.py verify --force --item '{{ id }}'", args = ["id"], description = "Ask again about one item; a trailing * matches a prefix, e.g. 'probes/life-*' (network)" }
mojo-verify-dry = { cmd = "python scripts/mojo/corpus.py verify --dry-run", description = "Show what mojo-verify would send; send nothing" }
mojo-verify-diagnostics = { cmd = "python scripts/mojo/corpus.py verify --corpus diagnostics", description = "Also check the compiler's own diagnostic tests (opt-in, about 140 files; network)" }
mojo-status = { cmd = "python scripts/mojo/corpus.py status", description = "Judge every item from the stored answers, offline; writes mojo/golden/STATUS.md" }
mojo-status-strict = { cmd = "python scripts/mojo/corpus.py status --strict", description = "The same, and fail if a program we wrote (probes, local, stress) fails" }
mojo-harvest = { cmd = "python scripts/mojo/corpus.py harvest", description = "After editing mojo/pin.json: fetch Modular's sources, process them, regenerate src/mojo/generated/ (network)" }
mojo-harvest-local = { cmd = "python scripts/mojo/corpus.py harvest --local-dir {{ dir }}", args = [{ arg = "dir", default = "zips" }], description = "Harvest, using zips in <dir> for sources the pin leaves UNRESOLVED" }
mojo-harvest-offline = { cmd = "python scripts/mojo/corpus.py harvest --local-dir {{ dir }} --offline", args = [{ arg = "dir", default = "zips" }], description = "Harvest from zips in <dir> only, no network" }
mojo-fetch = { cmd = "python scripts/mojo/corpus.py fetch --update", description = "Re-resolve every ref in the pin and rewrite mojo/mojo.lock.json (network)" }
mojo-emit = { cmd = "python scripts/mojo/corpus.py emit", description = "Regenerate src/mojo/generated/ from the pin and the corpus, offline" }
mojo-test = { cmd = "python -m unittest discover -s scripts/mojo/tests", description = "The corpus pipeline's own tests (also run by test)" }
mojo-run = { cmd = "mojo run {{ file }}", args = ["file"], description = "Run one Mojo file on the pinned local compiler, e.g. mojo/probes/int-floordiv.mojo" }
mojo-probes-local = { cmd = "for f in mojo/probes/*.mojo; do echo \"== $f\"; mojo run \"$f\" < /dev/null; echo \"exit $?\"; done", description = "Run every probe on the local compiler (a quick look; godbolt's answers stay the reference)" }
mojo-update = { depends-on = ["mojo-harvest", "mojo-verify", "mojo-status", "test"], description = "After editing mojo/pin.json: harvest, verify, status, test" }
# --- ship ------------------------------------------------------------------
ci = { depends-on = ["test", "mojo-status-strict"], description = "What CI runs: every test, and no program of ours failing" }
site = { cmd = "scripts/assemble.sh", depends-on = ["test"], description = "Test, then assemble site/ for publishing" }
deploy = { cmd = "scripts/deploy.sh {{ slug }} {{ target }}", args = [{ arg = "slug", default = "pplus" }, { arg = "target", default = "" }], depends-on = ["site"], description = "Publish site/ to /srv/www/<slug>, optionally on <target> (user@host) over SSH (docs/deploy.md)" }