ReviewOS

zig-utils/zig-js

Implement versioned UWS and H3 response writer bridge

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

Parent: #381

Implement WebCore__FetchHeaders__toUWSResponse through a revisioned C bridge for Bun response kinds TCP=0, SSL=1, H3=2. zig-js must not cast opaque C++ response objects.

Acceptance:

  • Project response rows in pinned order: Set-Cookie occurrences first, then known/common insertion order, then uncommon insertion order.
  • Provide a Bun 4982b91e C++ adapter that calls the concrete writeHeader/writeMark methods.
  • Match Content-Length, Date, and Transfer-Encoding state-bit behavior for TCP/SSL and Content-Length/Date behavior for H3; reject null/unknown kinds safely.
  • Preserve all row bytes for the duration of the call and propagate bridge failure without partial Zig lifetime hazards.
  • Add exact layout/kind/order/state fixtures in Debug and ReleaseSafe, inventories/docs/CI.
9 days ago

Implemented and pushed in 2683d572 (response bridge, exact Bun matrix, inventories) and 6f44964b (Home/absent-provider evidence and docs).

The final adapter now:

  • projects rows in pinned order: each Set-Cookie, then known/common insertion order, then uncommon insertion order
  • dispatches exact ResponseKind values TCP=0, SSL=1, H3=2
  • applies Content-Length writeMark, Date state, and TCP/SSL Transfer-Encoding state through the real consumer C++ methods
  • rejects null responses and unknown kinds before invoking the bridge
  • uses a copied version/size-checked v1 callback table; absent callbacks no-op safely without linker-order assumptions

Evidence:

  • FetchHeaders units 4/4
  • Bun exact boundary 25/25 in Debug and ReleaseSafe, including row order and all three state matrices
  • provider-absent executable links and fails closed
  • Home exact fixture 388/388 in Debug and ReleaseSafe
  • C/C++ bridge header and installer syntax pass
  • C API and both private inventory audits pass with zero unclassified
  • inventories: Home 401/471, Bun 393/461

Sign in to comment on this issue.