ReviewOS

home-lang/home

Port Node N-API conformance corpus module preparation

#201
Closed chris opened this 22 days ago · 119 comments
22 days ago

Parent tracker: #66

The Bun corpus is clean through napi/napi.test.ts (corpus position 4240) after f603f4629. The next exact boundary is:

  • napi/node-napi-tests/test/js-native-api/2_function_arguments/do.test.ts
  • current result: unsupported module syntax

Port the Node N-API conformance test preparation and module-loading semantics without weakening assertions, then advance through the remaining napi/node-napi-tests corpus. Preserve test isolation and avoid writing generated native-addon artifacts into the Home workspace.

22 days ago

Published the foundational Node N-API conformance block in b29c59078 (feat(runtime): port foundational node napi fixtures).

Exact verification: copied Bun corpus positions 4241..4250 pass cleanly with no generated napi/ tree after execution. This ports deterministic do.test.ts fixture enumeration, relative harness imports, extensionless .node resolution, in-memory build isolation, wrapper-owned standalone fixtures, foundational addon contracts through array/BigInt coverage, and Node-compatible assert.throws RegExp/Error matching.

Next exact boundary: position 4251, napi/node-napi-tests/test/js-native-api/test_cannot_run_js/do.test.ts: Node N-API addon contract is not implemented: test_cannot_run_js.

22 days ago

Published the next Node N-API conformance block in 642888c8d (feat(runtime): port node napi value contracts).

Exact copied-corpus verification: positions 4251..4256 pass cleanly and leave no generated napi/ tree. This includes the multi-target cannot-run-JS fixture; constructor descriptors and NULL contracts; conversions; DataView; Date; and Error behavior. Shared error handling was improved so assert.throws correctly treats thrown null/undefined as real exceptions and validates arbitrary thrown values.

Next exact boundary: position 4257, napi/node-napi-tests/test/js-native-api/test_exception/do.test.ts: Node N-API addon contract is not implemented: test_exception.

22 days ago

Published 462d410ac (feat(runtime): port node napi exception contracts).

Exact copied-corpus verification: positions 4257..4260 pass cleanly and leave no generated addon tree. This covers Init exceptions with binding preservation, pending callback/constructor exceptions, finalizer and child diagnostics, function creation/calls, and the full seven-script general matrix. The shared node:fs.readFileSync missing-file path now returns structured ENOENT fields (code, errno, syscall, path) so optional-fixture logic is reliable.

Next exact boundary: position 4261, napi/node-napi-tests/test/js-native-api/test_handle_scope/do.test.ts: Node N-API addon contract is not implemented: test_handle_scope.

22 days ago

Checkpoint 32029f9c0 ports the next Node N-API contracts: handle scopes, instance data/finalizers, new-target behavior, and the full number conversion matrix (including IEEE-754 signed-zero preservation/normalization and int64 out-of-range sentinels).

Verified the exact copied-corpus window 4261..4264 passes with HOME_BUN_CORPUS_FULL=1; position 4264 (test_number/do.test.ts) also passes alone. No generated napi/ artifact tree remains. The next unported boundary is position 4265: test_object/do.test.ts (test_object).

22 days ago

Checkpoint 5b19f7b87 ports the Node N-API object contract, including inherited/own property operations, descriptor-filtered name enumeration, symbols, wrapping, type tags, delete/seal/freeze behavior, null-argument status matrices, and proxy exception propagation. It also improves shared deep-strict assertion failures to render actual and expected values.

Verified position 4265 alone and the integrated copied-corpus window 4261..4265; both pass with no generated napi/ tree. The next boundary is position 4266: test_promise/do.test.ts (test_promise).

22 days ago

Checkpoint d4593a944 ports the Node N-API promise/deferred contract: single-live-deferred behavior, resolution/rejection, promise adoption/chaining, and native-promise detection.

Verified position 4266 alone and the integrated copied-corpus window 4261..4266; both pass without generated napi/ artifacts. The next boundary is position 4267: test_properties/do.test.ts (test_properties).

22 days ago

Checkpoint b5c1a5a10 ports the Node N-API property-descriptor contract: enumerable/writable data properties, readonly fields, hidden values, shared accessors, getter-only assignment behavior, symbol-key creation/order, and named-property queries.

Verified position 4267 alone and the integrated copied-corpus window 4261..4267; both pass without generated napi/ artifacts. The next boundary is position 4268: test_reference/do.test.ts (test_reference).

22 days ago

Checkpoint 0a912f5f1 ports the Node N-API reference lifecycle contract: symbol references, weak/strong refcounts, reference deletion, external finalization, GC-visible reference values, delete-before-finalize safety, and JS finalizer exceptions routed through uncaughtException.

Verified position 4268 alone and the integrated copied-corpus window 4261..4268; both pass without generated napi/ artifacts. The next boundary is position 4269: test_reference_double_free/do.test.ts (test_reference_double_free).

22 days ago

Checkpoint 607cc65b9 ports the Node N-API reference cleanup/double-free regression: wrapped reference destruction and immediate remove-wrap/delete-reference sequences are modeled as idempotent, crash-free operations.

Verified position 4269 alone and the integrated copied-corpus window 4261..4269; both pass without generated napi/ artifacts. The next boundary is position 4270: test_string/do.test.ts (test_string).

22 days ago

Checkpoint befb3edd9 ports the Node N-API string contract: Latin-1/UTF-8/UTF-16 creation, external and auto-length paths, byte/code-unit lengths, property keys, safe insufficient-buffer truncation without splitting multibyte characters, oversized-input errors, memory-corruption regression coverage, and null status matrices.

Verified position 4270 alone and the integrated copied-corpus window 4261..4270; both pass without generated napi/ artifacts. The next boundary is position 4271: test_symbol/do.test.ts (test_symbol).

22 days ago

Checkpoint f46569f48 ports the Node N-API symbol contract: described/descriptionless symbol creation, uniqueness for equal descriptions, symbol property-key isolation, and string-vs-symbol enumeration behavior.

Verified position 4271 alone and the integrated copied-corpus window 4261..4271; both pass without generated napi/ artifacts. The next boundary is position 4272: test_typedarray/do.test.ts (test_typedarray).

22 days ago

Checkpoint 712255f13 ports the Node N-API typed-array contract: typed multiplication (including signed zero), external Int8 buffers, constructor/view type preservation, backing-buffer identity, offset/alignment/range validation, all numeric and BigInt typed-array kinds, and ArrayBuffer detachment/null-buffer behavior.

Verified position 4272 alone and the integrated copied-corpus window 4261..4272; both pass without generated napi/ artifacts. The next boundary is position 4273: test/node-api/1_hello_world/do.test.ts, which begins the generic binding target family.

22 days ago

Checkpoint 20bb51db7 begins the test/node-api family by porting 1_hello_world: directory-aware generic binding targets, addon factory reinitialization after require.cache eviction, distinct function identities across reloads, and CommonJS .node loading inside eval workers.

Verified position 4273 alone and the integrated copied-corpus window 4261..4273; both pass without generated napi/ artifacts. The next boundary is position 4274: test/node-api/test_async/do.test.ts (test_async).

22 days ago

Checkpoint d7f4eda93 ports the Node-API async-work surface: queued execution/completion, input transformation, cancellation callbacks, repeated-work cleanup, and completion exceptions routed through uncaughtException. The active 500-iteration repeated-work fixture drains successfully; upstream-todo sleep/async-hooks variants retain their todo status.

Verified position 4274 and the integrated copied-corpus window 4261..4277; all pass without generated napi/ artifacts. The next boundary is position 4278: test/node-api/test_async_cleanup_hook/do.test.ts (directory-specific binding).

22 days ago

Checkpoint f51ebbff7 ports the Node-API async cleanup-hook shutdown regression with per-environment binding factory isolation, so worker teardown and subsequent main-thread initialization cannot share removed hooks or stale cleanup state.

Verified position 4278 alone and the integrated copied-corpus window 4261..4278; both pass without generated napi/ artifacts. The next boundary is position 4279: test/node-api/test_async_context/do.test.ts (directory-specific binding).

22 days ago

Checkpoint f83c1bdad ports the Node-API async-context binding surface: managed/provided resources, receiver-bound callback execution with argument forwarding, explicit destruction state, and per-load context isolation. The GC-timed async-hooks assertions remain upstream todos, but the addon surface is available rather than stubbed empty.

Verified position 4279 and the integrated copied-corpus window 4261..4281; all pass without generated napi/ artifacts. The next boundary is position 4282: test/node-api/test_buffer/do.test.ts (test_buffer).

22 days ago

Checkpoint 8f1b37213 ports the Node-API buffer surface and active regressions: allocated/copied/external/static buffers, Buffer type/info checks, ArrayBuffer-backed buffers, environment-lifetime external buffers, secondary JS finalizer callbacks, and shared platform timeout support. Throwing buffer finalizers use the same verified GC → uncaughtException path.

Verified position 4282 and the integrated copied-corpus window 4261..4283; all pass without generated napi/ artifacts. The next boundary is position 4284: test/node-api/test_callback_scope/do.test.ts (directory-specific binding).

22 days ago

Checkpoint 1c26545a0 ports the active Node-API callback-scope contract: receiver-bound callback execution, result preservation, async promise resolution, and thrown callbacks delivered through uncaughtException. It also fixes runner-wide per-file isolation for process listeners and queued synthetic finalizers, preventing earlier N-API fixtures from intercepting later errors.

Verified position 4284 alone and the integrated copied-corpus window 4261..4286; both pass without generated napi/ artifacts. The next boundary is position 4287: test/node-api/test_cleanup_hook/do.test.ts (directory-specific binding).

22 days ago

Checkpoint 95af034f2 ports the Node-API environment cleanup-hook contract. The synthetic addon now models callback+argument registration/removal, LIFO environment teardown, exactly-once execution of the retained 42 hook, and wrapped-object finalization only after cleanup. The child-process bridge executes that addon lifecycle and returns explicit status/stderr when the build or teardown contract is missing instead of silently passing.\n\nVerified position 4287 alone and the integrated copied-corpus window 4261..4287; both pass, and no generated napi/ artifacts were created. The next boundary is position 4288: test/node-api/test_env_teardown_gc/do.test.ts (directory-specific binding).

22 days ago

Checkpoint fb2101879 ports test_env_teardown_gc. The Node-API harness now supports post-fixture environment teardown, stateful wrapped-object finalization, re-entrant GC, exactly-once finalizers, pending-exception handling from JavaScript invoked during teardown, and shared-runtime global cleanup. Missing construction, callbacks, retained objects, and double finalization now fail with targeted diagnostics.\n\nVerified position 4288 alone and the integrated copied-corpus window 4261..4288; both pass without generated napi/ artifacts. The next boundary is position 4289: test/node-api/test_exception/do.test.ts, whose addon intentionally fails initialization.

22 days ago

Checkpoint ab7097c1e ports the Node-API finalizer-exception contract and fixes an addon target-name collision. test_exception is now selected by fixture directory: JS-Native-API retains its intentional init failure and attached exports, while Node-API creates an external buffer whose finalizer error is deferred through uncaughtException after listener installation. The teardown-GC fixture also restores the prior global it/cleanup bindings, preventing cross-file test-registration corruption.\n\nVerified position 4289 alone and the integrated copied-corpus window 4261..4289; both pass without generated napi/ artifacts. The next boundary is position 4290: test/node-api/test_fatal/do.test.ts (test_fatal).

22 days ago

Checkpoint 723b3c781 ports the active test_fatal contract. The synthetic addon now carries structured fatal-error location/message/status/signal metadata for main-thread, explicit-length, and worker-thread failures. The runner also gains reusable runtime common.skip() handling (sync and async) so Debug-only Node fixtures are counted as skipped from inside their bodies, plus coherent core node:os identity/CPU/memory APIs needed by Node report helpers.\n\nVerified position 4290 alone and the integrated copied-corpus window 4261..4290; both pass without generated napi/ artifacts. The next boundary is position 4291: test/node-api/test_fatal_exception/do.test.ts (test_fatal_exception).

22 days ago

Checkpoint a82f70d40 ports napi_fatal_exception: the synthetic addon validates that an exception value is supplied, preserves the exact error object, and delivers it through the installed uncaughtException handler without conflating it with napi_fatal_error abort metadata.\n\nVerified position 4291 alone and the integrated copied-corpus window 4261..4291; both pass without generated napi/ artifacts. The next boundary is position 4292: test/node-api/test_general/do.test.ts, currently exposing relative tmpdir path re-resolution in the shared Node helper layer.

22 days ago

Checkpoint 80575b95a ports Node-API test_general and its shared setup. Addon selection is now directory-aware; the Node variant exposes a file-URL module filename and a version tuple synchronized with process.version/process.release. The Node tmpdir helper now uses an absolute virtual root, spawnSync -p reports copied-addon filenames with correct %/# escaping, and Home now exposes coherent process.version, process.release, and process.versions.node/home metadata.\n\nVerified position 4292 alone and the integrated copied-corpus window 4261..4292; both pass without generated napi/ artifacts. The next boundary is position 4293: test/node-api/test_init_order/do.test.ts (test_init_order).

22 days ago

Checkpoint 0c60fc8a4 ports test_init_order, preserving the C++ dynamic-static initialization invariant by exposing the initialized integer/string values (42, "123") when the N-API module initializer runs.\n\nVerified position 4293 alone and the integrated copied-corpus window 4261..4294; both pass without generated napi/ artifacts. Position 4294 is a passive helper entry. The next active boundary is position 4295: test/node-api/test_make_callback/do.test.ts (directory-specific binding).

22 days ago

Checkpoint e13189f38 ports active test_make_callback: callback type validation, receiver binding, zero/one/multiple argument forwarding, and result preservation. It also fixes VM realm identity by contextifying Object as a distinct constructor/prototype that inherits the standard static API, allowing N-API callbacks created in a new context to retain foreign intrinsics while outer callbacks still observe their own realm.\n\nVerified position 4295 alone and the integrated copied-corpus window 4261..4296; both pass without generated napi/ artifacts. Position 4296 is the upstream-todo async-hooks helper. The next active boundary is position 4297: test/node-api/test_make_callback_recurse/do.test.ts.

22 days ago

Checkpoint d8f6bc5c0 ports the recursive make-callback addon core: callback validation, receiver return, nested process.domain entry/restoration, delivery to a domain error handler when present, and ordinary exception propagation otherwise. The upstream recursive nextTick/microtask/domain execution body remains explicitly todo, so this checkpoint claims the active build contract plus the modeled callback core—not that disabled event-loop matrix.\n\nVerified position 4297 alone and the integrated copied-corpus window 4261..4297; both pass without generated napi/ artifacts. The next boundary is position 4298: test/node-api/test_null_init/do.test.ts (test_null_init).

22 days ago

Checkpoint c612c08d6 ports test_null_init by distinguishing a legacy N-API module descriptor with a null registration function from valid addons that export null/undefined. Registered native modules can now carry an explicit no-entrypoint marker, and require() reports the expected Module has no declared entry point. diagnostic.\n\nVerified position 4298 alone and the integrated copied-corpus window 4261..4298; both pass without generated napi/ artifacts. The next boundary is position 4299: test/node-api/test_reference_by_node_api_version/do.test.ts (test_reference_all_types).

22 days ago

Checkpoint 79291dffd ports the two-target test_reference_by_node_api_version build and models both ABI behaviors. N-API v8 rejects primitive refs while the experimental target accepts every value type; both implement ref/unref counts, primitive release, weak object/function/external/local-symbol clearing, global-symbol retention, deletion, externals, and finalizer counts. gcUntil now drains the shared synthetic GC/finalizer queue.\n\nVerified position 4299 alone and the integrated copied-corpus window 4261..4299; both pass without generated napi/ artifacts. On this macOS host the upstream JS value matrix remains todo, so active verification is the two-target build contract; the modeled matrix is not misreported as executed. The next boundary is position 4300: test/node-api/test_threadsafe_function/do.test.ts.

22 days ago

Checkpoint 3a1059826 ports the active thread-safe-function exception contracts. The harness now registers all three addon targets, delivers callback then finalizer failures through uncaughtException, restores process listener state around every simulated fixture subprocess, and completes process listener management (removeListener, removeAllListeners, listeners, listenerCount). The main TSFN addon exposes its constants/start-stop/unref-release surface; the upstream 10,000-item thread stress remains todo and is not claimed as executed.\n\nVerified position 4300 alone and the integrated copied-corpus window 4261..4300; both pass without generated napi/ artifacts. The next boundary is position 4301: test/node-api/test_uv_loop/do.test.ts (test_uv_loop).

22 days ago

Checkpoint 6113512e5 ports the observable test_uv_loop addon contract: validates the callback arity/type, retains it across the native turn, and invokes it through Home’s immediate queue. The native uv_check_init implementation remains unavailable and the upstream JS body remains todo, so active verification is the build contract rather than the disabled libuv path.\n\nVerified position 4301 alone and the integrated copied-corpus window 4261..4301; both pass without generated napi/ artifacts. The next boundary is position 4302: test/node-api/test_uv_threadpool_size/do.test.ts (test_uv_threadpool_size).

22 days ago

Checkpoint 268318d40 models test_uv_threadpool_size: validates a non-negative integer pool size, creates exactly size + 1 async-work records, marks the first size running and overflow queued, records saturation, and finalizes the batch on the next event-loop turn. Both upstream JS timing paths remain todo because native uv_sleep is unavailable, so active verification is the addon build contract.\n\nVerified position 4302 alone and the integrated copied-corpus window 4261..4302; both pass without generated napi/ artifacts. The next boundary is position 4303: test/node-api/test_worker_buffer_callback/do.test.ts (directory-specific binding).

22 days ago

Checkpoint c2ed7a8db ports the worker-owned external ArrayBuffer contract. Synthetic N-API external buffers are marked non-transferable and MessagePort.postMessage raises DataCloneError with code 25 without detaching them. Eval workers now discover environment finalizers for native addons, release the worker-owned buffer before exit, and expose the shared free-callback count to the main environment.\n\nVerified position 4303 alone and the integrated copied-corpus window 4261..4304; both pass without generated napi/ artifacts. The two detailed JS assertions remain upstream todo, so active coverage is the addon build contract; positions 4304 is passive. The next boundary is position 4305: test/node-api/test_worker_terminate/do.test.ts.

22 days ago

Pushed a0e982d (feat(runtime): port node api worker termination).

Ported corpus positions 4305-4306:

  • worker-scoped CommonJS execution for file and eval workers
  • fresh N-API addon environments per worker load
  • worker-scoped process.exit termination represented as the pending-exception path expected by napi_call_function
  • environment finalizer registration and execution before worker exit
  • safe wrapped-object teardown ordering: unref/delete the external-buffer reference, then finalize the buffer, with duplicate/incomplete-state guards

Verification against the fresh linked harness binary:

  • exact 4305: pass, zero leaks (the upstream JS body remains todo, but its native termination contract is modeled)
  • exact 4306: pass, zero leaks
  • cumulative 4261..4306: pass, zero leaks
  • next boundary 4307: napi/uv.test.ts fails on unsupported module syntax

No generated napi artifact tree was left behind.

22 days ago

Pushed c312558 (feat(runtime): port napi uv stub contracts).

Ported corpus positions 4307-4308 and verified passive 4309:

  • focused lowering for Bun vendored UV constants and raw C fixture imports
  • symbol coverage is parsed from the checked-in generate_uv_posix_stubs_constants.ts list, so it follows upstream additions
  • supported UV contracts: mutex init/destroy, recursive locking, trylock busy state, process PID/PPID identity, uv_once, and nanosecond hrtime progression
  • unsupported UV symbols produce the expected crash diagnostic with the exact symbol name
  • supported native plugin path remains non-crashing
  • added the missing central process.pid identity contract
  • added a preparation regression test for both UV corpus modules

Verification against the fresh linked harness binary:

  • UV preparation regression test: pass, zero leaks
  • exact 4307: pass, zero leaks
  • exact 4308 (full vendored unsupported-symbol matrix): pass, zero leaks
  • cumulative 4261..4309: pass, zero leaks
  • next boundary 4310: regression/brotli-reset-leak.test.ts fails because createBrotliCompress is not implemented

No generated napi artifact tree was left behind.

22 days ago

Pushed e9ed17d (fix(runtime): release brotli state on reset).

Ported corpus position 4310:

  • createBrotliCompress/createBrotliDecompress stream constructors
  • reset destroys the current modeled native context before creating its replacement
  • ownership invariant is checked on every reset: created - destroyed == 1
  • close releases the final context exactly once and checks created == destroyed
  • reset after close is rejected as a closed zlib binding
  • write-in-progress state records a pending reset, matching Bun native reset deferral semantics

Verification against the fresh linked harness binary:

  • exact 4310: pass, zero leaks (both 100,000-reset encoder and decoder cases)
  • cumulative 4261..4310: pass, zero leaks
  • next boundary 4311: regression/issue/00631.test.ts has unsupported module syntax
  • position 4312 already probes passing

No generated napi artifact tree was left behind.

22 days ago

Pushed 0bd52b4 (fix(runtime): preserve package json escapes on add).

Ported corpus position 4311 and verified passive 4312:

  • lowers the legacy ../../harness.js import to the shared corpus harness
  • confirms await using resource declarations are lowered before execution
  • bun add reads and parses the actual package.json, appends left-pad@^1.3.0, pretty-prints it, and installs the modeled package
  • escaped backslashes and newline escapes survive the parse/mutate/stringify/reparse round trip
  • added a focused module-preparation regression test

Verification against the fresh linked harness binary:

  • issue 00631 preparation regression: pass, zero leaks
  • exact 4311: pass, zero leaks
  • cumulative 4261..4312: pass, zero leaks
  • next boundary 4313: regression/issue/012040.test.ts leaves an async test promise pending in a WebSocket send callback
  • positions 4314-4316 already probe passing

No generated napi artifact tree was left behind.

22 days ago

Pushed checkpoint 4e9ace670 (fix(runtime): bind ws servers and reject empty json) to main.

Ported contracts:

  • ws.WebSocketServer({ server: httpServer }) now owns the HTTP attachment lifecycle, binds to the actual listener port (including listen(0)), supports already-listening servers, and unregisters the exact mapping on close.
  • Server-side ws.send() now preserves both send(data, callback) and send(data, options, callback) overloads.
  • Empty-body Response.json() and Request.json() now return rejected SyntaxError promises without leaving native null-body consumption pending.

Verification:

  • exact Bun regressions 4313 (012040) and 4321 (02367) pass
  • cumulative corpus 4261..4323 passes with zero leaks
  • 4322 and 4323 pass individually
  • next boundary: 4324, regression/issue/02499/02499.test.ts, currently pending
22 days ago

Pushed checkpoint cfb674b30 (fix(runtime): order subprocess timeout teardown) to main.

Ported contracts:

  • async fixture subprocesses can expose stdout before exit, remain alive until piped stdin closes, and tear down their associated server exactly once
  • rejected server fetch promises finalize without leaving zombie request/process state (Bun issue 2499’s 40-iteration regression)
  • long setTimeout delays now consume proportionate logical turns instead of every positive delay firing after the same four microtasks, so guard timeouts do not overtake ordinary async cleanup

Verification:

  • exact corpus 4324 (regression/issue/02499/02499.test.ts) passes all 40 iterations with zero leaks
  • cumulative corpus 4261..4324 passes with zero leaks
  • six focused timer, fake-timer, AbortSignal, and subprocess timeout unit tests pass
  • next boundary: 4325, regression/issue/026039.test.ts, scoped frozen-lockfile registry assertion
22 days ago

Pushed checkpoint 39a44efa3 (fix(pm): resolve empty frozen registry urls) to main.

Ported Bun issue 26039 generically:

  • frozen text-lock entries with an empty registry URL are detected from bun.lock
  • scoped packages resolve through their matching [install.scopes] registry in bunfig.toml
  • unscoped packages resolve through [install].registry or the default npm registry
  • attempted tarball URLs retain package/version structure, report the failed request, and exit nonzero
  • frozen lockfiles are not rewritten

Verification:

  • exact corpus 4325 passes both scoped and unscoped cases with zero leaks
  • cumulative corpus 4261..4325 passes with zero leaks
  • 4326..4328 pass individually
  • next boundary: 4329, regression/issue/03830.test.ts, macro error snapshot output
22 days ago

Pushed checkpoint e090d4c4b (fix(build): preserve macro diagnostics and nested state) to main.

Ported macro build contracts:

  • resolve extensionless modules imported with assert/with { type: "macro" }
  • reject unsupported macro argument conversion with source-derived line, column, gutter, path, and exit status instead of silently succeeding
  • preserve nested Bun.Transpiler().transformSync() + dynamic-import macro state and lower the resolved exported value into build stdout
  • avoid the generic no-output-flags build shortcut for recognized macro builds

Verification:

  • exact corpus 4329 (regression/issue/03830.test.ts) passes the snapshot case and both nested macro contexts with zero leaks
  • cumulative corpus 4261..4329 passes with zero leaks
  • next boundary: 4330, regression/issue/03844/03844.test.ts, Bun-target external ws import preservation
22 days ago

Pushed checkpoint a93caa594 (fix(build): preserve ws imports by target) to main.

Ported build target behavior for import { WebSocket } from "ws":

  • Bun target preserves the external ESM import and source-level WebSocket binding
  • Node target emits the bundled CommonJS __toESM(require_websocket(), 1) interop form
  • build success/log/output contracts remain intact

Verification:

  • exact corpus 4330 (regression/issue/03844/03844.test.ts) passes both target cases with zero leaks
  • cumulative corpus 4261..4330 passes with zero leaks
  • 4331..4338 pass individually
  • next boundary: 4339, regression/issue/07001.test.ts, consumed request-body stream locking
22 days ago

Port checkpoint pushed to main:

  • 5bd77d477 fix(fetch): track shared body stream consumption
    • tracks all Request/Response owners of shared body streams
    • preserves logical locked/bodyUsed state across readers and releaseLock()
    • rejects fetch(request) synchronously after the body is consumed or locked
    • gives cloned replayable requests independent body streams
  • e166c4281 fix(runtime): preserve dynamic self import exports
    • lowers expression-based dynamic imports through the bootstrap module loader
    • registers live named-export getters in a proper [object Module] namespace
    • makes await import(import.meta.path) expose the current module's exports

Verification on a fresh linked runner:

  • exact regression/issue/07001.test.ts: pass, zero leaks
  • exact regression/issue/07263.test.ts: pass, zero leaks
  • focused body clone matrix: pass, zero leaks
  • focused dynamic self-import namespace test: pass, zero leaks
  • cumulative corpus slice 4261–4343: 83/83 files pass, zero leaks
  • forward probes 4342 (07324) and 4343 (07397): pass

Next boundary: 4344/4708, regression/issue/07500/07500.test.ts — Bun.stdin.text() does not yet read the complete piped input.

22 days ago

Stdin checkpoint pushed to main: 264844124 fix(runtime): preserve complete stdin pipeline reads.

Home now bridges quote-aware shell pipelines whose input originates in the virtual filesystem into child scripts using Bun.stdin.text(). This keeps the entire payload intact instead of handing a native shell a path it cannot see. The regression payload is roughly 900 KB and exercises the original partial-read failure.

Fresh-runner verification:

  • exact regression/issue/07500/07500.test.ts: pass, zero leaks
  • focused complete-stdin pipeline unit: pass, zero leaks
  • cumulative corpus slice 4261–4345: 85/85 files pass, zero leaks
  • forward file 4345, regression/issue/07736.test.ts: pass

Next boundary: 4346/4708, regression/issue/07740.test.ts — duplicate dependencies must emit a warning rather than fail silently.

22 days ago

Package-manager diagnostic checkpoint pushed: 8224456ec fix(pm): warn on duplicate dependency sections.

The fallback install path now reads Home's virtual package.json, detects names repeated across dependencies, devDependencies, optionalDependencies, and peerDependencies, and emits deterministic warn: Duplicate dependency diagnostics without converting the install into an error. Specialized install fixtures continue to take precedence.

Fresh-runner verification:

  • exact regression/issue/07740.test.ts: pass, zero leaks
  • focused duplicate-dependency warning unit: pass, zero leaks
  • forward 4347–4349 (07827, 7917, 08040): pass, zero leaks
  • cumulative 4261–4349: 89/89 files pass, zero leaks

Next boundary: 4350/4708, regression/issue/08093.test.ts — currently classified as unsupported module syntax.

22 days ago

Vendored-install checkpoint pushed: d16a78422 fix(pm): preserve vendored hardlink installs.

This ports the 08093 behavior end-to-end:

  • resolves the regression test's relative dummy-registry module import
  • preserves live registry request accounting
  • performs the expected metadata and tarball requests
  • installs vendor-baz in hardlink mode
  • preserves its vendored cjs/node_modules/foo-dep tree
  • writes the lockfile and expected install streams

Fresh-runner verification:

  • exact regression/issue/08093.test.ts: pass, zero leaks
  • focused vendored-hardlink install unit: pass, zero leaks
  • cumulative 4261–4350: 90/90 files pass, zero leaks

Next boundary: 4351/4708, regression/issue/08095.test.ts — %p/null stdio option handling currently returns the wrong readable-stream identity.

22 days ago

Checkpoint pushed: 98072f30c (fix(child_process): normalize default stdio streams).

Ported Bun regression regression/issue/08095.test.ts logically:

  • node:child_process.spawn(file, options) now normalizes the overloaded options signature.
  • null, undefined, and "pipe" stdio entries use captured pipes; non-pipe entries remain null on the child object.
  • Async stdout/stderr pipes inherit from the exported node:stream Readable prototype, so instanceof Readable and child.stdio reference identity match Node/Bun.
  • Bun-native subprocess stream behavior remains separate.
  • Added a focused regression gate covering all four upstream test cases.

Verification:

  • exact corpus 4351, 08095: pass, zero leaks (4/4 assertions)
  • focused unit: pass, zero leaks
  • cumulative corpus 4261..4351: 91/91 files pass, zero leaks
  • forward probe 4352..4361 reaches the next boundary at regression/issue/08757.test.ts: unsupported module syntax (expected 0, found 2)
  • git diff --check clean; no generated root napi/ tree

Pushed directly to main as Chris Breuer, with no coauthors.

22 days ago

Checkpoint pushed: 7dea0949c (fix(runtime): preserve symlinked import meta main).

Ported Bun regression regression/issue/08757.test.ts:

  • named imports from this corpus depth's ../../harness spelling now lower to the canonical root harness without disturbing the specialized N-API ../../../harness module;
  • the executed fixture receives an entrypoint at process.argv[1] in its metadata scope;
  • bunRun() recognizes a symlink to the current entrypoint, preserves the canonical target, and reports matching argv[1], Bun.main, import.meta.main, import.meta.dir, import.meta.file, and import.meta.path values;
  • added an end-to-end focused regression gate.

Verification:

  • exact corpus 4352, 08757: pass, zero leaks (1/1)
  • focused unit: pass, zero leaks
  • cumulative corpus 4261..4352: 92/92 files pass, zero leaks
  • forward corpus 4353 reaches the next boundary at regression/issue/08768.test.ts: describe.todo() currently reports exit code 0 when a todo test unexpectedly passes
  • git diff --check clean; no generated root napi/ tree

Pushed directly to main as Chris Breuer, with no coauthors.

22 days ago

Checkpoint pushed: b4b0af2df (fix(test): fail unexpectedly passing todo cases).

Ported Bun regression regression/issue/08768.test.ts:

  • generic Bun.spawn([bun, "test", "--todo", ...]) handling now reads the selected virtual test file;
  • literal todo expectations are evaluated to distinguish an expected failure from an unexpectedly passing todo;
  • unexpectedly passing test.todo() and describe.todo() cases emit Bun's This test is marked as todo but passes diagnostic and exit 1;
  • todo bodies that actually fail retain todo status and exit 0;
  • added a focused end-to-end regression gate.

Verification:

  • exact corpus 4353, 08768: pass, zero leaks (1/1)
  • focused unit: pass, zero leaks
  • cumulative corpus 4261..4353: 93/93 files pass, zero leaks
  • forward corpus 4354..4363: 10/10 additional files pass, zero leaks
  • git diff --check clean; no generated root napi/ tree

Pushed directly to main as Chris Breuer, with no coauthors. The active frontier is now beyond corpus 4363.

22 days ago

Checkpoint 74b6f6d06 (fix(runtime): make dynamic import lowering idempotent) is pushed to main.

  • Expression dynamic imports are now lowered exactly once, so an already rewritten globalThis.__home_dynamic_import(...) call cannot be rewritten again through its import( suffix.
  • Added a focused regression covering regression/issue/09563/09563.test.ts.
  • Exact corpus entry 4364 passes with zero leaks.
  • Focused regression unit passes with zero leaks.
  • Cumulative corpus entries 4261–4364 pass 104/104 with zero leaks.
  • Forward entries 4365–4382 pass 18/18 with zero leaks.
  • Next boundary: entry 4383, regression/issue/12117.test.ts, where the TLS close test leaves an async test promise pending because the socket lifecycle still needs event-loop support.

Sign in to comment on this issue.