Commit Graph
4 Commits
Author SHA1 Message Date
alexmandClaude 977117504f Give the catalog, the machine presets and AreaId homes on the core side
Two engine modules reached into app modules: the exercise type named the
app's AreaId, and the assembly service read the machine presets from the
Hardware area's board module. And the catalog mixed core's problems with
the app's areas and saved state.

- core/machine.ts holds the machine presets and their names (parseMachine,
  machineSpec, machineLabel); hardware.ts re-exports them for the board.
- AreaId lives in core/types.ts; areas.ts re-exports it.
- core/problems.ts builds the problems from the exercises and the corpus
  (PROBLEMS, problemById, workForProblem for a Workspace). core/catalog.ts
  adds each problem's area and stateForProblem.

No behavior changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
2026-10-05 05:16:27 +00:00
alexmandClaude c1544e7550 Separate what the sources mean (Workspace) from how the app keeps them (Session)
The engines are moving into their own project. Session mixed the two jobs:
deciding what a program means (the hub's cascade, parsing every language,
diagnostics, the run, the proof, the fuzzer) and app concerns (the area,
saving to localStorage, versions, compile history, the best-practices
helper, change events). Tests of meaning could only reach it through the
app's state.

src/core/workspace.ts is the first job alone, with no DOM, storage or
areas: Workspace reads a WorkState (sources, sync, lang, call, input, setup,
machine), and edit() returns whether anything changed. Session now extends
it, keeps every app concern, and overrides only what the app changes: the
Bridge's Mojo is derived (derivesMojo), and the Mojo diagnostics come from
the compiler's answer and the helper when there is one.

No behavior changes; every test passes unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
2026-10-05 05:12:49 +00:00
alexmandClaude 5c6e7e2df5 Send Compile & run through a CompileBackend instead of straight to godbolt
Every compile went to godbolt.org from the session directly. The roadmap
moves compiles, and later Dafny and Lean checks, to a pinned service of the
app's own, and godbolt has no service guarantee, so where a compile goes is
now one replaceable piece.

- src/services/compile-backend.ts: a CompileBackend (id, host, compiler,
  compile), explorerBackend() for any service that speaks Compiler
  Explorer's API at a base URL, GODBOLT as the default, and
  compileBackend() / setCompileBackend().
- godbolt.ts: compileMojo takes a CompileTarget (base, compiler, host) and
  names that host in its messages; the request body is unchanged, so
  tests/mojo.test.mjs still holds it to what the corpus pipeline sends.
- Session.compile asks the current backend and records which host answered
  (CompileRecord.host; older records came from godbolt.org).
- The Compiler view names the host it is asking and the host that answered.
  The "Compiled on godbolt" badge keeps its wording until a second backend
  is deployed.

A test sends a compile through a fake backend and a refused local address.

Manual check list: open a Mojo exercise in the Developer area, Compile &
run, and see "Asking godbolt.org (mojo_1_1_0)…" then "Mojo 1.1.0 on
godbolt.org" in the Compiler view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
2026-10-05 03:46:04 +00:00
alexm 31f2fb8a5a Baseline: tree as shared 2026-10-05 03:03:38 +00:00