ReviewOS

home-lang/home

Port es-module-lexer async initialization contracts

#217
Closed chris opened this 10 days ago ·
10 days ago

Context

The sequential Bun corpus frontier is js/third_party/es-module-lexer/es-module-lexer.test.ts at position 3959/4708, following completed legacy DuckDB work in #216. This contributes to #66.

Current gap

The copied test launches the same es-module-lexer entrypoint ten times, awaits its JavaScriptCore/WebAssembly-style initialization promise, parses static import/export metadata, reads JSON from subprocess stdout, and requires exit code 42. The current subprocess produces an empty body.

Acceptance criteria

  • CommonJS es-module-lexer resolution exposes init and parse.
  • init is asynchronously awaitable and keeps the child lifecycle alive.
  • parse returns exact import/export offsets and names for the copied module source.
  • Repeated child launches produce complete JSON before exiting with code 42.
  • Initialization/parser failures retain useful child source and stack context.
  • The copied test passes 10 repeated launches and is pinned in the permanent third-party gate.
10 days ago

Completed on main in fa0dd4e.

The CommonJS module now exposes an asynchronously awaitable init, static import/export parsing with exact offsets and names, parser source/stack diagnostics, and subprocess stdout whose bytes are promise-backed by initialization. Exit code 42 is set only after the complete JSON payload is available. The copied test passes all ten launches and is pinned permanently.

Verification: focused position 3959 reports files=1, passed=1, failed=0, todo=0, unsupported=0, allowed-empty=0; all permanent gates pass.

Sign in to comment on this issue.