Commit graph

4 commits

Author SHA1 Message Date
Sebastian Herrlinger
6d7e96a399 refactor(codemode): make the Rust crate the language layer only
The crate becomes the Rust implementation of the reference's language layer (`src/language/`): its public API is
the Rust form of `Language` (`Runtime::make` with `globals(run)`, modules, limits and translation; `HostFunction`
for `Host.fn` with sync, async and sync-thenable types, idempotent, constructible and takes-functions;
`DurableFunction`; `Namespace`; `Failure` for `Host.fail` and `Host.missing`; `Run` with its metadata; programs,
suspend and resume; snapshots). Code Mode (tools, schemas, the catalog, `search`, OpenAPI, hooks, max tool calls,
extensions) is removed, and the language files move from `src/language/` to `src/`.

Host calls follow the reference's language runtime: arguments cross under the runtime's translation (functions and
promises fail the call unless dropped or awaited), a function from a result crosses back only to a function that
takes functions, async and durable calls start at the next handover, sync work can block (`Returned::Block`) or
stay pending (`Returned::Pending`), and a suspend is refused while a call that can't be detached runs. Namespace
paths carry their root label, and their `keys` may fail. Snapshots save the run's metadata and its calls by global
path, and restart them by resolving that path again.

The replays define the generators' host globals (`conformance/reference.rs` shares `tools` with
`conformance/reference.ts`): the cases, `host.json`, `boundary.json` and `streaming.json`. `tests/host.rs` mirrors
the reference's `test/language.test.ts`; the API tests are ported, and the Code Mode tests are removed.
2026-11-19 01:54:11 +01:00
kommander
8bc1023f3d Merge the test262 runner into the host API work 2026-11-18 18:54:15 +01:00
kommander
e9164a18ce test(codemode): check test262 parity in both directions
The runner now checks the files in the reference's skipped.txt too: those
that pass here are gaps on the TypeScript side, listed with a category in
test262/reference-gaps.txt. The check fails when an unlisted one passes, a
listed one fails here or leaves the reference's skipped.txt, or the
reference's own runner, through test262/reference.ts, passes a listed one.
Each category says whether Rust really has the behaviour or passes through
a looser check where the reference is strict on purpose.
2026-11-18 18:54:08 +01:00
Sebastian
ee90bf2aa2 test(codemode): add a test262 parity runner for the Rust port
Runs the reference's pinned test262 file set, synced by the reference's own
script, with the reference harness semantics. test262/rust-skipped.txt lists
the files that fail here but pass in the reference; the runner fails on an
unlisted failure and on a listed file that passes.
2026-11-18 18:53:57 +01:00