ReviewOS

zig-utils/zig-js

ABI: implement HTTP server inspector request lifecycle events

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

Parent: #140 Profiles: #163, #164 Roadmap: #134 Depends on session-agent foundation: #396

Implement the five shared pending HTTP server inspector imports against one live zig-js inspector session and the exact Bun/WebKit protocol pinned by Bun 4982b91 (WebKit cd821fe). Bun declares these imports but does not define them, so zig-js must provide complete failure-atomic protocol behavior rather than stubs.

Exports:

  • Bun__HTTPServerAgent__notifyRequestWillBeSent
  • Bun__HTTPServerAgent__notifyResponseReceived
  • Bun__HTTPServerAgent__notifyBodyChunkReceived
  • Bun__HTTPServerAgent__notifyRequestFinished
  • Bun__HTTPServerAgent__notifyRequestHandlerException

Acceptance:

  • Pin Bun HTTPServerAgent declarations, HTTP method ordinals, Bun WebKit revision, and exact HTTPServer.json source hash.
  • Advertise exact HTTPServer enable/disable commands and isolate enablement per session.
  • Emit exact nested request/response/body-chunk/finished/handler-error event payloads and scalar types.
  • Parse headers/params JSON as protocol arrays; malformed or wrong-shaped input emits no partial event.
  • Preserve optional params/URL/duration behavior without serializing absent fields as null or empty placeholders.
  • Reject invalid/detached/foreign handles, invalid BunStrings, invalid HTTP method values, OOM, and callback-driven release safely.
  • Add focused unit coverage plus one compiled Home/Bun consumer in Debug and ReleaseSafe.
  • Record the bounded fixing CI, refresh parent/profile evidence, and close.

Backward compatibility is intentionally out of scope; implement the clean pinned contract.

9 days ago

Implemented in 34a06e80 and documented in c19d255b. Both profile libraries compile/link/run the five exports in Debug and ReleaseSafe; focused event semantics pass in both modes; Bun/Home audits and docs build pass. Exact counts are now Home 423/471 (48 pending) and Bun 415/461 (46 pending). Awaiting fixing main CI.

9 days ago

Completed on main through 34a06e80 and c19d255b. All five HTTPServer lifecycle exports, exact protocol payloads, session/domain gates, and failure/reentrancy behavior are green in the fixing private-abi-boundary job.

Sign in to comment on this issue.