fix: close the RC.1 API audit gaps (type exports, TLS on Deno/Bun, README) #181

Merged
chrnx merged 3 commits from fix/rc1-api-gaps into develop 2026-10-30 14:26:19 +00:00
Owner

Closes findings 2–4 of the RC.1 API audit (.specs/reports/2026-10-30-rc1-api-audit.md). Finding 1, the api-extractor reports and the CI drift gate, comes in a follow-up PR.

Every type a public signature uses is now exported. Before this change, a caller could use these APIs but could not name the types of their parameters or results. All changes are additive, and no name from beta.2 moves.

  • Root: ModuleOptions, Ctor, BusLike, ArgSource, GraphNodeView, GraphRouteView, StandardIssue, StandardResult, and the experimental mesh types.
  • /deno: DenoServeOptions, DenoHttpServer.
  • /bun: BunServeOptions, BunServer.
  • /edge: EdgeCtx.

After the build, a script walked the emitted .d.ts for each entry point to find any declared type that is not exported. The only one left is SSE_EVENT, the unique-symbol brand on SseEvent. It stays private on purpose, so that an SseEvent can only be created through sse().

channel() had started returning TappableChannel on develop. That return type exposed the internal tap symbol in the public API. It now returns Channel<T> again, as it did in beta.2.

Breaking change: serveDeno() and serveBun() reject createApp({ tls }). Only Node's listen() ever used tls. On Deno and Bun the app was served as plain HTTP with no warning. Now both adapters throw before they boot or bind. The CHANGELOG has the entry with migration notes, and test/adapter-tls.test.ts covers the behaviour.

README. It no longer says the API is still moving. It describes what the freeze covers (mesh stays outside it), notes that native TLS is Node-only, and marks the radix matcher as done in the roadmap.

Checks run locally:

  • npm test: 1213 passed.
  • test:deno: 63 passed.
  • test:bun: 52 passed.
  • test:edge: OK.
  • typecheck: OK.
  • deno publish --dry-run: OK.
  • npm audit: 0 vulnerabilities.

Not benchmarked. No per-request code changed. The TLS check runs once at serve time, and the other changes are type-only.

The green-tea-docs pages for tls (guides/security.md, reference/createapp.md) are updated in a separate PR in that repo.

Closes findings 2–4 of the RC.1 API audit (`.specs/reports/2026-10-30-rc1-api-audit.md`). Finding 1, the api-extractor reports and the CI drift gate, comes in a follow-up PR. **Every type a public signature uses is now exported.** Before this change, a caller could use these APIs but could not name the types of their parameters or results. All changes are additive, and no name from beta.2 moves. - Root: `ModuleOptions`, `Ctor`, `BusLike`, `ArgSource`, `GraphNodeView`, `GraphRouteView`, `StandardIssue`, `StandardResult`, and the experimental mesh types. - `/deno`: `DenoServeOptions`, `DenoHttpServer`. - `/bun`: `BunServeOptions`, `BunServer`. - `/edge`: `EdgeCtx`. After the build, a script walked the emitted `.d.ts` for each entry point to find any declared type that is not exported. The only one left is `SSE_EVENT`, the unique-symbol brand on `SseEvent`. It stays private on purpose, so that an `SseEvent` can only be created through `sse()`. `channel()` had started returning `TappableChannel` on develop. That return type exposed the internal tap symbol in the public API. It now returns `Channel<T>` again, as it did in beta.2. **Breaking change: `serveDeno()` and `serveBun()` reject `createApp({ tls })`.** Only Node's `listen()` ever used `tls`. On Deno and Bun the app was served as plain HTTP with no warning. Now both adapters throw before they boot or bind. The CHANGELOG has the entry with migration notes, and `test/adapter-tls.test.ts` covers the behaviour. **README.** It no longer says the API is still moving. It describes what the freeze covers (mesh stays outside it), notes that native TLS is Node-only, and marks the radix matcher as done in the roadmap. **Checks run locally:** - `npm test`: 1213 passed. - `test:deno`: 63 passed. - `test:bun`: 52 passed. - `test:edge`: OK. - `typecheck`: OK. - `deno publish --dry-run`: OK. - `npm audit`: 0 vulnerabilities. **Not benchmarked.** No per-request code changed. The TLS check runs once at serve time, and the other changes are type-only. The green-tea-docs pages for `tls` (`guides/security.md`, `reference/createapp.md`) are updated in a separate PR in that repo.
chrnx added 3 commits 2026-10-30 13:54:14 +00:00
Public declarations named types the entry points did not export, so a
caller could invoke the API but could not name its parameters or
results. The affected types were ModuleOptions, Ctor, BusLike,
ArgSource, GraphNodeView, GraphRouteView, StandardIssue,
StandardResult, the experimental mesh types, and the adapter option
types: DenoServeOptions, BunServeOptions and EdgeCtx.

Export them all. The changes are additive only, and no beta.2 name
moves. Bun's private BunServeShortOptions becomes the exported
BunServeOptions, and the ambient Bun.serve shape is renamed so the two
cannot collide.

channel() had started returning TappableChannel, which leaked the
internal tap symbol into its public return type. Restore the beta.2
return type, Channel<T>. ws-core still finds the tap through the
symbol, not through the signature.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Only Node's listen() reads tls. serveDeno and serveBun serve through
the runtime's own listener, so an app created with tls came up as
plain HTTP without warning, for a caller who had asked for HTTPS.

createApp now marks the app with a symbol, following the MARK_EDGE
pattern. Both adapters throw on that mark before they boot or bind.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
docs: record the RC.1 freeze, the TLS refusal and the new type exports
CI / dco (pull_request) Successful in 6s
CI / runtimes (bun) (pull_request) Successful in 20s
CI / build (pull_request) Successful in 29s
CI / runtimes (edge) (pull_request) Successful in 22s
CI / runtimes (deno) (pull_request) Successful in 32s
ff7001f4be
The README no longer describes the API as still moving, or the radix
matcher as future work. It also states that native TLS is Node-only.
The CHANGELOG gains a Breaking entry, with migration notes, for the
Deno and Bun TLS refusal, and an Added entry listing the newly
exported types.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx merged commit 46cfa744a1 into develop 2026-10-30 14:26:19 +00:00
Sign in to join this conversation.