Repository navigation
Conversation
eval takes a trailing `surface: Global_Surface = .Node`. `.Node` is what every context got before and stays the default; `run_file` and the CLI never select anything else. `.Web` exposes the web-platform subset only: no `process`, `require`, `module`, `exports`, `__filename`, `__dirname`, `Buffer`, `global`, `setImmediate`/`clearImmediate`, and no `__lava*` hook. How `.Web` gets there: - the CommonJS entry bindings are never injected; - install_stdio does not run, so internal/stdio and the node-streams stack are never compiled (console writes through its own native writer); - `process`, `Buffer`, `setImmediate`, `clearImmediate` and `global` are installed for the bootstrap and removed as the last step before user code; - an `.mjs` source name is Invalid_Input, and no top-level nextTick drain is appended. The one change on the default path: `__lavaDrainNextTicks` and `__lava_tl_drain` are now defined from install_microtasks instead of microtasks.js, with the same attributes. They are non-configurable, so a `.Web` context could not have deleted them. `.Web` promises that the names are gone, nothing more: web APIs still hand out Buffer-backed bytes and `ERR_*` codes (#5). Pinned by cmd/lava/global_surface_test.odin; seven mutations recorded in tests/mutation-manifest.json. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(runtime): add a Web global surface that hides the Node names
Brings x-ror/lava up to f54b283c: - 07c29cc feat(runtime): add a Web global surface that hides the Node names One conflict, pkg/runtime/runtime.odin: Lava changed eval's body, which Larva keeps in page_open (page.odin). Resolved on Larva's side and the seam carried through: - eval takes `surface: Global_Surface = .Node` right after `report_data`, where Lava has it, and before Larva's `limits`, so Lava's positional calls bind the same parameters. It hands the surface to page_open. - page_open takes `surface` (default `.Node`) and does what Lava's eval does on `.Web`: refuses an `.mjs` source name before a context exists, passes the surface to setup_module_environment, skips both register_entry_module calls and appends no top-level nextTick drain. Three of the seven mutation-manifest entries Lava recorded pointed at lines that live elsewhere here: the `.mjs` refusal and the top-level drain guard are in page.odin, and eval's signature ends with `limits`. Retargeted, same mutations. Pages opened by the page runner and the dispatcher stay on `.Node`: nothing selects `.Web` for a page yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync of x-ror/lava
master(f54b283). It brings one change: x-ror/lava#502, a second global surface (Global_Surface.Web) behind a defaultedsurfaceparameter oneval. This is the seam for page contexts in #5.Conflict, resolved by hand
One file,
pkg/runtime/runtime.odin: Lava changedeval's body, which Larva keeps inpage_open(page.odin). Resolved on Larva's side, with the seam carried through:evaltakessurface: Global_Surface = .Noderight afterreport_data, where Lava has it, and before Larva'slimits, so Lava's positional calls bind the same parameters. It hands the surface topage_open.page_opentakessurface(default.Node) and does what Lava'sevaldoes on.Web: refuses an.mjssource name before a context exists, passes the surface tosetup_module_environment, skips bothregister_entry_modulecalls, and appends no top-level nextTick drain.Mutation manifest
Three of the seven entries Lava recorded pointed at lines that live elsewhere in Larva. Retargeted, same mutations:
.mjsrefusal and the top-level drain guard:sourceis nowpkg/runtime/page.odin;eval's default surface: thefindnow includes thelimitsparameter that followssurfacehere.All 368 entries find their line exactly once.
Not in this PR
Pages opened by the page runner and the dispatcher stay on
.Node. Nothing selects.Webfor a page yet; that, the two-page isolation test and thebench/pagesstart-up number are the follow-up for #5.page_open's own default is not pinned by a recorded mutation yet, for the same reason.Gates
Run locally on d8d026c, Node 26.13.1, 16 cores. All passed:
make check,make check-js,make check-md,make check-actions,make buildmake test: 209 Odin tests (113 incmd/lava, including the fourglobal_surface_*tests from Lava); node-compat (91 cases), sqlite, fs and event-loop oraclesmake test-odin-serial,make test-eventloop-odin,make test-lava-nohostfn,make test-stdio,make test-propertymake bench-gatemake test-mutation CHANGED=1: 117/117 died as recorded, including all sevenglobal_surface_*entries against Larva's sourcesCI has 4 cores, so the concurrency-sensitive gates above are not proof of a pass there.
Merge with "Create a merge commit", not squash.
🤖 Generated with Claude Code