ReviewOS

home-lang/home

Bun parity: port node:v8 structured clone for Blob and File

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

Parent: #66 Predecessor: #384

Corpus frontier: position 4185, js/web/structured-clone-blob-file.test.ts.

Current exact result: 0 passed, 1 failed, 0 todo, 0 unsupported. First failure: node:v8 serialize is undefined.

Scope:

  • port node:v8 serialize/deserialize contracts used by Bun structured cloning
  • preserve Blob/File bytes, names, MIME metadata, and clone independence
  • account for repeated clone/GC behavior without leaks or aliasing
  • improve serialization/deserialization failures with structured operation, phase, cause, and composed stack context
  • add focused permanent regression coverage
  • verify the exact upstream file and a clean full build

The preceding TransformStream lifecycle work is complete in #384.

10 days ago

Completed and pushed in fbf021a (fix(v8): port Blob and File structured cloning).

Verification:

  • Upstream js/web/structured-clone-blob-file.test.ts: 36 pass, 0 todo, 0 fail, 0 unsupported.
  • Permanent Home regression: 3 pass, covering bounded slice windows, Blob/File metadata, aliases/cycles, generic bun:jsc and node:v8 values, malicious maximum offsets, and truncated input diagnostics.
  • Full zig build --cache-dir /private/tmp/home-zig-abi-cache: pass.
  • zig fmt --check and git diff --check: pass.

The port adds bun:jsc and node:v8 serialize/deserialize behavior, Blob/File binary envelopes, generic structured values, bounded reads, clamped attacker-controlled offsets, and structured actionable errors (code, operation, phase, cause, and composed stack). Parent tracker: #66.

Sign in to comment on this issue.