ReviewOS

zig-utils/zig-js

Implement Home ScriptExecutionContext registry teardown boundary

#401
Closed chris opened this 9 days ago ·
9 days ago

Parent: #140 Roadmap: #134

Implement the Home-only Bun__ScriptExecutionContext__removeFromContextsMapByIdentifier boundary as a real, thread-safe execution-context registry lifecycle—not a link-only stub.

Scope

  • Pin the exact Home teardown bridge and upstream ScriptExecutionContext registry contract.
  • Register stable process-wide identifiers with a resolvable live context.
  • Export lookup and identifier removal with null/unknown/idempotent behavior.
  • Automatically unregister contexts before every C-API destruction path.
  • Cover sibling isolation, explicit removal, stale IDs, natural teardown, and concurrent context lifetimes.
  • Compile, link, and run exact Home-profile evidence in Debug and ReleaseSafe.
  • Refresh ABI inventories, concise README counts, and roadmap evidence.
  • Close only after the fixing main GitHub Actions run is green.

Source contract

Home 7ed99c02, especially lang/packages/runtime/src/native/napi_weak_home_dups.cpp and its pinned upstream ScriptExecutionContext.cpp. The required behavior removes the worker context before its event loop/VM is freed so late cross-thread posts cannot resolve a dangling identifier.

9 days ago

Implemented and pushed to main in e92dd31a + 0c9b3756. Evidence: focused unit test and exact Home-profile external consumer pass in Debug and ReleaseSafe; Home/Bun audits and the release-compatibility gate pass; the docs site builds 32 pages. Home moved to 425/471 (46 pending), Bun correctly remained 416/461. Awaiting the fixing main private-ABI job before closure.

9 days ago

The first fixing CI run found one bookkeeping-only failure: the implemented ScriptExecutionContextIdentifier__getGlobalObject export was missing from the public extension classification. Commit 1831d7e adds the exact classification; local c-api-audit is green (117/117 public, 23 extensions, no unexpected exports). Awaiting the new main CI gate before closure.

9 days ago

Closure gate is green: the exact private-abi-boundary job for main commit 7983fcab completed successfully: https://github.com/zig-utils/zig-js/actions/runs/29776746300/job/88467854285

Sign in to comment on this issue.