Repository navigation
Conversation
…ct (#391)
Verified against node 24.22.1 with a 904-case probe; before this change 580
lines differed under bin/lava, after it 224, and no line that matched before
differs now. The remainder is #392 and the documented kMaxLength bound.
1. ERR_INVALID_ARG_TYPE wording. errInvalidArgType splices its 'expected'
argument verbatim and three call sites passed a bare 'number', giving
'must be number'. size (assertSize), offset (checkBounds) and concat's
length now read 'must be of type number', as node does.
2. The deprecated constructor's number branch skipped assertSize: Buffer(-1)
surfaced the engine's codeless RangeError and Buffer(NaN) returned an empty
Buffer. Both now throw ERR_OUT_OF_RANGE, with and without new. The bound in
the message stays lava's K_MAX_LENGTH (documented deviation).
3. inspect adds the separator before '... N more bytes' even when no byte is
shown, so INSPECT_MAX_BYTES = 0 prints '<Buffer ... 2 more bytes>'.
4. util.inspect shows a Buffer's extra own properties after the bytes
('<Buffer 61 62, foo: 1>'): insertion order, symbol keys, non-enumerable
only with showHidden, getters by value, depth honoured. util.js now passes
util.inspect itself as the custom hook's third argument, as node does; the
old depth+1 closure rendered every extra one level short.
Deviation, measured and pinned: a Buffer longer than 1024 bytes shows its
symbol-keyed extras but not its string-keyed ones. Listing a typed array's
named properties materialises one string per byte; the method and timings are
in the comment at INSPECT_EXTRAS_MAX_LENGTH. Pinned Lava-only by
cmd/lava/buffer_inspect_extras_test.odin (buffer_inspect_extras_cap), which
also pins that a bare buf.inspect() renders bytes only.
Known gaps left as they were: extras are not coloured (util.inspect colours
nothing yet, #104) and a Buffer nested in a Buffer's property renders one
level short.
Oracle: tests/node-compat/cases/70-buffer-size-inspect-parity.js. Each fix was
mutated by hand and turned the case red; the manifest entries are not in this
commit because tests/mutation-manifest.json is human-only.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQTDDUu9z73JRY3RpV6Adg
Review of cf850ca found one regression, one cost and several gaps in the new extras rendering. All verified against node 24.22.1. - console.js still called the inspect.custom hook with {} and a one-argument closure, so console.log printed a Buffer's nested extras at the wrong depth (four levels deeper than node) and got Map extras wrong. It now passes a depth-aware inspect the way util.js does. - A Buffer whose property reaches itself made util.inspect / console.log throw an uncaught RangeError; before #391 it returned a string. The hook now catches the engine's stack-overflow error and prints node's 'Inspection interrupted prematurely. Maximum call stack size exceeded', rethrowing anything else. Extras are inspected at the caller's depth, which also closes the Buffer-in-Buffer depth-1 gap. - buf.inspect(0, {}) with a context but no inspect function now renders extras through util.inspect, as node does. This was declared a deviation in cf850ca; it bought no speed or memory, so it is withdrawn. A bare buf.inspect() still prints bytes only, which is node's behaviour. - showHidden and depth are read as own properties of the context only: a polluted Object.prototype.showHidden exposed non-enumerable properties of every logged Buffer. Pinned by buffer_inspect_extras_pollution. - Two mutants survived the oracle (the symbol-loop enumerable filter, and the leading-digit key check); case 70 now kills both. Deviation, narrowed: string-keyed extras are listed only for Buffers of at most 64 bytes (was 1024). At 1024 one inspect cost ~92us against ~5us for the bytes-only hook. At 64 it is ~9.0-10.0us against ~2.9-3.8us (about 2.8x), and inspect of an empty Buffer is ~0.35us against ~0.12us; above the cap the scan is skipped. Method: mean per call over max(20, 2e6/n) calls after 200 warm-up calls, performance.now(), three interleaved launches per arm, base arm = the head binary with the pre-#391 hook swapped in. Numbers and method are in the comment at INSPECT_EXTRAS_MAX_LENGTH; pinned at 64/65 by buffer_inspect_extras_cap. reference/node-compatibility.md: the Buffer 'Rendering' bullet now describes the extras, the 64-byte deviation and its pin. The probe is unchanged at 224 differing lines of 904; no line that matched at cf850ca differs now. Manifest entries are again not in the commit (tests/mutation-manifest.json is human-only). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQTDDUu9z73JRY3RpV6Adg
… (#391) The cycle handling added in c5fd268 had two regressions, both found on re-review against node 24.22.1. - A Buffer with two or more self-references hung: the overflow catch recovered only in the innermost hook, and every enclosing hook then descended to the stack limit again, so work grew like k^depth. 'b.k0=b; b.k1=b; console.log(b)' ran past 60 s. The overflow is now caught and latched in the inspect function a hook is handed (util.js hookInspect, console.js inspectWithOptions); once latched nothing descends again. Three self-references now throw in ~76-79 ms. - The inspect passed to a custom hook restarted with an empty visited set, so a user hook calling inspect(parent) threw RangeError where the base printed a circular marker. Fixed by catching at the hook boundary, as node does. Carrying the visited set instead changed a line that matches node today. Node's outcomes, recorded from a fresh process: one self-reference, a two-Buffer cycle and a cycle through an object all return with 'Inspection interrupted prematurely'; two or three self-references throw. Node's throw is a SyntaxError from a regex compiled lazily at the stack limit, and once that regex is warm the same input runs for minutes; lava throws a RangeError. The shape (returns vs throws) is pinned, the error type is not. Also: - An extra's getter is read outside the catch, so an error it throws, including a forged overflow RangeError, propagates as in node. The catch-everything mutant now fails case 70. - The util.inspect fallback for buf.inspect(0, {}) is no longer cached: the loader publishes no pristine util handle, and a cached one kept a user-replaced util.inspect forever. It is still a live read; noted at the site. - console.js reads depth as an own property only. - The options object for extras is built on the first extra, not per call. - Comments: the cost table is re-measured at 300 000 calls per launch. At the 64-byte cap one inspect is 7.3-9.1 us against 1.9-3.0 us (about 3.5x, not the 2.8x stated before); at 1024 bytes 2.91 us against 2.13-2.33 us. Tests: case 70 gains the 2- and 3-reference shapes and the getter-throws lines; new case 71 covers a user hook that inspects its ancestor; Odin tests buffer_inspect_cycle_bounded (30 s fail-timeout) and buffer_inspect_hook_ancestor_cycle pin the bounded path and console.log. Not done: recognising the engine's own overflow error without a name and message comparison is not possible from JS; node uses the same test. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQTDDUu9z73JRY3RpV6Adg
… add them tests/mutation-manifest.json is human-only under the gate-integrity rules, so the mutations recorded while fixing #391 could not be added there, and the only other copy was in a session scratch directory. This file holds them in the manifest's own entry shape, ready to append to its mutations array; delete it once they are in. Every find string was checked unique in its source at 49bc489 and every mutant was run and went red. Entry 6's expect_detail is the value corrected by the final review. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQTDDUu9z73JRY3RpV6Adg
Item 4 of #391 (rendering a Buffer's extra own properties in util.inspect, with the cycle handling it needed) produced a P1 in each of three review passes, every one in the cycle path: a hang on multiply self-referential Buffers, a lost visited set, and separate overflow latches in console.js and util.js that let a hook run for minutes. It is deferred until console's formatter is unified with util's (#104); the work stays in this branch's history at 49bc489, tracked by #399, #400, #401, #402 and #404. What remains against master: - ERR_INVALID_ARG_TYPE reads 'must be of type number' for size, offset and Buffer.concat's length; - the deprecated constructor's number branch validates through assertSize, so Buffer(-1) and Buffer(NaN) throw ERR_OUT_OF_RANGE; - inspect adds the separator before '... N more bytes' when no byte is shown. util.js, console.js and reference/node-compatibility.md are byte-identical to master again; buffer.js was rebuilt from master with only those three changes; the Lava-only inspect test is removed; case 70 covers the three items only and also finishes under node 22. The primordials ratchet equals master's (1553). docs/issue-391-recorded-mutations.json keeps the five entries that apply. NOT DONE, needs a human: tests/node-compat/cases/71-inspect-hook-ancestor-cycle.js belongs to the deferred work and must be deleted, but the gate-integrity hook makes deleting an oracle case human-only. Until it is removed, make test-compat-lava fails on that case alone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQTDDUu9z73JRY3RpV6Adg
fix(buffer): match Node on type-error wording, Buffer(n) size validation and the inspect separator
… in check-md Append the gen-matrix mutation from #397 and the five #391 entries parked in docs/issue-391-recorded-mutations.json to tests/mutation-manifest.json, and delete the parked file. Run gen-matrix.py --check from check-md, the one gate a docs-only PR executes, so a hand edit inside a GENERATED block fails its own PR instead of the master push. Closes #397 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build(gates): record the #389/#391 mutations and run the matrix check in check-md
ci(gates): pin Node 24, per-case timeouts, honest gate runner, and bench-gate
…le changes .nvmrc pins 26.13.0 and compare.sh treats its major as a floor, not an exact match: Lava tracks Node forward (26 now, 28 planned), so a newer oracle may run and its drift shows up as case diffs, while an older one is refused before any case runs. The compare-integrity fixtures read the floor from .nvmrc, so the next bump does not touch them. Running every oracle case under node 26.13.0 found four behavior changes, now matched (tests rewritten from a node 26 probe first, red on Lava, then fixed): - node:sqlite binds `undefined` as NULL (node 24 threw ERR_INVALID_ARG_TYPE). - run()'s changes/lastInsertRowid throw ERR_OUT_OF_RANGE past 2^53 after the row is written (node 24 returned a lossy number); sqlite_int_value loses its now-constant throw_on_unsafe flag. - util.parseEnv returns a null-prototype object that keeps `__proto__` as an own key (node 24 dropped it and returned a plain object). - MIMEType trims the input at both ends and discards text after a closing quote up to the next ';' (WHATWG mimesniff). Five mutations recorded. Docs move the target from 22+/24 to 26+; historical "verified on node 24.x" comments stay, since they record how a fact was checked. Closes #185. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bun fmt make check-md / fix-md now run `bun fmt` over **/*.md before markdownlint: bun fmt owns layout (list markers, table alignment, spacing), markdownlint keeps the semantic rules a formatter cannot (MD051 link fragments, MD040, MD001/MD025, MD024 siblings). The two agree: bun-formatted output lints clean. bunfig.toml ignores the vendored reference/node-doc-api and the generated reference/node-compatibility.md, which gen-matrix.py --check diffs byte-for-byte. gate-runner.md (+ .claude mirror): two inline code spans broken across lines are rejoined; bun fmt otherwise strips the list-continuation indent after them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build(md): bump markdownlint-cli2 to 0.24.1 and format markdown with bun fmt
…or, port pool cases to node 26 - node:buffer no longer exports SlowBuffer (removed in Node 26); pinned in tests/node-compat/cases/03-buffer.js and a manifest mutation. - bun-buffer ported cases stop calling SlowBuffer and assert the pool backing is at least Buffer.poolSize (Node 26 allocates poolSize + 64). - scripts/lib/compare.sh refuses an .nvmrc with no numeric major and treats a non-integer oracle major as 0, instead of `[ -lt ]` erroring into a pass. - Docs: README floor and oracle-test-auditor advisory rule follow .nvmrc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd client Node 26 throws ERR_INVALID_ARG_VALUE for an IP address in tls.connect's servername; identity is still checked against host (the smoke cert has IP:127.0.0.1). Found by CI's HTTPS server smoke on #412. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node 26 is 2-3x faster at UTF-8 encode than 24, so the lava/node ratio rose with no Lava change. Caps set at ~1.4x the max of three CI bench-gate runs (median of 3 launches per side); measurements recorded in thresholds.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(compat): move the Node oracle to 26+
- buffer.compare: bound targetStart/sourceStart by kMaxLength, only *End by length (node 26: Buffer.alloc(3).compare(Buffer.alloc(3), 100) === 1). - buffer.write: validate length in 0..buf.length, then clamp to remaining. - typed_array.odin: drop the nil-return deletes; JSTypedArray.h:61 says the bytesDeallocator always runs on failure, so they double-freed. - events.once: validate options as an object, Node's exact message. - validateOffsetArg helper replaces the repeated offset checks. - mutation manifest: unambiguous checkBounds find, buf=262144 detail, four new entries pinning the fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- buffer.writeBig(U)Int64: range check, then offset check, then coercion, in Node's order; Object(5n) is accepted again, out-of-range and bad offsets get coded errors. - atob/btoa: ERR_MISSING_ARGS and HTML forgiving-base64 validation; invalid input throws InvalidCharacterError (code 5). Deviates: not instanceof DOMException (Lava has none), pinned by cmd/lava/atob_invalid_character_test.odin. - util.isDeepStrictEqual: Map/Set primitive keys looked up directly, pairwise scan only for object keys (16k-entry Map: 2179 -> 4 ms, medians of 5 interleaved launches, darwin arm64). - buffer.fill: numbers take the & 0xff path first (fill(i,0,32) x3e6: 1111 -> 989 ms, same method). - primordials baseline lowered; four new recorded mutations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- atob/btoa: one non-global regex pass via P.RegExpMatches as the fast
path; the per-char loop now runs only to pick the error. btoa 48 KiB x200:
615 -> 89 ms; atob 64 KiB x200: 2542 -> 1579 ms (base 1325, which did no
validation).
- atob: check the unpadded remainder before padding, as node does
('a=' / 'a==' / 'abcde=' report "not correctly encoded").
- fill: offset/end checks inlined at the call site; fill(i,0,32) x3e6:
954 -> 496 ms (base 738).
Method: base 8619888 / 85a2319 / this commit, 5 interleaved launches per
arm, medians, darwin arm64, -o:speed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(runtime): align buffer, events, assert, and typed_array allocators with Node
The oracle moved to node 26.13.0 in #412, but 60 comments still cited node 24 as the version a behavior was verified against. Each claim was re-verified on node 26.13.0 (15 cited cases byte-identical node vs lava, the rest by direct probe); none diverged, and the citations now name node 26 and how they were checked. Kept on purpose: historical node-24-vs-26 contrasts, bench/thresholds.json calibration history, the gen-matrix PROBED_NODE label (restamping it without a re-curated probe would claim a probe that never happened), and two claims not reproducible on darwin (fs.odin:996 Windows runner, encoding.js:712 Linux RSS). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(compat): retarget node 24 verification citations to node 26
…from the directory layout js/node/ holds every module user code may require, at the path of its specifier; js/internal/ holds what only builtins may require; js/bootstrap/ holds the preludes that are not modules. The loader's public resolver answers node/ ids only, replacing the hand-kept INTERNAL_ONLY table, and globals.odin embeds each directory with #load_directory instead of 41 #load constants and a parallel file table. scripts/check-js-graph.mjs replaces check-orphan-js.mjs: it fails on a non-literal or unresolvable require, an unreachable file, an unembedded directory, or a cycle through top-level requires. One observable change: JSC source names are now node:<specifier> and node:internal/<path>, as in node's own stack frames. Pinned by tests/node-compat/cases/74-builtin-visibility.js and two recorded mutations. Known divergences #415 and #416 are carried over unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ource line
The formatter split `if (!seen.has(id)) add(...)` across two lines after the
entry was recorded, so its `find` no longer matched and the mutation gate
reported it STALE. Anchor on the `add('unreachable',` call instead, which is
unique in the file; the mutant still turns only its own test red.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
refactor(runtime): derive embedded-JS module identity and visibility from the directory layout
…code SES-style non-configurable accessors (as node --frozen-intrinsics): assigning on Function.prototype throws in both modes, f.call = x on an ordinary function still defines an own property. Closes #450. Approved deviation, pinned by main.function_call_lock; poisoned-call vectors move from oracle cases into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check-js-graph.mjs exported checkJsGraph for its test and ran the report only behind `if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1])`. Node realpaths the module URL but not argv[1], so run through a symlink the guard failed open: nothing printed, exit 0. No test noticed the guard's removal either. The rules now live in scripts/lib/js-graph-check.mjs, which the test imports; the CLI is a guard-free script that always reports. A new node:test case spawns the CLI on the real tree, directly and through a symlink, and requires the OK line. Same defect and fix shape as the primordials ratchet (2579be6, efa53bc). Mutation manifest: the five entries whose find moved are repointed to the lib file; two new entries silence the CLI before the check (killed by the direct arm) and put the shipped guard back (killed only by the symlink arm). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
harden(runtime): lock Function.prototype.call/apply/bind before user code
The CLI spawn test only ran on the clean real tree, so a CLI that exited 0 on violations, printed OK without checking, or dropped its violation lines passed it. The CLI now takes an optional root (for the test only), and a new case runs it over the natives-key fixture: no OK line, exit 1, the violation header and the rule's line on stderr. Both mutants are recorded with distinct details. The recorded entry-point guard mutation now decodes import.meta.url's pathname, so a checkout path with a space still trips only the symlink arm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since f707936 the graph rules live in scripts/lib/js-graph-check.mjs and scripts/check-js-graph.mjs only reports. The js-graph.mjs header and ARCHITECTURE.md still named the CLI as the parser's consumer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(scripts): re-arm the eager-classification mutation and stop the ratchet CLI failing open
The CLI spawn tests ran only under node, but the real gate runs the CLI under bun (make check-js -> js:graph -> `bun run scripts/check-js-graph.mjs`). Each CLI case (clean tree direct and through a symlink, and the one-defect fixture through the optional root) now runs once per runtime, named [node] / [bun]. bun comes from PATH and is required: a missing bun fails the bun arms with a clear message instead of skipping them. Mutation manifest: the four CLI entries now target the [node] test names and details; two new entries pin the [bun] arms (exit 0 before reporting, exit 0 on a violating tree). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every CLI mutant fails node and bun with the same message, so a [bun] arm resolving to node (or a [node] arm running bun behind a shim) passed every recorded mutation. Each resolved binary is now asked `typeof Bun` and must answer 'object' for [bun] and 'undefined' for [node]; the mutation `return 'bun'` -> `return process.execPath` is recorded. The symlink-arm comment no longer implies the [bun] arm pins the entry-point guard: bun realpaths argv[1] (bun 1.4.4), so only the [node] symlink arm does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plain language on internal data, captured apply for listener calls (safe under the #485 lock, matches node's ReflectApply), null-proto on() queue, and module-eval captures instead of P.* reads in bodies (35 -> 0). No behavior change vs master; events.js ratchet 12 -> 2. Linux emit with one listener 96.4 -> 2.5 ms/1e6. New Lava-only test events_pollution_immunity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refactor(events): rewrite node:events in the new JS design (pilot)
… callees; marker takes a reason The #485 lock does not protect .call on captured intrinsics (an own call on the intrinsic steers it, #494), so module-eval captures and primordials exports stay counted. Exempt only a strict function declaration the file never lets go of. '// primordials-ok[: classes] — reason' now suppresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build(js): ratchet exempts only private function-declaration callees; marker takes a reason
fix(scripts): stop the JS graph CLI failing open under a symlinked path
test(scripts): run the graph CLI spawn tests under bun as well as node
- js-graph.mjs header names lib/primordials-scan.mjs as the eager-set consumer (the scan moved there in #484), CLI in parentheses. - check-js-graph.test.mjs / check-primordials.test.mjs: every spawnSync goes through one run() helper with a 60 s timeout that fails the test, by arm, on a timeout or signal before any other assertion. - graph CLI clean-tree runs assert empty stderr. - ratchet CLI test asserts the OK line's figures equal an in-process scanTree(ROOT), so printing OK without scanning no longer passes. - mutation manifest: [node] arm runs bun; graph CLI writes stderr on a clean run; ratchet CLI prints OK without scanning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…K claim - run() in both CLI tests reports r.error first (ETIMEDOUT as a timeout, anything else by code, e.g. ENOBUFS, which also leaves SIGTERM), then the signal; ENOENT still reaches the bun arm's PATH message. - The ratchet CLI test comment and its manifest `why` claim only what is pinned (OK figures equal the in-process scan) and list the survivors: echoing baseline totals, skipping selfTest(), skipping compare(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(scripts): bound CLI spawns, pin clean stderr and the ratchet OK figures
…ches Drive the real check-primordials.mjs over a disposable copy of the tree (ROOT follows the CLI's own location), so a new method site and a failing self-test reach the branches the clean real tree never does. Three recorded mutations: echo the baseline, skip selfTest(), skip compare(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chet sandbox run() in both CLI test files now kills with SIGKILL on timeout: a child trapping SIGTERM held a 500 ms bound for 8 s. ratchetSandbox() removes its temp dir when a copy step throws, and asserts node_modules/acorn up front instead of failing on a misleading missing-line message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(scripts): pin the ratchet CLI's scan, self-test and compare branches
Across 28 ubuntu-latest CI bench-gate runs (median of 3 launches per side, Node v26.13.0) url-parse-ipv4 measured 10.37x-16.06x and breached the 14.7x cap 3 times with no runtime change: Node's time on that bench is either ~12 ms or ~5-7 ms depending on the runner, Lava's moves less. Cap set at ~1.4x the max observed; measurements and the detection cost are recorded in thresholds.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…' fire-proof stale perf-memory-auditor re-read all 28 CI rows: 20.0 (~1.25x the max, >5 sd above the fast-runner mean) has no false positive among them and keeps more detection than 22.5. The note no longer claims no runtime change between breaches (5228c42 moved the parser) and gives the evidence that the breaches track the runner instead. bench/micro/url.js no longer claims the caps are proven to fire: the old hand slowdown breaches none of the current caps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bench(gate): widen the url-parse-ipv4 cap to 20.0 for bimodal CI runners
…roperty steering (#494) Function.prototype.call/apply/bind were locked on Function.prototype (#450), but the held functions themselves still took an own `call` or a new prototype: `Function.prototype.apply.call = evil` hijacked every `apply.call(listener, ...)` in events.js, and `Array.prototype.push.call = evil` hijacked the callerN `fn.call(t, ...)` wrappers. node runs neither. lockIntrinsics() now makes call/apply/bind, and exactly the set of methods a primordials wrapper closes over, non-extensible. The set is recorded by the wrapper factories themselves, so a newly wrapped method is covered; a factory call after the lock (the loader's pristine-Buffer uncurryThis) locks on the spot. The wrappers keep `fn.call`: `call.call(fn, ...)` was measured slower than Reflect.apply on Linux JSC (new URL 2.64x). Deviation: the locked functions answer as under node --frozen-intrinsics (isExtensible false, own props and setPrototypeOf throw) but are not frozen. Pinned by cmd/lava/function_call_lock_test.odin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s not Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
harden(js): lock call/apply/bind and wrapped intrinsics against own-property steering (#494)
Brings x-ror/lava up to e14b53d: - 68ee7b8 docs(claude): state what the #494 lock protects and what it still does not - 8f5db09 harden(js): lock call/apply/bind and wrapped intrinsics against own-property steering (#494) - d3fce98 bench(gate): set the url-parse-ipv4 cap to 20.0 and mark the url caps' fire-proof stale - 87688b0 bench(gate): widen the url-parse-ipv4 cap to 22.5 for bimodal CI runners - a55a4b0 test(scripts): SIGKILL bounded CLI spawns; clean up and guard the ratchet sandbox - f9eb1b8 test(scripts): pin the ratchet CLI's echo, self-test and compare branches - b854f7b test(scripts): name spawn errors before signals; narrow the ratchet OK claim - 84e3911 test(scripts): bound CLI spawns, pin clean stderr and ratchet OK figures - 2cf0187 build(js): ratchet exempts only provably private function-declaration callees; marker takes a reason - adfe585 refactor(events): rewrite node:events in the new JS design (pilot) - 80cac00 test(scripts): prove each graph CLI arm runs the runtime it names - 0784f7a test(scripts): run the graph CLI spawn tests under bun as well as node - 19dd2ad docs(scripts): name lib/js-graph-check.mjs as the graph rules' home - 19a8692 test(scripts): pin the graph CLI's failing branch on a one-defect tree - f707936 fix(scripts): move the graph check to lib so the CLI runs unguarded - f146fb6 harden(runtime): lock Function.prototype.call/apply/bind before user code - b6b7742 harden(gates): protect scripts/lib/primordials-scan.mjs from agent writes - efa53bc test(primordials): record the fail-open entry-point guard as a mutation - 2579be6 fix(scripts): move the ratchet scan to lib so the CLI runs unguarded - e0968ef test(primordials): pin the eager/lazy classification on a fixture tree - 33c2d95 refactor(url): move punycode and IDNA out of internal/url - 5228c42 refactor(url): move the WHATWG URL implementation to internal/url - e6b18a6 refactor(os): move os.constants tables to internal/os/constants - b91fee2 refactor(buffer): move node:buffer's codecs and numeric read/write to internal/buffer - 6fa09a6 refactor(util): split node:util into internal/util{,/inspect,/comparisons,/debuglog} - a85ac6d refactor(crypto): split node:crypto into internal/crypto/{util,hash,random,pbkdf2,hkdf,scrypt} - 6aaa5cc refactor(fetch): split internal/fetch into internal/fetch/{headers,body,request,response} - 8be9b8d refactor(http): split node:http into internal/http/{common,incoming,outgoing,server} - cb87479 refactor(runtime): split stream/web.js into internal/webstreams like node - 563f174 fix(test): retarget the lazy-os mutation off the removed bare req('crypto') - 0532f25 fix(test): keep crypto's eager root single so the lazy_builtins mutation still bites - f0361d4 refactor(runtime): split stream.js into internal/streams like node - e2a2eb5 refactor(runtime): tidy internal/blob.js and take its live reads from primordials - 249157a refactor(runtime): split Blob, File and the blob: URL registry out of buffer.js - 978abd7 fix(test): pin case-76 and 62 mutations to what the runner reports - c4f90b6 refactor(runtime): build every builtin coded error through internal/errors - 567333e fix(util): guard the promisify.custom SymbolFor call like the inspect one - 0213331 harden(runtime): take lazy builtins' module-eval globals from primordials - 633cca3 build(js): count module-eval global reads in lazy builtin modules - f9f0cf8 perf(runtime): compile builtin JS factories on first require - 1de56c0 fix(test): repoint the unreachable-module mutation at the formatted source line - 5ebfe30 refactor(runtime): derive embedded-JS module identity and visibility from the directory layout - dd62797 docs(compat): retarget node 24 verification citations to node 26 - b81f812 perf(buffer): recover atob/btoa and fill cost from PR #413 validation - 85a2319 fix(runtime): close PR #413 pr-gate findings - f16b22c fix(runtime): close PR #413 review findings - bc7ff71 fix(runtime): align buffer, events, assert, and typed_array allocators with Node - ae1fb6b bench(gate): recalibrate four UTF-8 caps for the node 26 oracle - 60c6229 test(https): drop the IP servername node 26 rejects in the graceful-end client - 138a551 docs(compat): drop SlowBuffer from the coverage matrix - 2b474ea fix(compat): drop SlowBuffer, fail closed on a non-numeric oracle major, port pool cases to node 26 - 5810038 build(md): bump markdownlint-cli2 to 0.24.1 and format markdown with bun fmt - bdfaae0 feat(compat): move the Node oracle to 26+ and match its four observable changes - 139ee25 ci(gates): pin Node 24, per-case timeouts, honest gate runner, and bench-gate - 8239f1f build(gates): record the #389/#391 mutations and run the matrix check in check-md - 6eaf6c8 test(compat): drop case 71, it belongs to the deferred inspect work (#391) - 960670e refactor(buffer): reduce the #391 change to its three simple items - efa16de docs(test): park the 22 recorded mutations for #391 until a human can add them - 49bc489 fix(inspect): bound cyclic custom-inspect hooks; pin the rethrow path (#391) - c5fd268 fix(buffer): close the pr-gate findings on Buffer inspect extras (#391) - cf850ca fix(buffer): close four Node divergences in size validation and inspect (#391) Conflicts, resolved as CONTRIBUTING.md ("Lava is upstream") prescribes: - CLAUDE.md, agents/specialists/{oracle-test,quality-docs}-auditor.md and their .claude/agents mirrors: Larva's two-oracle wording kept; Lava's facts carried in (Node 26+ floor from .nvmrc, errors built through internal/errors, the js/node/ paths). The same Node 26+ wording replaces "22+/24" in agents/prompts/odin-feature.md and pr-gate-reference/scoring.md. - agents/prompts/pr-gate-reference/gates.md: Lava's routing table, plus Larva's vm_pool and bench/jsc-vm rows. - .github/workflows/ci.yml: Lava's `make bench-gate` step replaces the report-only bench; Larva's pages-bench smoke stays. - Makefile: both sides' .PHONY additions. package.json: Larva's fast-check bump; bun.lock regenerated with `bun install`. - README.md, bench/README.md, docs/ARCHITECTURE.md: Larva's sections kept, Lava's reworded sentences taken where Larva had not touched them. - pkg/runtime/js/internal/{fetch,url,streams}.js: Lava's split into internal/fetch/*, node/url.js and node/stream/web.js taken whole; Larva's only change there was a comment that named reference/node-compatibility.md. Larva still does not carry Lava's ROADMAP.md or the node-compat matrix (reference/node-compat.json, reference/node-compatibility.md, scripts/node-compat/gen-matrix.py), deleted in 5729ba4. Kept deleted, so what Lava newly hangs on the matrix is dropped here too: the `gen-matrix.py --check` step in `make check-md`, its bunfig.toml ignore entry, its mutation-manifest entry, and six comments that point at the page. tests/mutation-manifest.json was merged by entry name (scripts/merge-mutation-manifest.mjs). 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(e14b53d): 99 commits, 61 without merges, listed in the merge commit message. Closes the gap reported in #63.The changes a Larva reviewer is most likely to trip over:
js/node/,js/internal/andjs/bootstrap/, and the directory decides visibility.fetch,urland the web streams are split into several internal modules..nvmrc. The oracle runner refuses an oldernode.make bench-gateinstead of printing the report-only bench table.Function.prototype.call/apply/bindand the intrinsics the primordials wrappers hold are locked before user code (harden(runtime): own call/apply on captured intrinsics still steers builtins after the #485 lock lava#494).No Odin file conflicted, and no Larva-only code (page runner, VM pool, CPU budget, dispatcher) needed a change.
Conflicts, resolved by hand
20 files.
tests/mutation-manifest.jsonmerged by entry name through the driver (361 entries, everysourcepresent).CLAUDE.md,agents/specialists/{oracle-test,quality-docs}-auditor.mdand their.claude/agentsmirrors: Larva's two-oracle wording is kept. Lava's facts are carried into it: the Node 26+ floor, errors built throughinternal/errors, thejs/node/paths. The same "Node 26+" replaces "22+/24" inagents/prompts/odin-feature.mdandpr-gate-reference/scoring.md, which merged cleanly but would otherwise contradict.nvmrc.agents/prompts/pr-gate-reference/gates.md: Lava's routing table plus Larva'svm_poolandbench/jsc-vmrows..github/workflows/ci.yml: Lava'smake bench-gatestep replaces the report-only bench. Larva's pages-bench smoke stays.Makefile: both sides'.PHONYadditions.package.json: Larva'sfast-checkbump;bun.lockregenerated withbun install.README.md,bench/README.md,docs/ARCHITECTURE.md: Larva's sections kept; Lava's reworded sentences taken where Larva had not touched them.pkg/runtime/js/internal/{fetch,url,streams}.js: Lava's split taken whole. Larva's only change in each was one comment.Still not carried from Lava
ROADMAP.mdand the node-compat matrix (reference/node-compat.json,reference/node-compatibility.md,scripts/node-compat/gen-matrix.py) stay deleted, as in every sync since 5729ba4. Lava has since hung more on the matrix, so this merge also drops, on Larva's side only:gen-matrix.py --checkstep inmake check-md, and its mention inmake help;bunfig.toml;gen-matrix.py;reference/node-compatibility.md.Eight of the 20 conflicts trace back to that deletion (the four deleted files, and three JS files plus the Makefile whose Larva-side edits exist only because of it). Worth a separate decision whether Larva should carry the matrix after all; this PR does not change the current answer.
bun fmtreformatteddocs/LARVA.mdandbench/README.mdtables under Lava's updatedbunfig.toml. No wording changed.Gates
Run locally on the merged tree before the merge commit, Node 26.13.1, 16 cores. All passed:
make check,make check-js,make check-md,make check-actions,make buildmake test(205 Odin tests; node-compat, sqlite, fs and event-loop oracles)make test-odin-serial,make test-lava-nohostfn,make test-stdio,make test-property(11 properties)make bench-gateNot run locally:
make test-mutation. It needs a clean tree and the merge was uncommitted while the gates ran; CI covers it. CI has 4 cores, so the concurrency-sensitive gates above are not proof of a pass there.Merge with "Create a merge commit", not squash. Closes #63.
🤖 Generated with Claude Code