From 5c6ee7d68f9d71676fb0747c71f7208696078735 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Fri, 30 Oct 2026 09:41:19 -0500 Subject: [PATCH 1/4] docs: publish the API stability policy (D18) and correct the freeze wording Add an API stability section to the README with the policy. From RC.1 to stable, releases are fixes only, with no additions and no deprecations. After stable, a deprecated API gets at least two monthly releases, JSDoc @deprecated, and a single app.logger warning before it is removed under ### Breaking. The committed API reports make every change visible, and mesh stays outside the promise. Correct the wording added in #181 and #182, which said the API could still grow until stable. That contradicted D18. Signed-off-by: Diego Resendez --- CONTRIBUTING.md | 2 +- README.md | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f69783e..1a5c06f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -155,7 +155,7 @@ Bun and the edge in its `runtimes` job. - Write tests for new behavior (TDD welcome). We use Vitest. - `complexity:check` caps the cognitive complexity of every function in `src/`. What it measures is how much you have to hold in your head to follow a function from top to bottom, and it charges nesting more heavily than branching: a condition inside a closure inside a function costs several times what the same condition costs at the top level. Going over the threshold is not a verdict on your code — it means one function has grown to ask too much of whoever reads it next. The fix is nearly always to lift a nested closure out to module scope, where its branches are charged once instead of three times over. Raising `COMPLEXITY_MAX` is not the fix, even though the script suggests it. - Keep runtime dependencies at zero beyond `reflect-metadata`. -- **The public API is frozen from RC.1, and `api/` is its record.** `api/*.api.md` holds one report per export-map entry, and `npm run api:check` fails when the build declares something they do not. If you meant to change the API, run `npm run build && npm run api` and commit the regenerated report with your change, so the reviewer reads the API change as a diff rather than finding it after release. Until the stable release a change may only add: removing or narrowing anything published in `26.9.0-beta.2` is not accepted. The check also fails when a public signature names a type its entry point does not export, because a user would have no way to name it. Mesh is `@experimental` and outside the freeze, but it is still in the report, so a mesh change shows up there too. +- **The public API is frozen from RC.1, and `api/` is its record.** `api/*.api.md` holds one report per export-map entry, and `npm run api:check` fails when the build declares something they do not. If you meant to change the API, run `npm run build && npm run api` and commit the regenerated report with your change, so the reviewer reads the API change as a diff rather than finding it after release. From RC.1 to stable, releases are fixes only, so a pull request that changes a report needs the owner to reopen the freeze first. The policy is in the README under [API stability](./README.md#api-stability). The check also fails when a public signature names a type its entry point does not export, because a user would have no way to name it. Mesh is `@experimental` and outside the freeze, but it is still in the report, so a mesh change shows up there too. - A new option or method on a public interface has to change that interface too. An implementation that grows a parameter without `src/app/types.ts` growing it as well is unreachable for anyone consuming the package. - New public API needs a doc note in `README.md`, **and a companion pull request to [green-tea-docs](https://github.com/Expressive-Tea/green-tea-docs) updating the page that documents it.** It is a second pull request because a pull request cannot span two repositories — link the two to each other so a reviewer can see both. The documentation site used to be built by this repository's CI, so a stale page broke the build; it is now a separate repository that imports nothing from here, and nothing fails when the two disagree. Issue #18 happened when the two still lived together, which is the reason this line exists rather than a hope. If you would rather not write the docs change, say so in your pull request and a maintainer will — an unmentioned API change is the failure this line exists to prevent, not an unwritten page. - If your change only works on one runtime, say so in the pull request. green-tea runs on Node, Deno, Bun and the edge, and behavior that quietly differs between them is treated as a bug — an explicit "not available here" is fine, silence is not. diff --git a/README.md b/README.md index fdec6dd..1c0df07 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ green-tea is **beta**, on the road to a release candidate. Express and Fastify h **What a teapot exports: steps and routes, and nothing else.** A `@Provider` marked `export: true` fails the boot with an error that says why — a provider's value *is* the object it builds, a pool or a client or a `db`, and the mesh moves data, not objects. Export a `@Step` instead: it runs on the teapot, per request, and its result is what comes back. That is also what lets a teacup boot without its teapot: a remote step holds nothing between requests, so a teacup whose teapot never answers still starts once the `bootTimeoutMs` grace runs out — it warns and carries on. Be precise about what that means, because it is narrower than it sounds. A teapot that never connected sent no manifest, so nothing of it reached the graph: its routes **404** rather than `503`, since nothing was registered to match, and a local step that `@needs` one of its tokens **still fails the boot**, naming the teapot that did not connect. That failure is deliberate — it is the check that catches a typo in a token name, which no amount of waiting will fix. `503` is what you get from a teapot that connected and *later* died, where the link and its exports do exist. So what the change buys is the teacup that does *not* depend on that teapot starting anyway, rather than refusing over a dependency it never had. Keeping a *needed* token serving while its teapot is legitimately away is a known gap, not an oversight: the intended answer is a per-teapot `expects` list that declares what a teapot would export, which is planned and not built. -**What is settled, and what is frozen.** From RC.1 the public surface of the four entry points (`@green-tea/core`, `/deno`, `/bun`, `/edge`) is frozen. Until the stable release it only gains things, and nothing published in `26.9.0-beta.2` is removed. That covers the graph (`needs`/`provides`, the order derived from them, and the boot-time failure when nothing provides a key), the decorators and handler shapes, the plugin API (`{ name, mount }` with `onShutdown`), the runtime entry points (`serveDeno()` and `serveBun()` are async so they boot before they bind), `createApp`'s options, and the pipeline context, which is one object mutated in place, so a step sees what earlier steps wrote. **Outside the freeze:** mesh, marked `@experimental` and described above. Legacy decorators are a standing *external* risk rather than a green-tea one — see [Why legacy decorators](#why-legacy-decorators). The [matcha](https://github.com/Expressive-Tea/matcha) CLI ships from its own repository on its own version line, so nothing here speaks for it. +**What is settled, and what is frozen.** From RC.1 the public surface of the four entry points (`@green-tea/core`, `/deno`, `/bun`, `/edge`) is frozen. Between RC.1 and the first stable release, releases are fixes only: nothing is added, removed, renamed or narrowed. Nothing published in `26.9.0-beta.2` was removed to reach the freeze. [API stability](#api-stability) has the full policy. That covers the graph (`needs`/`provides`, the order derived from them, and the boot-time failure when nothing provides a key), the decorators and handler shapes, the plugin API (`{ name, mount }` with `onShutdown`), the runtime entry points (`serveDeno()` and `serveBun()` are async so they boot before they bind), `createApp`'s options, and the pipeline context, which is one object mutated in place, so a step sees what earlier steps wrote. **Outside the freeze:** mesh, marked `@experimental` and described above. Legacy decorators are a standing *external* risk rather than a green-tea one — see [Why legacy decorators](#why-legacy-decorators). The [matcha](https://github.com/Expressive-Tea/matcha) CLI ships from its own repository on its own version line, so nothing here speaks for it. ## Docs & development @@ -363,7 +363,16 @@ consumer would have received. green-tea uses **calendar versioning**: `YY.M.PATCH` (e.g. `26.8.0` = the first release cut in August 2026, patch 0). The month is **not** zero-padded — npm treats versions as semver, which forbids leading zeros. A version tells you *when* it shipped, not how many breaking changes preceded it — those are always called out in the [CHANGELOG](./CHANGELOG.md). -**While in beta**, releases carry a `-beta.N` pre-release suffix on the calendar version (e.g. `26.8.0-beta.0`) and publish under the npm `beta` dist-tag. Until the first stable release there is nothing else to install, so `latest` tracks the newest beta too — `npm install @green-tea/core` and `@green-tea/core@beta` resolve to the same version. Install with the explicit `@beta` tag anyway: the day a stable ships, `latest` moves to it and your installs stay on the channel you meant. The API can still change between betas. +**While in beta**, releases carry a `-beta.N` pre-release suffix on the calendar version (e.g. `26.8.0-beta.0`) and publish under the npm `beta` dist-tag. Until the first stable release there is nothing else to install, so `latest` tracks the newest beta too — `npm install @green-tea/core` and `@green-tea/core@beta` resolve to the same version. Install with the explicit `@beta` tag anyway: the day a stable ships, `latest` moves to it and your installs stay on the channel you meant. Release candidates (`-rc.N`) publish the same way. + +### API stability + +**From the first release candidate (RC.1) the public API is frozen.** The public API is everything exported from the four entry points: `@green-tea/core`, `/deno`, `/bun` and `/edge`. + +- **RC.1 to stable: fixes only.** No release in that window adds, removes, renames or narrows a public API. It also deprecates nothing. If a fix needs an API change, the freeze is reopened, and the change is called out under `### Breaking` in the CHANGELOG. +- **After stable, deprecations come before removals.** A deprecated API keeps working for at least two monthly releases. It carries JSDoc `@deprecated` naming its replacement. Where it has a runtime path, it warns once per process through `app.logger`, never `console`. It is removed only in a release whose CHANGELOG lists the removal under `### Breaking`. +- **Every API change shows up in review.** [`api/`](./api) holds the committed API report for each entry point, and CI fails when the build no longer matches it. A deliberate change regenerates the report in the same pull request. +- **Mesh is outside the promise.** It is `@experimental` and gated behind `createApp({ experimental: true })`, so it may change in any release. Its exports still appear in the reports, so those changes still show up in review. ## License -- 2.54.1 From 582f6278c15dfc3dd30def87402b9f3ff5706674 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Fri, 30 Oct 2026 09:45:25 -0500 Subject: [PATCH 2/4] docs(mesh): mark the newly exported mesh types @experimental #181 exported Link, ReconnectOptions, ManifestPolicy, SocketCtor, EventfulSocket, RouteEntry, RemoteScopeNode, RemoteRoute and MeshControlDeps without the tag the other mesh exports carry, so they would have read as part of the frozen API. They are mesh plumbing, outside the freeze like MeshConfig. Signed-off-by: Diego Resendez --- src/http/ws-adapter.ts | 14 ++++++++++++-- src/mesh/link.ts | 17 +++++++++++++++-- src/mesh/protocol.ts | 7 ++++++- src/mesh/teacup.ts | 14 ++++++++++++-- src/mesh/teapot.ts | 7 ++++++- 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/http/ws-adapter.ts b/src/http/ws-adapter.ts index 59eca5b..d4b3369 100644 --- a/src/http/ws-adapter.ts +++ b/src/http/ws-adapter.ts @@ -37,7 +37,12 @@ export function toWsRequest(request: Request, ip: string): WsRequest { }; } -/** The subset of a host WebSocket that {@link eventSocket} drives (Deno's WebSocket and workerd's both satisfy it). */ +/** + * The subset of a host WebSocket that {@link eventSocket} drives (Deno's WebSocket and workerd's both satisfy it). + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface EventfulSocket { readonly readyState: number; /** Bytes queued by `send` and not yet written. Deno reports it; a host without it is never waited on. */ @@ -153,7 +158,12 @@ async function pollDrained(host: Pick EventfulSocket; /** diff --git a/src/mesh/link.ts b/src/mesh/link.ts index 5ca6666..550b232 100644 --- a/src/mesh/link.ts +++ b/src/mesh/link.ts @@ -5,14 +5,24 @@ import { connectSocket, type SocketCtor } from '../http/ws-adapter'; import { sendWhenDrained, type WsSocket } from '../http/ws-core'; import { encode, decode, MESH_PROTOCOL_VERSION, type Manifest, type RequestEnvelope, type Frame } from './protocol'; -/** Client handle to a remote mesh server: its manifest, an RPC caller, and a close(). */ +/** + * Client handle to a remote mesh server: its manifest, an RPC caller, and a close(). + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface Link { manifest: Manifest; rpc(kind: 'scope' | 'route', name: string, ctx: RequestEnvelope): Promise; close(): void; } -/** Backoff bounds for reconnection. `false` disables reconnecting entirely. */ +/** + * Backoff bounds for reconnection. `false` disables reconnecting entirely. + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface ReconnectOptions { /** Delay before the first retry; doubles from here (default: 500ms). */ initialDelayMs?: number; @@ -26,6 +36,9 @@ export interface ReconnectOptions { * Only `'refuse'` exists. It is a named strategy rather than implicit behaviour so that hot graph * reconciliation can arrive later as `'reconcile'` *additively* — peers run on separate deploy * cadences, and silently changing what the default means is the worst kind of breaking change. + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. */ export type ManifestPolicy = 'refuse'; diff --git a/src/mesh/protocol.ts b/src/mesh/protocol.ts index bff604d..36dbf2e 100644 --- a/src/mesh/protocol.ts +++ b/src/mesh/protocol.ts @@ -54,7 +54,12 @@ export interface RequestEnvelope { correlation?: { requestId?: string; traceId?: string }; } -/** Manifest entry for an exported route. */ +/** + * Manifest entry for an exported route. + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface RouteEntry { method: string; pattern: string; diff --git a/src/mesh/teacup.ts b/src/mesh/teacup.ts index 7139c57..39e6434 100644 --- a/src/mesh/teacup.ts +++ b/src/mesh/teacup.ts @@ -2,12 +2,22 @@ import type { Link } from './link'; import type { RequestEnvelope } from './protocol'; import type { ResponseShape } from '../pipeline'; -/** Local proxy for a remote scope: runs the RPC and returns its token→value binding. */ +/** + * Local proxy for a remote scope: runs the RPC and returns its token→value binding. + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface RemoteScopeNode { name: string; run: (ctx: any) => Promise>; } -/** Local proxy for a remote route: forwards the request envelope over the link. */ +/** + * Local proxy for a remote route: forwards the request envelope over the link. + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface RemoteRoute { method: string; pattern: string; diff --git a/src/mesh/teapot.ts b/src/mesh/teapot.ts index 8012338..1c7b7dc 100644 --- a/src/mesh/teapot.ts +++ b/src/mesh/teapot.ts @@ -90,7 +90,12 @@ function safeEqual(left: string, right: string): boolean { return crypto.timingSafeEqual(leftBuf, rightBuf); } -/** Dependencies for the mesh control handler: shared secret, manifest, and scope/route resolvers. */ +/** + * Dependencies for the mesh control handler: shared secret, manifest, and scope/route resolvers. + * + * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the + * API freeze, so it may change in a minor release. + */ export interface MeshControlDeps { secret: string; manifest: Manifest; -- 2.54.1 From ff63fc7c877a8deacbdb57e97e1ae11315779298 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Fri, 30 Oct 2026 09:56:00 -0500 Subject: [PATCH 3/4] docs(pipeline): tag ResponseShape @experimental ResponseShape reaches the public API only through the mesh signatures MeshControlDeps and RemoteRoute. The CHANGELOG already lists it with the mesh types, so tag it like them, which keeps it outside the freeze. Signed-off-by: Diego Resendez --- CHANGELOG.md | 2 +- src/pipeline.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01e5ea7..4f9198d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -147,7 +147,7 @@ npm treats versions as semver and semver forbids leading zeros. declarations, but nothing exported them, so code could call the API and could not name what it passed or got back. From the root: `ModuleOptions`, `Ctor`, `BusLike`, `ArgSource`, `GraphNodeView`, `GraphRouteView`, `StandardIssue`, `StandardResult`, and, for the experimental - mesh, `Link`, `ReconnectOptions`, `ManifestPolicy`, `SocketCtor`, `EventfulSocket`, `RouteEntry`, + mesh (tagged `@experimental`, outside the freeze), `Link`, `ReconnectOptions`, `ManifestPolicy`, `SocketCtor`, `EventfulSocket`, `RouteEntry`, `RemoteScopeNode`, `RemoteRoute`, `MeshControlDeps` and `ResponseShape`. From `/deno`: `DenoServeOptions` and `DenoHttpServer`. From `/bun`: `BunServeOptions` and `BunServer`. From `/edge`: `EdgeCtx`. All of them are additions, and nothing was renamed. diff --git a/src/pipeline.ts b/src/pipeline.ts index 8dd31ad..b526886 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -11,7 +11,12 @@ export interface PipelineStep { origin: string; run: (ctx: any) => any; } -/** A fully materialized HTTP response produced by a transformer. */ +/** + * A fully materialized HTTP response produced by a transformer. + * + * @experimental Public only through the mesh (`MeshControlDeps`, `RemoteRoute`), which needs + * `createApp({ experimental: true })`: outside the API freeze, so it may change in a minor release. + */ export interface ResponseShape { status: number; /** A value may be an array: `set-cookie` arrays are sent one line per element, others joined with `, `. */ -- 2.54.1 From 846346b53a5be368d22fe218bd7ed54111d15085 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Fri, 30 Oct 2026 10:16:12 -0500 Subject: [PATCH 4/4] docs(mesh): mesh may change in any release, and only within its own surface Make the wording consistent: mesh is alpha and may change in any release. The JSDoc tags said 'a minor release' while the README said 'any'. State the rule mesh now follows. Its surface is the @experimental exports, MeshConfig and the mesh:* events. A mesh change stays inside that surface: it adds no createApp option, App method or decorator, and it changes no stable type. Mesh adapts to the stable API instead of moving it. Signed-off-by: Diego Resendez --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- src/app/types.ts | 2 +- src/http/ws-adapter.ts | 4 ++-- src/index.ts | 2 +- src/mesh/link.ts | 8 ++++---- src/mesh/protocol.ts | 8 ++++---- src/mesh/teacup.ts | 8 ++++---- src/mesh/teapot.ts | 8 ++++---- src/pipeline.ts | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f9198d..a50cdc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -242,7 +242,7 @@ npm treats versions as semver and semver forbids leading zeros. `envelopeFrom`, `buildManifest`, `createMeshControl`, `MESH_CONTROL_PATH`, `Manifest`, `RequestEnvelope`, `Frame` and `MeshConfig`. They stay exported, unchanged. The mesh already needs `createApp({ experimental: true })`; the tag says the same thing in the types: these are outside - the API freeze and may change in a minor release. + the API freeze and may change in any release. - **Every `304` is bodiless** (#114). A `304` has no body and no `content-*` headers on any adapter, including one from `throw new NotModified()`, which used to go out with the default JSON envelope's `content-type`. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a5c06f..322c60c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -155,7 +155,7 @@ Bun and the edge in its `runtimes` job. - Write tests for new behavior (TDD welcome). We use Vitest. - `complexity:check` caps the cognitive complexity of every function in `src/`. What it measures is how much you have to hold in your head to follow a function from top to bottom, and it charges nesting more heavily than branching: a condition inside a closure inside a function costs several times what the same condition costs at the top level. Going over the threshold is not a verdict on your code — it means one function has grown to ask too much of whoever reads it next. The fix is nearly always to lift a nested closure out to module scope, where its branches are charged once instead of three times over. Raising `COMPLEXITY_MAX` is not the fix, even though the script suggests it. - Keep runtime dependencies at zero beyond `reflect-metadata`. -- **The public API is frozen from RC.1, and `api/` is its record.** `api/*.api.md` holds one report per export-map entry, and `npm run api:check` fails when the build declares something they do not. If you meant to change the API, run `npm run build && npm run api` and commit the regenerated report with your change, so the reviewer reads the API change as a diff rather than finding it after release. From RC.1 to stable, releases are fixes only, so a pull request that changes a report needs the owner to reopen the freeze first. The policy is in the README under [API stability](./README.md#api-stability). The check also fails when a public signature names a type its entry point does not export, because a user would have no way to name it. Mesh is `@experimental` and outside the freeze, but it is still in the report, so a mesh change shows up there too. +- **The public API is frozen from RC.1, and `api/` is its record.** `api/*.api.md` holds one report per export-map entry, and `npm run api:check` fails when the build declares something they do not. If you meant to change the API, run `npm run build && npm run api` and commit the regenerated report with your change, so the reviewer reads the API change as a diff rather than finding it after release. From RC.1 to stable, releases are fixes only, so a pull request that changes a report needs the owner to reopen the freeze first. The policy is in the README under [API stability](./README.md#api-stability). The check also fails when a public signature names a type its entry point does not export, because a user would have no way to name it. Mesh is alpha, `@experimental` and outside the freeze. Mesh adapts to the stable API and never changes it. Its own surface is the exports tagged `@experimental`, the shape of `MeshConfig` behind the `mesh` option, and the `mesh:*` lifecycle events. A mesh change may alter those and nothing else. It cannot add a `createApp` option, an `App` method or a decorator, and it cannot change a stable type. If mesh needs something the stable API does not offer, it builds on what is there. It is still in the report, so a reviewer can confirm a mesh change touched only mesh. - A new option or method on a public interface has to change that interface too. An implementation that grows a parameter without `src/app/types.ts` growing it as well is unreachable for anyone consuming the package. - New public API needs a doc note in `README.md`, **and a companion pull request to [green-tea-docs](https://github.com/Expressive-Tea/green-tea-docs) updating the page that documents it.** It is a second pull request because a pull request cannot span two repositories — link the two to each other so a reviewer can see both. The documentation site used to be built by this repository's CI, so a stale page broke the build; it is now a separate repository that imports nothing from here, and nothing fails when the two disagree. Issue #18 happened when the two still lived together, which is the reason this line exists rather than a hope. If you would rather not write the docs change, say so in your pull request and a maintainer will — an unmentioned API change is the failure this line exists to prevent, not an unwritten page. - If your change only works on one runtime, say so in the pull request. green-tea runs on Node, Deno, Bun and the edge, and behavior that quietly differs between them is treated as a bug — an explicit "not available here" is fine, silence is not. diff --git a/README.md b/README.md index 1c0df07..2fad360 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ green-tea uses **calendar versioning**: `YY.M.PATCH` (e.g. `26.8.0` = the first - **RC.1 to stable: fixes only.** No release in that window adds, removes, renames or narrows a public API. It also deprecates nothing. If a fix needs an API change, the freeze is reopened, and the change is called out under `### Breaking` in the CHANGELOG. - **After stable, deprecations come before removals.** A deprecated API keeps working for at least two monthly releases. It carries JSDoc `@deprecated` naming its replacement. Where it has a runtime path, it warns once per process through `app.logger`, never `console`. It is removed only in a release whose CHANGELOG lists the removal under `### Breaking`. - **Every API change shows up in review.** [`api/`](./api) holds the committed API report for each entry point, and CI fails when the build no longer matches it. A deliberate change regenerates the report in the same pull request. -- **Mesh is outside the promise.** It is `@experimental` and gated behind `createApp({ experimental: true })`, so it may change in any release. Its exports still appear in the reports, so those changes still show up in review. +- **Mesh is alpha and outside the promise.** It is `@experimental` and gated behind `createApp({ experimental: true })`, so it may change in any release. Mesh adapts to the stable API and never changes it. Its own surface is the exports tagged `@experimental`, the shape of `MeshConfig` behind the `mesh` option, and the `mesh:*` lifecycle events. A mesh change may alter those and nothing else. It cannot add a `createApp` option, an `App` method or a decorator, and it cannot change a stable type. If mesh needs something the stable API does not offer, it builds on what is there. Its exports still appear in the reports, so those changes still show up in review. ## License diff --git a/src/app/types.ts b/src/app/types.ts index 0925c2e..e9ac091 100644 --- a/src/app/types.ts +++ b/src/app/types.ts @@ -129,7 +129,7 @@ export interface RoutePlan { * Mesh networking options: a secret to gate this node's exports and/or remote teapots to connect to. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface MeshConfig { secret?: string; diff --git a/src/http/ws-adapter.ts b/src/http/ws-adapter.ts index d4b3369..de1ef06 100644 --- a/src/http/ws-adapter.ts +++ b/src/http/ws-adapter.ts @@ -41,7 +41,7 @@ export function toWsRequest(request: Request, ip: string): WsRequest { * The subset of a host WebSocket that {@link eventSocket} drives (Deno's WebSocket and workerd's both satisfy it). * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface EventfulSocket { readonly readyState: number; @@ -162,7 +162,7 @@ async function pollDrained(host: Pick EventfulSocket; diff --git a/src/index.ts b/src/index.ts index 774dea6..061c6cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -105,7 +105,7 @@ export type { TlsOptions, CorsOptions, SecurityOptions } from './security'; export type { UploadedFile, MultipartBody } from './multipart'; export type { StandardSchemaV1, StandardIssue, StandardResult } from './standard-schema'; -// Mesh — experimental (`createApp({ experimental: true })`): outside the API freeze, may change in a minor. +// Mesh — experimental (`createApp({ experimental: true })`): outside the API freeze, may change in any release. export { connectLink } from './mesh/link'; export { buildRemote, envelopeFrom } from './mesh/teacup'; export { buildManifest, createMeshControl, MESH_CONTROL_PATH } from './mesh/teapot'; diff --git a/src/mesh/link.ts b/src/mesh/link.ts index 550b232..e524130 100644 --- a/src/mesh/link.ts +++ b/src/mesh/link.ts @@ -9,7 +9,7 @@ import { encode, decode, MESH_PROTOCOL_VERSION, type Manifest, type RequestEnvel * Client handle to a remote mesh server: its manifest, an RPC caller, and a close(). * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface Link { manifest: Manifest; @@ -21,7 +21,7 @@ export interface Link { * Backoff bounds for reconnection. `false` disables reconnecting entirely. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface ReconnectOptions { /** Delay before the first retry; doubles from here (default: 500ms). */ @@ -38,7 +38,7 @@ export interface ReconnectOptions { * cadences, and silently changing what the default means is the worst kind of breaking change. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export type ManifestPolicy = 'refuse'; @@ -474,7 +474,7 @@ function backoffBounds( * `Ctor` is injectable to exercise both client implementations on a single runtime. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export function connectLink(args: { url: string; diff --git a/src/mesh/protocol.ts b/src/mesh/protocol.ts index 36dbf2e..6d285bc 100644 --- a/src/mesh/protocol.ts +++ b/src/mesh/protocol.ts @@ -36,7 +36,7 @@ export const MESH_PROTOCOL_VERSION = 1; * green-tea simply ignores them, which costs the correlation of that hop and nothing else. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface RequestEnvelope { method: string; @@ -58,7 +58,7 @@ export interface RequestEnvelope { * Manifest entry for an exported route. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface RouteEntry { method: string; @@ -73,7 +73,7 @@ export interface RouteEntry { * lazy — the token exists in the teacup's graph, and running it is an RPC. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface Manifest { steps: string[]; @@ -88,7 +88,7 @@ export interface Manifest { * so a protocol-level heartbeat could not work on every runtime mesh claims to support. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export type Frame = | { type: 'hello'; v: number; secret: string } diff --git a/src/mesh/teacup.ts b/src/mesh/teacup.ts index 39e6434..c7c0d2e 100644 --- a/src/mesh/teacup.ts +++ b/src/mesh/teacup.ts @@ -6,7 +6,7 @@ import type { ResponseShape } from '../pipeline'; * Local proxy for a remote scope: runs the RPC and returns its token→value binding. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface RemoteScopeNode { name: string; @@ -16,7 +16,7 @@ export interface RemoteScopeNode { * Local proxy for a remote route: forwards the request envelope over the link. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface RemoteRoute { method: string; @@ -32,7 +32,7 @@ export interface RemoteRoute { * and its events on the far side join the same trace instead of starting a new one. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export function envelopeFrom(ctx: any): RequestEnvelope { const req = ctx?.req; @@ -54,7 +54,7 @@ export function envelopeFrom(ctx: any): RequestEnvelope { * Turn a link's manifest into local proxy nodes: lazy request-scope steps, and routes. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export function buildRemote(link: Link): { steps: RemoteScopeNode[]; routes: RemoteRoute[] } { const steps: RemoteScopeNode[] = link.manifest.steps.map((token) => ({ diff --git a/src/mesh/teapot.ts b/src/mesh/teapot.ts index 1c7b7dc..3984739 100644 --- a/src/mesh/teapot.ts +++ b/src/mesh/teapot.ts @@ -24,7 +24,7 @@ import { * to it on an app without a control channel closes `1008` on every adapter. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export const MESH_CONTROL_PATH = '/__mesh__/control'; @@ -77,7 +77,7 @@ export function controlFrameLimit(maxBodyBytes = DEFAULT_MAX_BODY_BYTES): number * Assemble a {@link Manifest} from exported step tokens and buffered routes. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export function buildManifest(args: { steps: string[]; routes: RouteEntry[] }): Manifest { return { steps: [...args.steps], routes: args.routes }; @@ -94,7 +94,7 @@ function safeEqual(left: string, right: string): boolean { * Dependencies for the mesh control handler: shared secret, manifest, and scope/route resolvers. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export interface MeshControlDeps { secret: string; @@ -292,7 +292,7 @@ async function serveFrames( * Build a control handler that authenticates peers and serves scope/route RPCs from the manifest. * * @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the - * API freeze, so it may change in a minor release. + * API freeze, so it may change in any release. */ export function createMeshControl(deps: MeshControlDeps): { path: string; diff --git a/src/pipeline.ts b/src/pipeline.ts index b526886..a980f9c 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -15,7 +15,7 @@ export interface PipelineStep { * A fully materialized HTTP response produced by a transformer. * * @experimental Public only through the mesh (`MeshControlDeps`, `RemoteRoute`), which needs - * `createApp({ experimental: true })`: outside the API freeze, so it may change in a minor release. + * `createApp({ experimental: true })`: outside the API freeze, so it may change in any release. */ export interface ResponseShape { status: number; -- 2.54.1